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  Qdot = combustion->Qdot();
15  volScalarField Yt(0.0*Y[0]);
16 
17  forAll(Y, i)
18  {
19  if (i != inertIndex && composition.active(i))
20  {
21  volScalarField& Yi = Y[i];
22 
23  fvScalarMatrix YiEqn
24  (
25  fvm::ddt(rho, Yi)
26  + mvConvection->fvmDiv(phi, Yi)
27  - fvm::laplacian(turbulence->alphaEff(), Yi)
28  ==
29  parcels.SYi(i, Yi)
30  + surfaceFilm.Srho(i)
31  + combustion->R(Yi)
32  + fvOptions(rho, Yi)
33  );
34 
35  YiEqn.relax();
36 
37  fvOptions.constrain(YiEqn);
38 
39  YiEqn.solve(mesh.solver("Yi"));
40 
41  fvOptions.correct(Yi);
42 
43  Yi.max(0.0);
44  Yt += Yi;
45  }
46  }
47 
48  Y[inertIndex] = scalar(1) - Yt;
49  Y[inertIndex].max(0.0);
50 
51  volScalarField& he = thermo.he();
52 
54  (
55  fvm::ddt(rho, he) + mvConvection->fvmDiv(phi, he)
56  + fvc::ddt(rho, K) + fvc::div(phi, K)
57  + (
58  he.name() == "e"
59  ? fvc::div
60  (
62  p,
63  "div(phiv,p)"
64  )
65  : -dpdt
66  )
67  - fvm::laplacian(turbulence->alphaEff(), he)
68  ==
69  Qdot
70  + radiation->Sh(thermo, he)
71  + parcels.Sh(he)
72  + surfaceFilm.Sh()
73  + fvOptions(rho, he)
74  );
75 
76  EEqn.relax();
77 
78  fvOptions.constrain(EEqn);
79 
80  EEqn.solve();
81 
82  fvOptions.correct(he);
83 
84  thermo.correct();
85 
86  Info<< "min/max(T) = "
87  << min(T).value() << ", " << max(T).value() << endl;
88 }
surfaceScalarField & phi
fvMatrix< scalar > fvScalarMatrix
Definition: fvMatricesFwd.H:42
U
Definition: pEqn.H:83
Info<< "Creating combustion model\"<< endl;autoPtr< combustionModels::psiCombustionModel > combustion(combustionModels::psiCombustionModel::New(mesh))
Y[inertIndex]
Definition: YEEqn.H:48
basicMultiComponentMixture & composition
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)
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)==Qdot+radiation->Sh(thermo, he)+parcels.Sh(he)+surfaceFilm.Sh()+fvOptions(rho, he))
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
Qdot
Definition: YEEqn.H:14
fv::options & fvOptions
multivariateSurfaceInterpolationScheme< scalar >::fieldTable fields
Definition: createFields.H:104
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
volScalarField & dpdt
forAll(Y, i)
Definition: YEEqn.H:17
Info<< "Reading field U\"<< endl;volVectorField U(IOobject("U", runTime.timeName(), mesh, IOobject::MUST_READ, IOobject::AUTO_WRITE), mesh);volScalarField rho(IOobject("rho", runTime.timeName(), mesh, IOobject::NO_READ, IOobject::AUTO_WRITE), thermo.rho());volVectorField rhoU(IOobject("rhoU", runTime.timeName(), mesh, IOobject::NO_READ, IOobject::NO_WRITE), rho *U);volScalarField rhoE(IOobject("rhoE", runTime.timeName(), mesh, IOobject::NO_READ, IOobject::NO_WRITE), rho *(e+0.5 *magSqr(U)));surfaceScalarField pos(IOobject("pos", runTime.timeName(), mesh), mesh, dimensionedScalar("pos", dimless, 1.0));surfaceScalarField neg(IOobject("neg", runTime.timeName(), mesh), mesh, dimensionedScalar("neg", dimless, -1.0));surfaceScalarField phi("phi", fvc::flux(rhoU));Info<< "Creating turbulence model\"<< endl;autoPtr< compressible::turbulenceModel > turbulence(compressible::turbulenceModel::New(rho, U, phi, thermo))
Definition: createFields.H:94
dimensioned< Type > min(const dimensioned< Type > &, const dimensioned< Type > &)
const volScalarField & T
static tmp< GeometricField< Type, fvsPatchField, surfaceMesh > > interpolate(const GeometricField< Type, fvPatchField, volMesh > &tvf, const surfaceScalarField &faceFlux, Istream &schemeData)
Interpolate field onto faces using scheme given by Istream.
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 label inertIndex(composition.species()[inertSpecie])
autoPtr< radiation::radiationModel > radiation(radiation::radiationModel::New(T))
volScalarField Yt(0.0 *Y[0])