reactingParcelFoam.C
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration |
5  \\ / A nd | www.openfoam.com
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8  Copyright (C) 2011-2017 OpenFOAM Foundation
9  Copyright (C) 2018-2019 OpenCFD Ltd.
10 -------------------------------------------------------------------------------
11 License
12  This file is part of OpenFOAM.
13 
14  OpenFOAM is free software: you can redistribute it and/or modify it
15  under the terms of the GNU General Public License as published by
16  the Free Software Foundation, either version 3 of the License, or
17  (at your option) any later version.
18 
19  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
20  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
21  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22  for more details.
23 
24  You should have received a copy of the GNU General Public License
25  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
26 
27 Application
28  reactingParcelFoam
29 
30 Group
31  grpLagrangianSolvers
32 
33 Description
34  Transient solver for compressible, turbulent flow with a reacting,
35  multiphase particle cloud, and surface film modelling.
36 
37 \*---------------------------------------------------------------------------*/
38 
39 #include "fvCFD.H"
41 
42 #include "surfaceFilmModel.H"
43 #include "rhoReactionThermo.H"
44 #include "CombustionModel.H"
45 #include "radiationModel.H"
46 #include "SLGThermo.H"
47 #include "fvOptions.H"
48 #include "pimpleControl.H"
49 #include "pressureControl.H"
50 #include "localEulerDdtScheme.H"
51 #include "fvcSmooth.H"
52 #include "cloudMacros.H"
53 
54 #ifndef CLOUD_BASE_TYPE
55  #define CLOUD_BASE_TYPE ReactingMultiphase
56  #define CLOUD_BASE_TYPE_NAME "reacting"
57 #endif
58 
59 #include CLOUD_INCLUDE_FILE(CLOUD_BASE_TYPE)
60 #define basicReactingTypeCloud CLOUD_TYPE(CLOUD_BASE_TYPE)
61 
62 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
63 
64 int main(int argc, char *argv[])
65 {
66  argList::addNote
67  (
68  "Transient solver for compressible, turbulent flow"
69  " with reacting, multiphase particle clouds"
70  " and surface film modelling."
71  );
72 
73  #define CREATE_MESH createMeshesPostProcess.H
74  #include "postProcess.H"
75 
76  #include "addCheckCaseOptions.H"
77  #include "setRootCaseLists.H"
78  #include "createTime.H"
79  #include "createMesh.H"
80  #include "createControl.H"
81  #include "createTimeControls.H"
82  #include "createFields.H"
83  #include "createFieldRefs.H"
84  #include "createRegionControls.H"
85  #include "initContinuityErrs.H"
86 
87  turbulence->validate();
88 
89  if (!LTS)
90  {
91  #include "compressibleCourantNo.H"
92  #include "setInitialDeltaT.H"
93  }
94 
95  // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
96 
97  Info<< "\nStarting time loop\n" << endl;
98 
99  while (runTime.run())
100  {
101  #include "readTimeControls.H"
102 
103  if (LTS)
104  {
105  #include "setRDeltaT.H"
106  }
107  else
108  {
109  #include "compressibleCourantNo.H"
110  #include "setMultiRegionDeltaT.H"
111  }
112 
113  ++runTime;
114 
115  Info<< "Time = " << runTime.timeName() << nl << endl;
116 
117  parcels.evolve();
118  surfaceFilm.evolve();
119 
120  if (solvePrimaryRegion)
121  {
122  if (pimple.nCorrPIMPLE() <= 1)
123  {
124  #include "rhoEqn.H"
125  }
126 
127  // --- PIMPLE loop
128  while (pimple.loop())
129  {
130  #include "UEqn.H"
131  #include "YEqn.H"
132  #include "EEqn.H"
133 
134  // --- Pressure corrector loop
135  while (pimple.correct())
136  {
137  #include "pEqn.H"
138  }
139 
140  if (pimple.turbCorr())
141  {
142  turbulence->correct();
143  }
144  }
145 
146  rho = thermo.rho();
147  }
148 
149  runTime.write();
150 
151  runTime.printExecutionTime(Info);
152  }
153 
154  Info<< "End" << endl;
155 
156  return 0;
157 }
158 
159 
160 // ************************************************************************* //
runTime
engineTime & runTime
Definition: createEngineTime.H:13
fvOptions.H
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
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
SLGThermo.H
rho
rho
Definition: readInitialConditions.H:88
pimpleControl.H
rhoReactionThermo.H
pimple
pimpleControl & pimple
Definition: setRegionFluidFields.H:56
setRootCaseLists.H
addCheckCaseOptions.H
localEulerDdtScheme.H
Foam::Info
messageStream Info
Information stream (uses stdout - output is on the master only)
surfaceFilm
regionModels::surfaceFilmModel & surfaceFilm
Definition: createFieldRefs.H:3
CombustionModel.H
surfaceFilmModel.H
LTS
bool LTS
Definition: createRDeltaT.H:1
postProcess.H
Execute application functionObjects to post-process existing results.
pressureControl.H
Foam::nl
constexpr char nl
Definition: Ostream.H:385
createTimeControls.H
Read the control parameters used by setDeltaT.
readTimeControls.H
Read the control parameters used by setDeltaT.
createMesh.H
createTime.H
fvCFD.H
solvePrimaryRegion
bool solvePrimaryRegion(additionalControlsDict.getOrDefault("solvePrimaryRegion", true))
cloudMacros.H
C-preprocessor cloud macros.
radiationModel.H
turbulentFluidThermoModel.H
fvcSmooth.H
Provides functions smooth spread and sweep which use the FaceCellWave algorithm to smooth and redistr...