OpenFOAM
10
The OpenFOAM Foundation
chtMultiRegionFoam.C
Go to the documentation of this file.
1
/*---------------------------------------------------------------------------*\
2
========= |
3
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4
\\ / O peration | Website: https://openfoam.org
5
\\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation
6
\\/ M anipulation |
7
-------------------------------------------------------------------------------
8
License
9
This file is part of OpenFOAM.
10
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.
15
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.
20
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/>.
23
24
Application
25
chtMultiRegionFoam
26
27
Description
28
Solver for steady or transient fluid flow and solid heat conduction, with
29
conjugate heat transfer between regions, buoyancy effects, turbulence,
30
reactions and radiation modelling.
31
32
\*---------------------------------------------------------------------------*/
33
34
#include "
fvCFD.H
"
35
#include "
compressibleMomentumTransportModels.H
"
36
#include "
fluidReactionThermophysicalTransportModel.H
"
37
#include "
fluidReactionThermo.H
"
38
#include "
combustionModel.H
"
39
#include "
fixedGradientFvPatchFields.H
"
40
#include "
regionProperties.H
"
41
#include "compressibleCourantNo.H"
42
#include "
solidRegionDiffNo.H
"
43
#include "
solidThermo.H
"
44
#include "
fvModels.H
"
45
#include "
fvConstraints.H
"
46
#include "
coordinateSystem.H
"
47
#include "
pimpleMultiRegionControl.H
"
48
#include "
pressureReference.H
"
49
#include "
hydrostaticInitialisation.H
"
50
51
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
52
53
int
main(
int
argc,
char
*argv[])
54
{
55
#define NO_CONTROL
56
#define CREATE_MESH createMeshesPostProcess.H
57
#include "
postProcess.H
"
58
59
#include "
setRootCaseLists.H
"
60
#include "
createTime.H
"
61
#include "
createMeshes.H
"
62
pimpleMultiRegionControl pimples(
fluidRegions
,
solidRegions
);
63
#include "createFields.H"
64
#include "initContinuityErrs.H"
65
#include "
createFluidPressureControls.H
"
66
#include "
createTimeControls.H
"
67
#include "
readSolidTimeControls.H
"
68
#include "
compressibleMultiRegionCourantNo.H
"
69
#include "
solidRegionDiffusionNo.H
"
70
#include "
setInitialMultiRegionDeltaT.H
"
71
72
while
(pimples.run(runTime))
73
{
74
#include "
readTimeControls.H
"
75
#include "
readSolidTimeControls.H
"
76
77
#include "
compressibleMultiRegionCourantNo.H
"
78
#include "
solidRegionDiffusionNo.H
"
79
#include "
setMultiRegionDeltaT.H
"
80
81
runTime++;
82
83
Info
<<
"Time = "
<< runTime.userTimeName() <<
nl
<<
endl
;
84
85
// Optional number of energy correctors
86
const
int
nEcorr = pimples.dict().lookupOrDefault<
int
>
87
(
88
"nEcorrectors"
,
89
1
90
);
91
92
// --- PIMPLE loop
93
while
(pimples.loop())
94
{
95
List<tmp<fvVectorMatrix>>
UEqns
(
fluidRegions
.size());
96
97
for
(
int
Ecorr=0; Ecorr<nEcorr; Ecorr++)
98
{
99
forAll
(
solidRegions
, i)
100
{
101
Info
<<
"\nSolving for solid region "
102
<<
solidRegions
[i].name() <<
endl
;
103
#include "
setRegionSolidFields.H
"
104
#include "
solveSolid.H
"
105
}
106
forAll
(
fluidRegions
, i)
107
{
108
Info
<<
"\nSolving for fluid region "
109
<<
fluidRegions
[i].name() <<
endl
;
110
#include "
setRegionFluidFields.H
"
111
#include "
solveFluid.H
"
112
}
113
}
114
}
115
116
runTime.
write
();
117
118
Info
<<
"ExecutionTime = "
<< runTime.elapsedCpuTime() <<
" s"
119
<<
" ClockTime = "
<< runTime.elapsedClockTime() <<
" s"
120
<<
nl
<<
endl
;
121
}
122
123
Info
<<
"End\n"
<<
endl
;
124
125
return
0;
126
}
127
128
129
// ************************************************************************* //
fvConstraints.H
fvCFD.H
fvModels.H
forAll
#define forAll(list, i)
Loop across all elements in list.
Definition:
UList.H:434
Foam::Ostream::write
virtual Ostream & write(const char)=0
Write character.
pressureReference.H
setRootCaseLists.H
setInitialMultiRegionDeltaT.H
Set the initial timestep for the CHT MultiRegion solver.
UEqns
UEqns[i]
Definition:
UEqn.H:5
compressibleMultiRegionCourantNo.H
pimpleMultiRegionControl.H
Foam::endl
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition:
Ostream.H:251
solidRegions
PtrList< fvMesh > solidRegions(solidNames.size())
readTimeControls.H
Read the control parameters used by setDeltaT.
createTime.H
solidRegionDiffusionNo.H
solidThermo.H
solidRegionDiffNo.H
Calculates and outputs the mean and maximum Diffusion Numbers for the solid regions.
setRegionFluidFields.H
fixedGradientFvPatchFields.H
combustionModel.H
fluidReactionThermo.H
fluidRegions
PtrList< fvMesh > fluidRegions(fluidNames.size())
createFluidPressureControls.H
Foam::nl
static const char nl
Definition:
Ostream.H:260
compressibleMomentumTransportModels.H
solveSolid.H
hydrostaticInitialisation.H
fluidReactionThermophysicalTransportModel.H
readSolidTimeControls.H
Read the control parameters used in the solid.
setRegionSolidFields.H
Foam::Info
messageStream Info
coordinateSystem.H
solveFluid.H
postProcess.H
Execute application functionObjects to post-process existing results.
setMultiRegionDeltaT.H
Reset the timestep to maintain a constant maximum courant and diffusion Numbers. Reduction of time-st...
createTimeControls.H
Read the control parameters used by setDeltaT.
regionProperties.H
createMeshes.H
applications
solvers
heatTransfer
chtMultiRegionFoam
chtMultiRegionFoam.C
Generated by
1.8.13