OpenFOAM: API Guide
v2112
The open source CFD toolbox
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
-------------------------------------------------------------------------------
10
License
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
26
Application
27
chtMultiRegionTwoPhaseEulerFoam
28
29
Group
30
grpHeatTransferSolvers
31
32
Description
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
"
41
#include "
turbulentFluidThermoModel.H
"
42
43
#include "twoPhaseSystem.H"
44
#include "phaseCompressibleTurbulenceModel.H"
45
#include "
pimpleControl.H
"
46
#include "
fixedGradientFvPatchFields.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
57
int
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
"
77
#include "
readSolidTimeControls.H
"
78
#include "compressibleMultiRegionCourantNo.H"
79
#include "solidRegionDiffusionNo.H"
80
#include "
setInitialMultiRegionDeltaT.H
"
81
82
while
(
runTime
.run())
83
{
84
#include "
readTimeControls.H
"
85
#include "
readSolidTimeControls.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
{
98
forAll
(
fluidRegions
, i)
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
109
forAll
(
fluidRegions
, i)
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
118
forAll
(
solidRegions
, i)
119
{
120
Info
<<
"\nSolving for solid region "
121
<<
solidRegions
[i].name() <<
endl
;
122
#include "
setRegionSolidFields.H
"
123
#include "
readSolidMultiRegionPIMPLEControls.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
136
forAll
(
fluidRegions
, i)
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
146
forAll
(
solidRegions
, i)
147
{
148
Info
<<
"\nSolving for solid region "
149
<<
solidRegions
[i].name() <<
endl
;
150
#include "
setRegionSolidFields.H
"
151
#include "
readSolidMultiRegionPIMPLEControls.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
// ************************************************************************* //
addCheckCaseOptions.H
Required Classes.
fluidRegions
PtrList< fvMesh > fluidRegions(fluidNames.size())
frozenFlow
bool frozenFlow
Definition:
setRegionFluidFields.H:34
pimple
pimpleControl & pimple
Definition:
setRegionFluidFields.H:56
coordinateSystem.H
runTime
engineTime & runTime
Definition:
createEngineTime.H:13
createMeshes.H
solidRegions
PtrList< fvMesh > solidRegions(solidNames.size())
createTimeControls.H
Read the control parameters used by setDeltaT.
createTime.H
fixedGradientFvPatchFields.H
fvCFD.H
fvOptions.H
loopControl.H
Foam::Info
messageStream Info
Information stream (stdout output on master, null elsewhere)
Foam::endl
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition:
Ostream.H:372
Foam::nl
constexpr char nl
The newline '\n' character (0x0a)
Definition:
Ostream.H:53
pimpleControl.H
postProcess.H
Execute application functionObjects to post-process existing results.
radiationModel.H
readPIMPLEControls.H
nOuterCorr
const int nOuterCorr
Definition:
readPIMPLEControls.H:7
readSolidMultiRegionPIMPLEControls.H
readSolidTimeControls.H
Read the control parameters used in the solid.
readTimeControls.H
Read the control parameters used by setDeltaT.
regionProperties.H
setInitialMultiRegionDeltaT.H
Set the initial timestep for the CHT MultiRegion solver.
setRegionSolidFields.H
setRootCase.H
solidThermo.H
forAll
#define forAll(list, i)
Loop across all elements in list.
Definition:
stdFoam.H:333
turbulentFluidThermoModel.H
applications
solvers
heatTransfer
chtMultiRegionFoam
chtMultiRegionTwoPhaseEulerFoam
chtMultiRegionTwoPhaseEulerFoam.C
Generated by
1.9.5
OPENFOAM® is a registered
trademark
of OpenCFD Ltd.