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 const dimensionedScalar& pSat = mixture->pSat();
42 
43 
44 // Need to store rho for ddt(rho, U)
46 (
47  IOobject
48  (
49  "rho",
50  runTime.timeName(),
51  mesh,
52  IOobject::READ_IF_PRESENT
53  ),
55  alpha1.boundaryField().types()
56 );
57 rho.oldTime();
58 
59 
60 // Construct interface from alpha1 distribution
61 interfaceProperties interface(alpha1, U, mixture());
62 
63 // Construct incompressible turbulence model
64 autoPtr<incompressible::turbulenceModel> turbulence
65 (
67 );
68 
69 
70 #include "readGravitationalAcceleration.H"
71 #include "readhRef.H"
72 #include "gh.H"
73 
74 
76 (
77  IOobject
78  (
79  "p",
80  runTime.timeName(),
81  mesh,
82  IOobject::NO_READ,
83  IOobject::AUTO_WRITE
84  ),
85  p_rgh + rho*gh
86 );
87 
89 scalar pRefValue = 0.0;
91 (
92  p,
93  p_rgh,
94  pimple.dict(),
95  pRefCell,
96  pRefValue
97 );
98 
99 if (p_rgh.needReference())
100 {
102  (
103  "p",
104  p.dimensions(),
106  );
107  p_rgh = p - rho*gh;
108 }
109 
110 mesh.setFluxRequired(p_rgh.name());
111 mesh.setFluxRequired(alpha1.name());
pRefCell
label pRefCell
Definition: createFields.H:112
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
interface
interfaceProperties interface(alpha1, U, mixture())
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
pSat
const dimensionedScalar & pSat
Definition: createFields.H:41
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
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