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<< "Creating phaseChangeTwoPhaseMixture\n" << endl;
33 autoPtr<phaseChangeTwoPhaseMixture> mixture =
35 
36 volScalarField& alpha1(mixture->alpha1());
37 volScalarField& alpha2(mixture->alpha2());
38 
39 const dimensionedScalar& rho1 = mixture->rho1();
40 const dimensionedScalar& rho2 = mixture->rho2();
41 
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
54 );
55 rho.oldTime();
56 
57 
58 // Construct interface from alpha1 distribution
59 interfaceProperties interface(alpha1, U, mixture());
60 
61 // Construct incompressible turbulence model
62 autoPtr<incompressible::turbulenceModel> turbulence
63 (
65 );
66 
67 
68 #include "readGravitationalAcceleration.H"
69 #include "readhRef.H"
70 #include "gh.H"
71 
72 
74 (
75  IOobject
76  (
77  "p",
78  runTime.timeName(),
79  mesh,
80  IOobject::NO_READ,
81  IOobject::AUTO_WRITE
82  ),
83  p_rgh + rho*gh
84 );
85 
86 label pRefCell = 0;
87 scalar pRefValue = 0.0;
89 (
90  p,
91  p_rgh,
92  pimple.dict(),
93  pRefCell,
94  pRefValue
95 );
96 
97 if (p_rgh.needReference())
98 {
100  (
101  "p",
102  p.dimensions(),
103  pRefValue - getRefCellValue(p, pRefCell)
104  );
105  p_rgh = p - rho*gh;
106 }
107 
108 mesh.setFluxRequired(p_rgh.name());
109 mesh.setFluxRequired(alpha1.name());
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)
interfaceProperties interface(alpha1, U, mixture())
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
const volScalarField & gh
volScalarField & alpha1(mixture->alpha1())
messageStream Info
scalar pRefValue
Definition: createFields.H:107