reactingTwoPhaseEulerFoam.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 | Copyright (C) 2011-2015 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  reactingTwoPhaseEulerFoam
26 
27 Group
28  grpMultiphaseSolvers
29 
30 Description
31  Solver for a system of 2 compressible fluid phases with a common pressure,
32  but otherwise separate properties. The type of phase model is run time
33  selectable and can optionally represent multiple species and in-phase
34  reactions. The phase system is also run time selectable and can optionally
35  represent different types of momentun, heat and mass transfer.
36 
37 \*---------------------------------------------------------------------------*/
38 
39 #include "fvCFD.H"
40 #include "twoPhaseSystem.H"
43 #include "pimpleControl.H"
44 #include "localEulerDdtScheme.H"
45 #include "fvcSmooth.H"
46 
47 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
48 
49 int main(int argc, char *argv[])
50 {
51  #include "setRootCase.H"
52 
53  #include "createTime.H"
54  #include "createMesh.H"
55 
56  pimpleControl pimple(mesh);
57 
58  #include "createTimeControls.H"
59  #include "createRDeltaT.H"
60  #include "createFields.H"
61 
62  if (!LTS)
63  {
64  #include "CourantNo.H"
65  #include "setInitialDeltaT.H"
66  }
67 
68  Switch faceMomentum
69  (
70  pimple.dict().lookupOrDefault<Switch>("faceMomentum", false)
71  );
72 
73  Switch implicitPhasePressure
74  (
75  mesh.solverDict(alpha1.name()).lookupOrDefault<Switch>
76  (
77  "implicitPhasePressure", false
78  )
79  );
80 
81  #include "pUf/createDDtU.H"
82 
83  int nEnergyCorrectors
84  (
85  pimple.dict().lookupOrDefault<int>("nEnergyCorrectors", 1)
86  );
87 
88  // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
89 
90  Info<< "\nStarting time loop\n" << endl;
91 
92  while (runTime.run())
93  {
94  #include "readTimeControls.H"
95 
96  if (LTS)
97  {
98  #include "setRDeltaT.H"
99  }
100  else
101  {
102  #include "CourantNos.H"
103  #include "setDeltaT.H"
104  }
105 
106  runTime++;
107  Info<< "Time = " << runTime.timeName() << nl << endl;
108 
109  // --- Pressure-velocity PIMPLE corrector loop
110  while (pimple.loop())
111  {
112  fluid.solve();
113  fluid.correct();
114 
115  #include "YEqns.H"
116 
117  if (faceMomentum)
118  {
119  #include "pUf/UEqns.H"
120  #include "EEqns.H"
121  #include "pUf/pEqn.H"
122  #include "pUf/DDtU.H"
123  }
124  else
125  {
126  #include "pU/UEqns.H"
127  #include "EEqns.H"
128  #include "pU/pEqn.H"
129  }
130 
131  fluid.correctKinematics();
132 
133  if (pimple.turbCorr())
134  {
135  fluid.correctTurbulence();
136  }
137  }
138 
139  runTime.write();
140 
141  Info<< "ExecutionTime = "
142  << runTime.elapsedCpuTime()
143  << " s\n\n" << endl;
144  }
145 
146  Info<< "End\n" << endl;
147 
148  return 0;
149 }
150 
151 
152 // ************************************************************************* //
fluid
multiphaseSystem & fluid
Definition: createFields.H:10
createRDeltaT.H
Foam::endl
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:251
pimpleControl.H
localEulerDdtScheme.H
Foam::nl
static const char nl
Definition: Ostream.H:260
Foam::Info
messageStream Info
main
int main(int argc, char *argv[])
Definition: postCalc.C:54
LTS
bool LTS
Definition: createRDeltaT.H:1
mesh
dynamicFvMesh & mesh
Definition: createDynamicFvMesh.H:18
phaseCompressibleTurbulenceModel.H
alpha1
volScalarField & alpha1
Definition: createFields.H:15
setRootCase.H
createTimeControls.H
Read the control parameters used by setDeltaT.
readTimeControls.H
Read the control parameters used by setDeltaT.
createMesh.H
createTime.H
fvCFD.H
pimple
const dictionary & pimple
Definition: readFluidMultiRegionPIMPLEControls.H:1
fixedFluxPressureFvPatchScalarField.H
fvcSmooth.H
Provides functions smooth spread and sweep which use the FaceCellWave algorithm to smooth and redistr...