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
33//- Overset specific
34
35// Add solver-specific interpolations
36{
37 wordHashSet& nonInt =
38 const_cast<wordHashSet&>(Stencil::New(mesh).nonInterpolatedFields());
39
40 nonInt.insert("HbyA");
41 nonInt.insert("grad(p_rgh)");
42 nonInt.insert("nHat");
43 nonInt.insert("surfaceIntegrate(phi)");
44 nonInt.insert("surfaceIntegrate(phiHbyA)");
45 nonInt.insert("cellMask");
46 nonInt.insert("cellDisplacement");
47 nonInt.insert("interpolatedCells");
48 nonInt.insert("cellInterpolationWeight");
49 nonInt.insert("pcorr");
50}
51
52
53// Mask field for zeroing out contributions on hole cells
54#include "createCellMask.H"
55
56// Create bool field with interpolated cells
58
59
60Info<< "Reading transportProperties\n" << endl;
61immiscibleIncompressibleTwoPhaseMixture mixture(U, phi);
62
65
66const dimensionedScalar& rho1 = mixture.rho1();
67const dimensionedScalar& rho2 = mixture.rho2();
68
69
70// Need to store rho for ddt(rho, U)
72(
73 IOobject
74 (
75 "rho",
76 runTime.timeName(),
77 mesh,
78 IOobject::READ_IF_PRESENT
79 ),
81);
82rho.oldTime();
83
84
85// Mass flux
87(
88 IOobject
89 (
90 "rhoPhi",
91 runTime.timeName(),
92 mesh,
93 IOobject::NO_READ,
94 IOobject::NO_WRITE
95 ),
96 fvc::interpolate(rho)*phi
97);
98
99
100// Construct incompressible turbulence model
101autoPtr<incompressible::turbulenceModel> turbulence
102(
103 incompressible::turbulenceModel::New(U, phi, mixture)
104);
105
106
107#include "readGravitationalAcceleration.H"
108#include "readhRef.H"
109#include "gh.H"
110
111
112volScalarField p
113(
114 IOobject
115 (
116 "p",
117 runTime.timeName(),
118 mesh,
119 IOobject::NO_READ,
120 IOobject::AUTO_WRITE
121 ),
122 p_rgh + rho*gh
123);
124
125label pRefCell = 0;
126scalar pRefValue = 0.0;
128(
129 p,
130 p_rgh,
131 pimple.dict(),
132 pRefCell,
134);
135
136if (p_rgh.needReference())
137{
138 p += dimensionedScalar
139 (
140 "p",
141 p.dimensions(),
142 pRefValue - getRefCellValue(p, pRefCell)
143 );
144 p_rgh = p - rho*gh;
145}
146
147mesh.setFluxRequired(p_rgh.name());
148mesh.setFluxRequired(alpha1.name());
149
150#include "createMRF.H"
rhoPhi
Definition: rhoEqn.H:10
volScalarField & p_rgh
surfaceScalarField & phi
const scalar pRefValue
const label pRefCell
const volScalarField & gh
pimpleControl & pimple
const volScalarField & alpha1
volScalarField & rho2
const volScalarField & alpha2
volScalarField & rho1
bool insert(const Key &key)
Insert a new entry, not overwriting existing entries.
Definition: HashSet.H:191
U
Definition: pEqn.H:72
volScalarField & p
Creates mask for blocked out cells.
dynamicFvMesh & mesh
engineTime & runTime
Creates mask for interpolated cells.
compressible::turbulenceModel & turbulence
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
GeometricField< scalar, fvPatchField, volMesh > volScalarField
Definition: volFieldsFwd.H:82
messageStream Info
Information stream (stdout output on master, null elsewhere)
GeometricField< scalar, fvsPatchField, surfaceMesh > surfaceScalarField
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:372
setRefCell(p, pimple.dict(), pRefCell, pRefValue)
Info<< "Creating temperaturePhaseChangeTwoPhaseMixture\n"<< endl;autoPtr< temperaturePhaseChangeTwoPhaseMixture > mixture
Definition: createFields.H:39