LutzGross / esys-escript.github.io

Other
30 stars 13 forks source link

Help with updateStokesEquation #103

Closed lolsenkettle closed 1 week ago

lolsenkettle commented 7 months ago

Hi,

Do you have any examples where you have updated the visocisty as a function fo velocity and pressure using setStokesEquation in the StokesProblemCartesian class?

Thanks, Louise

LutzGross commented 7 months ago

Louise

I am embarrassed to admit that I cannot find an example but to update viscosity during the iteration process this should work: you define a new subclass of StokesProblemCartesian and overwrite the updateStokesEquation method:

class StokesProblemLouise(StokesProblemCartesian): def updateStokesEquation(self, v, p): new_eta = .... self.setStokesEquation(eta=inerpolate(new_eta, Function(self.domain))

You can use instances of StokesProblemLouise in the same way you use instances of StokesProblemCartesian. Please note that you need to run this with a second-order mesh for velocity (with or without useMacroElements=True).

PS: StokesProblemCartesian is not included in version 6.0 anymore.

Hope that helps. More question? - let me know. Lutz

LutzGross commented 2 weeks ago

StokesProblemCartesian has been removed in version 6.