FreeFOAM The Cross-Platform CFD Toolkit
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) 1991-2010 OpenCFD Ltd.
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 a solid region and fluid region
30 
31 Usage
32  - chtMultiRegionFoam [OPTION]
33 
34  @param -case <dir> \n
35  Specify the case directory
36 
37  @param -parallel \n
38  Run the case in parallel
39 
40  @param -help \n
41  Display short usage message
42 
43  @param -doc \n
44  Display Doxygen documentation page
45 
46  @param -srcDoc \n
47  Display source code
48 
49 \*---------------------------------------------------------------------------*/
50 
51 #include <finiteVolume/fvCFD.H>
58 
59 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
60 
61 int main(int argc, char *argv[])
62 {
63  #include <OpenFOAM/setRootCase.H>
64  #include <OpenFOAM/createTime.H>
65 
66  regionProperties rp(runTime);
67 
68  #include "fluid/createFluidMeshes.H"
69  #include "solid/createSolidMeshes.H"
70 
71  #include "fluid/createFluidFields.H"
72  #include "solid/createSolidFields.H"
73 
75 
78 
79 
83 
84 
85  while (runTime.run())
86  {
89  #include "readPIMPLEControls.H"
90 
91 
95 
96  runTime++;
97 
98  Info<< "Time = " << runTime.timeName() << nl << endl;
99 
100  if (nOuterCorr != 1)
101  {
102  forAll(fluidRegions, i)
103  {
105  #include "fluid/storeOldFluidFields.H"
106  }
107  }
108 
109 
110  // --- PIMPLE loop
111  for (int oCorr=0; oCorr<nOuterCorr; oCorr++)
112  {
113  forAll(fluidRegions, i)
114  {
115  Info<< "\nSolving for fluid region "
116  << fluidRegions[i].name() << endl;
119  #include "fluid/solveFluid.H"
120  }
121 
122  forAll(solidRegions, i)
123  {
124  Info<< "\nSolving for solid region "
125  << solidRegions[i].name() << endl;
128  #include "solid/solveSolid.H"
129  }
130  }
131 
132  runTime.write();
133 
134  Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s"
135  << " ClockTime = " << runTime.elapsedClockTime() << " s"
136  << nl << endl;
137  }
138 
139  Info << "End\n" << endl;
140 
141  return 0;
142 }
143 
144 
145 // ************************ vim: set sw=4 sts=4 et: ************************ //