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 
32 Info<< "Reading transportProperties\n" << endl;
33 immiscibleIncompressibleTwoPhaseMixture mixture(U, phi);
34 
35 volScalarField& alpha1(mixture.alpha1());
36 volScalarField& alpha2(mixture.alpha2());
37 
38 const dimensionedScalar& rho1 = mixture.rho1();
39 const dimensionedScalar& rho2 = mixture.rho2();
40 
41 
42 // Need to store rho for ddt(rho, U)
44 (
45  IOobject
46  (
47  "rho",
48  runTime.timeName(),
49  mesh,
50  IOobject::READ_IF_PRESENT
51  ),
52  alpha1*rho1 + alpha2*rho2,
53  alpha1.boundaryField().types()
54 );
55 rho.oldTime();
56 
57 
58 // Mass flux
60 (
61  IOobject
62  (
63  "rhoPhi",
64  runTime.timeName(),
65  mesh,
66  IOobject::NO_READ,
67  IOobject::NO_WRITE
68  ),
70 );
71 
72 
73 // Construct incompressible turbulence model
74 autoPtr<incompressible::turbulenceModel> turbulence
75 (
77 );
78 
79 
80 #include "readGravitationalAcceleration.H"
81 #include "readhRef.H"
82 #include "gh.H"
83 
84 
86 (
87  IOobject
88  (
89  "p",
90  runTime.timeName(),
91  mesh,
92  IOobject::NO_READ,
93  IOobject::AUTO_WRITE
94  ),
95  p_rgh + rho*gh
96 );
97 
98 label pRefCell = 0;
99 scalar pRefValue = 0.0;
101 (
102  p,
103  p_rgh,
104  pimple.dict(),
105  pRefCell,
106  pRefValue
107 );
108 
109 if (p_rgh.needReference())
110 {
112  (
113  "p",
114  p.dimensions(),
115  pRefValue - getRefCellValue(p, pRefCell)
116  );
117  p_rgh = p - rho*gh;
118 }
119 
120 mesh.setFluxRequired(p_rgh.name());
121 mesh.setFluxRequired(alpha1.name());
122 
123 // MULES flux from previous time-step
125 (
126  IOobject
127  (
128  "alphaPhi",
129  runTime.timeName(),
130  mesh,
131  IOobject::READ_IF_PRESENT,
132  IOobject::AUTO_WRITE
133  ),
135 );
136 
137 // MULES Correction
138 tmp<surfaceScalarField> talphaPhiCorr0;
tmp< surfaceScalarField > talphaPhiCorr0
Definition: createFields.H:138
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
tmp< surfaceScalarField > interpolate(const RhoType &rho)
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
surfaceScalarField alphaPhi(IOobject( "alphaPhi", runTime.timeName(), mesh, IOobject::READ_IF_PRESENT, IOobject::AUTO_WRITE ), phi *fvc::interpolate(alpha1))
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