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  alpha1.boundaryField().types()
55 );
56 rho.oldTime();
57 
58 
59 // Mass flux
60 // Initialisation does not matter because rhoPhi is reset after the
61 // alpha solution before it is used in the U equation.
63 (
64  IOobject
65  (
66  "rhoPhi",
67  runTime.timeName(),
68  mesh,
69  IOobject::NO_READ,
70  IOobject::NO_WRITE
71  ),
72  rho1*phi
73 );
74 
75 
76 // Construct incompressible turbulence model
77 autoPtr<incompressible::turbulenceModel> turbulence
78 (
80 );
81 
82 #include "readGravitationalAcceleration.H"
83 #include "readhRef.H"
84 #include "gh.H"
85 
87 (
88  IOobject
89  (
90  "p",
91  runTime.timeName(),
92  mesh,
93  IOobject::NO_READ,
94  IOobject::AUTO_WRITE
95  ),
96  p_rgh + rho*gh
97 );
98 
99 label pRefCell = 0;
100 scalar pRefValue = 0.0;
102 (
103  p,
104  p_rgh,
105  pimple.dict(),
106  pRefCell,
107  pRefValue
108 );
109 
110 if (p_rgh.needReference())
111 {
113  (
114  "p",
115  p.dimensions(),
116  pRefValue - getRefCellValue(p, pRefCell)
117  );
118  p_rgh = p - rho*gh;
119 }
120 
121 mesh.setFluxRequired(p_rgh.name());
122 mesh.setFluxRequired(alpha2.name());
scalar pRefValue
Definition: createFields.H:113
volVectorField U(IOobject( "U", runTime.timeName(), runTime, IOobject::NO_READ, IOobject::NO_WRITE ), mesh, dimensionedVector("zero", dimVelocity, vector::zero), p.boundaryField().types())
surfaceScalarField & phi
Definition: createFields.H:13
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
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
setRefCell(p, p_rgh, pimple.dict(), pRefCell, pRefValue)
volScalarField & p_rgh
messageStream Info
autoPtr< compressible::turbulenceModel > turbulence
Definition: createFields.H:23
dynamicFvMesh & mesh
rhoPhi
Definition: rhoEqn.H:10
const dictionary & pimple
autoPtr< BasicCompressibleTurbulenceModel > New(const volScalarField &rho, const volVectorField &U, const surfaceScalarField &phi, const typename BasicCompressibleTurbulenceModel::transportModel &transport, const word &propertiesName)
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:251
GeometricField< scalar, fvPatchField, volMesh > volScalarField
Definition: volFieldsFwd.H:52
volScalarField & p
Definition: createFields.H:51
GeometricField< scalar, fvsPatchField, surfaceMesh > surfaceScalarField
volScalarField & alpha2
Definition: createFields.H:16
rho
Definition: createFields.H:79
volScalarField & alpha1
Definition: createFields.H:15
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:154
label pRefCell
Definition: createFields.H:112
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
const volScalarField & gh