LutzGross/esys-escript.github.io

Help with updateStokesEquation

Opened this issue · 1 comments

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

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