[Nek5000-users] scalar zero flux bc

nek5000-users at lists.mcs.anl.gov nek5000-users at lists.mcs.anl.gov
Thu Apr 4 02:55:07 CDT 2013


Hi Mike,

You probably can get away with the following:

> (Eq. 2) k grad(phi) dot N = J dot N

Set the phi bc to be "f" (for "flux", evaluated in userbc).

Then, in userbc, set

      integer e,eg
      e = gllel(eg)
      flux = scale(ix,iy,iz,e)

where you precompute the array scale() in userchk, using the J
from the last timestep.   If you want to get fancy, you could
use  2*J^n - J^{n-1}, which would give you a 2nd-order accurate BC.

Note that "scale" should simply be the rhs of your Eq. 2.
Nek sets this right hand side to be equal to k grad phi . nhat.

I can't recall off the top of my head of q" (the surface flux)
is the flux into the domain, or out of, so you should check the
sign.  I'm pretty certain that it is coming into the domain.
The unit normal for certain points out of the domain.

Please let me know if this works for you.

Paul


On Wed, 3 Apr 2013, nek5000-users at lists.mcs.anl.gov wrote:

> Hello Neks,
>
> I'm looking for guidance on implementing appropriate volume forcing and zero-net-flux boundary conditions for the scalar equation.
>
> I'm solving
>
> (Eq. 1) phi_t +  U dot grad(phi) = - div(J) + k Laplacian(phi)
>
> where phi is the scalar, phi_t denotes time derivative, and capital letters are vector quantities.  Here, J = J(phi) is modeled flux.
>
> I need zero net flux at the boundaries, which requires
>
> (-J + k grad(phi)) dot N  = 0
>
> or
>
> (Eq. 2) k grad(phi) dot N = J dot N
>
> where N is the boundary normal.
>
> For (Eq. 1), I am simply using
>
> qvol = -div(J)
>
> in userq, and I specify the constant diffusivity in uservp (udiff set for ifield.eq.2).  This seems correct, but please let me know if not.
>
> In regard to the boundary condition (Eq. 2), what is the appropriate implementation in userbc and what boundary specification should be used in the .rea file ('c' or 'F')?
>
> Thanks,
> Mike
>
>
>
> _______________________________________________
> Nek5000-users mailing list
> Nek5000-users at lists.mcs.anl.gov
> https://lists.mcs.anl.gov/mailman/listinfo/nek5000-users
>


More information about the Nek5000-users mailing list