All Classes Namespaces Files Functions Variables Typedefs Friends Macros Groups
scalarTransportQHDFoam.C
Go to the documentation of this file.
1 
2 
3 /*---------------------------------------------------------------------------*\
4  ========= |
5  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
6  \\ / O peration |
7  \\ / A nd | www.openfoam.com
8  \\/ M anipulation |
9 -------------------------------------------------------------------------------
10  Copyright (C) 2011-2016 OpenFOAM Foundation
11  Copyright (C) 2019 OpenCFD Ltd.
12  Copyright (C) 2016-2019 ISP RAS (www.ispras.ru) UniCFD Group (www.unicfd.ru)
13 -------------------------------------------------------------------------------
14 License
15  This file is part of QGDsolver library, based on OpenFOAM+.
16 
17  OpenFOAM is free software: you can redistribute it and/or modify it
18  under the terms of the GNU General Public License as published by
19  the Free Software Foundation, either version 3 of the License, or
20  (at your option) any later version.
21 
22  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
23  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
24  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
25  for more details.
26 
27  You should have received a copy of the GNU General Public License
28  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
29 
30 Application
31  scalarTransportQHDFoam
32 
33 Description
34  Evolves a passive scalar transport equation with regularized terms.
35 
36  Developed by UniCFD group (www.unicfd.ru) of ISP RAS (www.ispras.ru).
37 
38 
39 \*---------------------------------------------------------------------------*/
40 
41 #include "fvCFD.H"
42 #include "QHD.H"
43 
44 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
45 
46 int main(int argc, char *argv[])
47 {
48  #define NO_CONTROL
49  #include "postProcess.H"
50 
51  #include "setRootCase.H"
52  #include "createTime.H"
53  #include "createMesh.H"
54  #include "createFields.H"
55  #include "createFaceFields.H"
56  #include "createFaceFluxes.H"
57  #include "createTimeControls.H"
58 
59  // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
60 
61  // Courant numbers used to adjust the time-step
62  scalar CoNum = 0.0;
63  scalar meanCoNum = 0.0;
64 
65  //solve for pressure to get zero divergence flux field
66  #include "updateFluxes.H"
67  #include "QHDpEqn.H"
68 
69  Info<< "\nStarting time loop\n" << endl;
70 
71  while (runTime.run())
72  {
73  /*
74  *
75  * Update fields
76  *
77  */
78  #include "updateFields.H"
79 
80 
81  /*
82  *
83  * Update time step
84  *
85  */
86  #include "readTimeControls.H"
87  if(runTime.controlDict().lookupOrDefault<bool>("adjustTimeStep", false))
88  {
89  surfaceScalarField Cof
90  (
91  "Cof",
92  runTime.deltaT()*
93  (
94  mag(Uf)/hQGDf
95  )
96  );
97  CoNum = max(Cof).value();
98  Info << "Courant Number = " << CoNum << endl;
99  }
100 
101  #include "setDeltaT-QGDQHD.H"
102 
103  runTime++;
104 
105  Info<< "Time = " << runTime.timeName() << nl << endl;
106 
107  // --- Store old time values
108  T.oldTime();
109 
110  #include "QHDTEqn.H"
111 
112  runTime.write();
113 
114  Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s"
115  << " ClockTime = " << runTime.elapsedClockTime() << " s"
116  << nl << endl;
117  }
118 
119 
120 
121  Info<< "End\n" << endl;
122 
123  return 0;
124 }
125 
126 // ************************************************************************* //
const surfaceScalarField & hQGDf
Definition: createFields.H:18
int main(int argc, char *argv[])
Reset the timestep to maintain a constant maximum courant Number. Reduction of time-step is immediate...
Solver for unsteady 3D turbulent flow of incompressible fluid governed by quasi-hydrodynamic dynamic ...
Uf
Definition: updateFields.H:30
Includation for QHD solver. Equations of state for QHD based on density. Class for fvsc namespace...
Solution of continuity equation for QGD solver.
const volScalarField & T
Definition: createFields.H:15