|
Hi, I'm trying to solve the following equations: ![]() ![]() And I'm defining the system in this way: mesh = fp.Grid3D(dx=dx, dy=dy,dz=dz, nx=nx, ny=ny,nz=nz) C = fp.CellVariable(name = "Calcium",mesh = mesh, value = 0.) B = fp.CellVariable(name = "Buffer",mesh = mesh, value = B_0) eqC = fp.TransientTerm(var=C) == fp.DiffusionTerm(coeff=D_c,var=C) - \ K*(B*C-K_d*(B_0-B)) eqB = fp.TransientTerm(var=B) == fp.DiffusionTerm(coeff=D_b,var=B) - \ K*(B*C-K_d*(B_0-B)) eq = eqC & eqB I know that I'm doing something wrong because I'm getting the wrong solution. Starting from the initial conditions as written there the system should remain unchanged, but instead it evolves in time. I think that one of the problems comes from having two equations, if I consider k=0 (that's I just solve two uncoupled diffusion equations) I get the solution for C right, but the solution for B is wrong (of course If i write a program to solve only the diffusion of B, then I get the right solution). Am I doing something wrong there? I also think that the nonlinear terms should be defined as ImplicitSource terms, but I don't know which variable should I use in the definition, since one of the terms depends both on B and C. Thanks in advance for your help. Adrian. |
_______________________________________________ fipy mailing list [email protected] http://www.ctcms.nist.gov/fipy [ NIST internal ONLY: https://email.nist.gov/mailman/listinfo/fipy ]


