OpenFOAM: API Guide
v2006
The open source CFD toolbox
chtMultiRegionSimpleFoam.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) 2011-2016 OpenFOAM Foundation
9
Copyright (C) 2017 OpenCFD Ltd.
10
-------------------------------------------------------------------------------
11
License
12
This file is part of OpenFOAM.
13
14
OpenFOAM is free software: you can redistribute it and/or modify it
15
under the terms of the GNU General Public License as published by
16
the Free Software Foundation, either version 3 of the License, or
17
(at your option) any later version.
18
19
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
20
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
21
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22
for more details.
23
24
You should have received a copy of the GNU General Public License
25
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
26
27
Application
28
chtMultiRegionSimpleFoam
29
30
Group
31
grpHeatTransferSolvers
32
33
Description
34
Steady-state solver for buoyant, turbulent fluid flow and solid heat
35
conduction with conjugate heat transfer between solid and fluid regions.
36
37
\*---------------------------------------------------------------------------*/
38
39
#include "
fvCFD.H
"
40
#include "
rhoThermo.H
"
41
#include "
turbulentFluidThermoModel.H
"
42
#include "
fixedGradientFvPatchFields.H
"
43
#include "
regionProperties.H
"
44
#include "
solidThermo.H
"
45
#include "
radiationModel.H
"
46
#include "
fvOptions.H
"
47
#include "
coordinateSystem.H
"
48
#include "
loopControl.H
"
49
50
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
51
52
int
main(
int
argc,
char
*argv[])
53
{
54
argList::addNote
55
(
56
"Steady-state solver for buoyant, turbulent fluid flow and solid heat"
57
" conduction with conjugate heat transfer"
58
" between solid and fluid regions."
59
);
60
61
#define NO_CONTROL
62
#define CREATE_MESH createMeshesPostProcess.H
63
#include "
postProcess.H
"
64
65
#include "
setRootCaseLists.H
"
66
#include "
createTime.H
"
67
#include "createMeshes.H"
68
#include "createFields.H"
69
#include "initContinuityErrs.H"
70
71
while
(
runTime
.loop())
72
{
73
Info
<<
"Time = "
<<
runTime
.timeName() <<
nl
<<
endl
;
74
75
forAll
(
fluidRegions
, i)
76
{
77
Info
<<
"\nSolving for fluid region "
78
<<
fluidRegions
[i].name() <<
endl
;
79
#include "setRegionFluidFields.H"
80
#include "
readFluidMultiRegionSIMPLEControls.H
"
81
#include "solveFluid.H"
82
}
83
84
forAll
(
solidRegions
, i)
85
{
86
Info
<<
"\nSolving for solid region "
87
<<
solidRegions
[i].name() <<
endl
;
88
#include "
setRegionSolidFields.H
"
89
#include "
readSolidMultiRegionSIMPLEControls.H
"
90
#include "solveSolid.H"
91
}
92
93
// Additional loops for energy solution only
94
{
95
loopControl looping(
runTime
,
"SIMPLE"
,
"energyCoupling"
);
96
97
while
(looping.loop())
98
{
99
Info
<<
nl
<< looping <<
nl
;
100
101
forAll
(
fluidRegions
, i)
102
{
103
Info
<<
"\nSolving for fluid region "
104
<<
fluidRegions
[i].name() <<
endl
;
105
#include "setRegionFluidFields.H"
106
#include "
readFluidMultiRegionSIMPLEControls.H
"
107
frozenFlow
=
true
;
108
#include "solveFluid.H"
109
}
110
111
forAll
(
solidRegions
, i)
112
{
113
Info
<<
"\nSolving for solid region "
114
<<
solidRegions
[i].name() <<
endl
;
115
#include "
setRegionSolidFields.H
"
116
#include "
readSolidMultiRegionSIMPLEControls.H
"
117
#include "solveSolid.H"
118
}
119
}
120
}
121
122
runTime
.write();
123
124
runTime
.printExecutionTime(
Info
);
125
}
126
127
Info
<<
"End\n"
<<
endl
;
128
129
return
0;
130
}
131
132
133
// ************************************************************************* //
runTime
engineTime & runTime
Definition:
createEngineTime.H:13
fvOptions.H
regionProperties.H
Foam::endl
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition:
Ostream.H:350
setRegionSolidFields.H
coordinateSystem.H
forAll
#define forAll(list, i)
Loop across all elements in list.
Definition:
stdFoam.H:296
solidThermo.H
rhoThermo.H
setRootCaseLists.H
readSolidMultiRegionSIMPLEControls.H
Foam::Info
messageStream Info
Information stream (uses stdout - output is on the master only)
readFluidMultiRegionSIMPLEControls.H
postProcess.H
Execute application functionObjects to post-process existing results.
fixedGradientFvPatchFields.H
Foam::nl
constexpr char nl
Definition:
Ostream.H:385
loopControl.H
fluidRegions
PtrList< fvMesh > fluidRegions(fluidNames.size())
solidRegions
PtrList< fvMesh > solidRegions(solidNames.size())
createTime.H
fvCFD.H
frozenFlow
bool frozenFlow
Definition:
setRegionFluidFields.H:32
radiationModel.H
turbulentFluidThermoModel.H
applications
solvers
heatTransfer
chtMultiRegionFoam
chtMultiRegionSimpleFoam
chtMultiRegionSimpleFoam.C
Generated by
1.8.17
OPENFOAM® is a registered
trademark
of OpenCFD Ltd.