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 #include "createMRF.H"
124 #include "createFvOptions.H"
125 
126 // Turbulent Prandtl number
127 dimensionedScalar Prt("Prt", dimless, thermo->transportPropertiesDict());
128 
130 (
131  IOobject
132  (
133  "kappaEff",
134  runTime.timeName(),
135  mesh,
136  IOobject::NO_READ,
137  IOobject::NO_WRITE
138  ),
139  thermo->kappa()
140 );
141 
142 // Need to store rho for ddt(rhoCp, U)
144 (
145  IOobject
146  (
147  "rhoCp",
148  runTime.timeName(),
149  mesh,
150  IOobject::NO_READ,
151  IOobject::NO_WRITE
152  ),
153  rho*thermo->Cp()
154 );
155 
156 rhoCp.oldTime();
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
p_rgh
p_rgh
Definition: createFields.H:95
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
interface
interfaceProperties interface(alpha1, U, thermo->transportPropertiesDict())
thermo
psiReactionThermo & thermo
Definition: createFields.H:28
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:369
setRefCell
setRefCell(p, pimple.dict(), pRefCell, pRefValue)
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 (stdout output on master, null elsewhere)
Prt
dimensionedScalar Prt("Prt", dimless, thermo->transportPropertiesDict())
Foam::dimensionedScalar
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
Definition: dimensionedScalarFwd.H:42
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
pRefCell
label pRefCell
Definition: createFields.H:75
pRefValue
scalar pRefValue
Definition: createFields.H:76
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.
Foam::dimless
const dimensionSet dimless
Dimensionless.
Definition: dimensionSets.C:189