Debian Codegraph @

pkg/openfoam/coupling/Solvers/pimpleFoamYadev2312/createFields.H

raw
1 #include "readGravitationalAcceleration.H"
2
3 word continuousPhaseName
4 (
5 IOdictionary
6 (
7 IOobject
8 (
9 "transportProperties",
10 runTime.constant(),
11 mesh,
12 IOobject::MUST_READ
13 )
14 ).lookup("continuousPhaseName")
15 );
16
17
18 IOdictionary transportProperties
19 {
20 IOobject
21 (
22 "transportProperties",
23 runTime.constant(),
24 mesh,
25 IOobject::MUST_READ_IF_MODIFIED,
26 IOobject::NO_WRITE )
27 };
28
29
30
31
32 Info<< "Reading field U\n" << endl;
33 volVectorField Uc
34 (
35 IOobject
36 (
37 IOobject::groupName("U", continuousPhaseName),
38 runTime.timeName(),
39 mesh,
40 IOobject::MUST_READ,
41 IOobject::AUTO_WRITE
42 ),
43 mesh
44 );
45
46 Info<< "Reading field p\n" << endl;
47 volScalarField p
48 (
49 IOobject
50 (
51 "p",
52 runTime.timeName(),
53 mesh,
54 IOobject::MUST_READ,
55 IOobject::AUTO_WRITE
56 ),
57 mesh
58 );
59
60 dimensionedScalar partDensity (
61 "partDensity",
62 dimDensity,
63 transportProperties.lookup("partDensity")
64 );
65
66
67 Info<< "Reading/calculating continuous-phase face flux field phic\n"
68 << endl;
69
70 surfaceScalarField phic
71 (
72 IOobject
73 (
74 IOobject::groupName("phi", continuousPhaseName),
75 runTime.timeName(),
76 mesh,
77 IOobject::READ_IF_PRESENT,
78 IOobject::AUTO_WRITE
79 ),
80 linearInterpolate(Uc) & mesh.Sf()
81 );
82
83 label pRefCell = 0;
84 scalar pRefValue = 0.0;
85 setRefCell(p, pimple.dict(), pRefCell, pRefValue);
86 mesh.setFluxRequired(p.name());
87
88 Info<< "Creating turbulence model\n" << endl;
89
90 singlePhaseTransportModel continuousPhaseTransport(Uc, phic);
91
92 dimensionedScalar rhocValue
93 (
94 IOobject::groupName("rho", continuousPhaseName),
95 dimDensity,
96 continuousPhaseTransport.lookup
97 (
98 IOobject::groupName("rho", continuousPhaseName)
99 )
100 );
101
102
103 dimensionedScalar nuValue (
104 "kinematic viscosity",
105 dimViscosity,
106 transportProperties.lookup("nu")
107 );
108
109 volScalarField rhoc
110 (
111 IOobject
112 (
113 rhocValue.name(),
114 runTime.timeName(),
115 mesh,
116 IOobject::NO_READ,
117 IOobject::AUTO_WRITE
118 ),
119 mesh,
120 rhocValue
121 );
122
123 volScalarField muc
124 (
125 IOobject
126 (
127 IOobject::groupName("mu", continuousPhaseName),
128 runTime.timeName(),
129 mesh,
130 IOobject::NO_READ,
131 IOobject::AUTO_WRITE
132 ),
133 rhoc*continuousPhaseTransport.nu()
134 );
135
136 Info << "Creating field alphac\n" << endl;
137 // alphac must be constructed before the cloud
138 // so that the drag-models can find it
139 volScalarField alphac
140 (
141 IOobject
142 (
143 IOobject::groupName("alpha", continuousPhaseName),
144 runTime.timeName(),
145 mesh,
146 IOobject::NO_READ,
147 IOobject::AUTO_WRITE
148 ),
149 mesh,
150 dimensionedScalar("0", dimless, 0)
151 );
152
153
154 volVectorField divT(
155 IOobject(
156 "divT",
157 runTime.timeName(),
158 mesh,
159 IOobject::NO_READ,
160 IOobject::NO_WRITE),
161 fvc::laplacian(Uc)
162 );
163
164
165
166 volTensorField vGrad(
167 IOobject(
168 "vGrad",
169 runTime.timeName(),
170 mesh,
171 IOobject::NO_READ,
172 IOobject::NO_WRITE),
173 fvc::grad(Uc)
174 );
175
176
177 volVectorField gradP(
178 IOobject(
179 "gradP",
180 runTime.timeName(),
181 mesh,
182 IOobject::NO_READ,
183 IOobject::AUTO_WRITE),
184 fvc::grad(p)
185 );
186
187
188
189 volScalarField uSourceDrag(
190 IOobject(
191 "uSourceDrag",
192 runTime.timeName(),
193 mesh,
194 IOobject::NO_READ,
195 IOobject::NO_WRITE),
196 mesh,
197 dimensionedScalar("dragCoeff", dimensionSet(0,0,-1,0,0,0,0), 0 )
198 );
199
200
201 volScalarField uCoeff(
202 IOobject(
203 "uCoeffDrag",
204 runTime.timeName(),
205 mesh,
206 IOobject::NO_READ,
207 IOobject::NO_WRITE),
208 mesh,
209 dimensionedScalar("dragCoeffFluid", dimensionSet(0,0,-1,0,0,0,0), 0 )
210 );
211
212 volVectorField uInterp(
213 IOobject(
214 "uInterpField",
215 runTime.timeName(),
216 mesh,
217 IOobject::NO_READ,
218 IOobject::NO_WRITE),
219 mesh,
220 dimensionedVector("interpVel", dimensionSet(0,1,-1,0,0,0,0), vector(0,0,0) )
221 );
222
223 volVectorField uSource(
224 IOobject(
225 "uSource",
226 runTime.timeName(),
227 mesh,
228 IOobject::NO_READ,
229 IOobject::NO_WRITE),
230 mesh,
231 dimensionedVector("volSource", dimensionSet(0,1,-2,0,0,0,0), vector(0,0,0) )
232 );
233
234
235
236 volVectorField uParticle(
237 IOobject(
238 "uParticle",
239 runTime.timeName(),
240 mesh,
241 IOobject::NO_READ,
242 IOobject::NO_WRITE),
243 mesh,
244 dimensionedVector("uParticle", dimensionSet(0,1,-1,0,0,0,0), vector(0,0,0) )
245 );
246
247
248 volVectorField ddtU_f (
249 IOobject (
250 "ddtU_f",
251 runTime.timeName(),
252 mesh,
253 IOobject::NO_READ,
254 IOobject::NO_WRITE),
255 fvc::ddt(Uc)+fvc::div(phic, Uc)
256 );
257
258
259
260 surfaceScalarField alphacf("alphacf", fvc::interpolate(alphac));
261
262 surfaceScalarField alphaPhic
263 (
264 IOobject::groupName
265 (
266 "alphaPhi",
267 continuousPhaseName
268 ),
269 alphacf*phic
270 );
271
272 autoPtr<DPMIncompressibleTurbulenceModel<singlePhaseTransportModel>>
273 continuousPhaseTurbulence
274 (
275 DPMIncompressibleTurbulenceModel<singlePhaseTransportModel>::New
276 (
277 alphac,
278 Uc,
279 alphaPhic,
280 phic,
281 continuousPhaseTransport
282 )
283 );