Merge branch 'master' of ssh://git.code.sf.net/p/foam-extend/foam-extend-3.2
[foam-extend-3.2.git] / applications / solvers / combustion / dieselEngineFoam / YEqn.H
blob86d060b8e3fe1d61bcd9819e94e34a0c1a8e047e
1 tmp<fv::convectionScheme<scalar> > mvConvection
3     fv::convectionScheme<scalar>::New
4     (
5         mesh,
6         fields,
7         phi,
8         mesh.schemesDict().divScheme("div(phi,Yi_h)")
9     )
14     label inertIndex = -1;
15     volScalarField Yt("Yt", 0.0*Y[0]);
17     for (label i = 0; i < Y.size(); i++)
18     {
19         if (Y[i].name() != inertSpecie)
20         {
21             volScalarField& Yi = Y[i];
23             solve
24             (
25                 fvm::ddt(rho, Yi)
26               + mvConvection->fvmDiv(phi, Yi)
27               - fvm::laplacian(turbulence->muEff(), Yi)
28               ==
29                 dieselSpray.evaporationSource(i)
30               + kappa*chemistry.RR(i),
31                 mesh.solutionDict().solver("Yi")
32             );
34             Yi.max(0.0);
35             Yt += Yi;
36         }
37         else
38         {
39             inertIndex = i;
40         }
41     }
43     Y[inertIndex] = scalar(1) - Yt;
44     Y[inertIndex].max(0.0);