YEEqn.H
Go to the documentation of this file.
1 tmp<fv::convectionScheme<scalar>> mvConvection
2 (
4  (
5  mesh,
6  fields,
7  phi,
8  mesh.divScheme("div(phi,Yi_h)")
9  )
10 );
11 {
12  radiation->correct();
13  combustion->correct();
14  dQ = combustion->dQ();
15  label inertIndex = -1;
16  volScalarField Yt(0.0*Y[0]);
17 
18  forAll(Y, i)
19  {
20  if (Y[i].name() != inertSpecie)
21  {
22  volScalarField& Yi = Y[i];
23 
24  fvScalarMatrix YiEqn
25  (
26  fvm::ddt(rho, Yi)
27  + mvConvection->fvmDiv(phi, Yi)
28  - fvm::laplacian(turbulence->alphaEff(), Yi)
29  ==
30  parcels.SYi(i, Yi)
31  + surfaceFilm.Srho(i)
32  + combustion->R(Yi)
33  + fvOptions(rho, Yi)
34  );
35 
36  YiEqn.relax();
37 
38  fvOptions.constrain(YiEqn);
39 
40  YiEqn.solve(mesh.solver("Yi"));
41 
42  fvOptions.correct(Yi);
43 
44  Yi.max(0.0);
45  Yt += Yi;
46  }
47  else
48  {
49  inertIndex = i;
50  }
51  }
52 
53  Y[inertIndex] = scalar(1) - Yt;
54  Y[inertIndex].max(0.0);
55 
56  volScalarField& he = thermo.he();
57 
59  (
60  fvm::ddt(rho, he) + mvConvection->fvmDiv(phi, he)
61  + fvc::ddt(rho, K) + fvc::div(phi, K)
62  + (
63  he.name() == "e"
64  ? fvc::div
65  (
67  p,
68  "div(phiv,p)"
69  )
70  : -dpdt
71  )
72  - fvm::laplacian(turbulence->alphaEff(), he)
73  ==
74  combustion->Sh()
75  + radiation->Sh(thermo)
76  + parcels.Sh(he)
77  + surfaceFilm.Sh()
78  + fvOptions(rho, he)
79  );
80 
81  EEqn.relax();
82 
83  fvOptions.constrain(EEqn);
84 
85  EEqn.solve();
86 
87  fvOptions.correct(he);
88 
89  thermo.correct();
90 
91  Info<< "min/max(T) = "
92  << min(T).value() << ", " << max(T).value() << endl;
93 }
autoPtr< compressible::turbulenceModel > turbulence
Definition: createFields.H:23
surfaceScalarField & phi
fvMatrix< scalar > fvScalarMatrix
Definition: fvMatricesFwd.H:42
U
Definition: pEqn.H:83
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Definition: label.H:59
Info<< "Creating combustion model\n"<< endl;autoPtr< combustionModels::psiCombustionModel > combustion(combustionModels::psiCombustionModel::New(mesh))
Y[inertIndex]
Definition: YEEqn.H:53
fvScalarMatrix EEqn(fvm::ddt(rho, he)+mvConvection->fvmDiv(phi, he)+fvc::ddt(rho, K)+fvc::div(phi, K)+(he.name()=="e"?fvc::div(fvc::absolute(phi/fvc::interpolate(rho), U), p,"div(phiv,p)"):-dpdt)-fvm::laplacian(turbulence->alphaEff(), he)==combustion->Sh()+radiation->Sh(thermo)+parcels.Sh(he)+surfaceFilm.Sh()+fvOptions(rho, he))
scalar Sh
Definition: solveChemistry.H:2
tmp< GeometricField< Type, fvPatchField, volMesh > > div(const GeometricField< Type, fvsPatchField, surfaceMesh > &ssf)
Definition: fvcDiv.C:47
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:253
Y[inertIndex] max(0.0)
tmp< surfaceScalarField > interpolate(const RhoType &rho)
tmp< GeometricField< Type, fvPatchField, volMesh > > laplacian(const GeometricField< Type, fvPatchField, volMesh > &vf, const word &name)
Definition: fvcLaplacian.C:45
CGAL::Exact_predicates_exact_constructions_kernel K
fv::options & fvOptions
multivariateSurfaceInterpolationScheme< scalar >::fieldTable fields
Definition: createFields.H:97
tmp< DimensionedField< TypeR, GeoMesh > > New(const tmp< DimensionedField< TypeR, GeoMesh >> &tdf1, const word &name, const dimensionSet &dimensions)
tmp< GeometricField< Type, fvPatchField, volMesh > > ddt(const dimensioned< Type > dt, const fvMesh &mesh)
Definition: fvcDdt.C:45
GeometricField< scalar, fvPatchField, volMesh > volScalarField
Definition: volFieldsFwd.H:52
psiReactionThermo & thermo
Definition: createFields.H:31
dynamicFvMesh & mesh
dQ
Definition: YEEqn.H:14
volScalarField & dpdt
label inertIndex
Definition: YEEqn.H:15
virtual void correct()
Main update/correction routine.
forAll(Y, i)
Definition: YEEqn.H:18
dimensioned< Type > min(const dimensioned< Type > &, const dimensioned< Type > &)
const volScalarField & T
word name(const complex &)
Return a string representation of a complex.
Definition: complex.C:47
tmp< surfaceScalarField > absolute(const tmp< surfaceScalarField > &tphi, const volVectorField &U)
Return the given relative flux in absolute form.
Definition: fvcMeshPhi.C:188
tmp< fv::convectionScheme< scalar > > mvConvection(fv::convectionScheme< scalar >::New(mesh, fields, phi, mesh.divScheme("div(phi,Yi_h)")))
messageStream Info
filmModelType & surfaceFilm
volScalarField alphaEff("alphaEff", turbulence->nu()/Pr+alphat)
volScalarField & p
const word inertSpecie(thermo.lookup("inertSpecie"))
autoPtr< radiation::radiationModel > radiation(radiation::radiationModel::New(T))
volScalarField Yt(0.0 *Y[0])