createFields.H
Go to the documentation of this file.
2
3Info<< "Reading field p_rgh\n" << endl;
4volScalarField p_rgh
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
17Info<< "Reading field U\n" << endl;
18volVectorField U
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
33Info<< "Constructing twoPhaseMixtureThermo\n" << endl;
34twoPhaseMixtureThermo mixture(U, phi);
35
36volScalarField& alpha1(mixture.alpha1());
37volScalarField& alpha2(mixture.alpha2());
38
39Info<< "Reading thermophysical properties\n" << endl;
40
41const volScalarField& rho1 = mixture.thermo1().rho();
42const volScalarField& rho2 = mixture.thermo2().rho();
43
44volScalarField rho
45(
46 IOobject
47 (
48 "rho",
49 runTime.timeName(),
50 mesh,
51 IOobject::READ_IF_PRESENT,
52 IOobject::AUTO_WRITE
53 ),
55);
56
57
58dimensionedScalar pMin
59(
60 "pMin",
61 dimPressure,
63);
64
65mesh.setFluxRequired(p_rgh.name());
66mesh.setFluxRequired(alpha1.name());
67
68
69#include "readGravitationalAcceleration.H"
70#include "readhRef.H"
71#include "gh.H"
72
73
74// Mass flux
75// Initialisation does not matter because rhoPhi is reset after the
76// alpha1 solution before it is used in the U equation.
77surfaceScalarField rhoPhi
78(
79 IOobject
80 (
81 "rhoPhi",
82 runTime.timeName(),
83 mesh,
84 IOobject::NO_READ,
85 IOobject::NO_WRITE
86 ),
87 fvc::interpolate(rho)*phi
88);
89
90volScalarField dgdt(alpha1*fvc::div(phi));
91
92#include "createAlphaFluxes.H"
93
94// Construct compressible turbulence model
95compressibleInterPhaseTransportModel turbulence
96(
97 rho,
98 U,
99 phi,
100 rhoPhi,
102 mixture
103);
104
105#include "createK.H"
106
107#include "createMRF.H"
108#include "createFvOptions.H"
109
110// Overset specific
111
112// Add solver-specific interpolations
113{
114 wordHashSet& nonInt =
115 const_cast<wordHashSet&>(Stencil::New(mesh).nonInterpolatedFields());
116
117 nonInt.insert("HbyA");
118 nonInt.insert("grad(p_rgh)");
119 nonInt.insert("nHat");
120 nonInt.insert("surfaceIntegrate(phi)");
121 nonInt.insert("surfaceIntegrate(phiHbyA)");
122 nonInt.insert("cellMask");
123 nonInt.insert("cellDisplacement");
124 nonInt.insert("interpolatedCells");
125 nonInt.insert("cellInterpolationWeight");
126 nonInt.insert("pcorr");
127}
128
129// Mask field for zeroing out contributions on hole cells
130#include "createCellMask.H"
131
132surfaceScalarField faceMask
133(
134 localMin<scalar>(mesh).interpolate(cellMask)
135);
136
137// Create bool field with interpolated cells
rhoPhi
Definition: rhoEqn.H:10
volScalarField & p_rgh
surfaceScalarField & phi
const volScalarField & alpha1
volScalarField & rho2
const volScalarField & alpha2
const dimensionedScalar & pMin
volScalarField & rho1
bool insert(const Key &key)
Insert a new entry, not overwriting existing entries.
Definition: HashSet.H:191
U
Definition: pEqn.H:72
alphaPhi10
Definition: alphaEqn.H:7
mesh interpolate(rAU)
Creates mask for blocked out cells.
dynamicFvMesh & mesh
engineTime & runTime
Creates mask for interpolated cells.
compressible::turbulenceModel & turbulence
surfaceScalarField faceMask(localMin< scalar >(mesh).interpolate(cellMask))
Info<< "Creating temperaturePhaseChangeTwoPhaseMixture\n"<< endl;autoPtr< temperaturePhaseChangeTwoPhaseMixture > mixture
Definition: createFields.H:39