CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM (https://www.cfd-online.com/Forums/openfoam/)
-   -   RAS Turbulence Models - Convective Term (https://www.cfd-online.com/Forums/openfoam/75546-ras-turbulence-models-convective-term.html)

 john_w April 28, 2010 11:18

RAS Turbulence Models - Convective Term

I was recently looking at the code for the RAS turbulence models within OF in order to relate the coding to the mathematical algorithms. As expected, with the standardized syntax within OF, this is not too hard to do. However, there is one expression within the kinetic energy and dissipation equations that is used in some cases in describing the left hand side (i.e. unsteady and convective terms), but not in all cases. For example if we look at the compressible kEpsilon.C kinetic energy equation, we find:

// Turbulent kinetic energy equation

tmp<fvScalarMatrix> kEqn
(
fvm::ddt(rho_, k_)
+ fvm::div(phi_, k_)
- fvm::laplacian(DkEff(), k_)
==
G
- fvm::SuSp((2.0/3.0)*rho_*divU, k_)
- fvm::Sp(rho_*epsilon_/k_, k_)
);

However, in the incompressible case, an additional term (in red) is also found:

// Turbulent kinetic energy equation
tmp<fvScalarMatrix> kEqn
(
fvm::ddt(k_)
+ fvm::div(phi_, k_)
- fvm::Sp(fvc::div(phi_), k_)
- fvm::laplacian(DkEff(), k_)
==
G
- fvm::Sp(epsilon_/k_, k_)
);

It appears to be part of the code which describes the convective term, but would appreciate more insight if anyone can help.

Thanks, John

 idrama April 29, 2010 07:42

Have a look into the ProgrammersGuide P-37. I consider it as a simple multiplication. However, it has something to do with the way how it is discretize.

Cheers

 ngj April 29, 2010 07:55

Hi John

With respect to the incompressible formulation, what the red part states is that you include convection of k which is proportional to the continuity error (fvc::div(phi)). This term is also present in the differential form as

k \nabla \cdot U

however due to the continuity equation for incompressible flow this is identical equal to zero. The discrete formulation as you mention account for the error in the continuity equation, thus with small enough tolerances on your solvers, this term should also go to zero.

I have no knowledge of compressible flows, hence cannot be of any help in that regard.

Best regards,

Niels

 sahm May 29, 2010 21:31

Source term. Implicit.

As far as I have understood it is a source term calculated by simply multiplying the terms. Since It is fvm::Sp(a,b) it calculated the source term with Implicit method.

 All times are GMT -4. The time now is 16:47.