-
Notifications
You must be signed in to change notification settings - Fork 60
/
createTwoPhaseTurbulence.H
216 lines (197 loc) · 4.45 KB
/
createTwoPhaseTurbulence.H
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
/*---------------------------------------------------------------------------*\
Copyright (C) 2015 Cyrille Bonamy, Julien Chauchat, Tian-Jian Hsu
and contributors
License
This file is part of SedFOAM.
SedFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
SedFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with SedFOAM. If not, see <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
dimensionedScalar SUSread
(
twophaseRASProperties.getOrDefault
(
"SUS",
dimensionedScalar("SUS", dimensionSet(0, 0, 0, 0, 0, 0, 0), 0)
)
);
dimensionedScalar SUS_I
(
twophaseRASProperties.getOrDefault
(
"SUS_I",
dimensionedScalar("SUS_I", dimensionSet(0, 0, 0, 0, 0, 0, 0), 1)
)
);
dimensionedScalar SUS_A
(
twophaseRASProperties.getOrDefault
(
"SUS_A",
dimensionedScalar("SUS_A", dimensionSet(0, 0, 0, 0, 0, 0, 0), 0)
)
);
// Tensor for anistropic drift velocity model
dimensionedTensor iso
(
"iso",
dimensionSet(0, 0, 0, 0, 0, 0, 0),
tensor(1e0, 0e0, 0e0, 0e0, 1e0, 0e0, 0e0, 0e0, 1e0)
// XX, XY, XZ, YX, YY, YZ, ZX, ZY, ZZ
);
dimensionedTensor aniso
(
"aniso",
dimensionSet(0, 0, 0, 0, 0, 0, 0),
tensor(0.0, 1.0, 1.0, 1.0, 0.0, 1.0, 1.0, 1.0, 0.0)
// XX, XY, XZ, YX, YY, YZ, ZX, ZY, ZZ
);
volScalarField SUS
(
IOobject
(
"SUS",
runTime.timeName(),
mesh,
IOobject::NO_READ,
IOobject::NO_WRITE
),
mesh,
SUSread
);
Switch SUSlocal
(
twophaseRASProperties.getOrDefault("SUSlocal", false)
);
Switch SUSaniso
(
twophaseRASProperties.getOrDefault("SUSaniso", false)
);
dimensionedScalar Usmall
(
transportProperties.getOrDefault
(
"Usmall",
dimensionedScalar("Usmall", dimensionSet(0, 1, -1, 0, 0, 0, 0), 1e-6)
)
);
dimensionedScalar B
(
twophaseRASProperties.getOrDefault
(
"B",
dimensionedScalar("B", dimensionSet(0, 0, 0, 0, 0, 0, 0), 0.25)
)
);
dimensionedScalar KE1
(
twophaseRASProperties.getOrDefault
(
"KE1",
dimensionedScalar("KE1", dimensionSet(0, 0, 0, 0, 0, 0, 0), 0)
)
);
dimensionedScalar Tpsmall
(
twophaseRASProperties.getOrDefault
(
"Tpsmall",
dimensionedScalar("Tpsmall", dimensionSet(0, 0, 1, 0, 0, 0, 0), 1e-6)
)
);
dimensionedScalar KE3
(
twophaseRASProperties.getOrDefault
(
"KE3",
dimensionedScalar("KE3", dimensionSet(0, 0, 0, 0, 0, 0, 0), 0)
)
);
dimensionedScalar KE6
(
twophaseRASProperties.getOrDefault
(
"KE6",
dimensionedScalar("KE6", dimensionSet(0, 0, 0, 0, 0, 0, 0), 0)
)
);
volScalarField tmfexp
(
IOobject
(
"tmfexp",
runTime.timeName(),
mesh,
IOobject::NO_READ,
IOobject::NO_WRITE
),
-B*rhoa*6.0/(max(beta*K, Tpsmall))
);
volScalarField rtemp((Ub-Ua) & gravity);
volVectorField Urtemp(Ub-Ua);
if (Foam::mag(gravity).value() != 0)
{
Urtemp = rtemp*gravity/magSqr(gravity);
}
volVectorField Urh((Ub-Ua) - Urtemp);
volScalarField ESD1((K/rhob)*(fvc::grad(alpha)) & Urh);
volScalarField ESD3
(
IOobject
(
"ESD3",
runTime.timeName(),
mesh,
IOobject::NO_READ,
IOobject::NO_WRITE
),
-2.0*K*alpha/rhob
);
volScalarField ESD4
(
IOobject
(
"ESD4",
runTime.timeName(),
mesh,
IOobject::NO_READ,
IOobject::NO_WRITE
),
(-(SUS/beta)*(rhoa/rhob-1.0)*gravity & fvc::grad(alpha)) + KE1*ESD1
);
volScalarField ESD5
(
IOobject
(
"ESD5",
runTime.timeName(),
mesh,
IOobject::NO_READ,
IOobject::NO_WRITE
),
max
(
-(SUS/beta)*(rhoa/rhob-1.0)*gravity & fvc::grad(alpha),
scalar(0.0)*ESD1
)
+ KE1*ESD1
);
volScalarField ESD
(
IOobject
(
"ESD",
runTime.timeName(),
mesh,
IOobject::NO_READ,
IOobject::NO_WRITE
),
KE3*ESD3
);