Merge branch 'master' of ssh://git.code.sf.net/p/foam-extend/foam-extend-3.2
[foam-extend-3.2.git] / applications / solvers / combustion / rhoReactingFoam / YEqn.H
blobbf0e0119a5e0d4bad507ed7f7878b1c55274113e
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     )
13     label inertIndex = -1;
14     volScalarField Yt("Yt", 0.0*Y[0]);
16     for (label i=0; i<Y.size(); i++)
17     {
18         if (Y[i].name() != inertSpecie)
19         {
20             volScalarField& Yi = Y[i];
22             solve
23             (
24                 fvm::ddt(rho, Yi)
25               + mvConvection->fvmDiv(phi, Yi)
26               - fvm::laplacian(turbulence->muEff(), Yi)
27              ==
28                 kappa*chemistry.RR(i),
29                 mesh.solutionDict().solver("Yi")
30             );
32             Yi.max(0.0);
33             Yt += Yi;
34         }
35         else
36         {
37             inertIndex = i;
38         }
39     }
41     Y[inertIndex] = scalar(1) - Yt;
42     Y[inertIndex].max(0.0);