createFields.H
Go to the documentation of this file.
1 #include "createRDeltaT.H"
2 
3 Info<< "Reading field p_rgh\n" << endl;
5 (
6  IOobject
7  (
8  "p_rgh",
9  runTime.timeName(),
10  mesh,
11  IOobject::MUST_READ,
12  IOobject::AUTO_WRITE
13  ),
14  mesh
15 );
16 
17 Info<< "Reading field U\n" << endl;
19 (
20  IOobject
21  (
22  "U",
23  runTime.timeName(),
24  mesh,
25  IOobject::MUST_READ,
26  IOobject::AUTO_WRITE
27  ),
28  mesh
29 );
30 
31 #include "createPhi.H"
32 
33 Info<< "Reading transportProperties\n" << endl;
34 immiscibleIncompressibleTwoPhaseMixture mixture(U, phi);
35 
36 volScalarField& alpha1(mixture.alpha1());
37 volScalarField& alpha2(mixture.alpha2());
38 
39 const dimensionedScalar& rho1 = mixture.rho1();
40 const dimensionedScalar& rho2 = mixture.rho2();
41 
42 // Need to store rho for ddt(rho, U)
44 (
45  IOobject
46  (
47  "rho",
48  runTime.timeName(),
49  mesh,
50  IOobject::READ_IF_PRESENT,
51  IOobject::AUTO_WRITE
52  ),
54 );
55 rho.oldTime();
56 
57 // Need to store mu as incompressibleTwoPhaseMixture does not store it
59 (
60  IOobject
61  (
62  "mu",
63  runTime.timeName(),
64  mesh,
65  IOobject::READ_IF_PRESENT
66  ),
67  mixture.mu(),
68  calculatedFvPatchScalarField::typeName
69 );
70 
71 
72 // Mass flux
74 (
75  IOobject
76  (
77  "rhoPhi",
78  runTime.timeName(),
79  mesh,
80  IOobject::NO_READ,
81  IOobject::NO_WRITE
82  ),
84 );
85 
86 #include "readGravitationalAcceleration.H"
87 #include "readhRef.H"
88 #include "gh.H"
89 
91 (
92  IOobject
93  (
94  "p",
95  runTime.timeName(),
96  mesh,
97  IOobject::NO_READ,
98  IOobject::AUTO_WRITE
99  ),
100  p_rgh + rho*gh
101 );
102 
103 label pRefCell = 0;
104 scalar pRefValue = 0.0;
106 (
107  p,
108  p_rgh,
109  mesh.solutionDict().subDict("PIMPLE"),
110  pRefCell,
111  pRefValue
112 );
113 
114 if (p_rgh.needReference())
115 {
117  (
118  "p",
119  p.dimensions(),
121  );
122  p_rgh = p - rho*gh;
123 }
124 
125 mesh.setFluxRequired(p_rgh.name());
126 mesh.setFluxRequired(alpha1.name());
127 
128 // alphac must be constructed before the cloud
129 // so that the drag-models can find it
130 volScalarField alphac
131 (
132  IOobject
133  (
134  "alphac",
135  runTime.timeName(),
136  mesh,
137  IOobject::READ_IF_PRESENT,
138  IOobject::AUTO_WRITE
139  ),
140  mesh,
142  zeroGradientFvPatchScalarField::typeName
143 );
144 alphac.oldTime();
145 
146 volScalarField alphacRho(alphac*rho);
147 alphacRho.oldTime();
148 
149 Info<< "Constructing kinematicCloud " << endl;
150 basicKinematicCloud kinematicCloud
151 (
152  "kinematicCloud",
153  rho,
154  U,
155  mu,
156  g
157 );
158 
159 // Particle fraction upper limit
160 scalar alphacMin
161 (
162  1.0
163  - (
164  kinematicCloud.particleProperties().subDict("constantProperties")
165  .get<scalar>("alphaMax")
166  )
167 );
168 
169 // Update alphac from the particle locations
170 alphac = max(1.0 - kinematicCloud.theta(), alphacMin);
171 alphac.correctBoundaryConditions();
172 
173 surfaceScalarField alphacf("alphacf", fvc::interpolate(alphac));
174 
175 // Phase mass flux
176 surfaceScalarField alphaRhoPhic("alphaRhoPhic", alphacf*rhoPhi);
177 
178 // Volumetric phase flux
179 surfaceScalarField alphaPhic("alphaPhic", alphacf*phi);
180 
181 autoPtr
182 <
183  PhaseCompressibleTurbulenceModel
184  <
185  immiscibleIncompressibleTwoPhaseMixture
186  >
187 >turbulence
188 (
189  PhaseCompressibleTurbulenceModel
190  <
191  immiscibleIncompressibleTwoPhaseMixture
192  >::New
193  (
194  alphac,
195  rho,
196  U,
197  alphaRhoPhic,
198  rhoPhi,
199  mixture
200  )
201 );
202 
203 #include "createMRF.H"
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
Foam::Zero
static constexpr const zero Zero
Global zero (0)
Definition: zero.H:131
Foam::GeometricField::oldTime
const GeometricField< Type, PatchField, GeoMesh > & oldTime() const
Return old time field.
Definition: GeometricField.C:850
createRDeltaT.H
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
basicKinematicCloud
Cloud class to introduce kinematic parcels.
alpha1
volScalarField & alpha1(thermo->alpha1())
rho2
const dimensionedScalar & rho2
Definition: createFields.H:47
Foam::Info
messageStream Info
Information stream (stdout output on master, null elsewhere)
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
Foam::max
label max(const labelHashSet &set, label maxValue=labelMin)
Find the max value in labelHashSet, optionally limited by second argument.
Definition: hashSets.C:47
p
volScalarField & p
Definition: createFields.H:23
mesh
dynamicFvMesh & mesh
Definition: createDynamicFvMesh.H:6
g
const uniformDimensionedVectorField & g
Definition: createFluidFields.H:26
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
mu
volScalarField mu(IOobject("mu", runTime.timeName(), mesh, IOobject::NO_READ, IOobject::AUTO_WRITE), laminarTransport.nu() *rhoInfValue)
pRefCell
label pRefCell
Definition: createFields.H:75
pRefValue
scalar pRefValue
Definition: createFields.H:76
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