chtMultiRegionFoam.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  chtMultiRegionFoam
26 
27 Description
28  Solver for steady or transient fluid flow and solid heat conduction, with
29  conjugate heat transfer between regions, buoyancy effects, turbulence,
30  reactions and radiation modelling.
31 
32 \*---------------------------------------------------------------------------*/
33 
34 #include "fvCFD.H"
37 #include "rhoReactionThermo.H"
38 #include "CombustionModel.H"
40 #include "regionProperties.H"
41 #include "compressibleCourantNo.H"
42 #include "solidRegionDiffNo.H"
43 #include "solidThermo.H"
44 #include "radiationModel.H"
45 #include "fvOptions.H"
46 #include "coordinateSystem.H"
48 #include "pressureControl.H"
49 
50 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
51 
52 int main(int argc, char *argv[])
53 {
54  #define NO_CONTROL
55  #define CREATE_MESH createMeshesPostProcess.H
56  #include "postProcess.H"
57 
58  #include "setRootCaseLists.H"
59  #include "createTime.H"
60  #include "createMeshes.H"
61  #include "createFields.H"
62  #include "initContinuityErrs.H"
63  pimpleMultiRegionControl pimples(fluidRegions, solidRegions);
65  #include "createTimeControls.H"
66  #include "readSolidTimeControls.H"
68  #include "solidRegionDiffusionNo.H"
70 
71  while (pimples.run(runTime))
72  {
73  #include "readTimeControls.H"
74  #include "readSolidTimeControls.H"
75 
77  #include "solidRegionDiffusionNo.H"
78  #include "setMultiRegionDeltaT.H"
79 
80  runTime++;
81 
82  Info<< "Time = " << runTime.timeName() << nl << endl;
83 
84  // --- PIMPLE loop
85  while (pimples.loop())
86  {
88  {
89  Info<< "\nSolving for fluid region "
90  << fluidRegions[i].name() << endl;
91  #include "setRegionFluidFields.H"
92  #include "solveFluid.H"
93  }
94 
96  {
97  Info<< "\nSolving for solid region "
98  << solidRegions[i].name() << endl;
99  #include "setRegionSolidFields.H"
100  #include "solveSolid.H"
101  }
102  }
103 
104  runTime.write();
105 
106  Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s"
107  << " ClockTime = " << runTime.elapsedClockTime() << " s"
108  << nl << endl;
109  }
110 
111  Info<< "End\n" << endl;
112 
113  return 0;
114 }
115 
116 
117 // ************************************************************************* //
#define forAll(list, i)
Loop across all elements in list.
Definition: UList.H:434
Set the initial timestep for the CHT MultiRegion solver.
engineTime & runTime
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:251
PtrList< fvMesh > solidRegions(solidNames.size())
Read the control parameters used by setDeltaT.
Calculates and outputs the mean and maximum Diffusion Numbers for the solid regions.
PtrList< fvMesh > fluidRegions(fluidNames.size())
static const char nl
Definition: Ostream.H:260
Read the control parameters used in the solid.
messageStream Info
Execute application functionObjects to post-process existing results.
Read the control parameters used by setDeltaT.