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 
32 Info<< "Creating phaseChangeTwoPhaseMixture\n" << endl;
33 autoPtr<phaseChangeTwoPhaseMixture> mixture =
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 
43 // Need to store rho for ddt(rho, U)
45 (
46  IOobject
47  (
48  "rho",
49  runTime.timeName(),
50  mesh,
51  IOobject::READ_IF_PRESENT
52  ),
54 );
55 rho.oldTime();
56 
57 
58 // Construct interface from alpha1 distribution
59 interfaceProperties interface(alpha1, U, mixture());
60 
61 // Construct incompressible turbulence model
62 autoPtr<incompressible::turbulenceModel> turbulence
63 (
65 );
66 
67 
68 #include "readGravitationalAcceleration.H"
69 #include "readhRef.H"
70 #include "gh.H"
71 
72 
74 (
75  IOobject
76  (
77  "p",
78  runTime.timeName(),
79  mesh,
80  IOobject::NO_READ,
81  IOobject::AUTO_WRITE
82  ),
83  p_rgh + rho*gh
84 );
85 
86 label pRefCell = 0;
87 scalar pRefValue = 0.0;
89 (
90  p,
91  p_rgh,
92  pimple.dict(),
93  pRefCell,
94  pRefValue
95 );
96 
97 if (p_rgh.needReference())
98 {
100  (
101  "p",
102  p.dimensions(),
104  );
105  p_rgh = p - rho*gh;
106 }
107 
108 mesh.setFluxRequired(p_rgh.name());
109 mesh.setFluxRequired(alpha1.name());
110 
111 #include "createFvOptions.H"
112 
113 IOobject alphaPhi10Header
114 (
115  IOobject::groupName("alphaPhi0", alpha1.group()),
116  runTime.timeName(),
117  mesh,
118  IOobject::NO_READ,
119  IOobject::NO_WRITE
120 );
121 
122 // MULES flux from previous time-step
124 (
127 );
128 
129 
130 // Overset specific
131 
132 // Add solver-specific interpolations
133 {
134  wordHashSet& nonInt =
135  const_cast<wordHashSet&>(Stencil::New(mesh).nonInterpolatedFields());
136 
137  nonInt.insert("HbyA");
138  nonInt.insert("grad(p_rgh)");
139  nonInt.insert("nHat");
140  nonInt.insert("surfaceIntegrate(phi)");
141  nonInt.insert("surfaceIntegrate(phiHbyA)");
142  nonInt.insert("cellMask");
143  nonInt.insert("cellDisplacement");
144  nonInt.insert("interpolatedCells");
145  nonInt.insert("cellInterpolationWeight");
146  nonInt.insert("pcorr");
147 }
148 
149 // Mask field for zeroing out contributions on hole cells
150 #include "createCellMask.H"
151 
153 (
154  localMin<scalar>(mesh).interpolate(cellMask)
155 );
156 
157 // Create bool field with interpolated cells
158 #include "createInterpolatedCells.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
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())
rho
rho
Definition: createFields.H:81
faceMask
surfaceScalarField faceMask(localMin< scalar >(mesh).interpolate(cellMask))
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)
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
alphaPhi10
surfaceScalarField alphaPhi10(alphaPhi10Header, phi *fvc::interpolate(alpha1))
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
createInterpolatedCells.H
Creates mask for interpolated cells.
Foam::surfaceScalarField
GeometricField< scalar, fvsPatchField, surfaceMesh > surfaceScalarField
Definition: surfaceFieldsFwd.H:54
readhRef.H
pRefCell
label pRefCell
Definition: createFields.H:75
Foam::HashSet::insert
bool insert(const Key &key)
Insert a new entry, not overwriting existing entries.
Definition: HashSet.H:191
createCellMask.H
Creates mask for blocked out cells.
pRefValue
scalar pRefValue
Definition: createFields.H:76
Foam::wordHashSet
HashSet< word, Hash< word > > wordHashSet
A HashSet of words, uses string hasher.
Definition: HashSet.H:77
alphaPhi10Header
IOobject alphaPhi10Header(IOobject::groupName("alphaPhi0", alpha1.group()), runTime.timeName(), mesh, IOobject::NO_READ, IOobject::NO_WRITE)
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.