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<multiphaseSystem> fluidPtr = multiphaseSystem::New(mesh);
67 
68  multiphaseSystem& fluid = fluidPtr();
69 
70  if (!fluid.incompressible())
71  {
72  FatalError << "One or more phases are not incompressible. " << nl
73  << "This is a incompressible solver." << abort(FatalError);
74  }
75 
76 
77  // Need to store rho for ddt(rho, U)
79  (
80  IOobject
81  (
82  "rho",
83  runTime.timeName(),
84  mesh,
85  IOobject::NO_READ,
86  IOobject::AUTO_WRITE
87  ),
88  fluid.rho()
89  );
90  rho.oldTime();
91 
92  // Update p using fluid.rho()
93  p = p_rgh + rho*gh;
94 
95  label pRefCell = 0;
96  scalar pRefValue = 0.0;
98  (
99  p,
100  p_rgh,
101  pimple.dict(),
102  pRefCell,
103  pRefValue
104  );
105 
106  if (p_rgh.needReference())
107  {
109  (
110  "p",
111  p.dimensions(),
113  );
114  p_rgh = p - rho*gh;
115  }
116 
117  // Mass flux
119 
120  // Construct incompressible turbulence model
121  autoPtr<CompressibleTurbulenceModel<multiphaseSystem>> turbulence
122  (
124  (
125  rho,
126  U,
127  rhoPhi,
128  fluid
129  )
130  );
131 
132  // Creating radiation model
133  autoPtr<radiation::radiationModel> radiation
134  (
136  );
137 
138  Info<< "Calculating field rhoCp\n" << endl;
140  (
141  IOobject
142  (
143  "rhoCp",
144  runTime.timeName(),
145  mesh,
146  IOobject::NO_READ,
147  IOobject::NO_WRITE
148  ),
149  fluid.rho()*fluid.Cp()
150  );
151  rhoCp.oldTime();
152 
153 
154  Info<< "Creating field kinetic energy K\n" << endl;
155  volScalarField K("K", 0.5*magSqr(U));
runTime
engineTime & runTime
Definition: createEngineTime.H:13
gh.H
U
volVectorField U(IOobject("U", runTime.timeName(), mesh, IOobject::NO_READ, IOobject::NO_WRITE), mesh, dimensionedVector(dimVelocity, Zero))
p_rgh
p_rgh
Definition: createFields.H:95
rhoPhi
surfaceScalarField & rhoPhi
Definition: createFields.H:118
turbulence
Info<< "Reading field U\n"<< 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\n"<< endl;autoPtr< compressible::turbulenceModel > turbulence(compressible::turbulenceModel::New(rho, U, phi, thermo))
Definition: createFields.H:94
rho
rho
Definition: createFields.H:81
radiation
autoPtr< radiation::radiationModel > radiation(radiation::radiationModel::New(T))
Foam::endl
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:369
setRefCell
setRefCell(p, pimple.dict(), pRefCell, pRefValue)
gh
const volScalarField & gh
Definition: setRegionFluidFields.H:17
fluidPtr
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< multiphaseSystem > fluidPtr
Definition: createFields.H:66
Foam::magSqr
dimensioned< typename typeOfMag< Type >::type > magSqr(const dimensioned< Type > &dt)
K
CGAL::Exact_predicates_exact_constructions_kernel K
Definition: CGALTriangulation3DKernel.H:58
pimple
pimpleControl & pimple
Definition: setRegionFluidFields.H:56
Foam::Info
messageStream Info
Information stream (stdout output on master, null elsewhere)
Foam::dimensionedScalar
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
Definition: dimensionedScalarFwd.H:42
Foam::volScalarField
GeometricField< scalar, fvPatchField, volMesh > volScalarField
Definition: volFieldsFwd.H:57
p
volScalarField & p
Definition: createFields.H:23
Foam::FatalError
error FatalError
mesh
dynamicFvMesh & mesh
Definition: createDynamicFvMesh.H:6
Foam::abort
errorManip< error > abort(error &err)
Definition: errorManip.H:144
Foam::New
tmp< DimensionedField< TypeR, GeoMesh > > New(const tmp< DimensionedField< TypeR, GeoMesh >> &tdf1, const word &name, const dimensionSet &dimensions)
Global function forwards to reuseTmpDimensionedField::New.
Definition: DimensionedFieldReuseFunctions.H:105
Foam::volVectorField
GeometricField< vector, fvPatchField, volMesh > volVectorField
Definition: volFieldsFwd.H:62
Foam::getRefCellValue
scalar getRefCellValue(const volScalarField &field, const label refCelli)
Return the current value of field in the reference cell.
Definition: findRefCell.C:134
Foam::nl
constexpr char nl
Definition: Ostream.H:404
Foam::surfaceScalarField
GeometricField< scalar, fvsPatchField, surfaceMesh > surfaceScalarField
Definition: surfaceFieldsFwd.H:54
readhRef.H
pRefCell
label pRefCell
Definition: createFields.H:75
pRefValue
scalar pRefValue
Definition: createFields.H:76
fluid
multiphaseSystem & fluid
Definition: createFields.H:68
rhoCp
volScalarField rhoCp(IOobject("rhoCp", runTime.timeName(), mesh, IOobject::NO_READ, IOobject::NO_WRITE), rho *thermo->Cp())
T
volScalarField & T
Definition: createFields.H:11