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 //- 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 
60 Info<< "Reading transportProperties\n" << endl;
61 immiscibleIncompressibleTwoPhaseMixture mixture(U, phi);
62 
63 volScalarField& alpha1(mixture.alpha1());
64 volScalarField& alpha2(mixture.alpha2());
65 
66 const dimensionedScalar& rho1 = mixture.rho1();
67 const 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 );
82 rho.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  ),
97 );
98 
99 
100 // Construct incompressible turbulence model
101 autoPtr<incompressible::turbulenceModel> turbulence
102 (
104 );
105 
106 
107 #include "readGravitationalAcceleration.H"
108 #include "readhRef.H"
109 #include "gh.H"
110 
111 
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 
125 label pRefCell = 0;
126 scalar pRefValue = 0.0;
128 (
129  p,
130  p_rgh,
131  pimple.dict(),
132  pRefCell,
133  pRefValue
134 );
135 
136 if (p_rgh.needReference())
137 {
139  (
140  "p",
141  p.dimensions(),
143  );
144  p_rgh = p - rho*gh;
145 }
146 
147 mesh.setFluxRequired(p_rgh.name());
148 mesh.setFluxRequired(alpha1.name());
149 
150 #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
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
alpha1
volScalarField & alpha1(thermo->alpha1())
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
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
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.