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 
16 (
17  IOobject
18  (
19  "U",
20  runTime.timeName(),
21  mesh,
22  IOobject::NO_READ,
23  IOobject::AUTO_WRITE
24  ),
25  mesh,
27 );
28 
30 (
31  IOobject
32  (
33  "phi",
34  runTime.timeName(),
35  mesh,
36  IOobject::NO_READ,
37  IOobject::AUTO_WRITE
38  ),
39  mesh,
41 );
42 
43 multiphaseSystem fluid(U, phi);
44 
45 for (const phaseModel& phase : fluid.phases())
46 {
47  const volScalarField& alpha = phase;
48 
49  U += alpha*phase.U();
50  phi += fvc::interpolate(alpha)*phase.phi();
51 }
52 
53 
55 (
56  IOobject
57  (
58  "rho",
59  runTime.timeName(),
60  mesh,
61  IOobject::NO_READ,
62  IOobject::AUTO_WRITE
63  ),
64  fluid.rho()
65 );
66 
67 
68 // Construct incompressible turbulence model
69 autoPtr<incompressible::turbulenceModel> turbulence
70 (
72 );
73 
74 
75 #include "readGravitationalAcceleration.H"
76 #include "readhRef.H"
77 #include "gh.H"
78 
79 
81 (
82  IOobject
83  (
84  "p",
85  runTime.timeName(),
86  mesh,
87  IOobject::NO_READ,
88  IOobject::AUTO_WRITE
89  ),
90  p_rgh + rho*gh
91 );
92 
93 label pRefCell = 0;
94 scalar pRefValue = 0.0;
96 (
97  p,
98  p_rgh,
99  pimple.dict(),
100  pRefCell,
101  pRefValue
102 );
103 mesh.setFluxRequired(p_rgh.name());
104 
105 
106 #include "createMRFZones.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))
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
Foam::Zero
static constexpr const zero Zero
Global zero (0)
Definition: zero.H:131
Foam::dimVelocity
const dimensionSet dimVelocity
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
Foam::dimensionedVector
dimensioned< vector > dimensionedVector
Dimensioned vector obtained from generic dimensioned type.
Definition: dimensionedVector.H:50
pimple
pimpleControl & pimple
Definition: setRegionFluidFields.H:56
Foam::dimArea
const dimensionSet dimArea(sqr(dimLength))
Definition: dimensionSets.H:59
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
createMRFZones.H
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::surfaceScalarField
GeometricField< scalar, fvsPatchField, surfaceMesh > surfaceScalarField
Definition: surfaceFieldsFwd.H:54
readhRef.H
pRefCell
label pRefCell
Definition: createFields.H:75
alpha
volScalarField alpha(IOobject("alpha", runTime.timeName(), mesh, IOobject::READ_IF_PRESENT, IOobject::AUTO_WRITE), lambda *max(Ua &U, zeroSensitivity))
pRefValue
scalar pRefValue
Definition: createFields.H:76
fluid
multiphaseSystem & fluid
Definition: createFields.H:68
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.