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 );
69 
70 
71 // Mass flux
73 (
74  IOobject
75  (
76  "rhoPhi",
77  runTime.timeName(),
78  mesh,
79  IOobject::NO_READ,
80  IOobject::NO_WRITE
81  ),
83 );
84 
85 #include "readGravitationalAcceleration.H"
86 #include "readhRef.H"
87 #include "gh.H"
88 
90 (
91  IOobject
92  (
93  "p",
94  runTime.timeName(),
95  mesh,
96  IOobject::NO_READ,
97  IOobject::AUTO_WRITE
98  ),
99  p_rgh + rho*gh
100 );
101 
102 label pRefCell = 0;
103 scalar pRefValue = 0.0;
105 (
106  p,
107  p_rgh,
108  mesh.solutionDict().subDict("PIMPLE"),
109  pRefCell,
110  pRefValue
111 );
112 
113 if (p_rgh.needReference())
114 {
116  (
117  "p",
118  p.dimensions(),
120  );
121  p_rgh = p - rho*gh;
122 }
123 
124 mesh.setFluxRequired(p_rgh.name());
125 mesh.setFluxRequired(alpha1.name());
126 
127 // alphac must be constructed before the cloud
128 // so that the drag-models can find it
129 volScalarField alphac
130 (
131  IOobject
132  (
133  "alphac",
134  runTime.timeName(),
135  mesh,
136  IOobject::READ_IF_PRESENT,
137  IOobject::AUTO_WRITE
138  ),
139  mesh,
142 );
143 alphac.oldTime();
144 
145 volScalarField alphacRho(alphac*rho);
146 alphacRho.oldTime();
147 
148 Info<< "Constructing kinematicCloud " << endl;
149 basicKinematicCloud kinematicCloud
150 (
151  "kinematicCloud",
152  rho,
153  U,
154  mu,
155  g
156 );
157 
158 // Particle fraction upper limit
159 scalar alphacMin
160 (
161  1.0
162  - (
163  kinematicCloud.particleProperties().subDict("constantProperties")
164  .get<scalar>("alphaMax")
165  )
166 );
167 
168 // Update alphac from the particle locations
169 alphac = max(1.0 - kinematicCloud.theta(), alphacMin);
170 alphac.correctBoundaryConditions();
171 
172 surfaceScalarField alphacf("alphacf", fvc::interpolate(alphac));
173 
174 // Phase mass flux
175 surfaceScalarField alphaRhoPhic("alphaRhoPhic", alphacf*rhoPhi);
176 
177 // Volumetric phase flux
178 surfaceScalarField alphaPhic("alphaPhic", alphacf*phi);
179 
180 autoPtr
181 <
182  PhaseCompressibleTurbulenceModel
183  <
184  immiscibleIncompressibleTwoPhaseMixture
185  >
186 >turbulence
187 (
188  PhaseCompressibleTurbulenceModel
189  <
190  immiscibleIncompressibleTwoPhaseMixture
191  >::New
192  (
193  alphac,
194  rho,
195  U,
196  alphaRhoPhic,
197  rhoPhi,
198  mixture
199  )
200 );
201 
202 #include "createMRF.H"
volScalarField mu(IOobject("mu", runTime.timeName(), mesh, IOobject::NO_READ, IOobject::AUTO_WRITE), laminarTransport.nu() *rhoInfValue)
const GeometricField< Type, PatchField, GeoMesh > & oldTime() const
Return old time field.
const word zeroGradientType
A zeroGradient patch field type.
const dimensionedScalar & rho1
Definition: createFields.H:46
label max(const labelHashSet &set, label maxValue=labelMin)
Find the max value in labelHashSet, optionally limited by second argument.
Definition: hashSets.C:40
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.
Info<< "Creating temperaturePhaseChangeTwoPhaseMixture\"<< endl;autoPtr< temperaturePhaseChangeTwoPhaseMixture > mixture
Definition: createFields.H:39
engineTime & runTime
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:531
setRefCell(p, pimple.dict(), pRefCell, pRefValue)
tmp< DimensionedField< TypeR, GeoMesh > > New(const tmp< DimensionedField< TypeR, GeoMesh >> &tf1, const word &name, const dimensionSet &dimensions, const bool initCopy=false)
Global function forwards to reuseTmpDimensionedField::New.
volScalarField & alpha1(thermo->alpha1())
const dimensionSet dimless
Dimensionless.
GeometricField< vector, fvPatchField, volMesh > volVectorField
Definition: volFieldsFwd.H:82
scalar getRefCellValue(const volScalarField &field, const label refCelli)
Return the current value of field in the reference cell.
Definition: findRefCell.C:127
p_rgh
Definition: createFields.H:95
GeometricField< scalar, fvPatchField, volMesh > volScalarField
Definition: volFieldsFwd.H:81
rho
Definition: createFields.H:81
dynamicFvMesh & mesh
volScalarField & alpha2(thermo->alpha2())
const dimensionedScalar & rho2
Definition: createFields.H:47
const uniformDimensionedVectorField & g
Info<< "Reading field U\"<< 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\"<< endl;autoPtr< compressible::turbulenceModel > turbulence(compressible::turbulenceModel::New(rho, U, phi, thermo))
Definition: createFields.H:94
volScalarField & p
Definition: createFields.H:23
volVectorField U(IOobject("U", runTime.timeName(), mesh, IOobject::NO_READ, IOobject::NO_WRITE), mesh, dimensionedVector(dimVelocity, Zero))
label pRefCell
Definition: createFields.H:75
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
KinematicCloud< Cloud< basicKinematicParcel > > basicKinematicCloud
const volScalarField & gh
messageStream Info
Information stream (stdout output on master, null elsewhere)
surfaceScalarField & rhoPhi
Definition: createFields.H:119
GeometricField< scalar, fvsPatchField, surfaceMesh > surfaceScalarField
scalar pRefValue
Definition: createFields.H:76
static constexpr const zero Zero
Global zero (0)
Definition: zero.H:127