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 =
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)
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()
94  p = p_rgh + rho*gh;
95 
96  label pRefCell = 0;
97  scalar pRefValue = 0.0;
99  (
100  p,
101  p_rgh,
102  pimple.dict(),
103  pRefCell,
104  pRefValue
105  );
106 
107  if (p_rgh.needReference())
108  {
110  (
111  "p",
112  p.dimensions(),
114  );
115  p_rgh = p - rho*gh;
116  }
117 
118  // Mass flux
120 
121  // Construct incompressible turbulence model
122  autoPtr
123  <
124  CompressibleTurbulenceModel<multiphaseInter::multiphaseSystem>
125  > turbulence
126  (
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  (
142  );
143 
144  Info<< "Calculating field rhoCp\n" << endl;
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));
error FatalError
Error stream (stdout output on all processes), with additional &#39;FOAM FATAL ERROR&#39; header text and sta...
constexpr char nl
The newline &#39;\n&#39; character (0x0a)
Definition: Ostream.H:49
engineTime & runTime
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:487
multiphaseInter::multiphaseSystem & fluid
Definition: createFields.H:69
setRefCell(p, pimple.dict(), pRefCell, pRefValue)
tmp< DimensionedField< TypeR, GeoMesh > > New(const tmp< DimensionedField< TypeR, GeoMesh >> &tf1, const word &name, const dimensionSet &dimensions, const bool initCopy=false)
Global function forwards to reuseTmpDimensionedField::New.
GeometricField< vector, fvPatchField, volMesh > volVectorField
Definition: volFieldsFwd.H:82
scalar getRefCellValue(const volScalarField &field, const label refCelli)
Return the current value of field in the reference cell.
Definition: findRefCell.C:127
CGAL::Exact_predicates_exact_constructions_kernel K
p_rgh
Definition: createFields.H:95
GeometricField< scalar, fvPatchField, volMesh > volScalarField
Definition: volFieldsFwd.H:81
rho
Definition: createFields.H:81
dynamicFvMesh & mesh
errorManip< error > abort(error &err)
Definition: errorManip.H:139
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.
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 field T\"<< endl;volScalarField T(IOobject("T", runTime.timeName(), mesh, IOobject::MUST_READ, IOobject::AUTO_WRITE), mesh);Info<< "Calculating field g.h\"<< endl;volScalarField p(IOobject("p", runTime.timeName(), mesh, IOobject::NO_READ, IOobject::AUTO_WRITE), p_rgh);Info<< "Creating multiphaseSystem\"<< endl;autoPtr< multiphaseInter::multiphaseSystem > fluidPtr
Definition: createFields.H:66
const volScalarField & gh
messageStream Info
Information stream (stdout output on master, null elsewhere)
surfaceScalarField & rhoPhi
Definition: createFields.H:119
GeometricField< scalar, fvsPatchField, surfaceMesh > surfaceScalarField
autoPtr< radiation::radiationModel > radiation(radiation::radiationModel::New(T))
scalar pRefValue
Definition: createFields.H:76
dimensioned< typename typeOfMag< Type >::type > magSqr(const dimensioned< Type > &dt)
volScalarField & T
Definition: createFields.H:11
volScalarField rhoCp(IOobject("rhoCp", runTime.timeName(), mesh, IOobject::NO_READ, IOobject::NO_WRITE), rho *thermo->Cp())