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 autoPtr<twoPhaseChangeModel> phaseChangePtr
38 (
40 );
41 
42 volScalarField& alpha1(mixture.alpha1());
43 volScalarField& alpha2(mixture.alpha2());
44 
45 const dimensionedScalar& rho1 = mixture.rho1();
46 const dimensionedScalar& rho2 = mixture.rho2();
47 
48 
49 // Need to store rho for ddt(rho, U)
51 (
52  IOobject
53  (
54  "rho",
55  runTime.timeName(),
56  mesh,
57  IOobject::READ_IF_PRESENT
58  ),
59  alpha1*rho1 + alpha2*rho2
60 );
61 rho.oldTime();
62 
63 
64 // Construct incompressible turbulence model
65 autoPtr<incompressible::momentumTransportModel> turbulence
66 (
68 );
69 
70 
71 #include "readGravitationalAcceleration.H"
72 #include "readhRef.H"
73 #include "gh.H"
74 
75 
77 (
78  IOobject
79  (
80  "p",
81  runTime.timeName(),
82  mesh,
83  IOobject::NO_READ,
84  IOobject::AUTO_WRITE
85  ),
86  p_rgh + rho*gh
87 );
88 
90 
91 if (p_rgh.needReference())
92 {
94  (
95  "p",
96  p.dimensions(),
97  pressureReference.refValue()
98  - getRefCellValue(p, pressureReference.refCell())
99  );
100  p_rgh = p - rho*gh;
101 }
102 
103 mesh.setFluxRequired(p_rgh.name());
104 mesh.setFluxRequired(alpha1.name());
105 
106 #include "createMRF.H"
107 #include "createFvModels.H"
108 #include "createFvConstraints.H"
volScalarField & p_rgh
pimpleNoLoopControl & pimple
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<< "Constructing twoPhaseMixtureThermo\"<< endl;twoPhaseMixtureThermo mixture(U, phi);autoPtr< twoPhaseChangeModel > phaseChangePtr(twoPhaseChangeModel::New(mixture))
pressureReference pressureReference(mixture.p(), p_rgh, pimple.dict(), false)
engineTime & runTime
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:251
volScalarField & alpha1(mixture.alpha1())
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
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)
phi
Definition: correctPhi.H:3
volScalarField & alpha2(mixture.alpha2())
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 & 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.
const volScalarField & gh
messageStream Info