CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM (https://www.cfd-online.com/Forums/openfoam/)
-   -   Dependency of diffusivity from temperature (https://www.cfd-online.com/Forums/openfoam/102622-dependency-diffusivity-temperature.html)

zhc_ykt May 30, 2012 03:33

Dependency of diffusivity from temperature
 
Hi,

I try to modify laplacianFoam solver and make depency of DT from temperature. Something like this:

if T>0 then DT=0.56 else DT=2.21.

Taking a temperature from previous time layer is ok. But i don't understand how to make OpenFoam fill each value of dimensionedScalar from respective value of calculated T.

nimasam May 30, 2012 03:53

some thing like this:

Code:

forAll (T, celli)
{
if (T[celli] > 0)
{
DT[celli] =0.56;
}
else
{
DT[celli] =2.21;
}

}

P.S
you should change diffusivity definition from dimensionedScalar into VolScalarField


All times are GMT -4. The time now is 06:55.