On Sat, Nov 9, 2013 at 3:01 PM, Richard Gillilan <[email protected]> wrote:

> Benny: I'm confused by the extra step of going from CellVariable (vvel) to
> FaceVariable  (exteriorCoeff) in your example. Is it simply that your code
> uses CellVariables for the vvel and ImplicitSourceTerm requires a
> FaceVariable? I thought ImplicitSourceTerms were supposed to need
> CellVariables.

"exteriorCoeff.getDivergence()" returns a CellVariable, but
"getDivergence" is a method of a FaceVariable so a FaceVarialbe is not
being passed to the ImplicitSourceTerm.

> # create an "open" exit
>
> # These terms didn't work for me:
> #phi.faceGrad.constrain([0],ExitFaces)    # no diffusion out exit

Perhaps the above would work bettter if "D" is set to zero on  ExitFaces.

> #vel.setValue([[0],[0]], where=ExitFaces) # no convection out exit
>
> exteriorCoeff = FaceVariable(mesh, value=vel, rank=1)
> exteriorCoeff.setValue([[0],[0]], where=~ExitFaces)
>
> eq = TransientTerm() ==
> (DiffusionTerm(coeff=D)+VanLeerConvectionTerm(coeff=vel))+ImplicitSourceTerm(exteriorCoeff.divergence())
>
> ------ end of example ----
> This example seems to do the right thing ... as near as I can tell.
>
> Now, why should this work at all?

I'm not entirely sure what the above does. It may be that the source
cancels the outward flux from the convection term.

> My fluid is incompressible so that
> vel.divergence = 0. What does setting exteriorCoeff.setValue to zero on the
> ExitFaces do to the divergence?

Nothing because then "exteriorCoeff" would be zero everywhere. IN the
above, "exteriorCoeff" is not set to zero on the the "ExitFaces", it
is only set to zero on the non-exit faces ("~" is  NOT in
numpy-array-like language). I think that the convection term includes
the outward flux, but that is being added back in by the source term.
There may or may not be a reason why this works better. I don't know
for sure

-- 
Daniel Wheeler
_______________________________________________
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