chtMultiRegionTwoPhaseEulerFoam.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 | www.openfoam.com
6 \\/ M anipulation |
7-------------------------------------------------------------------------------
8 Copyright (C) 2018 OpenCFD Ltd.
9-------------------------------------------------------------------------------
10License
11 This file is part of OpenFOAM.
12
13 OpenFOAM is free software: you can redistribute it and/or modify it
14 under the terms of the GNU General Public License as published by
15 the Free Software Foundation, either version 3 of the License, or
16 (at your option) any later version.
17
18 OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
19 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
20 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21 for more details.
22
23 You should have received a copy of the GNU General Public License
24 along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
25
26Application
27 chtMultiRegionTwoPhaseEulerFoam
28
29Group
30 grpHeatTransferSolvers
31
32Description
33 Transient solver for buoyant, turbulent fluid flow and solid heat
34 conduction with conjugate heat transfer between solid and fluid regions.
35
36 It solves a two-phase Euler approach on the fluid region.
37
38\*---------------------------------------------------------------------------*/
39
40#include "fvCFD.H"
42
43#include "twoPhaseSystem.H"
44#include "phaseCompressibleTurbulenceModel.H"
45#include "pimpleControl.H"
47#include "regionProperties.H"
48#include "solidRegionDiffNo.H"
49#include "solidThermo.H"
50#include "radiationModel.H"
51#include "fvOptions.H"
52#include "coordinateSystem.H"
53#include "loopControl.H"
54
55// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
56
57int main(int argc, char *argv[])
58{
59 argList::addNote
60 (
61 "Transient solver for buoyant, turbulent two phase fluid flow and"
62 "solid heat conduction with conjugate heat transfer "
63 "between solid and fluid regions."
64 );
65
66 #define NO_CONTROL
67 #define CREATE_MESH createMeshesPostProcess.H
68 #include "postProcess.H"
69
70 #include "addCheckCaseOptions.H"
71 #include "setRootCase.H"
72 #include "createTime.H"
73 #include "createMeshes.H"
74 #include "createFields.H"
75 #include "initContinuityErrs.H"
76 #include "createTimeControls.H"
78 #include "compressibleMultiRegionCourantNo.H"
79 #include "solidRegionDiffusionNo.H"
81
82 while (runTime.run())
83 {
84 #include "readTimeControls.H"
86 #include "readPIMPLEControls.H"
87
88 #include "compressibleMultiRegionCourantNo.H"
89 #include "solidRegionDiffusionNo.H"
90 #include "setMultiRegionDeltaT.H"
91
92 ++runTime;
93
94 Info<< "Time = " << runTime.timeName() << nl << endl;
95
96 if (nOuterCorr != 1)
97 {
99 {
100 #include "storeOldFluidFields.H"
101 }
102 }
103
104 // --- PIMPLE loop
105 for (int oCorr=0; oCorr<nOuterCorr; ++oCorr)
106 {
107 const bool finalIter = (oCorr == nOuterCorr-1);
108
110 {
111 Info<< "\nSolving for fluid region "
112 << fluidRegions[i].name() << endl;
113 #include "setRegionFluidFields.H"
114 #include "readFluidMultiRegionPIMPLEControls.H"
115 #include "solveFluid.H"
116 }
117
119 {
120 Info<< "\nSolving for solid region "
121 << solidRegions[i].name() << endl;
122 #include "setRegionSolidFields.H"
124 #include "solveSolid.H"
125 }
126
127 // Additional loops for energy solution only
128 if (!oCorr && nOuterCorr > 1)
129 {
130 loopControl looping(runTime, pimple, "energyCoupling");
131
132 while (looping.loop())
133 {
134 Info<< nl << looping << nl;
135
137 {
138 Info<< "\nSolving for fluid region "
139 << fluidRegions[i].name() << endl;
140 #include "setRegionFluidFields.H"
141 #include "readFluidMultiRegionPIMPLEControls.H"
142 frozenFlow = true;
143 #include "solveFluid.H"
144 }
145
147 {
148 Info<< "\nSolving for solid region "
149 << solidRegions[i].name() << endl;
150 #include "setRegionSolidFields.H"
152 #include "solveSolid.H"
153 }
154 }
155 }
156 }
157
158 runTime.write();
159
160 runTime.printExecutionTime(Info);
161 }
162
163 Info<< "End\n" << endl;
164
165 return 0;
166}
167
168
169// ************************************************************************* //
Required Classes.
PtrList< fvMesh > fluidRegions(fluidNames.size())
bool frozenFlow
pimpleControl & pimple
engineTime & runTime
PtrList< fvMesh > solidRegions(solidNames.size())
Read the control parameters used by setDeltaT.
messageStream Info
Information stream (stdout output on master, null elsewhere)
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:372
constexpr char nl
The newline '\n' character (0x0a)
Definition: Ostream.H:53
Execute application functionObjects to post-process existing results.
const int nOuterCorr
Read the control parameters used in the solid.
Read the control parameters used by setDeltaT.
Set the initial timestep for the CHT MultiRegion solver.
#define forAll(list, i)
Loop across all elements in list.
Definition: stdFoam.H:333