chtMultiRegionFoam.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  chtMultiRegionFoam
26 
27 Description
28  Combination of heatConductionFoam and buoyantFoam for conjugate heat
29  transfer between solid regions and fluid regions. Both regions include
30  the fvOptions framework.
31 
32  It handles secondary fluid or solid circuits which can be coupled
33  thermally with the main fluid region. i.e radiators, etc.
34 
35 \*---------------------------------------------------------------------------*/
36 
37 #include "fvCFD.H"
38 #include "rhoThermo.H"
41 #include "regionProperties.H"
42 #include "compressibleCourantNo.H"
43 #include "solidRegionDiffNo.H"
44 #include "solidThermo.H"
45 #include "radiationModel.H"
46 #include "fvIOoptionList.H"
47 #include "coordinateSystem.H"
49 
50 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
51 
52 int main(int argc, char *argv[])
53 {
54  #include "setRootCase.H"
55  #include "createTime.H"
56 
57  regionProperties rp(runTime);
58 
59  #include "createFluidMeshes.H"
60  #include "createSolidMeshes.H"
61 
62  #include "createFluidFields.H"
63  #include "createSolidFields.H"
64 
65  #include "initContinuityErrs.H"
66  #include "createTimeControls.H"
67  #include "readSolidTimeControls.H"
68 
69 
70  #include "compressibleMultiRegionCourantNo.H"
71  #include "solidRegionDiffusionNo.H"
73 
74  while (runTime.run())
75  {
76  #include "createTimeControls.H"
77  #include "readSolidTimeControls.H"
78  #include "readPIMPLEControls.H"
79 
80  #include "compressibleMultiRegionCourantNo.H"
81  #include "solidRegionDiffusionNo.H"
82  #include "setMultiRegionDeltaT.H"
83 
84  runTime++;
85 
86  Info<< "Time = " << runTime.timeName() << nl << endl;
87 
88  if (nOuterCorr != 1)
89  {
91  {
92  #include "storeOldFluidFields.H"
93  }
94  }
95 
96 
97  // --- PIMPLE loop
98  for (int oCorr=0; oCorr<nOuterCorr; oCorr++)
99  {
100  bool finalIter = oCorr == nOuterCorr-1;
101 
102  forAll(fluidRegions, i)
103  {
104  Info<< "\nSolving for fluid region "
105  << fluidRegions[i].name() << endl;
106  #include "setRegionFluidFields.H"
108  #include "solveFluid.H"
109  }
110 
111  forAll(solidRegions, i)
112  {
113  Info<< "\nSolving for solid region "
114  << solidRegions[i].name() << endl;
115  #include "setRegionSolidFields.H"
117  #include "solveSolid.H"
118  }
119 
120  }
121 
122  runTime.write();
123 
124  Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s"
125  << " ClockTime = " << runTime.elapsedClockTime() << " s"
126  << nl << endl;
127  }
128 
129  Info<< "End\n" << endl;
130 
131  return 0;
132 }
133 
134 
135 // ************************************************************************* //
Set the initial timestep for the CHT MultiRegion solver.
PtrList< fvMesh > fluidRegions(fluidNames.size())
const int nOuterCorr
messageStream Info
Read the control parameters used in the solid.
Calculates and outputs the mean and maximum Diffusion Numbers for the solid regions.
static const char nl
Definition: Ostream.H:260
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:251
#define forAll(list, i)
Definition: UList.H:421
virtual Ostream & write(const token &)=0
Write next token to stream.
Read the control parameters used by setDeltaT.
int main(int argc, char *argv[])
Definition: postCalc.C:54
PtrList< fvMesh > solidRegions(solidsNames.size())