createFields.H
Go to the documentation of this file.
1Info<< "Reading thermophysical properties\n" << endl;
2
3autoPtr<fluidThermo> pThermo
4(
5 fluidThermo::New(mesh)
6);
7fluidThermo& thermo = pThermo();
8thermo.validate(args.executable(), "h", "e");
9
10volScalarField& p = thermo.p();
11volScalarField& T = thermo.T();
12
13volScalarField rho
14(
15 IOobject
16 (
17 "rho",
18 runTime.timeName(),
19 mesh,
20 IOobject::READ_IF_PRESENT,
21 IOobject::AUTO_WRITE
22 ),
23 thermo.rho()
24);
25
26Info<< "Reading field U\n" << endl;
27volVectorField U
28(
29 IOobject
30 (
31 "U",
32 runTime.timeName(),
33 mesh,
34 IOobject::MUST_READ,
35 IOobject::AUTO_WRITE
36 ),
37 mesh
38);
39
40Info<< "Calculating face flux field phi\n" << endl;
41
42surfaceScalarField phi
43(
44 IOobject
45 (
46 "phi",
47 runTime.timeName(),
48 mesh,
49 IOobject::READ_IF_PRESENT,
50 IOobject::AUTO_WRITE
51 ),
52 linearInterpolate(rho)*linearInterpolate(U) & mesh.Sf()
53);
54
55Info<< "Calculating face flux field phiByRho\n" << endl;
56
57surfaceScalarField phiByRho
58(
59 IOobject
60 (
61 "phiByRho",
62 runTime.timeName(),
63 mesh,
64 IOobject::READ_IF_PRESENT,
65 IOobject::AUTO_WRITE
66 ),
67 phi/linearInterpolate(rho)
68);
69
70Info<< "Creating turbulence model\n" << endl;
71autoPtr<compressible::turbulenceModel> turbulence
72(
73 compressible::turbulenceModel::New
74 (
75 rho,
76 U,
77 phi,
78 thermo
79 )
80);
81
82mesh.setFluxRequired(p.name());
83
84#include "createMRF.H"
85
86Info<< "Creating compressibility field psi\n" << endl;
87volScalarField psi("psi", 1.0/((thermo.Cp() - thermo.Cv())*T));
88psi.oldTime() = 1.0/((thermo.Cp() - thermo.Cv())*T.oldTime());
89psi.oldTime().oldTime() = 1.0/((thermo.Cp()-thermo.Cv())*T.oldTime().oldTime());
surfaceScalarField & phi
const word & executable() const noexcept
Name of executable without the path.
Definition: argListI.H:51
Basic thermodynamics type based on the use of fitting functions for cp, h, s obtained from the templa...
U
Definition: pEqn.H:72
volScalarField & p
const volScalarField & psi
const volScalarField & T
phiByRho
Definition: pEqn.H:76
dynamicFvMesh & mesh
engineTime & runTime
compressible::turbulenceModel & turbulence
messageStream Info
Information stream (stdout output on master, null elsewhere)
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:372
Foam::argList args(argc, argv)
Info<< "Reading thermophysical properties\n"<< endl;autoPtr< psiReactionThermo > pThermo(psiReactionThermo::New(mesh))