ENH: autoLayerDriver: better layering information message
[OpenFOAM-2.0.x.git] / applications / solvers / lagrangian / porousExplicitSourceReactingParcelFoam / YEqn.H
blob53c6b25d81c1e10fb8f3f0d377ca35d715bf4686
2 tmp<fv::convectionScheme<scalar> > mvConvection
4     fv::convectionScheme<scalar>::New
5     (
6         mesh,
7         fields,
8         phi,
9         mesh.divScheme("div(phi,Yi_h)")
10     )
14 if (solveSpecies)
16     label inertIndex = -1;
17     volScalarField Yt(0.0*Y[0]);
19     forAll(Y, i)
20     {
21         if (Y[i].name() != inertSpecie)
22         {
23             volScalarField& Yi = Y[i];
24             solve
25             (
26                 fvm::ddt(rho, Yi)
27               + mvConvection->fvmDiv(phi, Yi)
28               - fvm::laplacian(turbulence->muEff(), Yi)
29               ==
30                 parcels.SYi(i, Yi)
31               + kappa*chemistry.RR(i)().dimensionedInternalField()
32               + massSource.Su(i),
33                 mesh.solver("Yi")
34             );
36             Yi.max(0.0);
37             Yt += Yi;
38         }
39         else
40         {
41             inertIndex = i;
42         }
43     }
45     Y[inertIndex] = scalar(1) - Yt;
46     Y[inertIndex].max(0.0);