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 
83 #include "readGravitationalAcceleration.H"
84 #include "readhRef.H"
85 #include "gh.H"
86 
87 
89 (
90  IOobject
91  (
92  "p",
93  runTime.timeName(),
94  mesh,
95  IOobject::NO_READ,
96  IOobject::AUTO_WRITE
97  ),
98  p_rgh + rho*gh
99 );
100 
102 scalar pRefValue = 0.0;
104 (
105  p,
106  p_rgh,
107  pimple.dict(),
108  pRefCell,
109  pRefValue
110 );
111 
112 if (p_rgh.needReference())
113 {
115  (
116  "p",
117  p.dimensions(),
119  );
120  p_rgh = p - rho*gh;
121 }
122 
123 mesh.setFluxRequired(p_rgh.name());
124 mesh.setFluxRequired(alpha2.name());
pRefCell
label pRefCell
Definition: createFields.H:112
rhoPhi
rhoPhi
Definition: rhoEqn.H:10
gh.H
rho1
const dimensionedScalar & rho1
Definition: createFields.H:39
pRefValue
scalar pRefValue
Definition: createFields.H:113
rho2
const dimensionedScalar & rho2
Definition: createFields.H:40
Foam::compressible::New
autoPtr< BasicCompressibleTurbulenceModel > New(const volScalarField &rho, const volVectorField &U, const surfaceScalarField &phi, const typename BasicCompressibleTurbulenceModel::transportModel &transport, const word &propertiesName)
Definition: turbulentFluidThermoModel.C:36
setRefCell
setRefCell(p, p_rgh, pimple.dict(), pRefCell, pRefValue)
phi
surfaceScalarField & phi
Definition: createFields.H:13
rho
rho
Definition: createFields.H:79
Foam::endl
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:251
mixture
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
Foam::label
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
turbulence
autoPtr< compressible::turbulenceModel > turbulence
Definition: createFields.H:23
Foam::Info
messageStream Info
Foam::dimensionedScalar
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
Definition: dimensionedScalarFwd.H:41
Foam::volScalarField
GeometricField< scalar, fvPatchField, volMesh > volScalarField
Definition: volFieldsFwd.H:52
p
volScalarField & p
Definition: createFields.H:51
mesh
dynamicFvMesh & mesh
Definition: createDynamicFvMesh.H:18
gh
const volScalarField & gh
Definition: setRegionFluidFields.H:34
alpha1
volScalarField & alpha1
Definition: createFields.H:15
Foam::volVectorField
GeometricField< vector, fvPatchField, volMesh > volVectorField
Definition: volFieldsFwd.H:55
Foam::getRefCellValue
scalar getRefCellValue(const volScalarField &field, const label refCelli)
Return the current value of field in the reference cell.
Definition: findRefCell.C:130
Foam::surfaceScalarField
GeometricField< scalar, fvsPatchField, surfaceMesh > surfaceScalarField
Definition: surfaceFieldsFwd.H:52
readhRef.H
pimple
const dictionary & pimple
Definition: readFluidMultiRegionPIMPLEControls.H:1
U
volVectorField U(IOobject("U", runTime.timeName(), mesh, IOobject::NO_READ, IOobject::AUTO_WRITE), Urel+SRF->U())
p_rgh
volScalarField & p_rgh
Definition: setRegionFluidFields.H:31
alpha2
volScalarField & alpha2
Definition: createFields.H:16