Hi Daniel,
Thanks for your reply.
My equations are :

or
(2 * mu + Lambda) * u,11 + mu * u,22 + (mu + Lambda) * v,12 = 0
(2 * mu + Lambda) * v,22 + mu * v,11 + (mu + Lambda) * u,21 = 0

I implement as:

mesh = Grid2D(dx=dx,dy=dy,nx=nx,ny=ny)
u = CellVariable(name="u",mesh=mesh,hasOld=1,rank=0)
v = CellVariable(name="v",mesh=mesh,hasOld=1,rank=0)
mu = FaceVariable(mesh=mesh,value= 0.5 * E / (1. + nu))
Lambda = FaceVariable(mesh=mesh,value=nu * E / ((1. + nu) * (1.-2.* nu)))
zero = FaceVariable(mesh=mesh,value=0.)
eq1 = DiffusionTerm(var=u,coeff=[[[2.*mu+Lambda,zero],[zero,mu]]]) + \
DiffusionTerm(var=v,coeff=[[[zero,mu+Lambda],[zero,zero]]])
eq2 = DiffusionTerm(var=u,coeff=[[[mu,zero],[zero,2.*mu+Lambda]]]) + \
DiffusionTerm(var=v,coeff=[[[zero,zero],[mu+Lambda,zero]]])


I want to constrain:

or
u,2 + v,1 =0
Lambda * u,1 + (2 * mu + Lambda) * v,2 = 0

I am wondering how could I implement the constraint in Fipy? Thank you.

Regards
Ronghai





On 24/06/14 21:52, Daniel Wheeler wrote:
On Mon, Jun 23, 2014 at 12:13 PM, Ronghai Wu <[email protected]> wrote:
Hello,

I would like to implement "partial derivative of u with respect to x +
partial derivative of v with respect to y = a constant" at boundaries. Is it
possible in Fipy? Thanks in advance.

or maybe something similar as
mesh = Grid2D(dx=dx,dy=dy,nx=nx,ny=ny)

u = CellVariable(mesh=mesh, hasOld=1, rank=0)
v = CellVariable(mesh=mesh, hasOld=1, rank=0)
(u.faceGrad[0] + v.faceGrad[1]).constrain(1., where=mesh.exteriorFaces)
The above syntax certainly won't work. The best way to do this would
be with source terms that add directly to the equations. Constraints
are not that sophisticated.

How this is implemented depends on the equations you are solving and
which equation the boundary condition is applied so you'll need to
supply some more details.



--
------------------------------------------
Ronghai Wu

Institute of Materials Simulation (WW8)
Department of Materials Science and Engineering
University of Erlangen-Nürnberg
Dr.-Mack-Str. 77, 90762 Fürth, Germany

Tel. +49 (0)911 65078-65064

_______________________________________________
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