CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM (http://www.cfd-online.com/Forums/openfoam/)
-   -   max time step related to diffusion time (http://www.cfd-online.com/Forums/openfoam/80285-max-time-step-related-diffusion-time.html)

 chegdan September 21, 2010 15:15

max time step related to diffusion time

Hello all,

I am interested in adjusting the time step for a transient solver on both the Courant number (already implemented in Openfoam) and on the time required for diffusion to be captured. Right now Im starting simple, using the icoFoam solver with species transport. Since I would like to add this to a turbulent solver later (diffusivity depends on turbulent schmidt number), I have made diffusivity a field. I want to find the average diffusion time and the minimum diffusion time based on:

t_diffusion = dx^2/D

I looked at the CourantNo.H file and found:

surfaceScalarField SfUfbyDelta =
mesh.surfaceInterpolation::deltaCoeffs()*mag(phi);

CoNum = max(SfUfbyDelta/mesh.magSf())
.value()*runTime.deltaT().value();

meanCoNum = (sum(SfUfbyDelta)/sum(mesh.magSf()))
.value()*runTime.deltaT().value();

velMag = max(mag(phi)/mesh.magSf()).value();

but I need to extract the delta X values, square them, and then divide them by the cell specific diffusivity. How does one do this exactly? Any help is much appreciated.

 eugene September 23, 2010 11:52

What do you mean exactly by delta X values?

 chegdan September 23, 2010 13:13

dalta x as in h, spacing, or cell-cell distance

Quote:
 Originally Posted by eugene (Post 276358) What do you mean exactly by delta X values?
dalta x as in h, spacing, or cell-cell distance. How far the species must diffuse across. If the time steps are too big then the result is incorrect.

 eugene September 23, 2010 18:40

Ok then you can get it from

mesh.surfaceInterpolation::deltaCoeffs()

This is a surfaceScalarField with value 1/delta - the cell-centre to cell-centre distances. (Or face centre to cell centre distance at the boundary.)

 All times are GMT -4. The time now is 10:59.