FreeFOAM The Cross-Platform CFD Toolkit
Hosted by SourceForge:
Get FreeFOAM at SourceForge.net.
            Fast, secure and Free Open Source software downloads

kEpsilon.H

Go to the documentation of this file.
00001 if(turbulence)
00002 {
00003     if (mesh.changing())
00004     {
00005         y.correct();
00006     }
00007 
00008     dimensionedScalar k0("k0", k.dimensions(), SMALL);
00009     dimensionedScalar epsilon0("epsilon0", epsilon.dimensions(), SMALL);
00010 
00011     volScalarField divU = fvc::div(phi/fvc::interpolate(rho));
00012 
00013     tmp<volTensorField> tgradU = fvc::grad(U);
00014     volScalarField G = 2*mut*(tgradU() && dev(symm(tgradU())));
00015     tgradU.clear();
00016 
00017     volScalarField Gcoef =
00018         alphak*Cmu*k*(g & fvc::grad(rho))/(epsilon + epsilon0);
00019 
00020 #   include "wallFunctions.H"
00021 
00022     // Dissipation equation
00023     fvScalarMatrix epsEqn
00024     (
00025         fvm::ddt(rho, epsilon)
00026       + fvm::div(phi, epsilon)
00027       - fvm::laplacian
00028         (
00029             alphaEps*mut + mul, epsilon,
00030             "laplacian(DepsilonEff,epsilon)"
00031         )
00032      ==
00033         C1*G*epsilon/k
00034       - fvm::SuSp(C1*(1.0 - C3)*Gcoef + (2.0/3.0*C1)*rho*divU, epsilon)
00035       - fvm::Sp(C2*rho*epsilon/k, epsilon)
00036     );
00037 
00038 #   include "wallDissipation.H"
00039 
00040     epsEqn.relax();
00041     epsEqn.solve();
00042 
00043     bound(epsilon, epsilon0);
00044 
00045 
00046     // Turbulent kinetic energy equation
00047 
00048     fvScalarMatrix kEqn
00049     (
00050         fvm::ddt(rho, k)
00051       + fvm::div(phi, k)
00052       - fvm::laplacian
00053         (
00054             alphak*mut + mul, k,
00055             "laplacian(DkEff,k)"
00056         )
00057      ==
00058         G
00059       - fvm::SuSp(Gcoef + 2.0/3.0*rho*divU, k)
00060       - fvm::Sp(rho*epsilon/k, k)
00061     );
00062 
00063     kEqn.relax();
00064     kEqn.solve();
00065 
00066     bound(k, k0);
00067 
00068 
00069     //- Re-calculate viscosity
00070     mut = rho*Cmu*sqr(k)/epsilon;
00071 
00072 #   include "wallViscosity.H"
00073 }
00074 
00075 mu = mut + mul;
00076 
00077 // ************************ vim: set sw=4 sts=4 et: ************************ //
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines