5 volScalarField c(scalar(1) - b);
9 volScalarField rhou(thermo.rhou());
11 // Calculate flame normal etc.
12 // ~~~~~~~~~~~~~~~~~~~~~~~~~~~
14 volVectorField n(fvc::grad(b));
16 volScalarField mgb(mag(n));
18 dimensionedScalar dMgb = 1.0e-3*
19 (b*c*mgb)().weightedAverage(mesh.V())
20 /((b*c)().weightedAverage(mesh.V()) + SMALL)
21 + dimensionedScalar("ddMgb", mgb.dimensions(), SMALL);
25 surfaceVectorField SfHat(mesh.Sf()/mesh.magSf());
26 surfaceVectorField nfVec(fvc::interpolate(n));
27 nfVec += SfHat*(fvc::snGrad(b) - (SfHat & nfVec));
28 nfVec /= (mag(nfVec) + dMgb);
29 surfaceScalarField nf((mesh.Sf() & nfVec));
35 // Calculate turbulent flame speed flux
36 // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
37 surfaceScalarField phiSt(fvc::interpolate(rhou*StCorr*Su*Xi)*nf);
41 mesh.surfaceInterpolation::deltaCoeffs()
42 *mag(phiSt)/(fvc::interpolate(rho)*mesh.magSf())
43 ).value()*runTime.deltaTValue();
45 Info<< "Max St-Courant Number = " << StCoNum << endl;
52 + mvConvection->fvmDiv(phi, b)
53 + fvm::div(phiSt, b, "div(phiSt,b)")
54 - fvm::Sp(fvc::div(phiSt), b)
55 - fvm::laplacian(turbulence->alphaEff(), b)
59 // Add ignition cell contribution to b-equation
60 // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
68 Info<< "min(b) = " << min(b).value() << endl;
71 // Calculate coefficients for Gulder's flame speed correlation
72 // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
74 volScalarField up(uPrimeCoef*sqrt((2.0/3.0)*turbulence->k()));
75 //volScalarField up(sqrt(mag(diag(n * n) & diag(turbulence->r()))));
77 volScalarField epsilon(pow(uPrimeCoef, 3)*turbulence->epsilon());
79 volScalarField tauEta(sqrt(thermo.muu()/(rhou*epsilon)));
86 + dimensionedScalar("1e-8", up.dimensions(), 1e-8)
90 //volScalarField l = 0.337*k*sqrt(k)/epsilon;
91 //Reta *= max((l - dimensionedScalar("dl", dimLength, 1.5e-3))/l, 0.0);
95 surfaceScalarField phiXi
98 - fvc::interpolate(fvc::laplacian(turbulence->alphaEff(), b)/mgb)*nf
99 + fvc::interpolate(rho)*fvc::interpolate(Su*(1.0/Xi - Xi))*nf
103 // Calculate mean and turbulent strain rates
104 // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
106 volVectorField Ut(U + Su*Xi*n);
107 volScalarField sigmat((n & n)*fvc::div(Ut) - (n & fvc::grad(Ut) & n));
109 volScalarField sigmas
111 ((n & n)*fvc::div(U) - (n & fvc::grad(U) & n))/Xi
113 (n & n)*fvc::div(Su*n)
114 - (n & fvc::grad(Su*n) & n)
115 )*(Xi + scalar(1))/(2*Xi)
119 // Calculate the unstrained laminar flame speed
120 // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
121 volScalarField Su0(unstrainedLaminarFlameSpeed()());
124 // Calculate the laminar flame speed in equilibrium with the applied strain
125 // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
126 volScalarField SuInf(Su0*max(scalar(1) - sigmas/sigmaExt, scalar(0.01)));
128 if (SuModel == "unstrained")
132 else if (SuModel == "equilibrium")
136 else if (SuModel == "transport")
138 // Solve for the strained laminar flame speed
139 // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
143 (sigmas*SuInf*(Su0 - SuInf) + sqr(SuMin)*sigmaExt)
144 /(sqr(Su0 - SuInf) + sqr(SuMin))
150 + fvm::div(phi + phiXi, Su, "div(phiXi,Su)")
151 - fvm::Sp(fvc::div(phiXi), Su)
153 - fvm::SuSp(-rho*Rc*Su0/Su, Su)
154 - fvm::SuSp(rho*(sigmas + Rc), Su)
160 // Limit the maximum Su
161 // ~~~~~~~~~~~~~~~~~~~~
168 << args.executable() << " : Unknown Su model " << SuModel
169 << abort(FatalError);
173 // Calculate Xi according to the selected flame wrinkling model
174 // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
176 if (XiModel == "fixed")
178 // Do nothing, Xi is fixed!
180 else if (XiModel == "algebraic")
182 // Simple algebraic model for Xi based on Gulders correlation
183 // with a linear correction function to give a plausible profile for Xi
184 // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
186 (scalar(1) + (2*XiShapeCoef)*(scalar(0.5) - b))
187 *XiCoef*sqrt(up/(Su + SuMin))*Reta;
189 else if (XiModel == "transport")
191 // Calculate Xi transport coefficients based on Gulders correlation
192 // and DNS data for the rate of generation
193 // with a linear correction function to give a plausible profile for Xi
194 // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
196 volScalarField XiEqStar
198 scalar(1.001) + XiCoef*sqrt(up/(Su + SuMin))*Reta
204 + (scalar(1) + (2*XiShapeCoef)*(scalar(0.5) - b))
205 *(XiEqStar - scalar(1.001))
208 volScalarField Gstar(0.28/tauEta);
209 volScalarField R(Gstar*XiEqStar/(XiEqStar - scalar(1)));
210 volScalarField G(R*(XiEq - scalar(1.001))/XiEq);
212 //R *= (Gstar + 2*mag(dev(symm(fvc::grad(U)))))/Gstar;
214 // Solve for the flame wrinkling
215 // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
219 + fvm::div(phi + phiXi, Xi, "div(phiXi,Xi)")
220 - fvm::Sp(fvc::div(phiXi), Xi)
223 - fvm::Sp(rho*(R - G), Xi)
229 dimensionedScalar("0", sigmat.dimensions(), 0)
238 // Correct boundedness of Xi
239 // ~~~~~~~~~~~~~~~~~~~~~~~~~
241 Info<< "max(Xi) = " << max(Xi).value() << endl;
242 Info<< "max(XiEq) = " << max(XiEq).value() << endl;
247 << args.executable() << " : Unknown Xi model " << XiModel
248 << abort(FatalError);
251 Info<< "Combustion progress = "
252 << 100*(scalar(1) - b)().weightedAverage(mesh.V()).value() << "%"