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 immiscibleIncompressibleThreePhaseMixture mixture(U, phi);
34 
35 volScalarField& alpha1(mixture.alpha1());
36 volScalarField& alpha2(mixture.alpha2());
37 volScalarField& alpha3(mixture.alpha3());
38 
39 const dimensionedScalar& rho1 = mixture.rho1();
40 const dimensionedScalar& rho2 = mixture.rho2();
41 const dimensionedScalar& rho3 = mixture.rho3();
42 
43 dimensionedScalar D23("D23", dimViscosity, mixture);
44 
45 // Need to store rho for ddt(rho, U)
47 (
48  IOobject
49  (
50  "rho",
51  runTime.timeName(),
52  mesh,
53  IOobject::READ_IF_PRESENT
54  ),
55  alpha1*rho1 + alpha2*rho2 + alpha3*rho3
56 );
57 rho.oldTime();
58 
59 
60 // Mass flux
61 // Initialisation does not matter because rhoPhi is reset after the
62 // alpha solution before it is used in the U equation.
64 (
65  IOobject
66  (
67  "rhoPhi",
68  runTime.timeName(),
69  mesh,
70  IOobject::NO_READ,
71  IOobject::NO_WRITE
72  ),
73  rho1*phi
74 );
75 
76 
77 // Construct incompressible turbulence model
78 autoPtr<incompressible::momentumTransportModel> turbulence
79 (
81 );
82 
83 
84 #include "readGravitationalAcceleration.H"
85 #include "readhRef.H"
86 #include "gh.H"
87 
88 
90 (
91  IOobject
92  (
93  "p",
94  runTime.timeName(),
95  mesh,
96  IOobject::NO_READ,
97  IOobject::AUTO_WRITE
98  ),
99  p_rgh + rho*gh
100 );
101 
103 
104 if (p_rgh.needReference())
105 {
107  (
108  "p",
109  p.dimensions(),
110  pressureReference.refValue()
111  - getRefCellValue(p, pressureReference.refCell())
112  );
113  p_rgh = p - rho*gh;
114 }
115 
116 mesh.setFluxRequired(p_rgh.name());
117 mesh.setFluxRequired(alpha2.name());
118 
119 #include "createMRF.H"
120 #include "createFvModels.H"
121 #include "createFvConstraints.H"
const dimensionSet dimViscosity
volScalarField & p_rgh
pimpleNoLoopControl & pimple
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.
surfaceScalarField rhoPhi(IOobject("rhoPhi", runTime.timeName(), mesh, IOobject::NO_READ, IOobject::NO_WRITE), fvc::interpolate(rho) *phi)
const volScalarField & gh
messageStream Info
GeometricField< scalar, fvsPatchField, surfaceMesh > surfaceScalarField