Hi, Currently, I am working on a 2-species (vacancy and solute atom) diffusion system (2D). The Fipy equation is set up as,
eqV = TransientTerm(coeff=TranTerm,var=C_V) == ( DiffusionTerm(coeff=DiffTerm_VV,var=C_V) + ConvectionTerm(coeff=CnvcTerm_VV,var=C_V) + DiffusionTerm(coeff=C_V*DiffTerm_VS,var=C_S) + ConvectionTerm(coeff=C_V*CnvcTerm_VS,var=C_S) ) eqS = TransientTerm(coeff=TranTerm,var=C_S) == ( DiffusionTerm(coeff=C_S*DiffTerm_SV,var=C_V) + ConvectionTerm(coeff=C_S*CnvcTerm_SV,var=C_V) + DiffusionTerm(coeff=C_V*DiffTerm_SS,var=C_S) + ConvectionTerm(coeff=C_V*CnvcTerm_SS,var=C_S) ) eq = eqV & eqS C_V and C_S are concentration of vacancy and solute respectively, DiffTerm_AB, CnvcTerm_AB (A,B = V or S) are position-dependent terms (DiffTerm_AB are 2nd order matrices and CnvcTerm_AB are vectors) used to compute the actually diffusivities and convection velocities (The actually diffusivities are DiffTerm_AB times concentration of V or S). The two equation are coupled together, that why it is difficult to compute the fluxes directly. (Here the DiffTerm_AB, CnvcTerm_AB are defined using Cellvariables) We need to apply zero solute flux at one boundary, and here we use (The way mentioned in the FAQ section) DiffTerm_SV.constrain(0,Pmesh.facesLeft) DiffTerm_SS.constrain(0,Pmesh.facesLeft) CnvcTerm_SV.constrain(0,Pmesh.facesLeft) CnvcTerm_SS.constrain(0,Pmesh.facesLeft), and Dirichlet B.C. for other boundaries. The code works. However, the result does not agree with our expectation. (We plot the flux of solute at steady-state, but it is not zero. The values are quite large.) Actually, the way I used to fix zero flux at the boundary only works if the diffusion term or convection term in a cell is computed by summing up contributions from neighboring faces. I thinks the ExplictDiffusionTerm works in this way, but DiffusionTerm does not. Therefore, I wonder is there any other methods to fix the boundary fluxes. Is there any thing to take care if I use the ExplictDiffusionTerm. (Currently, I just change "DiffusitionTerm" into "ExplicitDiffusionTerm", and it causes a lot of errors. I think I need to use Facevariables, then how about C_V and C_S in the diffusivity entries.) best, Zebo
_______________________________________________ fipy mailing list [email protected] http://www.ctcms.nist.gov/fipy [ NIST internal ONLY: https://email.nist.gov/mailman/listinfo/fipy ]
