Loading...
Searching...
No Matches
createFields.H
Go to the documentation of this file.
1/*---------------------------------------------------------------------------*\
2 ██╗████████╗██╗ ██╗ █████╗ ██████╗ █████╗ ███████╗██╗ ██╗
3 ██║╚══██╔══╝██║ ██║██╔══██╗██╔════╝██╔══██╗ ██╔════╝██║ ██║
4 ██║ ██║ ███████║███████║██║ ███████║█████╗█████╗ ██║ ██║
5 ██║ ██║ ██╔══██║██╔══██║██║ ██╔══██║╚════╝██╔══╝ ╚██╗ ██╔╝
6 ██║ ██║ ██║ ██║██║ ██║╚██████╗██║ ██║ ██║ ╚████╔╝
7 ╚═╝ ╚═╝ ╚═╝ ╚═╝╚═╝ ╚═╝ ╚═════╝╚═╝ ╚═╝ ╚═╝ ╚═══╝
8
9 * In real Time Highly Advanced Computational Applications for Finite Volumes
10 * Copyright (C) 2017 by the ITHACA-FV authors
11-------------------------------------------------------------------------------
12 License
13 This file is part of ITHACA-FV
14 ITHACA-FV is free software: you can redistribute it and/or modify
15 it under the terms of the GNU Lesser General Public License as published by
16 the Free Software Foundation, either version 3 of the License, or
17 (at your option) any later version.
18 ITHACA-FV is distributed in the hope that it will be useful,
19 but WITHOUT ANY WARRANTY; without even the implied warranty of
20 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 GNU Lesser General Public License for more details.
22 You should have received a copy of the GNU Lesser General Public License
23 along with ITHACA-FV. If not, see <http://www.gnu.org/licenses/>.
24\*---------------------------------------------------------------------------*/
25
26Info << "Reading thermophysical properties\n" << endl;
27
28pThermo = autoPtr<fluidThermo>
29 (
30 fluidThermo::New(mesh)
31 );
32
33fluidThermo& thermo = pThermo();
34
35thermo.validate(args.executable(), "h", "e");
36
37_p = autoPtr<volScalarField>
38 (
39 new volScalarField(thermo.p())
40 );
41
42volScalarField& p = _p();
43
44volScalarField p0(thermo.p());
45
46_p0 = autoPtr<volScalarField>
47 (
48 new volScalarField(p0)
49 );
50
51_rho = autoPtr<volScalarField>
52 (
53 new volScalarField
54 (
55 IOobject
56 (
57 "rho",
58 runTime.timeName(),
59 mesh,
60 IOobject::READ_IF_PRESENT,
61 IOobject::AUTO_WRITE
62 ),
63 thermo.rho()
64 )
65 );
66
67volScalarField& rho = _rho();
68
69volScalarField rho0(rho);
70
71_rho0 = autoPtr<volScalarField>
72 (
73 new volScalarField(rho0)
74 );
75
76_E = autoPtr<volScalarField>
77 (
78 new volScalarField(thermo.he())
79 );
80
81volScalarField E0(_E());
82
83_E0 = autoPtr<volScalarField>
84 (
85 new volScalarField(E0)
86 );
87
88Info << "Reading field U\n" << endl;
89_U = autoPtr<volVectorField>
90 (
91 new volVectorField
92 (
93 IOobject
94 (
95 "U",
96 runTime.timeName(),
97 mesh,
98 IOobject::MUST_READ,
99 IOobject::AUTO_WRITE
100 ),
101 mesh
102 )
103 );
104volVectorField& U = _U();
105
106volVectorField U0(U);
107
108_U0 = autoPtr<volVectorField>
109 (
110 new volVectorField(U0)
111 );
112
114
115_pressureControl = autoPtr<pressureControl>
116 (
117 new pressureControl(p, rho, simple.dict())
118 );
119
120//pressureControl& pressureControl = _pressureControl();
121
122mesh.setFluxRequired(p.name());
123
124Info << "Creating turbulence model\n" << endl;
125
126turbulence = autoPtr<compressible::turbulenceModel>
127 (
128 compressible::turbulenceModel::New
129 (
130 rho,
131 U,
132 phi,
133 thermo
134 )
135 );
136
137_initialMass = autoPtr<dimensionedScalar>
138 (
139 new dimensionedScalar(fvc::domainIntegrate(rho))
140 );
141
142_MRF = autoPtr<IOMRFZoneList>
143 (
144 new IOMRFZoneList(mesh)
145 );
146
147_psi = autoPtr<volScalarField>
148 (
149 new volScalarField(thermo.psi())
150 );
151
152_fvOptions = autoPtr<fv::options>(new fv::options(mesh));
153
154//turbulence->validate();
155
156/*_laminarTransport = autoPtr<singlePhaseTransportModel>
157 (
158 new singlePhaseTransportModel( U, phi )
159 );
160singlePhaseTransportModel& laminarTransport = _laminarTransport();*/
Foam::fvMesh & mesh
Definition createMesh.H:47
Foam::Time & runTime
Definition createTime.H:33
pressureControl & pressureControl
Definition NLsolve.H:30
simpleControl simple(mesh)
surfaceScalarField & phi
_U0
volVectorField & U
volVectorField U0(U)
_fvOptions
_E
_psi
volScalarField & p
volScalarField & rho
volScalarField p0(thermo.p())
volScalarField E0(_E())
_p0
_rho0
_E0
volScalarField rho0(rho)
fluidThermo & thermo
_MRF
_rho
_pressureControl
_initialMass
_p
turbulence