ENH: autoLayerDriver: better layering information message
[OpenFOAM-2.0.x.git] / applications / solvers / heatTransfer / chtMultiRegionFoam / chtMultiRegionFoam.C
blobb65ecf5118e0908642ff045171af0f2dad0e58a9
1 /*---------------------------------------------------------------------------*\
2   =========                 |
3   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
4    \\    /   O peration     |
5     \\  /    A nd           | Copyright (C) 2011 OpenFOAM Foundation
6      \\/     M anipulation  |
7 -------------------------------------------------------------------------------
8 License
9     This file is part of OpenFOAM.
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.
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.
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/>.
24 Application
25     chtMultiRegionFoam
27 Description
28     Combination of heatConductionFoam and buoyantFoam for conjugate heat
29     transfer between a solid region and fluid region
31 \*---------------------------------------------------------------------------*/
33 #include "fvCFD.H"
34 #include "basicRhoThermo.H"
35 #include "turbulenceModel.H"
36 #include "fixedGradientFvPatchFields.H"
37 #include "regionProperties.H"
38 #include "compressibleCourantNo.H"
39 #include "solidRegionDiffNo.H"
40 #include "basicSolidThermo.H"
41 #include "radiationModel.H"
43 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
45 int main(int argc, char *argv[])
47     #include "setRootCase.H"
48     #include "createTime.H"
50     regionProperties rp(runTime);
52     #include "createFluidMeshes.H"
53     #include "createSolidMeshes.H"
55     #include "createFluidFields.H"
56     #include "createSolidFields.H"
58     #include "initContinuityErrs.H"
60     #include "readTimeControls.H"
61     #include "readSolidTimeControls.H"
64     #include "compressibleMultiRegionCourantNo.H"
65     #include "solidRegionDiffusionNo.H"
66     #include "setInitialMultiRegionDeltaT.H"
69     while (runTime.run())
70     {
71         #include "readTimeControls.H"
72         #include "readSolidTimeControls.H"
73         #include "readPIMPLEControls.H"
76         #include "compressibleMultiRegionCourantNo.H"
77         #include "solidRegionDiffusionNo.H"
78         #include "setMultiRegionDeltaT.H"
80         runTime++;
82         Info<< "Time = " << runTime.timeName() << nl << endl;
84         if (nOuterCorr != 1)
85         {
86             forAll(fluidRegions, i)
87             {
88                 #include "setRegionFluidFields.H"
89                 #include "storeOldFluidFields.H"
90             }
91         }
94         // --- PIMPLE loop
95         for (int oCorr=0; oCorr<nOuterCorr; oCorr++)
96         {
97             bool finalIter = oCorr == nOuterCorr-1;
99             forAll(fluidRegions, i)
100             {
101                 Info<< "\nSolving for fluid region "
102                     << fluidRegions[i].name() << endl;
103                 #include "setRegionFluidFields.H"
104                 #include "readFluidMultiRegionPIMPLEControls.H"
105                 #include "solveFluid.H"
106             }
108             forAll(solidRegions, i)
109             {
110                 Info<< "\nSolving for solid region "
111                     << solidRegions[i].name() << endl;
112                 #include "setRegionSolidFields.H"
113                 #include "readSolidMultiRegionPIMPLEControls.H"
114                 #include "solveSolid.H"
115             }
116         }
118         runTime.write();
120         Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s"
121             << "  ClockTime = " << runTime.elapsedClockTime() << " s"
122             << nl << endl;
123     }
125     Info<< "End\n" << endl;
127     return 0;
131 // ************************************************************************* //