createFields.H
Go to the documentation of this file.
1 #include "readGravitationalAcceleration.H"
2 #include "readhRef.H"
3 
4 Info<< "Creating twoPhaseSystem\n" << endl;
5 
6 twoPhaseSystem fluid(mesh, g);
7 
8 phaseModel& phase1 = fluid.phase1();
9 phaseModel& phase2 = fluid.phase2();
10 
13 
14 volVectorField& U1 = phase1.U();
16 surfaceScalarField& alphaPhi1 = phase1.alphaPhi();
17 surfaceScalarField& alphaRhoPhi1 = phase1.alphaRhoPhi();
18 
19 volVectorField& U2 = phase2.U();
21 surfaceScalarField& alphaPhi2 = phase2.alphaPhi();
22 surfaceScalarField& alphaRhoPhi2 = phase2.alphaRhoPhi();
23 
25 
27 (
28  "pMin",
30  fluid
31 );
32 
33 #include "gh.H"
34 
35 rhoThermo& thermo1 = phase1.thermo();
36 rhoThermo& thermo2 = phase2.thermo();
37 
38 volScalarField& p = thermo1.p();
39 
40 volScalarField& rho1 = thermo1.rho();
41 const volScalarField& psi1 = thermo1.psi();
42 
43 volScalarField& rho2 = thermo2.rho();
44 const volScalarField& psi2 = thermo2.psi();
45 
46 Info<< "Reading field p_rgh\n" << endl;
48 (
49  IOobject
50  (
51  "p_rgh",
52  runTime.timeName(),
53  mesh,
54  IOobject::MUST_READ,
55  IOobject::AUTO_WRITE
56  ),
57  mesh
58 );
59 
61 (
62  IOobject
63  (
64  "U",
65  runTime.timeName(),
66  mesh,
67  IOobject::NO_READ,
68  IOobject::AUTO_WRITE
69  ),
70  fluid.U()
71 );
72 
73 label pRefCell = 0;
74 scalar pRefValue = 0.0;
76 (
77  p,
78  p_rgh,
79  pimple.dict(),
80  pRefCell,
81  pRefValue
82 );
83 mesh.setFluxRequired(p_rgh.name());
84 mesh.setFluxRequired(alpha1.name());
85 
86 Info<< "Creating field dpdt\n" << endl;
88 (
89  IOobject
90  (
91  "dpdt",
92  runTime.timeName(),
93  mesh
94  ),
95  mesh,
96  dimensionedScalar("dpdt", p.dimensions()/dimTime, 0)
97 );
98 
99 
100 Info<< "Creating field kinetic energy K\n" << endl;
101 volScalarField K1(IOobject::groupName("K", phase1.name()), 0.5*magSqr(U1));
102 volScalarField K2(IOobject::groupName("K", phase2.name()), 0.5*magSqr(U2));
pRefCell
label pRefCell
Definition: createFields.H:112
U2
volVectorField & U2
Definition: createFields.H:23
Foam::dimPressure
const dimensionSet dimPressure
gh.H
rho1
const dimensionedScalar & rho1
Definition: createFields.H:39
thermo2
rhoThermo & thermo2
Definition: createFields.H:40
pRefValue
scalar pRefValue
Definition: createFields.H:113
rho2
const dimensionedScalar & rho2
Definition: createFields.H:40
K1
#define K1
Definition: SHA1.C:169
phi1
surfaceScalarField & phi1
Definition: createFields.H:19
fluid
multiphaseSystem & fluid
Definition: createFields.H:10
pMin
dimensionedScalar pMin("pMin", dimPressure, fluid)
setRefCell
setRefCell(p, p_rgh, pimple.dict(), pRefCell, pRefValue)
phi
surfaceScalarField & phi
Definition: createFields.H:13
g
const dimensionedVector & g
Definition: setRegionFluidFields.H:33
Foam::endl
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:251
alphaPhi1
surfaceScalarField & alphaPhi1
Definition: createFields.H:20
dpdt
volScalarField & dpdt
Definition: setRegionFluidFields.H:12
phi2
surfaceScalarField & phi2
Definition: createFields.H:24
psi2
const volScalarField & psi2
Definition: createFields.H:48
Foam::dimTime
const dimensionSet dimTime(0, 0, 1, 0, 0, 0, 0)
Definition: dimensionSets.H:51
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
Foam::Info
messageStream Info
Foam::dimensionedScalar
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
Definition: dimensionedScalarFwd.H:41
thermo1
rhoThermo & thermo1
Definition: createFields.H:39
Foam::volScalarField
GeometricField< scalar, fvPatchField, volMesh > volScalarField
Definition: volFieldsFwd.H:52
K2
#define K2
Definition: SHA1.C:170
p
volScalarField & p
Definition: createFields.H:51
mesh
dynamicFvMesh & mesh
Definition: createDynamicFvMesh.H:18
U1
volVectorField & U1
Definition: createFields.H:18
alpha1
volScalarField & alpha1
Definition: createFields.H:15
Foam::volVectorField
GeometricField< vector, fvPatchField, volMesh > volVectorField
Definition: volFieldsFwd.H:55
alphaRhoPhi1
surfaceScalarField & alphaRhoPhi1
Definition: createFields.H:21
Foam::surfaceScalarField
GeometricField< scalar, fvsPatchField, surfaceMesh > surfaceScalarField
Definition: surfaceFieldsFwd.H:52
readhRef.H
alphaRhoPhi2
surfaceScalarField & alphaRhoPhi2
Definition: createFields.H:26
phase2
phaseModel & phase2
Definition: createFields.H:13
alphaPhi2
surfaceScalarField & alphaPhi2
Definition: createFields.H:25
pimple
const dictionary & pimple
Definition: readFluidMultiRegionPIMPLEControls.H:1
psi1
const volScalarField & psi1
Definition: createFields.H:45
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
Foam::magSqr
dimensioned< scalar > magSqr(const dimensioned< Type > &)
phase1
phaseModel & phase1
Definition: createFields.H:12