initial commit for version 1.6.x patch release
[OpenFOAM-1.6.x.git] / applications / solvers / heatTransfer / chtMultiRegionFoam / chtMultiRegionFoam.C
blob54e1c8cb1840d4719b1f2f360a7ab3d4ba81b052
1 /*---------------------------------------------------------------------------*\
2   =========                 |
3   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
4    \\    /   O peration     |
5     \\  /    A nd           | Copyright (C) 1991-2009 OpenCFD Ltd.
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 the
13     Free Software Foundation; either version 2 of the License, or (at your
14     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, write to the Free Software Foundation,
23     Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
25 Application
26     chtMultiRegionFoam
28 Description
29     Combination of heatConductionFoam and buoyantFoam for conjugate heat
30     transfer between a solid region and fluid region
32 \*---------------------------------------------------------------------------*/
34 #include "fvCFD.H"
35 #include "basicPsiThermo.H"
36 #include "turbulenceModel.H"
37 #include "fixedGradientFvPatchFields.H"
38 #include "regionProperties.H"
39 #include "compressibleCourantNo.H"
41 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
43 int main(int argc, char *argv[])
45     #include "setRootCase.H"
46     #include "createTime.H"
48     regionProperties rp(runTime);
50     #include "createFluidMeshes.H"
51     #include "createSolidMeshes.H"
53     #include "createFluidFields.H"
54     #include "createSolidFields.H"
56     #include "initContinuityErrs.H"
58     #include "readTimeControls.H"
60     if (fluidRegions.size())
61     {
62         #include "compressibleMultiRegionCourantNo.H"
63         #include "setInitialDeltaT.H"
64     }
66     while (runTime.run())
67     {
68         #include "readTimeControls.H"
69         #include "readPIMPLEControls.H"
71         if (fluidRegions.size())
72         {
73             #include "compressibleMultiRegionCourantNo.H"
74             #include "setDeltaT.H"
75         }
77         runTime++;
79         Info<< "Time = " << runTime.timeName() << nl << endl;
81         if (nOuterCorr != 1)
82         {
83             forAll(fluidRegions, i)
84             {
85                 #include "setRegionFluidFields.H"
86                 #include "storeOldFluidFields.H"
87             }
88         }
91         // --- PIMPLE loop
92         for (int oCorr=0; oCorr<nOuterCorr; oCorr++)
93         {
94             forAll(fluidRegions, i)
95             {
96                 Info<< "\nSolving for fluid region "
97                     << fluidRegions[i].name() << endl;
98                 #include "setRegionFluidFields.H"
99                 #include "readFluidMultiRegionPIMPLEControls.H"
100                 #include "solveFluid.H"
101             }
103             forAll(solidRegions, i)
104             {
105                 Info<< "\nSolving for solid region "
106                     << solidRegions[i].name() << endl;
107                 #include "setRegionSolidFields.H"
108                 #include "readSolidMultiRegionPIMPLEControls.H"
109                 #include "solveSolid.H"
110             }
111         }
113         runTime.write();
115         Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s"
116             << "  ClockTime = " << runTime.elapsedClockTime() << " s"
117             << nl << endl;
118     }
120     Info << "End\n" << endl;
122     return 0;
126 // ************************************************************************* //