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  combustion->correct();
13  Qdot = combustion->Qdot();
14  volScalarField Yt(0.0*Y[0]);
15 
16  forAll(Y, i)
17  {
18  if (i != inertIndex && composition.active(i))
19  {
20  volScalarField& Yi = Y[i];
21 
22  fvScalarMatrix YiEqn
23  (
24  fvm::ddt(rho, Yi)
25  + mvConvection->fvmDiv(phi, Yi)
26  - fvm::laplacian(turbulence->alphaEff(), Yi)
27  ==
28  parcels.SYi(i, Yi)
29  + surfaceFilm.Srho(i)
30  + combustion->R(Yi)
31  + fvOptions(rho, Yi)
32  );
33 
34  YiEqn.relax();
35 
36  fvOptions.constrain(YiEqn);
37 
38  YiEqn.solve(mesh.solver("Yi"));
39 
40  fvOptions.correct(Yi);
41 
42  Yi.max(0.0);
43  Yt += Yi;
44  }
45  }
46 
47  Y[inertIndex] = scalar(1) - Yt;
48  Y[inertIndex].max(0.0);
49 
50  radiation->correct();
51 
53 
55  (
56  fvm::ddt(rho, he) + mvConvection->fvmDiv(phi, he)
57  + fvc::ddt(rho, K) + fvc::div(phi, K)
58  + (
59  he.name() == "e"
60  ? fvc::div
61  (
63  p,
64  "div(phiv,p)"
65  )
66  : -dpdt
67  )
68  - fvm::laplacian(turbulence->alphaEff(), he)
69  ==
70  Qdot
71  + radiation->Sh(thermo, he)
72  + parcels.Sh(he)
73  + surfaceFilm.Sh()
74  + fvOptions(rho, he)
75  );
76 
77  EEqn.relax();
78 
79  fvOptions.constrain(EEqn);
80 
81  EEqn.solve();
82 
83  fvOptions.correct(he);
84 
85  thermo.correct();
86 
87  Info<< "min/max(T) = "
88  << min(T).value() << ", " << max(T).value() << endl;
89 }
p
volScalarField & p
Definition: createFieldRefs.H:8
turbulence
Info<< "Reading field U\n"<< 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\n"<< endl;autoPtr< compressible::turbulenceModel > turbulence(compressible::turbulenceModel::New(rho, U, phi, thermo))
Definition: createFields.H:94
forAll
forAll(Y, i)
Definition: YEEqn.H:16
thermo
Basic thermodynamics type based on the use of fitting functions for cp, h, s obtained from the templa...
Foam::endl
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:350
Foam::fac::div
tmp< GeometricField< Type, faPatchField, areaMesh > > div(const GeometricField< Type, faePatchField, edgeMesh > &ssf)
Definition: facDiv.C:50
rho
rho
Definition: readInitialConditions.H:88
composition
basicSpecieMixture & composition
Definition: createFieldRefs.H:6
Foam::min
label min(const labelHashSet &set, label minValue=labelMax)
Find the min value in labelHashSet, optionally limited by second argument.
Definition: hashSets.C:33
K
CGAL::Exact_predicates_exact_constructions_kernel K
Definition: CGALTriangulation3DKernel.H:58
Foam::fvScalarMatrix
fvMatrix< scalar > fvScalarMatrix
Definition: fvMatricesFwd.H:44
fvOptions
fv::options & fvOptions
Definition: setRegionFluidFields.H:23
Yt
volScalarField Yt(0.0 *Y[0])
Foam::Info
messageStream Info
Information stream (uses stdout - output is on the master only)
surfaceFilm
regionModels::surfaceFilmModel & surfaceFilm
Definition: createFieldRefs.H:3
EEqn
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))
mvConvection
tmp< fv::convectionScheme< scalar > > mvConvection(fv::convectionScheme< scalar >::New(mesh, fields, phi, mesh.divScheme("div(phi,Yi_h)")))
phi
surfaceScalarField & phi
Definition: setRegionFluidFields.H:8
Foam::volScalarField
GeometricField< scalar, fvPatchField, volMesh > volScalarField
Definition: volFieldsFwd.H:57
radiation
autoPtr< radiation::radiationModel > radiation(radiation::radiationModel::New(T))
Y
Y[inertIndex]
Definition: YEEqn.H:47
mesh
dynamicFvMesh & mesh
Definition: createDynamicFvMesh.H:6
T
const volScalarField & T
Definition: createFieldRefs.H:2
Foam::New
tmp< DimensionedField< TypeR, GeoMesh > > New(const tmp< DimensionedField< TypeR, GeoMesh >> &tdf1, const word &name, const dimensionSet &dimensions)
Global function forwards to reuseTmpDimensionedField::New.
Definition: DimensionedFieldReuseFunctions.H:105
max
Y[inertIndex] max(0.0)
U
U
Definition: pEqn.H:72
he
volScalarField & he
Definition: YEEqn.H:52
Foam::fac::ddt
tmp< GeometricField< Type, faPatchField, areaMesh > > ddt(const dimensioned< Type > dt, const faMesh &mesh)
Definition: facDdt.C:47
inertIndex
label inertIndex
Definition: setRegionFluidFields.H:11
alphaEff
volScalarField alphaEff("alphaEff", turbulence->nu()/Pr+alphat)
Qdot
Qdot
Definition: YEEqn.H:13
dpdt
volScalarField & dpdt
Definition: setRegionFluidFields.H:32
Foam::fac::laplacian
tmp< GeometricField< Type, faPatchField, areaMesh > > laplacian(const GeometricField< Type, faPatchField, areaMesh > &vf, const word &name)
Definition: facLaplacian.C:47
Foam::fac::interpolate
static tmp< GeometricField< Type, faePatchField, edgeMesh > > interpolate(const GeometricField< Type, faPatchField, areaMesh > &tvf, const edgeScalarField &faceFlux, Istream &schemeData)
Interpolate field onto faces using scheme given by Istream.
Foam::fvc::absolute
tmp< surfaceScalarField > absolute(const tmp< surfaceScalarField > &tphi, const volVectorField &U)
Return the given relative flux in absolute form.
Definition: fvcMeshPhi.C:190
fields
multivariateSurfaceInterpolationScheme< scalar >::fieldTable fields
Definition: createFields.H:97
combustion
Info<< "Creating combustion model\n"<< endl;autoPtr< CombustionModel< psiReactionThermo > > combustion(CombustionModel< psiReactionThermo >::New(thermo, turbulence()))