Merge branch 'master' of ssh://git.code.sf.net/p/foam-extend/foam-extend-3.2
[foam-extend-3.2.git] / applications / solvers / multiphase / twoPhaseEulerFoam / turbulenceModel / kEpsilon.H
blob9479d6a47fcef3e4f2d1fae2622eb305023d401b
1 if(turbulence)
3     if (mesh.changing())
4     {
5         y.correct();
6     }
8     tmp<volTensorField> tgradUb = fvc::grad(Ub);
9     volScalarField G = 2*nutb*(tgradUb() && dev(symm(tgradUb())));
10     tgradUb.clear();
12 #   include "wallFunctions.H"
14     // Dissipation equation
15     fvScalarMatrix epsEqn
16     (
17         fvm::ddt(beta, epsilon)
18       + fvm::div(phib, epsilon)
19       - fvm::laplacian
20         (
21             alphaEps*nuEffb,
22             epsilon,
23             "laplacian((alphaEps*nuEffb),epsilon)"
24         )
25       ==
26          C1*beta*G*epsilon/k
27        - fvm::Sp(C2*beta*epsilon/k, epsilon)
28     );
30 #   include "wallDissipation.H"
32     epsEqn.relax();
33     epsEqn.solve();
35     epsilon.max(dimensionedScalar("zero", epsilon.dimensions(), 1.0e-15));
38     // Turbulent kinetic energy equation
39     fvScalarMatrix kEqn
40     (
41         fvm::ddt(beta, k)
42       + fvm::div(phib, k)
43       - fvm::laplacian(alphak*nuEffb, k, "laplacian((alphak*nuEffb),k)")
44       ==
45         beta*G
46       - fvm::Sp(beta*epsilon/k, k)
47     );
48     kEqn.relax();
49     kEqn.solve();
51     k.max(dimensionedScalar("zero", k.dimensions(), 1.0e-8));
53     //- Re-calculate turbulence viscosity
54     nutb = Cmu*sqr(k)/epsilon;
56 #   include "wallViscosity.H"
60 nuEffa = sqr(Ct)*nutb + nua;
61 nuEffb = nutb + nub;