1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
7 -------------------------------------------------------------------------------
9 This file is part of OpenFOAM.
11 OpenFOAM is free software: you can redistribute it and/or modify it
12 under the terms of the GNU General Public License as published by
13 the Free Software Foundation, either version 3 of the License, or
14 (at your option) any later version.
16 OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
17 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21 You should have received a copy of the GNU General Public License
22 along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
23 Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
29 Solver for compressible premixed/partially-premixed combustion with
32 Combusting RANS code using the b-Xi two-equation model.
33 Xi may be obtained by either the solution of the Xi transport
34 equation or from an algebraic exression. Both approaches are
35 based on Gulder's flame speed correlation which has been shown
36 to be appropriate by comparison with the results from the
39 Strain effects are incorporated directly into the Xi equation
40 but not in the algebraic approximation. Further work need to be
41 done on this issue, particularly regarding the enhanced removal rate
42 caused by flame compression. Analysis using results of the spectral
43 model will be required.
45 For cases involving very lean Propane flames or other flames which are
46 very strain-sensitive, a transport equation for the laminar flame
47 speed is present. This equation is derived using heuristic arguments
48 involving the strain time scale and the strain-rate at extinction.
49 the transport velocity is the same as that for the Xi equation.
51 For large flames e.g. explosions additional modelling for the flame
52 wrinkling due to surface instabilities may be applied.
54 PDR (porosity/distributed resistance) modelling is included to handle
55 regions containing blockages which cannot be resolved by the mesh.
57 \*---------------------------------------------------------------------------*/
60 #include "dynamicFvMesh.H"
61 #include "hhuCombustionThermo.H"
63 #include "laminarFlameSpeed.H"
65 #include "PDRDragModel.H"
69 #include "dynamicRefineFvMesh.H"
71 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
73 int main(int argc, char *argv[])
75 #include "setRootCase.H"
77 #include "createTime.H"
78 #include "createDynamicFvMesh.H"
79 #include "readCombustionProperties.H"
80 #include "readGravitationalAcceleration.H"
81 #include "createFields.H"
82 #include "initContinuityErrs.H"
83 #include "readTimeControls.H"
84 #include "CourantNo.H"
85 #include "setInitialDeltaT.H"
89 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
91 Info<< "\nStarting time loop\n" << endl;
95 #include "readTimeControls.H"
96 #include "readPISOControls.H"
97 #include "CourantNo.H"
98 #include "setDeltaT.H"
100 // Indicators for refinement. Note: before runTime++
101 // only for postprocessing reasons.
102 tmp<volScalarField> tmagGradP = mag(fvc::grad(p));
103 volScalarField normalisedGradP
106 tmagGradP()/max(tmagGradP())
108 normalisedGradP.writeOpt() = IOobject::AUTO_WRITE;
113 Info<< "\n\nTime = " << runTime.timeName() << endl;
116 bool meshChanged = false;
118 // Make the fluxes absolute
119 fvc::makeAbsolute(phi, rho, U);
121 // Test : disable refinement for some cells
122 PackedBoolList& protectedCell =
123 refCast<dynamicRefineFvMesh>(mesh).protectedCell();
125 if (protectedCell.empty())
127 protectedCell.setSize(mesh.nCells());
133 if (betav[cellI] < 0.99)
135 protectedCell[cellI] = 1;
139 //volScalarField pIndicator("pIndicator",
140 // p*(fvc::laplacian(p))
142 // magSqr(fvc::grad(p))
143 // + dimensionedScalar
146 // sqr(p.dimensions()/dimLength),
150 //pIndicator.writeOpt() = IOobject::AUTO_WRITE;
152 // Flux estimate for introduced faces.
153 volVectorField rhoU("rhoU", rho*U);
155 // Do any mesh changes
156 meshChanged = mesh.update();
158 // if (mesh.moving() || meshChanged)
160 // #include "correctPhi.H"
163 // Make the fluxes relative to the mesh motion
164 fvc::makeRelative(phi, rho, U);
172 for (int corr=1; corr<=nCorr; corr++)
187 turbulence->correct();
191 Info<< "\nExecutionTime = "
192 << runTime.elapsedCpuTime()
202 // ************************************************************************* //