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 Info<< "Reading transportProperties\n" << endl;
32 incompressibleTwoPhaseMixture mixture(U, phi);
33 
34 volScalarField& alpha1(mixture.alpha1());
35 volScalarField& alpha2(mixture.alpha2());
36 
37 const dimensionedScalar& rho1 = mixture.rho1();
38 const dimensionedScalar& rho2 = mixture.rho2();
39 
41 
42 // Read the reciprocal of the turbulent Schmidt number
43 dimensionedScalar alphatab("alphatab", dimless, mixture);
44 
45 // Need to store rho for ddt(rho, U)
47 rho.oldTime();
48 
49 
50 // Mass flux
51 // Initialisation does not matter because rhoPhi is reset after the
52 // alpha1 solution before it is used in the U equation.
54 (
55  IOobject
56  (
57  "rhoPhi",
58  runTime.timeName(),
59  mesh,
60  IOobject::NO_READ,
61  IOobject::NO_WRITE
62  ),
63  rho1*phi
64 );
65 
66 // Construct incompressible turbulence model
67 autoPtr<incompressible::turbulenceModel> turbulence
68 (
70 );
71 
72 
73 #include "readGravitationalAcceleration.H"
74 #include "readhRef.H"
75 #include "gh.H"
76 
77 
79 (
80  IOobject
81  (
82  "p",
83  runTime.timeName(),
84  mesh,
85  IOobject::NO_READ,
86  IOobject::AUTO_WRITE
87  ),
88  p_rgh + rho*gh
89 );
90 
92 scalar pRefValue = 0.0;
94 (
95  p,
96  p_rgh,
97  pimple.dict(),
98  pRefCell,
99  pRefValue
100 );
101 
102 if (p_rgh.needReference())
103 {
105  (
106  "p",
107  p.dimensions(),
109  );
110  p_rgh = p - rho*gh;
111 }
112 
113 mesh.setFluxRequired(p_rgh.name());
114 mesh.setFluxRequired(alpha1.name());
pRefCell
label pRefCell
Definition: createFields.H:112
rhoPhi
rhoPhi
Definition: rhoEqn.H:10
gh.H
rho1
const dimensionedScalar & rho1
Definition: createFields.H:39
Foam::dimless
const dimensionSet dimless(0, 0, 0, 0, 0, 0, 0)
Definition: dimensionSets.H:47
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
Foam::dimViscosity
const dimensionSet dimViscosity
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