PDRFoam.C
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration | Website: https://openfoam.org
5  \\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8 License
9  This file is part of OpenFOAM.
10 
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.
15 
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
19  for more details.
20 
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 
24 Application
25  PDRFoam
26 
27 Description
28  Solver for compressible premixed/partially-premixed combustion with
29  turbulence modelling.
30 
31  Combusting RANS code using the b-Xi two-equation model.
32  Xi may be obtained by either the solution of the Xi transport
33  equation or from an algebraic expression. Both approaches are
34  based on Gulder's flame speed correlation which has been shown
35  to be appropriate by comparison with the results from the
36  spectral model.
37 
38  Strain effects are incorporated directly into the Xi equation
39  but not in the algebraic approximation. Further work need to be
40  done on this issue, particularly regarding the enhanced removal rate
41  caused by flame compression. Analysis using results of the spectral
42  model will be required.
43 
44  For cases involving very lean Propane flames or other flames which are
45  very strain-sensitive, a transport equation for the laminar flame
46  speed is present. This equation is derived using heuristic arguments
47  involving the strain time scale and the strain-rate at extinction.
48  the transport velocity is the same as that for the Xi equation.
49 
50  For large flames e.g. explosions additional modelling for the flame
51  wrinkling due to surface instabilities may be applied.
52 
53  PDR (porosity/distributed resistance) modelling is included to handle
54  regions containing blockages which cannot be resolved by the mesh.
55 
56  The fields used by this solver are:
57 
58  betav: Volume porosity
59  Lobs: Average diameter of obstacle in cell (m)
60  Aw: Obstacle surface area per unit volume (1/m)
61  CR: Drag tensor (1/m)
62  CT: Turbulence generation parameter (1/m)
63  Nv: Number of obstacles in cell per unit volume (m^-2)
64  nsv: Tensor whose diagonal indicates the number to subtract from
65  Nv to get the number of obstacles crossing the flow in each
66  direction.
67 
68 \*---------------------------------------------------------------------------*/
69 
70 #include "fvCFD.H"
71 #include "psiuReactionThermo.H"
74 #include "laminarFlameSpeed.H"
75 #include "XiModel.H"
76 #include "PDRDragModel.H"
77 #include "ignition.H"
78 #include "Switch.H"
79 #include "bound.H"
80 #include "pimpleControl.H"
81 #include "fvOptions.H"
82 
83 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
84 
85 int main(int argc, char *argv[])
86 {
87  #include "postProcess.H"
88 
89  #include "setRootCaseLists.H"
90  #include "createTime.H"
91  #include "createMesh.H"
92  #include "createControl.H"
93  #include "readCombustionProperties.H"
94  #include "readGravitationalAcceleration.H"
95  #include "createFields.H"
96  #include "createFieldRefs.H"
97  #include "initContinuityErrs.H"
98  #include "createTimeControls.H"
99  #include "compressibleCourantNo.H"
100  #include "setInitialDeltaT.H"
101 
102  turbulence->validate();
103  scalar StCoNum = 0.0;
104 
105  // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
106 
107  Info<< "\nStarting time loop\n" << endl;
108 
109  while (pimple.run(runTime))
110  {
111  #include "readTimeControls.H"
112  #include "compressibleCourantNo.H"
113  #include "setDeltaT.H"
114 
115  runTime++;
116  Info<< "\n\nTime = " << runTime.timeName() << endl;
117 
118  #include "rhoEqn.H"
119 
120  // --- Pressure-velocity PIMPLE corrector loop
121  while (pimple.loop())
122  {
123  #include "UEqn.H"
124 
125  // --- Pressure corrector loop
126  while (pimple.correct())
127  {
128  #include "bEqn.H"
129  #include "ftEqn.H"
130  #include "EauEqn.H"
131  #include "EaEqn.H"
132 
133  if (!ign.ignited())
134  {
135  thermo.heu() == thermo.he();
136  }
137 
138  #include "pEqn.H"
139  }
140 
141  if (pimple.turbCorr())
142  {
143  turbulence->correct();
144  thermophysicalTransport->correct();
145  }
146  }
147 
148  runTime.write();
149 
150  Info<< "\nExecutionTime = "
151  << runTime.elapsedCpuTime()
152  << " s\n" << endl;
153  }
154 
155  Info<< "\n end\n";
156 
157  return 0;
158 }
159 
160 
161 // ************************************************************************* //
pimpleNoLoopControl & pimple
engineTime & runTime
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:251
Read the control parameters used by setDeltaT.
rhoReactionThermo & thermo
Definition: createFields.H:28
rhoReactionThermophysicalTransportModel & thermophysicalTransport
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(dimless, 1.0));surfaceScalarField neg(IOobject("neg", runTime.timeName(), mesh), mesh, dimensionedScalar(dimless, -1.0));surfaceScalarField phi("phi", fvc::flux(rhoU));Info<< "Creating turbulence model\"<< endl;autoPtr< compressible::momentumTransportModel > turbulence(compressible::momentumTransportModel::New(rho, U, phi, thermo))
Definition: createFields.H:94
Bound the given scalar field if it has gone unbounded.
messageStream Info
Execute application functionObjects to post-process existing results.
Read the control parameters used by setDeltaT.