solidFoam.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) 2020 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  solidFoam
28 
29 Group
30  grpHeatTransferSolvers
31 
32 Description
33  Solver for energy transport and thermodynamics on a solid.
34 
35 \*---------------------------------------------------------------------------*/
36 
37 #include "fvCFD.H"
38 #include "dynamicFvMesh.H"
39 #include "solidThermo.H"
40 #include "radiationModel.H"
41 #include "fvOptions.H"
42 #include "simpleControl.H"
43 #include "pimpleControl.H"
44 #include "dummyCourantNo.H"
45 #include "solidRegionDiffNo.H"
46 #include "coordinateSystem.H"
47 
48 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
49 
50 int main(int argc, char *argv[])
51 {
52  argList::addNote
53  (
54  "Solver for energy transport and thermodynamics on a solid"
55  );
56 
57  #define NO_CONTROL
58  #include "postProcess.H"
59 
60  #include "addCheckCaseOptions.H"
61  #include "setRootCaseLists.H"
62  #include "createTime.H"
63  #include "createDynamicFvMesh.H"
64  #include "createFields.H"
65  #include "createFieldRefs.H"
66 
67  // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
68 
69  Info<< "\nEvolving thermodynamics\n" << endl;
70 
71  if (mesh.solutionDict().found("SIMPLE"))
72  {
73  simpleControl simple(mesh);
74 
75  while (simple.loop())
76  {
77  Info<< "Time = " << runTime.timeName() << nl << endl;
78 
79  while (simple.correctNonOrthogonal())
80  {
81  #include "hEqn.H"
82  }
83 
84  runTime.write();
85 
86  runTime.printExecutionTime(Info);
87  }
88  }
89  else
90  {
91  pimpleControl pimple(mesh);
92 
93  #include "createDyMControls.H"
94 
95  while (runTime.run())
96  {
97  #include "readDyMControls.H"
98  #include "readSolidTimeControls.H"
99 
100  #include "solidDiffusionNo.H"
101  #include "setMultiRegionDeltaT.H"
102 
103  ++runTime;
104 
105  Info<< "Time = " << runTime.timeName() << nl << endl;
106 
107  while (pimple.loop())
108  {
109  if (pimple.firstIter() || moveMeshOuterCorrectors)
110  {
111  // Do any mesh changes
112  mesh.controlledUpdate();
113 
114  if (mesh.changing() && checkMeshCourantNo)
115  {
116  #include "meshCourantNo.H"
117  }
118  }
119 
120  while (pimple.correct())
121  {
122  #include "hEqn.H"
123  }
124  }
125 
126  runTime.write();
127  runTime.printExecutionTime(Info);
128  }
129  }
130 
131  Info<< "End\n" << endl;
132 
133  return 0;
134 }
135 
136 
137 // ************************************************************************* //
constexpr char nl
The newline &#39;\n&#39; character (0x0a)
Definition: Ostream.H:50
engineTime & runTime
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:531
checkMeshCourantNo
dynamicFvMesh & mesh
pimpleControl & pimple
moveMeshOuterCorrectors
Calculates and outputs the mean and maximum Courant Numbers.
const dictionary & simple
Read the control parameters used in the solid.
messageStream Info
Information stream (stdout output on master, null elsewhere)
Execute application functionObjects to post-process existing results.
Required Classes.
Dummy (fluid) Courant number.