ENH: sixDoFRigidBodyDisplacement. rho field handling and new tutorial.
[OpenFOAM-1.6.x.git] / applications / solvers / lagrangian / porousExplicitSourceReactingParcelFoam / YEqn.H
blobf54be04bb8778fb886f21231f860439e426188d9
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     )
15     label inertIndex = -1;
16     volScalarField Yt = 0.0*Y[0];
18     forAll(Y, i)
19     {
20         if (Y[i].name() != inertSpecie)
21         {
22             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                 parcels.Srho(i)
30               + kappa*chemistry.RR(i)().dimensionedInternalField()
31               + massSource.Su(i),
32                 mesh.solver("Yi")
33             );
35             Yi.max(0.0);
36             Yt += Yi;
37         }
38         else
39         {
40             inertIndex = i;
41         }
42     }
44     Y[inertIndex] = scalar(1) - Yt;
45     Y[inertIndex].max(0.0);