createFields.H
Go to the documentation of this file.
1 Info<< "Reading field p_rgh\n" << endl;
3 (
4  IOobject
5  (
6  "p_rgh",
7  runTime.timeName(),
8  mesh,
9  IOobject::MUST_READ,
10  IOobject::AUTO_WRITE
11  ),
12  mesh
13 );
14 
15 Info<< "Reading field U\n" << endl;
17 (
18  IOobject
19  (
20  "U",
21  runTime.timeName(),
22  mesh,
23  IOobject::MUST_READ,
24  IOobject::AUTO_WRITE
25  ),
26  mesh
27 );
28 
29 #include "createPhi.H"
30 
31 // Creating e based thermo
32 autoPtr<twoPhaseMixtureEThermo> thermo
33 (
34  new twoPhaseMixtureEThermo(U, phi)
35 );
36 
37 // Create mixture and
38 Info<< "Creating temperaturePhaseChangeTwoPhaseMixture\n" << endl;
39 autoPtr<temperaturePhaseChangeTwoPhaseMixture> mixture =
41 
42 
43 volScalarField& alpha1(thermo->alpha1());
44 volScalarField& alpha2(thermo->alpha2());
45 
46 const dimensionedScalar& rho1 = thermo->rho1();
47 const dimensionedScalar& rho2 = thermo->rho2();
48 
49 // Need to store rho for ddt(rho, U)
51 (
52  IOobject
53  (
54  "rho",
55  runTime.timeName(),
56  mesh,
57  IOobject::READ_IF_PRESENT,
58  IOobject::AUTO_WRITE
59  ),
61 );
62 rho.oldTime();
63 
64 // Mass flux
66 (
67  IOobject
68  (
69  "rhoPhi",
70  runTime.timeName(),
71  mesh,
72  IOobject::NO_READ,
73  IOobject::NO_WRITE
74  ),
76 );
77 
78 // Construct interface from alpha1 distribution
79 interfaceProperties interface
80 (
81  alpha1,
82  U,
83  thermo->transportPropertiesDict()
84 );
85 
86 // Construct incompressible turbulence model
87 autoPtr<incompressible::turbulenceModel> turbulence
88 (
90 );
91 
92 #include "readGravitationalAcceleration.H"
93 #include "readhRef.H"
94 #include "gh.H"
95 
97 
98 label pRefCell = 0;
99 scalar pRefValue = 0.0;
101 (
102  p,
103  p_rgh,
104  pimple.dict(),
105  pRefCell,
106  pRefValue
107 );
108 
109 if (p_rgh.needReference())
110 {
112  (
113  "p",
114  p.dimensions(),
116  );
117  p_rgh = p - rho*gh;
118 }
119 
120 mesh.setFluxRequired(p_rgh.name());
121 mesh.setFluxRequired(alpha1.name());
122 
123 // MULES compressed flux is registered in case scalarTransport FO needs it.
125 (
126  IOobject
127  (
128  "alphaPhiUn",
129  runTime.timeName(),
130  mesh,
131  IOobject::NO_READ,
132  IOobject::NO_WRITE
133  ),
134  mesh,
135  dimensionedScalar(phi.dimensions(), Zero)
136 );
137 
138 #include "createMRF.H"
139 #include "createFvOptions.H"
140 
141 // Turbulent Prandtl number
142 dimensionedScalar Prt("Prt", dimless, thermo->transportPropertiesDict());
143 
145 (
146  IOobject
147  (
148  "kappaEff",
149  runTime.timeName(),
150  mesh,
151  IOobject::NO_READ,
152  IOobject::NO_WRITE
153  ),
154  thermo->kappa()
155 );
156 
157 // Need to store rho for ddt(rhoCp, U)
159 (
160  IOobject
161  (
162  "rhoCp",
163  runTime.timeName(),
164  mesh,
165  IOobject::NO_READ,
166  IOobject::NO_WRITE
167  ),
168  rho*thermo->Cp()
169 );
170 
171 rhoCp.oldTime();
pRefCell
label pRefCell
Definition: createFields.H:106
runTime
engineTime & runTime
Definition: createEngineTime.H:13
gh.H
U
volVectorField U(IOobject("U", runTime.timeName(), mesh, IOobject::NO_READ, IOobject::NO_WRITE), mesh, dimensionedVector(dimVelocity, Zero))
rho1
const dimensionedScalar & rho1
Definition: createFields.H:46
Foam::dimless
const dimensionSet dimless(0, 0, 0, 0, 0, 0, 0)
Dimensionless.
Definition: dimensionSets.H:50
pRefValue
scalar pRefValue
Definition: createFields.H:107
p_rgh
p_rgh
Definition: createFields.H:91
rhoPhi
surfaceScalarField & rhoPhi
Definition: createFields.H:118
turbulence
Info<< "Reading field U\n"<< endl;volVectorField U(IOobject("U", runTime.timeName(), mesh, IOobject::MUST_READ, IOobject::AUTO_WRITE), mesh);volScalarField rho(IOobject("rho", runTime.timeName(), mesh, IOobject::NO_READ, IOobject::AUTO_WRITE), thermo.rho());volVectorField rhoU(IOobject("rhoU", runTime.timeName(), mesh, IOobject::NO_READ, IOobject::NO_WRITE), rho *U);volScalarField rhoE(IOobject("rhoE", runTime.timeName(), mesh, IOobject::NO_READ, IOobject::NO_WRITE), rho *(e+0.5 *magSqr(U)));surfaceScalarField pos(IOobject("pos", runTime.timeName(), mesh), mesh, dimensionedScalar("pos", dimless, 1.0));surfaceScalarField neg(IOobject("neg", runTime.timeName(), mesh), mesh, dimensionedScalar("neg", dimless, -1.0));surfaceScalarField phi("phi", fvc::flux(rhoU));Info<< "Creating turbulence model\n"<< endl;autoPtr< compressible::turbulenceModel > turbulence(compressible::turbulenceModel::New(rho, U, phi, thermo))
Definition: createFields.H:94
Foam::Zero
static constexpr const zero Zero
Global zero (0)
Definition: zero.H:131
interface
interfaceProperties interface(alpha1, U, thermo->transportPropertiesDict())
thermo
psiReactionThermo & thermo
Definition: createFields.H:28
setRefCell
setRefCell(p, p_rgh, pimple.dict(), pRefCell, pRefValue)
thermo
Basic thermodynamics type based on the use of fitting functions for cp, h, s obtained from the templa...
rho
rho
Definition: createFields.H:81
Foam::endl
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:350
gh
const volScalarField & gh
Definition: setRegionFluidFields.H:17
alpha1
volScalarField & alpha1(thermo->alpha1())
createFvOptions.H
rho2
const dimensionedScalar & rho2
Definition: createFields.H:47
pimple
pimpleControl & pimple
Definition: setRegionFluidFields.H:56
Foam::Info
messageStream Info
Information stream (uses stdout - output is on the master only)
Prt
dimensionedScalar Prt("Prt", dimless, thermo->transportPropertiesDict())
Foam::dimensionedScalar
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
Definition: dimensionedScalarFwd.H:43
phi
surfaceScalarField & phi
Definition: setRegionFluidFields.H:8
Foam::volScalarField
GeometricField< scalar, fvPatchField, volMesh > volScalarField
Definition: volFieldsFwd.H:57
p
volScalarField & p
Definition: createFields.H:23
mesh
dynamicFvMesh & mesh
Definition: createDynamicFvMesh.H:6
Foam::New
tmp< DimensionedField< TypeR, GeoMesh > > New(const tmp< DimensionedField< TypeR, GeoMesh >> &tdf1, const word &name, const dimensionSet &dimensions)
Global function forwards to reuseTmpDimensionedField::New.
Definition: DimensionedFieldReuseFunctions.H:105
Foam::volVectorField
GeometricField< vector, fvPatchField, volMesh > volVectorField
Definition: volFieldsFwd.H:62
Foam::getRefCellValue
scalar getRefCellValue(const volScalarField &field, const label refCelli)
Return the current value of field in the reference cell.
Definition: findRefCell.C:134
Foam::surfaceScalarField
GeometricField< scalar, fvsPatchField, surfaceMesh > surfaceScalarField
Definition: surfaceFieldsFwd.H:54
readhRef.H
rhoCp
volScalarField rhoCp(IOobject("rhoCp", runTime.timeName(), mesh, IOobject::NO_READ, IOobject::NO_WRITE), rho *thermo->Cp())
kappaEff
volScalarField kappaEff(IOobject("kappaEff", runTime.timeName(), mesh, IOobject::NO_READ, IOobject::NO_WRITE), thermo->kappa())
mixture
Info<< "Creating temperaturePhaseChangeTwoPhaseMixture\n"<< endl;autoPtr< temperaturePhaseChangeTwoPhaseMixture > mixture
Definition: createFields.H:39
alpha2
volScalarField & alpha2(thermo->alpha2())
Foam::fac::interpolate
static tmp< GeometricField< Type, faePatchField, edgeMesh > > interpolate(const GeometricField< Type, faPatchField, areaMesh > &tvf, const edgeScalarField &faceFlux, Istream &schemeData)
Interpolate field onto faces using scheme given by Istream.
alphaPhiUn
surfaceScalarField alphaPhiUn(IOobject("alphaPhiUn", runTime.timeName(), mesh, IOobject::NO_READ, IOobject::NO_WRITE), mesh, dimensionedScalar(phi.dimensions(), Zero))