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 immiscibleIncompressibleThreePhaseMixture mixture(U, phi);
34 
35 volScalarField& alpha1(mixture.alpha1());
36 volScalarField& alpha2(mixture.alpha2());
37 volScalarField& alpha3(mixture.alpha3());
38 
39 const dimensionedScalar& rho1 = mixture.rho1();
40 const dimensionedScalar& rho2 = mixture.rho2();
41 const dimensionedScalar& rho3 = mixture.rho3();
42 
44 
45 // Need to store rho for ddt(rho, U)
47 (
48  IOobject
49  (
50  "rho",
51  runTime.timeName(),
52  mesh,
53  IOobject::READ_IF_PRESENT
54  ),
55  alpha1*rho1 + alpha2*rho2 + alpha3*rho3
56 );
57 rho.oldTime();
58 
59 
60 // Mass flux
61 // Initialisation does not matter because rhoPhi is reset after the
62 // alpha solution before it is used in the U equation.
64 (
65  IOobject
66  (
67  "rhoPhi",
68  runTime.timeName(),
69  mesh,
70  IOobject::NO_READ,
71  IOobject::NO_WRITE
72  ),
73  rho1*phi
74 );
75 
76 
77 // Construct incompressible turbulence model
78 autoPtr<incompressible::turbulenceModel> turbulence
79 (
81 );
82 
83 
84 #include "readGravitationalAcceleration.H"
85 #include "readhRef.H"
86 #include "gh.H"
87 
88 
90 (
91  IOobject
92  (
93  "p",
94  runTime.timeName(),
95  mesh,
96  IOobject::NO_READ,
97  IOobject::AUTO_WRITE
98  ),
99  p_rgh + rho*gh
100 );
101 
102 label pRefCell = 0;
103 scalar pRefValue = 0.0;
105 (
106  p,
107  p_rgh,
108  pimple.dict(),
109  pRefCell,
110  pRefValue
111 );
112 
113 if (p_rgh.needReference())
114 {
116  (
117  "p",
118  p.dimensions(),
119  pRefValue - getRefCellValue(p, pRefCell)
120  );
121  p_rgh = p - rho*gh;
122 }
123 
124 mesh.setFluxRequired(p_rgh.name());
125 mesh.setFluxRequired(alpha2.name());
126 
127 #include "createMRF.H"
128 #include "createFvOptions.H"
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Definition: label.H:59
pimpleNoLoopControl & pimple
surfaceScalarField & phi
volScalarField p_rgh(IOobject("p_rgh", runTime.timeName(), mesh, IOobject::MUST_READ, IOobject::AUTO_WRITE), mesh)
setRefCell(p, p_rgh, pimple.dict(), pRefCell, pRefValue)
const dimensionSet dimViscosity
engineTime & runTime
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:256
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(dimless, 1.0));surfaceScalarField neg(IOobject("neg", runTime.timeName(), mesh), mesh, dimensionedScalar(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
GeometricField< vector, fvPatchField, volMesh > volVectorField
Definition: volFieldsFwd.H:55
scalar getRefCellValue(const volScalarField &field, const label refCelli)
Return the current value of field in the reference cell.
Definition: findRefCell.C:136
tmp< DimensionedField< TypeR, GeoMesh > > New(const tmp< DimensionedField< TypeR, GeoMesh >> &tdf1, const word &name, const dimensionSet &dimensions)
GeometricField< scalar, fvPatchField, volMesh > volScalarField
Definition: volFieldsFwd.H:52
rho
Definition: createFields.H:81
dynamicFvMesh & mesh
volScalarField & alpha1(mixture.alpha1())
volScalarField & alpha2(mixture.alpha2())
volScalarField & p
Definition: createFields.H:23
volVectorField U(IOobject("U", runTime.timeName(), mesh, IOobject::NO_READ, IOobject::NO_WRITE), mesh, dimensionedVector(dimVelocity, Zero))
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
label pRefCell
Definition: createFields.H:106
rhoPhi
Definition: rhoEqn.H:10
const volScalarField & gh
messageStream Info
GeometricField< scalar, fvsPatchField, surfaceMesh > surfaceScalarField
phaseChangeTwoPhaseMixture & mixture
Definition: createFields.H:38
scalar pRefValue
Definition: createFields.H:107