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 // Note: construct T to be around before the thermos. The thermos will
30 // not update T.
31 Info<< "Reading field T\n" << endl;
33 (
34 IOobject
35 (
36 "T",
37 runTime.timeName(),
38 mesh,
39 IOobject::MUST_READ,
40 IOobject::AUTO_WRITE
41 ),
42 mesh
43 );
44
45
46 Info<< "Calculating field g.h\n" << endl;
47 #include "readGravitationalAcceleration.H"
48 #include "readhRef.H"
49 #include "gh.H"
50
52 (
53 IOobject
54 (
55 "p",
56 runTime.timeName(),
57 mesh,
58 IOobject::NO_READ,
59 IOobject::AUTO_WRITE
60 ),
61 p_rgh
62 );
63
64
65 Info<< "Creating multiphaseSystem\n" << endl;
66 autoPtr<multiphaseInter::multiphaseSystem> fluidPtr =
67 multiphaseInter::multiphaseSystem::New(mesh);
68
69 multiphaseInter::multiphaseSystem& fluid = fluidPtr();
70
71 if (!fluid.incompressible())
72 {
73 FatalError << "One or more phases are not incompressible. " << nl
74 << "This is a incompressible solver." << abort(FatalError);
75 }
76
77
78 // Need to store rho for ddt(rho, U)
79 volScalarField rho
80 (
81 IOobject
82 (
83 "rho",
84 runTime.timeName(),
85 mesh,
86 IOobject::NO_READ,
87 IOobject::AUTO_WRITE
88 ),
89 fluid.rho()
90 );
91 rho.oldTime();
92
93 // Update p using fluid.rho()
95
96 label pRefCell = 0;
97 scalar pRefValue = 0.0;
99 (
100 p,
101 p_rgh,
102 pimple.dict(),
103 pRefCell,
105 );
106
107 if (p_rgh.needReference())
108 {
109 p += dimensionedScalar
110 (
111 "p",
112 p.dimensions(),
113 pRefValue - getRefCellValue(p, pRefCell)
114 );
115 p_rgh = p - rho*gh;
116 }
117
118 // Mass flux
119 surfaceScalarField& rhoPhi = fluid.rhoPhi();
120
121 // Construct incompressible turbulence model
122 autoPtr
123 <
124 CompressibleTurbulenceModel<multiphaseInter::multiphaseSystem>
126 (
127 CompressibleTurbulenceModel<multiphaseInter::multiphaseSystem>::New
128 (
129 rho,
130 U,
131 rhoPhi,
132 fluid
133 )
134 );
135
136 fluid.setTurbulence(turbulence());
137
138 // Creating radiation model
139 autoPtr<radiation::radiationModel> radiation
140 (
141 radiation::radiationModel::New(T)
142 );
143
144 Info<< "Calculating field rhoCp\n" << endl;
145 volScalarField rhoCp
146 (
147 IOobject
148 (
149 "rhoCp",
150 runTime.timeName(),
151 mesh,
152 IOobject::NO_READ,
153 IOobject::NO_WRITE
154 ),
155 fluid.rho()*fluid.Cp()
156 );
157 rhoCp.oldTime();
158
159
160 Info<< "Creating field kinetic energy K\n" << endl;
161 volScalarField K("K", 0.5*magSqr(U));
CGAL::Exact_predicates_exact_constructions_kernel K
rhoPhi
Definition: rhoEqn.H:10
volScalarField & p_rgh
const scalar pRefValue
const label pRefCell
const volScalarField & gh
pimpleControl & pimple
twoPhaseSystem & fluid
U
Definition: pEqn.H:72
volScalarField & p
const volScalarField & T
dynamicFvMesh & mesh
engineTime & runTime
compressible::turbulenceModel & turbulence
rhoCp
Definition: TEqn.H:3
GeometricField< vector, fvPatchField, volMesh > volVectorField
Definition: volFieldsFwd.H:83
GeometricField< scalar, fvPatchField, volMesh > volScalarField
Definition: volFieldsFwd.H:82
messageStream Info
Information stream (stdout output on master, null elsewhere)
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:372
setRefCell(p, pimple.dict(), pRefCell, pRefValue)
Info<< "Reading field p_rgh\n"<< endl;volScalarField p_rgh(IOobject("p_rgh", runTime.timeName(), mesh, IOobject::MUST_READ, IOobject::AUTO_WRITE), mesh);Info<< "Reading field U\n"<< endl;volVectorField U(IOobject("U", runTime.timeName(), mesh, IOobject::MUST_READ, IOobject::AUTO_WRITE), mesh);Info<< "Reading field T\n"<< endl;volScalarField T(IOobject("T", runTime.timeName(), mesh, IOobject::MUST_READ, IOobject::AUTO_WRITE), mesh);Info<< "Calculating field g.h\n"<< endl;volScalarField p(IOobject("p", runTime.timeName(), mesh, IOobject::NO_READ, IOobject::AUTO_WRITE), p_rgh);Info<< "Creating multiphaseSystem\n"<< endl;autoPtr< multiphaseInter::multiphaseSystem > fluidPtr
Definition: createFields.H:66
autoPtr< radiation::radiationModel > radiation(radiation::radiationModel::New(T))