Hi,


We have a system of equations, wherein the BC of one PDE couples with the 
source term of another PDE.



We have a regular 2D unit grid in x and y.



There are two PDEs to be solved

a)    The first PDE (elliptic diffusion problem) is defined only at y = 1, 
acting along the x-axis (i.e. it acts in the x-direction and only along the top 
of the cartesian grid). This x-axis is discretized with a fixed gird-spacing, 
generating a finite number of nodes. Let this set of nodes/co-ordinates be 
represented by 'X'.

b)   The second PDE is a time-varying diffusion problem. This is defined only 
along the y-axis, but for all x-nodes (i.e. for all 'X'), where the 1st PDE is 
being solved.



Mathematically (plain-text version) :



PDE1: divergence(S * grad(a)) =  f(w,a)

BC1:  a = 0 , at x = 0     (dirichelet)

BC2:   d_a/dx = 1 at x = 1  (Neumann)





D = faceVariable(rank=2, value = 1.0)       # Rank 2 tensor for anisotropic 
diffusion  (i.e. allowed only along the y-axis)



PDE2: partial_B/partial_t = divergence( [[[0, 0], [0, D]]] * grad(B) )

BC1:  B = 0, at y = 0 at all 'X' (dirichelet), i.e. along the bottom face

BC2:  d_B/dy = g(w,a) (Neumann)



f and g are linear functions in 'w(x,y,t)' and 'a(x,y,t)'.



Importantly, w = B at y = 1, for all 'X'; i.e., the BC2 of the 2nd PDE couples 
with the Implicit Source Term of the 1st PDE along the top face of the 
Cartesian mesh.





What's the best way to implement this problem in FiPy ?





Best Regards,



Krishna



PS: Since the problem is mathematically harder to express in plain-text, here 
is a HTML formatted version of the PDEs and BCs.

PDE1: [cid:[email protected]]

BC1:   [cid:[email protected]]  (Dirichelet)

BC2:   [cid:[email protected]]  (Neumann)





D = faceVariable(mesh=pos_p2d_mesh, rank=2, value = 1.0)         # Rank 2 
tensor for anisotropic diffusion  (i.e. allowed only along the y-axis)



PDE2:     [cid:[email protected]]  = 
[cid:[email protected]]

BC1 is:  [cid:[email protected]]  i.e. along the bottom face

BC2 is:  [cid:[email protected]]  (Neumann)



f and g are linear functions in 'w(x,y,t)' and 'a(x,y,t)'.  
[cid:[email protected]]  is defined in the 2D grid as  B(x,y,t)



Importantly, [cid:[email protected]]  i.e., the BC2 of the 2nd PDE 
couples with the Implicit Source Term of the 1st PDE along the top face of the 
Cartesian mesh.






_______________________________________________
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