createFields.H
Go to the documentation of this file.
1 #include "createRDeltaT.H"
2 
3 Info<< "Reading field p_rgh\n" << endl;
5 (
6  IOobject
7  (
8  "p_rgh",
9  runTime.timeName(),
10  mesh,
11  IOobject::MUST_READ,
12  IOobject::AUTO_WRITE
13  ),
14  mesh
15 );
16 
17 Info<< "Reading field U\n" << endl;
19 (
20  IOobject
21  (
22  "U",
23  runTime.timeName(),
24  mesh,
25  IOobject::MUST_READ,
26  IOobject::AUTO_WRITE
27  ),
28  mesh
29 );
30 
31 #include "createPhi.H"
32 
33 
34 Info<< "Reading transportProperties\n" << endl;
35 immiscibleIncompressibleTwoPhaseMixture mixture(U, phi);
36 
37 volScalarField& alpha1(mixture.alpha1());
38 volScalarField& alpha2(mixture.alpha2());
39 
40 const dimensionedScalar& rho1 = mixture.rho1();
41 const dimensionedScalar& rho2 = mixture.rho2();
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 );
56 rho.oldTime();
57 
58 
59 // Mass flux
61 (
62  IOobject
63  (
64  "rhoPhi",
65  runTime.timeName(),
66  mesh,
67  IOobject::NO_READ,
68  IOobject::NO_WRITE
69  ),
71 );
72 
73 
74 typedef incompressibleInterPhaseTransportModel
75  <
76  immiscibleIncompressibleTwoPhaseMixture
78 
79 autoPtr<transportModelType> turbulence
80 (
82  (
83  rho, U, phi, rhoPhi, mixture
84  )
85 );
86 
87 
88 #include "readGravitationalAcceleration.H"
89 #include "readhRef.H"
90 #include "gh.H"
91 
92 
94 (
95  IOobject
96  (
97  "p",
98  runTime.timeName(),
99  mesh,
100  IOobject::NO_READ,
101  IOobject::AUTO_WRITE
102  ),
103  p_rgh + rho*gh
104 );
105 
106 label pRefCell = 0;
107 scalar pRefValue = 0.0;
109 (
110  p,
111  p_rgh,
112  pimple.dict(),
113  pRefCell,
114  pRefValue
115 );
116 
117 if (p_rgh.needReference())
118 {
120  (
121  "p",
122  p.dimensions(),
124  );
125  p_rgh = p - rho*gh;
126 }
127 
128 mesh.setFluxRequired(p_rgh.name());
129 mesh.setFluxRequired(alpha1.name());
130 
131 #include "createMRF.H"
132 #include "createFvOptions.H"
133 #include "createPorosity.H"
134 
135 isoAdvection advector(alpha1, phi, U);
const dimensionedScalar & rho1
Definition: createFields.H:46
isoAdvection advector(alpha1, phi, U)
static tmp< GeometricField< Type, faePatchField, edgeMesh > > interpolate(const GeometricField< Type, faPatchField, areaMesh > &tvf, const edgeScalarField &faceFlux, Istream &schemeData)
Interpolate field onto faces using scheme given by Istream.
Info<< "Creating temperaturePhaseChangeTwoPhaseMixture\"<< endl;autoPtr< temperaturePhaseChangeTwoPhaseMixture > mixture
Definition: createFields.H:39
engineTime & runTime
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:531
setRefCell(p, pimple.dict(), pRefCell, pRefValue)
volScalarField & alpha1(thermo->alpha1())
GeometricField< vector, fvPatchField, volMesh > volVectorField
Definition: volFieldsFwd.H:76
scalar getRefCellValue(const volScalarField &field, const label refCelli)
Return the current value of field in the reference cell.
Definition: findRefCell.C:127
p_rgh
Definition: createFields.H:95
GeometricField< scalar, fvPatchField, volMesh > volScalarField
Definition: volFieldsFwd.H:72
rho
Definition: createFields.H:81
dynamicFvMesh & mesh
Info<< "Reading field p_rgh\"<< endl;volScalarField p_rgh(IOobject("p_rgh", runTime.timeName(), mesh, IOobject::MUST_READ, IOobject::AUTO_WRITE), mesh);Info<< "Reading field U\"<< endl;volVectorField U(IOobject("U", runTime.timeName(), mesh, IOobject::MUST_READ, IOobject::AUTO_WRITE), mesh);Info<< "Reading transportProperties\"<< endl;immiscibleIncompressibleTwoPhaseMixture mixture(U, phi);volScalarField &alpha1(mixture.alpha1());volScalarField &alpha2(mixture.alpha2());const dimensionedScalar &rho1=mixture.rho1();const dimensionedScalar &rho2=mixture.rho2();volScalarField rho(IOobject("rho", runTime.timeName(), mesh, IOobject::READ_IF_PRESENT), alpha1 *rho1+alpha2 *rho2);rho.oldTime();surfaceScalarField rhoPhi(IOobject("rhoPhi", runTime.timeName(), mesh, IOobject::NO_READ, IOobject::NO_WRITE), fvc::interpolate(rho) *phi);typedef incompressibleInterPhaseTransportModel< immiscibleIncompressibleTwoPhaseMixture > transportModelType
Definition: createFields.H:76
volScalarField & alpha2(thermo->alpha2())
const dimensionedScalar & rho2
Definition: createFields.H:47
pimpleControl & pimple
Info<< "Reading field U\"<< endl;volVectorField U(IOobject("U", runTime.timeName(), mesh, IOobject::MUST_READ, IOobject::AUTO_WRITE), mesh);volScalarField rho(IOobject("rho", runTime.timeName(), mesh, IOobject::NO_READ, IOobject::AUTO_WRITE), thermo.rho());volVectorField rhoU(IOobject("rhoU", runTime.timeName(), mesh, IOobject::NO_READ, IOobject::NO_WRITE), rho *U);volScalarField rhoE(IOobject("rhoE", runTime.timeName(), mesh, IOobject::NO_READ, IOobject::NO_WRITE), rho *(e+0.5 *magSqr(U)));surfaceScalarField pos(IOobject("pos", runTime.timeName(), mesh), mesh, dimensionedScalar("pos", dimless, 1.0));surfaceScalarField neg(IOobject("neg", runTime.timeName(), mesh), mesh, dimensionedScalar("neg", dimless, -1.0));surfaceScalarField phi("phi", fvc::flux(rhoU));Info<< "Creating turbulence model\"<< endl;autoPtr< compressible::turbulenceModel > turbulence(compressible::turbulenceModel::New(rho, U, phi, thermo))
Definition: createFields.H:94
volScalarField & p
Definition: createFields.H:23
volVectorField U(IOobject("U", runTime.timeName(), mesh, IOobject::NO_READ, IOobject::NO_WRITE), mesh, dimensionedVector(dimVelocity, Zero))
label pRefCell
Definition: createFields.H:75
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
const volScalarField & gh
messageStream Info
Information stream (stdout output on master, null elsewhere)
surfaceScalarField & rhoPhi
Definition: createFields.H:119
GeometricField< scalar, fvsPatchField, surfaceMesh > surfaceScalarField
scalar pRefValue
Definition: createFields.H:76