CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM Running, Solving & CFD (http://www.cfd-online.com/Forums/openfoam-solving/)
-   -   Negative values in scalar transport (http://www.cfd-online.com/Forums/openfoam-solving/63351-negative-values-scalar-transport.html)

jnally April 6, 2009 10:29

Negative values in scalar transport
 
I am trying to solve the following scalar transport equation using a steady state flow solution obtained using simpleFoam:

fvm::ddt(Y) + fvm::div(phi, Y) – fvm::laplacian(DY + (turbulence->nut() / Sct), Y)

Where Sct is the turbulent Schmidt number.

The solver seems to run fine however, I sometimes get negative values reported when tracking the scalar using probes throughout the domain. I have looked through the forums and found a couple of posts that describe the same situation although trying out the solutions found there does not solve my problem. My fvSchemes file is as follows:

ddtSchemes
{
default none;
ddt(Y) Euler;
}
gradSchemes
{
default none;
snGradCorr(Y) Gauss linear;
grad(Y) Gauss linear;
}
divSchemes
{
default none;
div(phi,Y) Gauss Gamma01 1;
}
laplacianSchemes
{
default none;
laplacian((DY+(((Cmu*spr(k))|epsilon+epsilonSmall))|Sct)),Y) Gauss linear limited 1;
}
interpolationSchemes
{
default none;
}
snGradSchemes
{
default none;
}
fluxRequired
{
default no;
Y;
}

Does anyone have any suggestions?

olesen April 7, 2009 04:12

Are you using "inletOutlet" conditions for the inlets of your scalar?
This is important if your inlets have backflow anytime during the solution.

jnally April 7, 2009 06:44

Thanks for the reply
 
Thanks for the reply.

I am not using the inletOutlet condition but I have just checked and made sure that there is no backflow on the inlets. It is a steady state flow so there will be no fluctuations throughout the simulation.

All of the inlets are using a fixedValue for velocity and turbulence, one is also using fixedValue to introduce the scalar (pressure is set as zeroGradient). The outlet patches are set as zeroGradient for velocity, turbulence and scalar with a fixedValue (0) for the pressure.

James

jnally September 26, 2009 09:56

Solved!!
 
I revisited and have solved my problem (which incidentally only occurred when using tet-meshes) by using these schemes:

grad: leastSquares
div: Gauss upwind
laplacian: Gauss linear uncorrected

Just in case anyone else has a similar problem.


All times are GMT -4. The time now is 22:33.