createFields.H
Go to the documentation of this file.
1autoPtr<hydroThermo> pThermo(hydroThermo::New(mesh));
2hydroThermo& thermo = pThermo();
3// new defined thermophysical model: htHydroThermo, supporting temperature and enthalpy for energy equation
4thermo.validate(args.executable(), "h","T");
5
6// --------------non const access variables------------------------------------------
7// pressure: only solved from pressure equation
8volScalarField& p=thermo.p();
9// Temperature field: solved from diffusion equation and updated in ThermalEquilibrium function
10volScalarField& T=thermo.T();
11// ----------------------------------------------------------------------------------
12
13// Darcy Velocity
14volVectorField U
15(
16 IOobject
17 (
18 "U",
19 runTime.timeName(),
20 mesh,
21 IOobject::READ_IF_PRESENT,
22 IOobject::AUTO_WRITE
23 ),
24 mesh,
25 dimensionedVector("U",dimensionSet(0,1,-1,0,0,0,0),vector::zero)
26);
27
28// Permeability
29volScalarField permeability
30(
31 IOobject
32 (
33 "permeability",
34 runTime.timeName(),
35 mesh,
36 IOobject::MUST_READ,
37 IOobject::AUTO_WRITE
38 ),
39 mesh
40);
41
42// change log: rock properties are moved from transportProperties to porousMedia sub-dict of thermophysicalProperties
43dimensionedScalar rho_rock=thermo.rho_rock();
44dimensionedScalar cp_rock = thermo.cp_rock();
45dimensionedScalar porosity0 = thermo.porosity();
46dimensionedScalar kr = thermo.kr();
47
48volVectorField heatFlux
49(
50 IOobject
51 (
52 "heatFlux",
53 runTime.timeName(),
54 mesh,
55 IOobject::NO_READ,
56 IOobject::AUTO_WRITE
57 ),
58 -kr*fvc::grad(T)
59);
60
61// Porosity, one can specify uniform porosity in thermophysicalProperties, and also specify it like permeability
62volScalarField porosity
63(
64 IOobject
65 (
66 "porosity",
67 runTime.timeName(),
68 mesh,
69 IOobject::READ_IF_PRESENT,
70 IOobject::AUTO_WRITE
71 ),
72 mesh,
74);
75
76// Fluid density
77volScalarField rho
78(
79 IOobject
80 (
81 "rho",
82 runTime.timeName(),
83 mesh,
84 IOobject::NO_READ,
85 IOobject::AUTO_WRITE
86 ),
87 thermo.rho()
88);
89
90// fluid dynamic viscosity
91volScalarField mu
92(
93 IOobject
94 (
95 "mu",
96 runTime.timeName(),
97 mesh,
98 IOobject::NO_READ,
99 IOobject::NO_WRITE
100 ),
101 thermo.mu()
102);
103
104// specific heat of fluid
105volScalarField Cp
106(
107 IOobject
108 (
109 "Cp",
110 runTime.timeName(),
111 mesh,
112 IOobject::NO_READ,
113 IOobject::NO_WRITE
114 ),
115 thermo.Cp()
116);
117// specific enthalpy
118volScalarField enthalpy
119(
120 IOobject
121 (
122 "enthalpy",
123 runTime.timeName(),
124 mesh,
125 IOobject::NO_READ,
126 IOobject::NO_WRITE
127 ),
128 thermo.enthalpy()
129);
130
131// thermal expansivity
132volScalarField alphaP
133(
134 IOobject
135 (
136 "alphaP",
137 runTime.timeName(),
138 mesh,
139 IOobject::NO_READ,
140 IOobject::NO_WRITE
141 ),
142 thermo.alphaP()
143);
144
145// compresibility
146volScalarField betaT
147(
148 IOobject
149 (
150 "betaT",
151 runTime.timeName(),
152 mesh,
153 IOobject::NO_READ,
154 IOobject::NO_WRITE
155 ),
156 thermo.betaT()
157);
158
159#include "readGravitationalAcceleration.H"
160
161#include "compressibleCreatePhi.H"
dimensionedScalar rho_rock
Definition: createFields.H:45
volScalarField & p
Definition: createFields.H:10
volScalarField mu(IOobject("mu", runTime.timeName(), mesh, IOobject::NO_READ, IOobject::NO_WRITE), thermo.mu())
dimensionedScalar kr
Definition: createFields.H:48
autoPtr< hydroThermo > pThermo(hydroThermo::New(mesh))
hydroThermo & thermo
Definition: createFields.H:4
volScalarField Cp(IOobject("Cp", runTime.timeName(), mesh, IOobject::NO_READ, IOobject::NO_WRITE), thermo.Cp())
dimensionedScalar porosity0
Definition: createFields.H:47
dimensionedScalar cp_rock
Definition: createFields.H:46
volScalarField porosity(IOobject("porosity", runTime.timeName(), mesh, IOobject::READ_IF_PRESENT, IOobject::AUTO_WRITE), mesh, porosity0)
volScalarField alphaP(IOobject("alphaP", runTime.timeName(), mesh, IOobject::NO_READ, IOobject::NO_WRITE), thermo.alphaP())
volVectorField U(IOobject("U", runTime.timeName(), mesh, IOobject::READ_IF_PRESENT, IOobject::AUTO_WRITE), mesh, dimensionedVector("U", dimensionSet(0, 1,-1, 0, 0, 0, 0), vector::zero))
volScalarField & T
Definition: createFields.H:12
volScalarField permeability(IOobject("permeability", runTime.timeName(), mesh, IOobject::MUST_READ, IOobject::AUTO_WRITE), mesh)
volScalarField betaT(IOobject("betaT", runTime.timeName(), mesh, IOobject::NO_READ, IOobject::NO_WRITE), thermo.betaT())
volScalarField rho(IOobject("rho", runTime.timeName(), mesh, IOobject::NO_READ, IOobject::AUTO_WRITE), thermo.rho())
volScalarField enthalpy(IOobject("enthalpy", runTime.timeName(), mesh, IOobject::NO_READ, IOobject::NO_WRITE), thermo.enthalpy())
volVectorField heatFlux(IOobject("heatFlux", runTime.timeName(), mesh, IOobject::NO_READ, IOobject::AUTO_WRITE), -kr *fvc::grad(T))