2013/10/1 Richard Edward Gillilan <r...@cornell.edu>

> Sorry, this is a basic theory question.
>
> convection-diffusion problem
>
> I have a pipe containing fluid with dissolved protein of concentration
> phi. I have uniform flow and constant diffusion.
> I would like to make one end of the pipe "open" so that protein does *not*
> accumulate at the end, but simply flows out and vanishes.
>
> By "open", I mean "unconstrained": a boundary segment having no
> constraints on the value of phi or its gradient.
>
> Is there a way to do this in FiPy?  Does this even make sense?
>

There are several ways to do this.

If you have only flow, you can use an upwind scheme. That does not require
'right'values so causes unconstrained outflow

For convection diffusion, you can set the diffusion 0 on that edge and use
upwind.
If you mimic an open cup, you can approximate with a constrain of 0 on the
outflow cells. As approx this will often be good.

Then there is the official way in fipy: set a constraint on faceGrad = 0 on
the outflow edge, and set velocity  0 on the same edge. Use an
explicitSourceTerm to mimic correct outflow. So the facegrad constrain
avoids flow due to normal fluxes, the sourceterm removes the correct amount
of material based on velocity.
With the shutdown of USA I don't find the example on the website, but I
used that here:
https://gitorious.org/microchanit/microchanit/source/c2c43969b2c7ceee783f84cfa4b977eeb648fbf4:src/stratflowbeam.py

    phi.faceGrad.constrain(0, (zfc > Lval - smallall))

    vvel.setValue([[0],[0],[0]], where=outletCells)

    exteriorCoeff = FaceVariable(mesh, value=vvel.arithmeticFaceValue, rank=1)
    exteriorCoeff.setValue([[0],[0],[0]], where=~outletFaces)


    diffeq = ConvectionTerm(coeff=vvel) \
             - DiffusionTerm(mesh, diffcoeff1) \
             + ImplicitSourceTerm(exteriorCoeff.getDivergence())


 Benny
_______________________________________________
fipy mailing list
fipy@nist.gov
http://www.ctcms.nist.gov/fipy
  [ NIST internal ONLY: https://email.nist.gov/mailman/listinfo/fipy ]

Reply via email to