buoyantBoussinesqPimpleFoam.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  buoyantBoussinesqPimpleFoam
26 
27 Group
28  grpHeatTransferSolvers
29 
30 Description
31  Transient solver for buoyant, turbulent flow of incompressible fluids
32 
33  Uses the Boussinesq approximation:
34  \f[
35  rho_{k} = 1 - beta(T - T_{ref})
36  \f]
37 
38  where:
39  \f$ rho_{k} \f$ = the effective (driving) kinematic density
40  beta = thermal expansion coefficient [1/K]
41  T = temperature [K]
42  \f$ T_{ref} \f$ = reference temperature [K]
43 
44  Valid when:
45  \f[
46  \frac{beta(T - T_{ref})}{rho_{ref}} << 1
47  \f]
48 
49 \*---------------------------------------------------------------------------*/
50 
51 #include "fvCFD.H"
54 #include "radiationModel.H"
55 #include "fvOptions.H"
56 #include "pimpleControl.H"
58 
59 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
60 
61 int main(int argc, char *argv[])
62 {
63  #include "setRootCase.H"
64  #include "createTime.H"
65  #include "createMesh.H"
66 
67  pimpleControl pimple(mesh);
68 
69  #include "createFields.H"
71  #include "createMRF.H"
72  #include "createFvOptions.H"
73  #include "initContinuityErrs.H"
74  #include "createTimeControls.H"
75  #include "CourantNo.H"
76  #include "setInitialDeltaT.H"
77 
78  turbulence->validate();
79 
80  // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
81 
82  Info<< "\nStarting time loop\n" << endl;
83 
84  while (runTime.loop())
85  {
86  Info<< "Time = " << runTime.timeName() << nl << endl;
87 
88  #include "createTimeControls.H"
89  #include "CourantNo.H"
90  #include "setDeltaT.H"
91 
92  // --- Pressure-velocity PIMPLE corrector loop
93  while (pimple.loop())
94  {
95  #include "UEqn.H"
96  #include "TEqn.H"
97 
98  // --- Pressure corrector loop
99  while (pimple.correct())
100  {
101  #include "pEqn.H"
102  }
103 
104  if (pimple.turbCorr())
105  {
106  laminarTransport.correct();
107  turbulence->correct();
108  }
109  }
110 
111  runTime.write();
112 
113  Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s"
114  << " ClockTime = " << runTime.elapsedClockTime() << " s"
115  << nl << endl;
116  }
117 
118  Info<< "End\n" << endl;
119 
120  return 0;
121 }
122 
123 
124 // ************************************************************************* //
fvOptions.H
singlePhaseTransportModel.H
turbulentTransportModel.H
Foam::endl
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:251
pimpleControl.H
createFvOptions.H
turbulence
autoPtr< compressible::turbulenceModel > turbulence
Definition: createFields.H:23
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
createIncompressibleRadiationModel.H
mesh
dynamicFvMesh & mesh
Definition: createDynamicFvMesh.H:18
setRootCase.H
laminarTransport
singlePhaseTransportModel laminarTransport(U, phi)
createTimeControls.H
Read the control parameters used by setDeltaT.
createMesh.H
createTime.H
fvCFD.H
pimple
const dictionary & pimple
Definition: readFluidMultiRegionPIMPLEControls.H:1
fixedFluxPressureFvPatchScalarField.H
radiationModel.H