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  QHDFoam.C
30 \*---------------------------------------------------------------------------*/
31 
32 Info<< "Reading thermophysical properties\n" << endl;
33 
34 autoPtr<rhoQGDThermo> pThermo
35 (
36  rhoQGDThermo::New(mesh)
37 );
38 rhoQGDThermo& thermo = pThermo();
39 thermo.correct();
40 
41 volScalarField& e = thermo.he();
42 
43 volScalarField& p = thermo.p();
44 const volScalarField& T = thermo.T();
45 const surfaceScalarField& hQGDf = thermo.hQGDf();
46 const surfaceScalarField& tauQGDf = thermo.tauQGDf();
47 
48 Info << "Thermo corrected" << endl;
49 
50 autoPtr<compressible::turbulenceModel> turbulence;
51 
52 volVectorField U
53 (
54  IOobject
55  (
56  "U",
57  runTime.timeName(),
58  mesh,
59  IOobject::MUST_READ,
60  IOobject::AUTO_WRITE
61  ),
62  mesh
63 );
64 
65 volScalarField rho
66 (
67  IOobject
68  (
69  "rho",
70  runTime.timeName(),
71  mesh,
72  IOobject::NO_READ,
73  IOobject::AUTO_WRITE
74  ),
75  thermo.rho()
76 );
77 
78 volVectorField W
79 (
80  IOobject
81  (
82  "W",
83  runTime.timeName(),
84  mesh,
85  IOobject::NO_READ,
86  IOobject::NO_WRITE
87  ),
88  U
89 );
90 
91 
92 
93 
94 Info<< "\nReading gravitationalProperties" << endl;
95 
96 IOdictionary gravitationalProperties
97 (
98  IOobject
99  (
100  "gravitationalProperties",
101  runTime.constant(),
102  mesh,
103  IOobject::MUST_READ_IF_MODIFIED,
104  IOobject::NO_WRITE
105  )
106 );
107 
108 const dimensionedVector g(gravitationalProperties.lookup("g"));
109 
110 dimensionedScalar beta
111 (
112  "beta",
113  dimless/dimTemperature,
114  thermo.subDict("mixture").subDict("transport")
115 );
116 
117 
118 surfaceScalarField phiu
119 (
120  "phiu",
121  mesh.Sf() & linearInterpolate(U)
122 );
123 
124 surfaceScalarField phiwo
125 (
126  "phiwo",
127  mesh.Sf() & linearInterpolate(W)
128 );
129 
130 surfaceScalarField phi
131 (
132  "phi",
133  mesh.Sf() & (linearInterpolate(U) - linearInterpolate(W))
134 );
135 
136 volVectorField BdFrc
137 (
138  "BdFrc",
139  T*g*beta
140 );
141 
142 Switch implicitDiffusion (thermo.implicitDiffusion());
143 
144 surfaceScalarField phiRhof
145 (
146  "phiRhof",
147  linearInterpolate(rho)*phi
148 );
149 
150 Info<< "Creating turbulence model\n" << endl;
151 turbulence.reset
152 (
153  compressible::turbulenceModel::New
154  (
155  rho,
156  U,
157  phiRhof,
158  thermo
159  ).ptr()
160 );
161 
162 label pRefCell = 0;
163 scalar pRefValue = 0.0;
164 
165 setRefCell(p, thermo.subDict("QGD"), pRefCell, pRefValue);
166 
167 #include "createIcoZeroSources.H"
168 
169 //
170 //END-OF-FILE
171 //
172 
volVectorField W(IOobject("W", runTime.timeName(), mesh, IOobject::NO_READ, IOobject::NO_WRITE), U)
const surfaceScalarField & tauQGDf
Definition: createFields.H:55
const surfaceScalarField & hQGDf
Definition: createFields.H:54
volVectorField U(IOobject("U", runTime.timeName(), mesh, IOobject::MUST_READ, IOobject::AUTO_WRITE), mesh)
Switch implicitDiffusion(thermo.implicitDiffusion())
dimensionedScalar beta("beta", dimless/dimTemperature, thermo.subDict("mixture").subDict("transport"))
surfaceScalarField phiRhof("phiRhof", linearInterpolate(rho)*phi)
BdFrc
Definition: updateFields.H:35
volScalarField & e
Definition: createFields.H:50
rhoQGDThermo & thermo
Definition: createFields.H:47
Info<< "\nReading gravitationalProperties"<< endl;IOdictionary gravitationalProperties(IOobject("gravitationalProperties", runTime.constant(), mesh, IOobject::MUST_READ_IF_MODIFIED, IOobject::NO_WRITE));const dimensionedVector g(gravitationalProperties.lookup("g"));Info<< "Reading thermophysical properties\n"<< endl;autoPtr< rhoQGDThermo > pThermo(rhoQGDThermo::New(mesh))
volScalarField rho(IOobject("rho", runTime.timeName(), mesh, IOobject::NO_READ, IOobject::AUTO_WRITE), thermo.rho())
phiu
——–Start———
Definition: updateFluxes.H:33
phiwo
Definition: updateFluxes.H:8
Info<< "Thermo corrected"<< endl;autoPtr< compressible::turbulenceModel > turbulence
Definition: createFields.H:59
volScalarField & T
Definition: createFields.H:53
volScalarField & p
Definition: createFields.H:52