On Tue, Nov 12, 2013 at 7:52 PM, Richard Gillilan <r...@cornell.edu> wrote:
> > Yes, that makes sense now! Thanks. The divergence is a cell-based variable > but derived from face vectors. So if I were to zero out 5 of the 6 vectors > on a volume element, but keep the 6th (an exit face) > non-zero, then the divergence would represent the flux though that one face. Right. > According to Sec 5.6.3 "Applying fixed flux boundary conditions", I should > constrain both the diffusion and convection values on the exit faces to > zero. > >>>> diffCoeff.constrain(0., mesh.exteriorFaces) >>>> convCoeff.constrain(0., mesh.exteriorFaces) > > or in my case, > > D.constrain(0.,ExitFaces) > exteriorCoeff.constain(0.,ExitFaces) > > But Sec 5.6.4 "Applying outlet or inlet boundary conditions" implies that > all convection terms default to the no flux boundary condition anyway. So > the constrain term > for exteriorCoeff is not necessary. It is very confusing. However the solution oulined in http://www.ctcms.nist.gov/fipy/documentation/USAGE.html#applying-fixed-flux-boundary-conditions will work regardless of whether the variable being solved for has exterior face constraints. Your statement above is only true when the variable has no exterior face constraints. > I am suspecting the same is true for the diffusion term D. It must default to > no diffusion outside a boundary. At least that is the behavior I am seeing > when all walls are closed. > So that would explain why I don't need either of these terms. Diffusion always falls back to zero flux as it requires values on both sides of a face to actually know what the flux should be. Convection doesn’t have this requirement, but zero flux for convection was the default early on although it wasn't necessarily the best choice and we have maintained backwards compatibility. > I'm not quite sure what Benny had in mind with the faceGrad.constrain except > that it might be an equivalent way of preventing diffusion past a wall ... > should one need to explicitly do that. I'm not sure exactly what Benny's intention is, however, I suspect that it is more to do with the convection term. Applying a constraint of any sort to the exterior faces will force the convection term to not have its default behaviour, but have a more "natural" boundary condition given by the product of the face value and the convection coefficient (in and out flow). > But I'm guessing this term is not technically necessary (see above comments) > since it would be the default boundary condition already. Only when a constraint is not already applied to the variable being solved for. > Thanks for all your useful comments! No problem. This is definitely a confusing issue. -- Daniel Wheeler _______________________________________________ fipy mailing list fipy@nist.gov http://www.ctcms.nist.gov/fipy [ NIST internal ONLY: https://email.nist.gov/mailman/listinfo/fipy ]