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 immiscibleIncompressibleThreePhaseMixture mixture(U, phi);
32 
33 volScalarField& alpha1(mixture.alpha1());
34 volScalarField& alpha2(mixture.alpha2());
35 volScalarField& alpha3(mixture.alpha3());
36 
37 const dimensionedScalar& rho1 = mixture.rho1();
38 const dimensionedScalar& rho2 = mixture.rho2();
39 const dimensionedScalar& rho3 = mixture.rho3();
40 
41 dimensionedScalar D23(mixture.lookup("D23"));
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  ),
53  alpha1*rho1 + alpha2*rho2 + alpha3*rho3
54 );
55 rho.oldTime();
56 
57 
58 // Mass flux
59 // Initialisation does not matter because rhoPhi is reset after the
60 // alpha solution before it is used in the U equation.
62 (
63  IOobject
64  (
65  "rhoPhi",
66  runTime.timeName(),
67  mesh,
68  IOobject::NO_READ,
69  IOobject::NO_WRITE
70  ),
71  rho1*phi
72 );
73 
74 
75 // Construct incompressible turbulence model
76 autoPtr<incompressible::turbulenceModel> turbulence
77 (
79 );
80 
81 
82 #include "readGravitationalAcceleration.H"
83 #include "readhRef.H"
84 #include "gh.H"
85 
86 
88 (
89  IOobject
90  (
91  "p",
92  runTime.timeName(),
93  mesh,
94  IOobject::NO_READ,
95  IOobject::AUTO_WRITE
96  ),
97  p_rgh + rho*gh
98 );
99 
100 label pRefCell = 0;
101 scalar pRefValue = 0.0;
103 (
104  p,
105  p_rgh,
106  pimple.dict(),
107  pRefCell,
108  pRefValue
109 );
110 
111 if (p_rgh.needReference())
112 {
114  (
115  "p",
116  p.dimensions(),
117  pRefValue - getRefCellValue(p, pRefCell)
118  );
119  p_rgh = p - rho*gh;
120 }
121 
122 mesh.setFluxRequired(p_rgh.name());
123 mesh.setFluxRequired(alpha2.name());
124 
125 #include "createMRF.H"
autoPtr< compressible::turbulenceModel > turbulence
Definition: createFields.H:23
surfaceScalarField & phi
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
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 dictionary & pimple
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:253
volScalarField & alpha2(mixture->alpha2())
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:130
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
volVectorField U(IOobject("U", runTime.timeName(), runTime, IOobject::NO_READ, IOobject::NO_WRITE), mesh, dimensionedVector("zero", dimVelocity, Zero))
Info<< "Reading field p_rgh\n"<< endl;volScalarField p_rgh(IOobject("p_rgh", runTime.timeName(), mesh, IOobject::MUST_READ, IOobject::AUTO_WRITE), mesh);Info<< "Reading field U\n"<< endl;volVectorField U(IOobject("U", runTime.timeName(), mesh, IOobject::MUST_READ, IOobject::AUTO_WRITE), mesh);Info<< "Creating phaseChangeTwoPhaseMixture\n"<< endl;autoPtr< phaseChangeTwoPhaseMixture > mixture
Definition: createFields.H:33
volScalarField & p
Definition: createFields.H:23
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
label pRefCell
Definition: createFields.H:106
rhoPhi
Definition: rhoEqn.H:10
const volScalarField & gh
volScalarField & alpha1(mixture->alpha1())
messageStream Info
GeometricField< scalar, fvsPatchField, surfaceMesh > surfaceScalarField
scalar pRefValue
Definition: createFields.H:107