Backported rhoPorousMRFPimpleFoam, rhoPorousSimpleFoam, rhoSimpleFoam, rhoSonicFoam...
[foam-extend-4.0.git] / applications / solvers / compressible / rhopSonicFoam / createFields.H
blobc8e478e88ac2dd7e61287fe67863042636206f02
1     Info<< "Reading field p\n" << endl;
2     volScalarField p
3     (
4         IOobject
5         (
6             "p",
7             runTime.timeName(),
8             mesh,
9             IOobject::MUST_READ,
10             IOobject::AUTO_WRITE
11         ),
12         mesh
13     );
14     p.oldTime();
16     Info<< "Reading field T\n" << endl;
17     volScalarField T
18     (
19         IOobject
20         (
21             "T",
22             runTime.timeName(),
23             mesh,
24             IOobject::MUST_READ,
25             IOobject::AUTO_WRITE
26         ),
27         mesh
28     );
29     T.correctBoundaryConditions();
31     volScalarField psi
32     (
33         IOobject
34         (
35             "psi",
36             runTime.timeName(),
37             mesh,
38             IOobject::NO_READ,
39             IOobject::AUTO_WRITE
40         ),
41         1.0/(R*T)
42     );
43     psi.oldTime();
45 #   include "rhoBoundaryTypes.H"
46     volScalarField rho
47     (
48         IOobject
49         (
50             "rho",
51             runTime.timeName(),
52             mesh,
53             IOobject::NO_READ,
54             IOobject::AUTO_WRITE
55         ),
56         p*psi,
57         rhoBoundaryTypes
58     );
60     Info<< "Reading field U\n" << endl;
61     volVectorField U
62     (
63         IOobject
64         (
65             "U",
66             runTime.timeName(),
67             mesh,
68             IOobject::MUST_READ,
69             IOobject::AUTO_WRITE
70         ),
71         mesh
72     );
74 #   include "rhoUboundaryTypes.H"
75     volVectorField rhoU
76     (
77         IOobject
78         (
79             "rhoU",
80             runTime.timeName(),
81             mesh,
82             IOobject::NO_READ,
83             IOobject::AUTO_WRITE
84         ),
85         rho*U,
86         rhoUboundaryTypes
87     );
89 #   include "rhoEboundaryTypes.H"
90     volScalarField rhoE
91     (
92         IOobject
93         (
94             "rhoE",
95             runTime.timeName(),
96             mesh,
97             IOobject::NO_READ,
98             IOobject::AUTO_WRITE
99         ),
100         rho*Cv*T + 0.5*rho*magSqr(rhoU/rho),
101         rhoEboundaryTypes
102     );
104 #   include "compressibleCreatePhi.H"
105     phi.oldTime();
107     surfaceScalarField phiv
108     (
109         IOobject
110         (
111             "phiv",
112             runTime.timeName(),
113             mesh
114         ),
115         phi/linearInterpolate(rho),
116         phi.boundaryField().types()
117     );
119     rhoU.correctBoundaryConditions();
121     multivariateSurfaceInterpolationScheme<scalar>::fieldTable fields;
123     volScalarField magRhoU = mag(rhoU);
124     volScalarField H("H", (rhoE + p)/rho);
126     fields.add(rho);
127     fields.add(magRhoU);
128     fields.add(H);
130     mesh.schemesDict().setFluxRequired(p.name());