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> mixturePtr
34 (
36 );
37 
38 phaseChangeTwoPhaseMixture& mixture = mixturePtr();
39 
40 volScalarField& alpha1(mixture.alpha1());
41 volScalarField& alpha2(mixture.alpha2());
42 
43 const dimensionedScalar& rho1 = mixture.rho1();
44 const dimensionedScalar& rho2 = mixture.rho2();
45 
46 
47 // Need to store rho for ddt(rho, U)
49 (
50  IOobject
51  (
52  "rho",
53  runTime.timeName(),
54  mesh,
55  IOobject::READ_IF_PRESENT
56  ),
57  alpha1*rho1 + alpha2*rho2
58 );
59 rho.oldTime();
60 
61 
62 // Construct incompressible turbulence model
63 autoPtr<incompressible::momentumTransportModel> turbulence
64 (
66 );
67 
68 
69 #include "readGravitationalAcceleration.H"
70 #include "readhRef.H"
71 #include "gh.H"
72 
73 
75 (
76  IOobject
77  (
78  "p",
79  runTime.timeName(),
80  mesh,
81  IOobject::NO_READ,
82  IOobject::AUTO_WRITE
83  ),
84  p_rgh + rho*gh
85 );
86 
87 label pRefCell = 0;
88 scalar pRefValue = 0.0;
90 (
91  p,
92  p_rgh,
93  pimple.dict(),
94  pRefCell,
95  pRefValue
96 );
97 
98 if (p_rgh.needReference())
99 {
101  (
102  "p",
103  p.dimensions(),
104  pRefValue - getRefCellValue(p, pRefCell)
105  );
106  p_rgh = p - rho*gh;
107 }
108 
109 mesh.setFluxRequired(p_rgh.name());
110 mesh.setFluxRequired(alpha1.name());
111 
112 #include "createFvOptions.H"
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
pimpleNoLoopControl & pimple
volScalarField p_rgh(IOobject("p_rgh", runTime.timeName(), mesh, IOobject::MUST_READ, IOobject::AUTO_WRITE), mesh)
setRefCell(p, p_rgh, pimple.dict(), pRefCell, pRefValue)
engineTime & runTime
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:251
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<< "Creating phaseChangeTwoPhaseMixture\"<< endl;autoPtr< phaseChangeTwoPhaseMixture > mixturePtr(phaseChangeTwoPhaseMixture::New(U, phi))
GeometricField< vector, fvPatchField, volMesh > volVectorField
Definition: volFieldsFwd.H:58
scalar getRefCellValue(const volScalarField &field, const label refCelli)
Return the current value of field in the reference cell.
Definition: findRefCell.C:136
phi
Definition: pEqn.H:104
GeometricField< scalar, fvPatchField, volMesh > volScalarField
Definition: volFieldsFwd.H:57
rho
Definition: createFields.H:81
dynamicFvMesh & mesh
autoPtr< BasicCompressibleMomentumTransportModel > New(const volScalarField &rho, const volVectorField &U, const surfaceScalarField &phi, const typename BasicCompressibleMomentumTransportModel::transportModel &transport)
volScalarField & alpha1(mixture.alpha1())
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(dimless, 1.0));surfaceScalarField neg(IOobject("neg", runTime.timeName(), mesh), mesh, dimensionedScalar(dimless, -1.0));surfaceScalarField phi("phi", fvc::flux(rhoU));Info<< "Creating turbulence model\"<< endl;autoPtr< compressible::momentumTransportModel > turbulence(compressible::momentumTransportModel::New(rho, U, phi, thermo))
Definition: createFields.H:94
volScalarField & alpha2(mixture.alpha2())
volScalarField & p
Definition: createFields.H:23
volVectorField U(IOobject("U", runTime.timeName(), mesh, IOobject::NO_READ, IOobject::NO_WRITE), mesh, dimensionedVector(dimVelocity, Zero))
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
label pRefCell
Definition: createFields.H:106
const volScalarField & gh
messageStream Info
scalar pRefValue
Definition: createFields.H:107