rhoPimpleFoam.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  rhoPimpleFoam
26 
27 Group
28  grpCompressibleSolvers
29 
30 Description
31  Transient solver for laminar or turbulent flow of compressible fluids
32  for HVAC and similar applications.
33 
34  Uses the flexible PIMPLE (PISO-SIMPLE) solution for time-resolved and
35  pseudo-transient simulations.
36 
37 \*---------------------------------------------------------------------------*/
38 
39 #include "fvCFD.H"
40 #include "psiThermo.H"
42 #include "bound.H"
43 #include "pimpleControl.H"
44 #include "fvOptions.H"
45 #include "localEulerDdtScheme.H"
46 #include "fvcSmooth.H"
47 
48 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
49 
50 int main(int argc, char *argv[])
51 {
52  #include "setRootCase.H"
53  #include "createTime.H"
54  #include "createMesh.H"
55 
56  pimpleControl pimple(mesh);
57 
58  #include "createTimeControls.H"
59  #include "createRDeltaT.H"
60  #include "initContinuityErrs.H"
61  #include "createFields.H"
62  #include "createMRF.H"
63  #include "createFvOptions.H"
64 
65  turbulence->validate();
66 
67  if (!LTS)
68  {
69  #include "compressibleCourantNo.H"
70  #include "setInitialDeltaT.H"
71  }
72 
73  // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
74 
75  Info<< "\nStarting time loop\n" << endl;
76 
77  while (runTime.run())
78  {
79  #include "readTimeControls.H"
80 
81  if (LTS)
82  {
83  #include "setRDeltaT.H"
84  }
85  else
86  {
87  #include "compressibleCourantNo.H"
88  #include "setDeltaT.H"
89  }
90 
91  runTime++;
92 
93  Info<< "Time = " << runTime.timeName() << nl << endl;
94 
95  if (pimple.nCorrPIMPLE() <= 1)
96  {
97  #include "rhoEqn.H"
98  }
99 
100  // --- Pressure-velocity PIMPLE corrector loop
101  while (pimple.loop())
102  {
103  #include "UEqn.H"
104  #include "EEqn.H"
105 
106  // --- Pressure corrector loop
107  while (pimple.correct())
108  {
109  if (pimple.consistent())
110  {
111  #include "pcEqn.H"
112  }
113  else
114  {
115  #include "pEqn.H"
116  }
117  }
118 
119  if (pimple.turbCorr())
120  {
121  turbulence->correct();
122  }
123  }
124 
125  runTime.write();
126 
127  Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s"
128  << " ClockTime = " << runTime.elapsedClockTime() << " s"
129  << nl << endl;
130  }
131 
132  Info<< "End\n" << endl;
133 
134  return 0;
135 }
136 
137 
138 // ************************************************************************* //
fvOptions.H
createRDeltaT.H
Foam::endl
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:251
pimpleControl.H
createFvOptions.H
localEulerDdtScheme.H
turbulence
autoPtr< compressible::turbulenceModel > turbulence
Definition: createFields.H:23
Foam::nl
static const char nl
Definition: Ostream.H:260
Foam::Info
messageStream Info
bound.H
Bound the given scalar field if it has gone unbounded.
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
setRootCase.H
psiThermo.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
turbulentFluidThermoModel.H
fvcSmooth.H
Provides functions smooth spread and sweep which use the FaceCellWave algorithm to smooth and redistr...