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(nHatf)");
44  nonInt.insert("surfaceIntegrate(phi+meshPhi)");
45  nonInt.insert("surfaceIntegrate(phi)");
46  nonInt.insert("surfaceIntegrate(phiHbyA)");
47  nonInt.insert("surfaceSum(((S|magSf)*S)");
48  nonInt.insert("surfaceIntegrate(((rAUf*magSf)*snGradCorr(p_rgh)))");
49  nonInt.insert("cellMask");
50  nonInt.insert("cellDisplacement");
51  nonInt.insert("interpolatedCells");
52  nonInt.insert("cellInterpolationWeight");
53  nonInt.insert("pcorr");
54 }
55 
56 
57 // Mask field for zeroing out contributions on hole cells
58 #include "createCellMask.H"
59 
60 // Create bool field with interpolated cells
62 
63 
64 Info<< "Reading transportProperties\n" << endl;
65 immiscibleIncompressibleTwoPhaseMixture mixture(U, phi);
66 
67 volScalarField& alpha1(mixture.alpha1());
68 volScalarField& alpha2(mixture.alpha2());
69 
70 const dimensionedScalar& rho1 = mixture.rho1();
71 const dimensionedScalar& rho2 = mixture.rho2();
72 
73 
74 // Need to store rho for ddt(rho, U)
76 (
77  IOobject
78  (
79  "rho",
80  runTime.timeName(),
81  mesh,
82  IOobject::READ_IF_PRESENT
83  ),
85 );
86 rho.oldTime();
87 
88 
89 // Mass flux
91 (
92  IOobject
93  (
94  "rhoPhi",
95  runTime.timeName(),
96  mesh,
97  IOobject::NO_READ,
98  IOobject::NO_WRITE
99  ),
101 );
102 
103 
104 // Construct incompressible turbulence model
105 autoPtr<incompressible::turbulenceModel> turbulence
106 (
108 );
109 
110 
111 #include "readGravitationalAcceleration.H"
112 #include "readhRef.H"
113 #include "gh.H"
114 
115 
117 (
118  IOobject
119  (
120  "p",
121  runTime.timeName(),
122  mesh,
123  IOobject::NO_READ,
124  IOobject::AUTO_WRITE
125  ),
126  p_rgh + rho*gh
127 );
128 
129 label pRefCell = 0;
130 scalar pRefValue = 0.0;
132 (
133  p,
134  p_rgh,
135  pimple.dict(),
136  pRefCell,
137  pRefValue
138 );
139 
140 if (p_rgh.needReference())
141 {
143  (
144  "p",
145  p.dimensions(),
147  );
148  p_rgh = p - rho*gh;
149 }
150 
151 mesh.setFluxRequired(p_rgh.name());
152 mesh.setFluxRequired(alpha1.name());
153 
154 #include "createMRF.H"
const dimensionedScalar & rho1
Definition: createFields.H:46
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())
GeometricField< vector, fvPatchField, volMesh > volVectorField
Definition: volFieldsFwd.H:76
bool insert(const Key &key)
Insert a new entry, not overwriting existing entries.
Definition: HashSet.H:232
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:72
rho
Definition: createFields.H:81
dynamicFvMesh & mesh
volScalarField & alpha2(thermo->alpha2())
HashSet< word, Hash< word > > wordHashSet
A HashSet of words, uses string hasher.
Definition: HashSet.H:73
const dimensionedScalar & rho2
Definition: createFields.H:47
pimpleControl & pimple
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
Creates mask for interpolated cells.
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.
const volScalarField & gh
Creates mask for blocked out cells.
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