createFields.H
Go to the documentation of this file.
1Info<< "Reading thermophysical properties\n" << endl;
2
3autoPtr<rhoThermo> pThermo(rhoThermo::New(mesh));
4rhoThermo& thermo = pThermo();
5thermo.validate(args.executable(), "h", "e");
6
7volScalarField rho
8(
9 IOobject
10 (
11 "rho",
12 runTime.timeName(),
13 mesh,
14 IOobject::NO_READ,
15 IOobject::NO_WRITE
16 ),
17 thermo.rho()
18);
19
20volScalarField& p = thermo.p();
21
22Info<< "Reading field U\n" << endl;
23volVectorField U
24(
25 IOobject
26 (
27 "U",
28 runTime.timeName(),
29 mesh,
30 IOobject::MUST_READ,
31 IOobject::AUTO_WRITE
32 ),
33 mesh
34);
35
37
38
39Info<< "Creating turbulence model\n" << endl;
40autoPtr<compressible::turbulenceModel> turbulence
41(
42 compressible::turbulenceModel::New
43 (
44 rho,
45 U,
46 phi,
47 thermo
48 )
49);
50
51
52#include "readGravitationalAcceleration.H"
53#include "readhRef.H"
54#include "gh.H"
55
56
57Info<< "Reading field p_rgh\n" << endl;
58volScalarField p_rgh
59(
60 IOobject
61 (
62 "p_rgh",
63 runTime.timeName(),
64 mesh,
65 IOobject::MUST_READ,
66 IOobject::AUTO_WRITE
67 ),
68 mesh
69);
70
71// Force p_rgh to be consistent with p
72p_rgh = p - rho*gh;
73
74mesh.setFluxRequired(p_rgh.name());
75
76label pRefCell = 0;
77scalar pRefValue = 0.0;
78
79if (p_rgh.needReference())
80{
82 (
83 p,
84 p_rgh,
85 pimple.dict(),
88 );
89
90 p += dimensionedScalar
91 (
92 "p",
93 p.dimensions(),
94 pRefValue - getRefCellValue(p, pRefCell)
95 );
96}
97
98dimensionedScalar initialMass("initialMass", fvc::domainIntegrate(rho));
99
100#include "createDpdt.H"
101
102#include "createK.H"
103
104#include "createMRF.H"
105#include "createRadiationModel.H"
106#include "createFvOptions.H"
107
108//- Overset specific
109
110// Add solver-specific interpolations
111{
112 wordHashSet& nonInt =
113 const_cast<wordHashSet&>(Stencil::New(mesh).nonInterpolatedFields());
114
115 nonInt.insert("HbyA");
116 nonInt.insert("grad(p_rgh)");
117 nonInt.insert("surfaceIntegrate(phi)");
118 nonInt.insert("surfaceIntegrate(phiHbyA)");
119 nonInt.insert("cellMask");
120 nonInt.insert("cellDisplacement");
121 nonInt.insert("interpolatedCells");
122 nonInt.insert("cellInterpolationWeight");
123}
124
125// Mask field for zeroing out contributions on hole cells
126#include "createCellMask.H"
volScalarField & p_rgh
surfaceScalarField & phi
const scalar pRefValue
const label pRefCell
const volScalarField & gh
pimpleControl & pimple
bool insert(const Key &key)
Insert a new entry, not overwriting existing entries.
Definition: HashSet.H:191
const word & executable() const noexcept
Name of executable without the path.
Definition: argListI.H:51
Basic thermodynamics type based on the use of fitting functions for cp, h, s obtained from the templa...
U
Definition: pEqn.H:72
volScalarField & p
Creates and initialises the face-flux field phi.
Creates mask for blocked out cells.
dynamicFvMesh & mesh
engineTime & runTime
compressible::turbulenceModel & turbulence
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
messageStream Info
Information stream (stdout output on master, null elsewhere)
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:372
HashSet< word, Hash< word > > wordHashSet
A HashSet of words, uses string hasher.
Definition: HashSet.H:82
Foam::argList args(argc, argv)
Info<< "Reading thermophysical properties\n"<< endl;autoPtr< psiReactionThermo > pThermo(psiReactionThermo::New(mesh))
dimensionedScalar initialMass
Definition: createFields.H:57
setRefCell(p, pimple.dict(), pRefCell, pRefValue)