All Classes Namespaces Files Functions Variables Typedefs Friends Macros Groups
createFields.H
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) 2019 OpenCFD Ltd.
10  Copyright (C) 2016-2019 ISP RAS (www.ispras.ru) UniCFD Group (www.unicfd.ru)
11 -------------------------------------------------------------------------------
12 License
13  This file is part of QGDsolver library, based on OpenFOAM+.
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  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  You should have received a copy of the GNU General Public License
23  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
24 Global
25  createFields
26 Description
27  Creating fields for calculations
28 SourceFile
29  mulesQHDFoam.C
30 /*---------------------------------------------------------------------------*\
31 #include "readGravitationalAcceleration.H"
32 #include "readhRef.H"
33 #include "gh.H"
34 
35 Info << "Reading thermophysical properties\n" << endl;
36 
37 autoPtr<rhoQGDThermo> pThermo
38 (
39  rhoQGDThermo::New(mesh)
40 );
41 rhoQGDThermo& thermo = pThermo();
42 thermo.correct();
43 
44 volScalarField& e = thermo.he();
45 
46 volScalarField& p = thermo.p();
47 volScalarField& T = const_cast<volScalarField&>(thermo.T());
48 const surfaceScalarField& hQGDf = thermo.hQGDf();
49 const surfaceScalarField& tauQGDf = thermo.tauQGDf();
50 
51 Info << "Thermo corrected" << endl;
52 
53 autoPtr<compressible::turbulenceModel> turbulence;
54 
55 volVectorField U
56 (
57  IOobject
58  (
59  "U",
60  runTime.timeName(),
61  mesh,
62  IOobject::MUST_READ,
63  IOobject::AUTO_WRITE
64  ),
65  mesh
66 );
67 
68 volScalarField T0
69 (
70  "T0",
71  T
72 );
73 
74 volScalarField rho
75 (
76  IOobject
77  (
78  "rho",
79  runTime.timeName(),
80  mesh,
81  IOobject::NO_READ,
82  IOobject::AUTO_WRITE
83  ),
84  thermo.rho()
85 );
86 
87 volVectorField W
88 (
89  IOobject
90  (
91  "W",
92  runTime.timeName(),
93  mesh,
94  IOobject::NO_READ,
95  IOobject::NO_WRITE
96  ),
97  U
98 );
99 
100 dimensionedScalar beta
101 (
102  "beta",
103  dimless / dimTemperature,
104  thermo.subDict("mixture").subDict("transport")
105 );
106 
107 
108 surfaceScalarField phiu
109 (
110  "phiu",
111  mesh.Sf() & linearInterpolate(U)
112 );
113 
114 surfaceScalarField phiwo
115 (
116  "phiwStar",
117  mesh.Sf() & linearInterpolate(W)
118 );
119 
120 surfaceScalarField phi
121 (
122  "phi",
123  mesh.Sf() & (linearInterpolate(U) - linearInterpolate(W))
124 );
125 
126 surfaceScalarField phiRhof
127 (
128  "phiRhof",
129  linearInterpolate(rho)*phi
130 );
131 
132 
133 volVectorField BdFrc
134 (
135  "BdFrc",
136  T* g* beta
137 );
138 
139 Switch implicitDiffusion (thermo.implicitDiffusion());
140 
141 Info << "Creating turbulence model\n" << endl;
142 turbulence.reset
143 (
144  compressible::turbulenceModel::New
145  (
146  rho,
147  U,
148  phiRhof,
149  thermo
150  ).ptr()
151 );
152 rho.oldTime();
153 
154 label pRefCell = 0;
155 scalar pRefValue = 0.0;
156 setRefCell(p, mesh.solutionDict().subDict("PIMPLE"), pRefCell, pRefValue);
157 
158 #include "createIcoZeroSources.H"
159 
160 //
161 //END-OF-FILE
162 //
163