Hi,
I'm trying to find the best way to write my equation, which involves not 
only diffusion terms in terms of two order parameters phi and psi, but also 
terms like grad(phi) dot grad(laplacian(psi)). Since all these terms are 
being added together, I'm trying to use faceGrad to make terms like 
grad(phi) dot grad(laplacian(psi)) consistent with terms like 
DiffusionTerm(var=phi). (Do you think this necessary?) The way I'm trying to 
express grad(phi) dot grad(laplacian(psi)) is

DOT(phi.faceGrad,((psi.faceGrad).divergence).faceGrad) 

as in the following code:


import fipy as fp
mesh= fp.Grid2D(nx=500,ny=500,dx=0.25, dy=0.25)
phi = fp.CellVariable(name=r"$\phi$", mesh=mesh)
phi.setValue(fp.GaussianNoiseVariable(mesh=mesh, mean=0.5, variance=0.01))
psi = fp.CellVariable(name=r"$\psi$", mesh=mesh)
psi.setValue(fp.GaussianNoiseVariable(mesh=mesh, mean=0.5, variance=0.01))
PHI = phi.getArithmeticFaceValue()
PSI = psi.getArithmeticFaceValue()

DOT = fp.numerix.dot
eq1=(fp.TransientTerm(var=phi) == 
DOT(phi.faceGrad,((psi.faceGrad).divergence).faceGrad)
+DiffusionTerm(coeff=PHI**2, var=phi)
-DiffusionTerm(coeff=PHI, var=psi))


But I get an error that the coefficient can not be a FaceVariable. Changing 
the faceGrad to grad seems to make it alright, but would that affect the 
accuracy? Why does the dot not allow for faceGrad?

_______________________________________________
fipy mailing list
[email protected]
http://www.ctcms.nist.gov/fipy
  [ NIST internal ONLY: https://email.nist.gov/mailman/listinfo/fipy ]

Reply via email to