bEqn.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,ft_b_ha_hau)")
9  )
10 );
11 
12 volScalarField Db("Db", turbulence->muEff());
13 
14 if (ign.ignited())
15 {
16  // Calculate the unstrained laminar flame speed
17  // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
19 
20  const volScalarField& Xi = flameWrinkling->Xi();
21 
22  // progress variable
23  // ~~~~~~~~~~~~~~~~~
24  volScalarField c("c", 1.0 - b);
25 
26  // Unburnt gas density
27  // ~~~~~~~~~~~~~~~~~~~
28  volScalarField rhou(thermo.rhou());
29 
30  // Calculate flame normal etc.
31  // ~~~~~~~~~~~~~~~~~~~~~~~~~~~
32 
33  //volVectorField n(fvc::grad(b));
35 
36  volScalarField mgb("mgb", mag(n));
37 
38  dimensionedScalar dMgb("dMgb", mgb.dimensions(), SMALL);
39 
40  {
41  volScalarField bc(b*c);
42 
43  dMgb += 1.0e-3*
44  (bc*mgb)().weightedAverage(mesh.V())
45  /(bc.weightedAverage(mesh.V()) + SMALL);
46  }
47 
48  mgb += dMgb;
49 
50  surfaceVectorField Sfhat(mesh.Sf()/mesh.magSf());
52  nfVec += Sfhat*(fvc::snGrad(b) - (Sfhat & nfVec));
53  nfVec /= (mag(nfVec) + dMgb);
54  surfaceScalarField nf("nf", mesh.Sf() & nfVec);
55  n /= mgb;
56 
57  #include "StCorr.H"
58 
59  // Calculate turbulent flame speed flux
60  // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
61  surfaceScalarField phiSt("phiSt", fvc::interpolate(rhou*StCorr*St)*nf);
62 
63  #include "StCourantNo.H"
64 
65  Db = flameWrinkling->Db();
66 
67  // Create b equation
68  // ~~~~~~~~~~~~~~~~~
69  fvScalarMatrix bEqn
70  (
72  + mvConvection->fvmDiv(phi, b)
73  + fvm::div(phiSt, b)
74  - fvm::Sp(fvc::div(phiSt), b)
75  - fvm::laplacian(Db, b)
76  ==
78  );
79 
80 
81  // Add ignition cell contribution to b-equation
82  // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
83  #include "ignite.H"
84 
85  // Solve for b
86  // ~~~~~~~~~~~
87  bEqn.relax();
88 
89  fvOptions.constrain(bEqn);
90 
91  bEqn.solve();
92 
93  fvOptions.correct(b);
94 
95  Info<< "min(b) = " << min(b).value() << endl;
96 
97  if (composition.contains("ft"))
98  {
99  volScalarField& ft = composition.Y("ft");
100 
101  Info<< "Combustion progress = "
102  << 100*(1.0 - b)().weightedAverage(mesh.V()*ft).value() << "%"
103  << endl;
104  }
105  else
106  {
107  Info<< "Combustion progress = "
108  << 100*(1.0 - b)().weightedAverage(mesh.V()).value() << "%"
109  << endl;
110  }
111 
112  // Correct the flame-wrinkling
113  flameWrinkling->correct(mvConvection);
114 
115  St = Xi*Su;
116 }
Foam::fvc::reconstruct
tmp< GeometricField< typename outerProduct< vector, Type >::type, fvPatchField, volMesh >> reconstruct(const GeometricField< Type, fvsPatchField, surfaceMesh > &ssf)
Definition: fvcReconstruct.C:56
Foam::fvc::snGrad
tmp< GeometricField< Type, fvsPatchField, surfaceMesh > > snGrad(const GeometricField< Type, fvPatchField, volMesh > &vf, const word &name)
Definition: fvcSnGrad.C:47
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
Sp
zeroField Sp
Definition: alphaSuSp.H:2
thermo
Basic thermodynamics type based on the use of fitting functions for cp, h, s obtained from the templa...
mvConvection
tmp< fv::convectionScheme< scalar > > mvConvection(fv::convectionScheme< scalar >::New(mesh, fields, phi, mesh.divScheme("div(phi,ft_b_ha_hau)")))
Foam::endl
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:369
StCourantNo.H
Calculates and outputs the mean and maximum Courant Numbers.
ignite.H
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
StCorr.H
Su
zeroField Su
Definition: alphaSuSp.H:1
n
label n
Definition: TABSMDCalcMethod2.H:31
Foam::fvScalarMatrix
fvMatrix< scalar > fvScalarMatrix
Definition: fvMatricesFwd.H:44
Foam::constant::physicoChemical::b
const dimensionedScalar b
Wien displacement law constant: default SI units: [m.K].
Definition: createFields.H:27
fvOptions
fv::options & fvOptions
Definition: setRegionFluidFields.H:23
Foam::Info
messageStream Info
Information stream (stdout output on master, null elsewhere)
Foam::dimensionedScalar
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
Definition: dimensionedScalarFwd.H:42
phi
surfaceScalarField & phi
Definition: setRegionFluidFields.H:8
Foam::volScalarField
GeometricField< scalar, fvPatchField, volMesh > volScalarField
Definition: volFieldsFwd.H:57
Db
volScalarField Db("Db", turbulence->muEff())
mesh
dynamicFvMesh & mesh
Definition: createDynamicFvMesh.H:6
betav
const volScalarField & betav
Definition: setRegionSolidFields.H:35
flameWrinkling
autoPtr< XiModel > flameWrinkling
Create the flame-wrinkling model.
Definition: createFields.H:175
Foam::volVectorField
GeometricField< vector, fvPatchField, volMesh > volVectorField
Definition: volFieldsFwd.H:62
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
StCorr
dimensionedScalar StCorr("StCorr", dimless, 1.0)
Foam::surfaceScalarField
GeometricField< scalar, fvsPatchField, surfaceMesh > surfaceScalarField
Definition: surfaceFieldsFwd.H:54
unstrainedLaminarFlameSpeed
Info<< "Creating the unstrained laminar flame speed\n"<< endl;autoPtr< laminarFlameSpeed > unstrainedLaminarFlameSpeed(laminarFlameSpeed::New(thermo))
Foam::mag
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
Foam::fac::ddt
tmp< GeometricField< Type, faPatchField, areaMesh > > ddt(const dimensioned< Type > dt, const faMesh &mesh)
Definition: facDdt.C:47
Foam::constant::universal::c
const dimensionedScalar c
Speed of light in a vacuum.
Foam::fac::laplacian
tmp< GeometricField< Type, faPatchField, areaMesh > > laplacian(const GeometricField< Type, faPatchField, areaMesh > &vf, const word &name)
Definition: facLaplacian.C:47
Foam::surfaceVectorField
GeometricField< vector, fvsPatchField, surfaceMesh > surfaceVectorField
Definition: surfaceFieldsFwd.H:59
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.
fields
multivariateSurfaceInterpolationScheme< scalar >::fieldTable fields
Definition: createFields.H:97