TrioCFD 1.9.8
TrioCFD documentation
Loading...
Searching...
No Matches
Flux_2groupes_Smith.cpp
1/****************************************************************************
2* Copyright (c) 2024, CEA
3* All rights reserved.
4*
5* Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
6* 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
7* 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
8* 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
9*
10* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
11* IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
12* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
13*
14*****************************************************************************/
15/////////////////////////////////////////////////////////////////////////////
16
17/// T.R. Smith, J.P. Schlegel, T. Hibiki, M. Ishii, Mechanistic modeling of interfacial area transport in large diameter pipes,
18/// International Journal of Multiphase Flow, Volume 47, 2012, https://doi.org/10.1016/j.ijmultiphaseflow.2012.06.009
19/// and Joseph L. Bottini, Taiyang Zhang, Caleb S. Brooks, Validation of two-group interfacial area transport equation in boiling flow,
20/// International Journal of Heat and Mass Transfer, 2024, https://doi.org/10.1016/j.ijheatmasstransfer.2024.125515
21
22/////////////////////////////////////////////////////////////////////////////
23
24
25#include <Flux_2groupes_Smith.h>
26#include <Pb_Multiphase.h>
27
28
29namespace
30{
31
32double gamma_incomplete_lower_series(double s, double x)
33{
34
35 const double epsilon=1e-14;
36 const int max_iter=1000 ;
37 double sum = 1.0 / s;
38 double term = sum;
39 for (int n = 1; n < max_iter; ++n)
40 {
41 term *= x / (s + n);
42 sum += term;
43 if (term < epsilon * sum) break;
44 }
45 return sum * std::exp(-x + s * std::log(x));
46}
47
48
49double gamma_incomplete_upper_cf(double s, double x)
50{
51
52 const double epsilon=1e-14;
53 const int max_iter=1000 ;
54 const double FPMIN = 1e-30; // petite constante pour éviter division par zéro
55 double ba = x + 1.0 - s;
56 double c = 1.0 / FPMIN;
57 double d = 1.0 / ba;
58 double h = d;
59
60 for (int i = 1; i < max_iter; ++i)
61 {
62 double an = -i * (i - s);
63 ba += 2.0;
64 d = an * d + ba;
65 if (std::abs(d) < FPMIN) d = FPMIN;
66 c = ba + an / c;
67 if (std::abs(c) < FPMIN) c = FPMIN;
68 d = 1.0 / d;
69 double delta = d * c;
70 h *= delta;
71 if (std::abs(delta - 1.0) < epsilon) break;
72 }
73 return h * std::exp(-x + s * std::log(x));
74}
75
76double gamma_regularized_lower(double s, double x)
77{
78 if (x == 0.0) return 0.0;
79
80 if (x < s + 1.0)
81 {
82 double gl = gamma_incomplete_lower_series(s, x);
83 return gl / std::tgamma(s);
84 }
85 else
86 {
87 double gu = gamma_incomplete_upper_cf(s, x);
88 return 1.0 - gu / std::tgamma(s);
89 }
90}
91
92}
93
94
95Implemente_instanciable(Flux_2groupes_Smith, "Flux_2groupes_Smith", Flux_2groupes_base);
96
98{
99 return os;
100}
101
103{
104 Param param(que_suis_je());
105 param.ajouter("hPNVG", &hPNVG_);
106 param.ajouter("Xi_h", &Xi_h_);
107 param.ajouter("A_c", &A_c_);
108 param.ajouter("R", &R_);
109 param.ajouter("theta", &theta_rad);
110 param.lire_avec_accolades_depuis(is);
111 return is;
112}
113
115{
116 // Initialisation
117 double eta = 0;
118 double deta_dalpha1 = 0;
119 double deta_dai1 = 0;
120 double deta_dalpha2 = 0;
121 double deta_dai2 = 0;
122
123 int clipping = 0;
124
125 // Number often used in source terms
126 const double alpha_max_cbrt = std::cbrt(alpha_max);
127 const double alpha_clipped = std::min(in.alpha(in.n_g1), alpha_coal_max_);
128 const double alpha_clipped_cbrt = std::cbrt(alpha_clipped);
129 const double alphag1_5_over3 = std::pow(in.alpha(in.n_g1), 5. / 3.);
130 const double alphag2_1_over3 = std::cbrt(in.alpha(in.n_g2));
131 const double alphag2_4_over3 = std::pow(in.alpha(in.n_g2), 4. / 3.);
132 const double ai1_cbrt = std::cbrt(in.a_i(in.n_g1));
133 const double ai2_cbrt = std::cbrt(in.a_i(in.n_g2));
134 const double eps_1_over3 = std::cbrt(in.epsilon(in.n_l));
135 const double alphafonction_3_over2 = std::sqrt(1. - in.alpha(in.n_g1)) *
136 std::sqrt(1. - in.alpha(in.n_g1)) *
137 std::sqrt(1. - in.alpha(in.n_g1));
138
139 // Physical constants
140 const double D_crit =
141 4. * std::sqrt(in.sigma(in.n_l, in.n_g1) / g / (in.rho(in.n_l) - in.rho(in.n_g1)));
142 const double D_etoile = D_crit / in.d_bulles(in.n_g1);
143 const double D_etoile2 = D_crit / in.d_bulles(in.n_g2);
144 const double khi_d = b / 3. *
145 ((3. / 2. * D_etoile) * std::pow(b * 3. / 2. * D_etoile, p) *
146 std::exp(-b * 3. / 2. * D_etoile)) /
147 (gamma_regularized_lower(p + 1., 0.) -
148 gamma_regularized_lower(p + 1., b * 3. / 2. * D_etoile));
149 const double C_D1 = std::max(
150 2. / 3. * in.d_bulles(in.n_g1) *
151 std::sqrt(g * std::abs(in.rho(in.n_l) - in.rho(in.n_g1)) / in.sigma(in.n_g1, in.n_l)) *
152 ((1. + 17.67 * std::pow(1. - in.alpha(in.n_g1), 9. / 7.)) /
153 (18.67 * alphafonction_3_over2)) *
154 ((1. + 17.67 * std::pow(1. - in.alpha(in.n_g1), 9. / 7.)) /
155 (18.67 * alphafonction_3_over2)),
156 1. / fac_sec_);
157 const double Ur1 =
158 std::min(in.nv(in.n_l, in.n_g1), std::sqrt(4. / 3. * in.d_bulles(in.n_g1) / C_D1 * g *
159 std::abs(in.rho(in.n_l) - in.rho(in.n_g1)) /
160 in.rho(in.n_l) * (in.alpha(in.n_l))));
161 const double Ur2 =
162 std::max(in.nv(in.n_l, in.n_g2),
163 std::sqrt(1. / 2. * D_crit * g * std::abs(in.rho(in.n_l) - in.rho(in.n_g2)) /
164 in.rho(in.n_l)));
165 const double We2 = 2. * in.rho(in.n_l) *
166 std::cbrt(in.epsilon(in.n_l) * std::max(in.d_bulles(in.n_g2), D_crit)) *
167 std::cbrt(in.epsilon(in.n_l) * std::max(in.d_bulles(in.n_g2), D_crit)) *
168 std::max(in.d_bulles(in.n_g2), D_crit) / in.sigma(in.n_g2, in.n_l);
169
170 // Fonctions in source terms
171 const double lambda_RC1 =
172 (in.alpha(in.n_g1) > 1. / fac_sec_)
173 ? std::exp(-C_RC0 *
174 std::sqrt(in.d_bulles(in.n_g1) * in.rho(in.n_l) / in.sigma(in.n_g1, in.n_l)) *
175 std::cbrt(in.d_bulles(in.n_g1) * in.epsilon(in.n_l)))
176 : 0.;
177 const double formfunc_alpha =
178 (in.alpha(in.n_g1) > 1. / fac_sec_)
179 ? (1. - std::exp(-C_RC1 * (alpha_max_cbrt * alpha_clipped_cbrt) /
180 (alpha_max_cbrt - alpha_clipped_cbrt)))
181 : 0.;
182 const double dformfunc_alpha_dalpha =
183 ((in.alpha(in.n_g1) > 1. / fac_sec_) && (in.alpha(in.n_g1) < alpha_coal_max_))
184 ? (1. / alpha_max_cbrt / 3. *
185 (1. - std::exp(-C_RC0 * (alpha_max_cbrt * alpha_clipped_cbrt) /
186 (alpha_max_cbrt - alpha_clipped_cbrt))) /
187 (alpha_clipped_cbrt * alpha_clipped_cbrt) / (alpha_max_cbrt - alpha_clipped_cbrt) /
188 (alpha_max_cbrt - alpha_clipped_cbrt) +
189 std::exp(-C_RC0 * (alpha_max_cbrt * alpha_clipped_cbrt) /
190 (alpha_max_cbrt - alpha_clipped_cbrt)) /
191 (alpha_max_cbrt - alpha_clipped_cbrt) * (C_RC0 / alpha_clipped_cbrt / 3.) /
192 (alpha_max_cbrt - alpha_clipped_cbrt) *
193 (1. / std::min(in.alpha(in.n_g1) * in.alpha(in.n_g1),
195 1. / (alpha_max_cbrt - alpha_clipped_cbrt)))
196 : 0.;
197 const double Dc_etoile_ratio = D_crit / std::max(in.d_bulles(in.n_g2), D_crit);
198 const double Dc_etoile_16_over3 = std::pow(Dc_etoile_ratio, 16. / 3.);
199 const double Dc_etoile_6 = std::pow(Dc_etoile_ratio, 6.);
200
201 // Eta RC (112) coefficient for secmem
202 eta += (in.alpha(in.n_g1) > 1. / fac_sec_)
203 ? 3.15 * C_RC1 * lambda_RC1 * formfunc_alpha / (alpha_max_cbrt * alpha_max_cbrt) *
204 (1. - 2. / 3. * D_etoile) * eps_1_over3 * alpha_clipped * alpha_clipped *
205 (ai1_cbrt * ai1_cbrt)
206 : 0;
207
208 // dEta RC (112) coefficient for mat
209 deta_dalpha1 += (in.alpha(in.n_g1) > 1. / fac_sec_)
210 ? 3.15 * C_RC1 * lambda_RC1 * formfunc_alpha /
211 (alpha_max_cbrt * alpha_max_cbrt) * (1. - 2. / 3. * D_etoile) *
212 eps_1_over3 * 2. * alpha_clipped * (ai1_cbrt * ai1_cbrt) +
213 3.15 * C_RC1 * lambda_RC1 * dformfunc_alpha_dalpha /
214 (alpha_max_cbrt * alpha_max_cbrt) * (1. - 2. / 3. * D_etoile) *
215 eps_1_over3 * alpha_clipped * alpha_clipped * (ai1_cbrt * ai1_cbrt)
216 : 0; // dEta/dalpha1
217
218 deta_dai1 += (in.alpha(in.n_g1) > 1. / fac_sec_)
219 ? 3.15 * C_RC1 * lambda_RC1 * formfunc_alpha /
220 (alpha_max_cbrt * alpha_max_cbrt) * (1. - 2. / 3. * D_etoile) *
221 eps_1_over3 * alpha_clipped * alpha_clipped * 2. / 3. /
222 std::min(ai1_cbrt, fac_sec_)
223 : 0; // dEta/dai1
224
225 // Eta RC (122) coefficient for secmem
226 eta += (in.alpha(in.n_g1) > 1. / fac_sec_)
227 ? 1.44 * C_RC122 * lambda_RC1 * formfunc_alpha * eps_1_over3 * alphag1_5_over3 *
228 alphag2_4_over3 * (ai2_cbrt * ai2_cbrt)
229 : 0;
230
231 // dEta RC (122) coefficient for mat
232 deta_dalpha1 +=
233 (in.alpha(in.n_g2) > 1. / fac_sec_)
234 ? 1.44 * C_RC122 * lambda_RC1 * formfunc_alpha * eps_1_over3 * 5. / 3. *
235 (alpha_clipped_cbrt * alpha_clipped_cbrt) *
236 (alpha_clipped * alpha_clipped_cbrt * alpha_clipped_cbrt * alpha_clipped_cbrt) *
237 (ai2_cbrt * ai2_cbrt) +
238 1.44 * C_RC122 * lambda_RC1 * dformfunc_alpha_dalpha * eps_1_over3 *
239 alphag1_5_over3 *
240 (alpha_clipped_cbrt * alpha_clipped_cbrt * alpha_clipped_cbrt *
241 alpha_clipped_cbrt) *
242 (ai2_cbrt * ai2_cbrt)
243 : 0; // dEta/dalpha1
244
245 deta_dalpha2 += (in.alpha(in.n_g2) > 1. / fac_sec_)
246 ? 1.44 * C_RC122 * lambda_RC1 * formfunc_alpha * eps_1_over3 *
247 alphag1_5_over3 * 4. / 3. * std::cbrt(in.alpha(in.n_g2)) *
248 (ai2_cbrt * ai2_cbrt)
249 : 0; // dEta/dalpha2
250
251 deta_dai2 += (in.alpha(in.n_g2) > 1. / fac_sec_)
252 ? 1.44 * C_RC122 * lambda_RC1 * formfunc_alpha * eps_1_over3 * alphag1_5_over3 *
253 alphag2_4_over3 * 2. / 3. / std::min(ai2_cbrt, fac_sec_)
254 : 0; // dEta/dai2
255
256 // Eta WE coefficient for secmem
257 // --------------------------------------------------------------------------------------------------------------------------------------------------------------------
258
259 eta += (in.alpha(in.n_g1) > 1. / fac_sec_)
260 ? 3.85 * C_WE1 * std::cbrt(C_D1) * Ur1 * in.alpha(in.n_g1) * in.a_i(in.n_g1)
261 : 0;
262
263 // dEta WE coefficient for
264 // mat--------------------------------------------------------------------------------------------------------------------------------------------------------
265
266 deta_dalpha1 += (in.alpha(in.n_g1) > 1. / fac_sec_)
267 ? 3.85 * C_WE1 * std::cbrt(C_D1) * Ur1 * in.a_i(in.n_g1)
268 : 0;
269
270 deta_dai1 += (in.alpha(in.n_g1) > 1. / fac_sec_)
271 ? 3.85 * C_WE1 * std::cbrt(C_D1) * Ur1 * in.alpha(in.n_g1)
272 : 0;
273
274 // Eta TI coefficient for
275 // secmem-----------------------------------------------------------------------------------------------------------------------------------------------------------
276
277 eta += (in.alpha(in.n_g2) > 1. / fac_sec_)
278 ? -11.65 * C_TI21 * std::exp(-We_cr2 / We2) *
279 std::sqrt(1. - std::min(We_cr1 / We2, 1.)) *
280 std::max(0.15 * Dc_etoile_16_over3 - 0.117 * Dc_etoile_6, 0.) * eps_1_over3 *
281 in.alpha(in.n_l) * alphag2_1_over3 * (ai2_cbrt * ai2_cbrt)
282 : 0;
283
284 // dEta TI coefficient for
285 // mat--------------------------------------------------------------------------------------------------------------------------------------------------------------------------
286
287 deta_dalpha2 +=
288 (in.alpha(in.n_g2) > 1. / fac_sec_)
289 ? -11.65 * C_TI21 * std::exp(-We_cr2 / We2) * std::sqrt(1. - std::min(We_cr1 / We2, 1.)) *
290 std::max(0.15 * Dc_etoile_16_over3 - 0.117 * Dc_etoile_6, 0.) * eps_1_over3 *
291 in.alpha(in.n_l) * 1. / 3. /
292 (std::min(alphag2_1_over3 * alphag2_1_over3, fac_sec_)) * (ai2_cbrt * ai2_cbrt)
293 : 0; // dEta/dalpha2
294
295 deta_dai2 +=
296 (in.alpha(in.n_g2) > 1. / fac_sec_)
297 ? -11.65 * C_TI21 * std::exp(-We_cr2 / We2) * std::sqrt(1. - std::min(We_cr1 / We2, 1.)) *
298 std::max(0.15 * Dc_etoile_16_over3 - 0.117 * Dc_etoile_6, 0.) * eps_1_over3 *
299 in.alpha(in.n_l) * alphag2_1_over3 * 2. / 3. / (std::min(ai2_cbrt, fac_sec_))
300 : 0; // dEta/dai2
301
302 // Eta SO coefficient for
303 // secmem----------------------------------------------------------------------------------------------------------------------------------------------------------------
304
305 eta += (in.alpha(in.n_g2) > 1. / fac_sec_)
306 ? -2.33 * C_S0 * in.sigma(in.n_g2, in.n_l) / in.rho(in.n_g2) / Ur2 *
307 std::max(1. - We_SO / We2, 0.) * (in.a_i(in.n_g2)) * (in.a_i(in.n_g2)) /
308 in.alpha(in.n_g2)
309 : 0.;
310
311 // dEta SO coefficient for
312 // mat---------------------------------------------------------------------------------------------------------------------------------------------------------------
313
314 deta_dalpha2 += (in.alpha(in.n_g2) > 1. / fac_sec_)
315 ? 2.33 * C_S0 * in.sigma(in.n_g2, in.n_l) / in.rho(in.n_g2) / Ur2 *
316 std::max(1. - We_SO / We2, 0.) * (in.a_i(in.n_g2)) * (in.a_i(in.n_g2)) /
317 (in.alpha(in.n_g2) * in.alpha(in.n_g2))
318 : 0; // dEta/dalpha2
319
320 deta_dai2 += (in.alpha(in.n_g2) > 1. / fac_sec_)
321 ? -2.33 * C_S0 * in.sigma(in.n_g2, in.n_l) / in.rho(in.n_g2) / Ur2 *
322 std::max(1. - We_SO / We2, 0.) * 2. * (in.a_i(in.n_g2)) / in.alpha(in.n_g2)
323 : 0; // dEta/dai2
324
325 // Physical/numerical security for mass exchange between phases
326 // --------------------------------------------------------------------------------------------------------------------------
327 if (eta > 0.) // if transfer from g1 to g2
328 {
329 if (1. / fac_sec_ > in.alpha(in.n_g1)) // if not enough g1
330
331 clipping = 1;
332 }
333 if (0. > eta) // if transfer from g2 to g1
334 {
335 if (1. / fac_sec_ > in.alpha(in.n_g2)) // if not enough g2
336
337 clipping = 1;
338 }
339
340 // Put in
341 // out-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
342
343 out.gamma(in.n_g1, in.n_g1) = (clipping == 0) ? eta : 0.; // G1
344 out.gamma(in.n_g2, in.n_g2) = (clipping == 0) ? -eta : 0.; // G2 = -G1
345 out.da_gamma(in.n_g1, in.n_g1) = (clipping == 0) ? deta_dalpha1 : 0.; // dG1/dalpha1
346 out.da_gamma(in.n_g2, in.n_g2) = (clipping == 0) ? deta_dalpha2 : 0.; // dG1/dalpha2
347 out.dai_gamma(in.n_g1, in.n_g1) = (clipping == 0) ? deta_dai1 : 0.; // dG1/dai1
348 out.dai_gamma(in.n_g2, in.n_g2) = (clipping == 0) ? deta_dai2 : 0.; // dG1/dai2
349
350 out.inter2g1 = khi_d * D_etoile * D_etoile;
351 out.da_inter2g1 = 0.;
352
353 out.inter2g2 =
354 khi_d * D_etoile2 * D_etoile2 *
355 ((in.alpha(in.n_g2) > 1. / fac_sec_)
356 ? in.alpha(in.n_g1) / in.alpha(in.n_g2) * (in.d_bulles(in.n_g2) / in.d_bulles(in.n_g1)) *
357 (in.d_bulles(in.n_g2) / in.d_bulles(in.n_g1)) *
358 (in.d_bulles(in.n_g2) / in.d_bulles(in.n_g1))
359 : 0.);
360 out.da_inter2g2 = khi_d * D_etoile2 * D_etoile2 *
361 ((in.alpha(in.n_g2) > 1. / fac_sec_)
362 ? -in.alpha(in.n_g1) / in.alpha(in.n_g2) / in.alpha(in.n_g2) *
363 (in.d_bulles(in.n_g2) / in.d_bulles(in.n_g1)) *
364 (in.d_bulles(in.n_g2) / in.d_bulles(in.n_g1)) *
365 (in.d_bulles(in.n_g2) / in.d_bulles(in.n_g1))
366 : 0.);
367
368 out.inter3g1 = khi_d * D_etoile * D_etoile * D_etoile;
369 out.da_inter3g1 = 0.;
370
371 out.inter3g2 =
372 khi_d * D_etoile2 * D_etoile2 * D_etoile2 *
373 ((in.alpha(in.n_g2) > 1. / fac_sec_)
374 ? in.alpha(in.n_g1) / in.alpha(in.n_g2) * (in.d_bulles(in.n_g2) / in.d_bulles(in.n_g1)) *
375 (in.d_bulles(in.n_g2) / in.d_bulles(in.n_g1)) *
376 (in.d_bulles(in.n_g2) / in.d_bulles(in.n_g1))
377 : 0.);
378 out.da_inter3g2 = khi_d * D_etoile2 * D_etoile2 * D_etoile2 *
379 ((in.alpha(in.n_g2) > 1. / fac_sec_)
380 ? -in.alpha(in.n_g1) / in.alpha(in.n_g2) / in.alpha(in.n_g2) *
381 (in.d_bulles(in.n_g2) / in.d_bulles(in.n_g1)) *
382 (in.d_bulles(in.n_g2) / in.d_bulles(in.n_g1)) *
383 (in.d_bulles(in.n_g2) / in.d_bulles(in.n_g1))
384 : 0.);
385}
386
388{
389
390 // For lisibility----------------------------------------------------------------------------------------------------------------------------------------------------------------------
391
392 const double dsm1 = in.d_bulles(in.n_g1);
393 const double dsm2 = in.d_bulles(in.n_g2);
394
395
396 // Physical constants ----------------------------------------------------------------------------------------------------------------------------------------------------------------------
397
398 const double Prl = in.mu(in.n_l) * in.Cp(in.n_l) / in.lambda(in.n_l) ;
399 const double Ja1 = std::max(in.rho(in.n_l) * in.Cp(in.n_l) * (in.Tsatg1-in.T(in.n_l))/in.rho(in.n_g1)/in.Lvap,0.);
400 const double Ja2 = std::max(in.rho(in.n_l) * in.Cp(in.n_l)*(in.Tsatg2-in.T(in.n_l))/in.rho(in.n_g2)/in.Lvap,0.);
401 const double dTl_Ja1 = ( 0.< Ja1) ? - in.rho(in.n_l) * in.Cp(in.n_l) / in.rho(in.n_g1) / in.Lvap : 0. ;
402 const double dp_Ja1 = ( 0.< Ja1) ? in.rho(in.n_l) * in.Cp(in.n_l) * (in.dp_Tsat1)/in.rho(in.n_g1)/in.Lvap : 0. ;
403 const double dTl_Ja2 = ( 0.< Ja2) ? - in.rho(in.n_l) * in.Cp(in.n_l) / in.rho(in.n_g2) / in.Lvap : 0. ;
404 const double dp_Ja2 = ( 0.< Ja2) ? in.rho(in.n_l) * in.Cp(in.n_l) * (in.dp_Tsat2)/in.rho(in.n_g2)/in.Lvap : 0. ;
405
406
407// Initialisation----------------------------------------------------------------------------------------------------------------------------------------------------------------------
408
409 double etaCo = 0.;
410 double dak_etaCo = 0.;
411 double dal_etaCo = 0.;
412 double dTk_etaCo = 0. ;
413 double dTl_etaCo = 0.;
414 double dp_etaCo = 0.;
415
416 double etaPc = 0.;
417 double dak_etaPc = 0.;
418 double dal_etaPc = 0.;
419 double dTk_etaPc = 0. ;
420 double dTl_etaPc = 0.;
421 double dp_etaPc = 0.;
422
423 double GWn = 0.;
424 double dak_GWn = 0.;
425 double dal_GWn = 0.;
426 double dTk_GWn = 0. ;
427 double dTl_GWn = 0.;
428 double dp_GWn = 0.;
429
430 double Reb = 0.; // used for both phases cant be const
431 double Nuc = 0.; // used for both phases cant be const
432
433
434 // Interfacial area monitored by Dsm for numerical safety -----------------------------------------------------------------------------------------------------------------------------------------------
435
436 const double Xai = (in.alpha(in.n_g2)>1./fac_sec_) ? (6. * in.alpha(in.n_g1) / dsm1) / ((6. * in.alpha(in.n_g1) / dsm1) + (6. * in.alpha(in.n_g2) / dsm2)) : 1. ;
437 const double da1_Xai = (in.alpha(in.n_g2)>1./fac_sec_) ? 36. / dsm1 / dsm2 * in.alpha(in.n_g2) / ((6. * in.alpha(in.n_g1) / dsm1) + (6. * in.alpha(in.n_g2) / dsm2)* (6. * in.alpha(in.n_g1) / dsm1) + (6. * in.alpha(in.n_g2) / dsm2)) : 0.;
438 const double da2_1_Xai = (in.alpha(in.n_g2)>1./fac_sec_) ? 36. / dsm2 / dsm1 * in.alpha(in.n_g1) / ((6. * in.alpha(in.n_g2) / dsm1) + (6. * in.alpha(in.n_g1) / dsm1)* (6. * in.alpha(in.n_g2) / dsm2) + (6. * in.alpha(in.n_g1) / dsm1)) : 0.;
439
440// Group 1 transfer -----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
441
442 Reb = std::sqrt(2.)*std::pow(( in.rho(in.n_l)- in.rho(in.n_g1) )*g * in.sigma(in.n_g1, in.n_l)/in.rho(in.n_l) / in.rho(in.n_l), 1./4.) * in.rho(in.n_l) * betac * dsm1 / in.mu(in.n_l);
443 Nuc = 4./M_PI*std::sqrt(Reb)*std::sqrt(Prl);
444
445 // Condensation -------------------------------------------------------------------------------------------------------------------------------------------------------------------
446
447 const double fac_Co1 = betac*betac*betac/(1.-betac*betac)/9. ;
448 etaCo = -fac_Co1* (6. * in.alpha(in.n_g1) / dsm1 ) *(1.-in.alpha(in.n_l)) / dsm1 * Nuc * Ja1 ;
449 dak_etaCo = -fac_Co1* (6. / dsm1 ) *(1.-in.alpha(in.n_l)) / dsm1 * Nuc * Ja1 ;
450 dal_etaCo = fac_Co1* (6. * in.alpha(in.n_g1) / dsm1 ) / dsm1 * Nuc * Ja1 ;
451 dTk_etaCo = 0. ;
452 dTl_etaCo = -fac_Co1* (6. * in.alpha(in.n_g1) / dsm1 ) *(1.-in.alpha(in.n_l)) / dsm1 * Nuc * dTl_Ja1 ;
453 dp_etaCo = -fac_Co1* (6. * in.alpha(in.n_g1) / dsm1 ) *(1.-in.alpha(in.n_l)) / dsm1 * Nuc * dp_Ja1 ;
454
455 // Phase change ---------------------------------------------------------------------------------------------------------------------------------------------------------------------
456
457 const double fac_Pc1 = (1.-pc);
458 etaPc = -fac_Pc1 * (6. * in.alpha(in.n_g1) / dsm1 ) / dsm1 * (1.-in.alpha(in.n_l)) * Nuc * Ja1 ;
459 dak_etaPc = -fac_Pc1 * (6. / dsm1 ) / dsm1 * (1.-in.alpha(in.n_l)) * Nuc * Ja1 ;
460 dal_etaPc =-fac_Pc1 * (6. * in.alpha(in.n_g1) / dsm1 ) / dsm1 * Nuc * Ja1 ;
461 dTk_etaPc = 0. ;
462 dTl_etaPc = -fac_Pc1 * (6. * in.alpha(in.n_g1) / dsm1 ) / dsm1 * (1.-in.alpha(in.n_l)) * Nuc * dTl_Ja1 ;
463 dp_etaPc = -fac_Pc1 * (6. * in.alpha(in.n_g1) / dsm1 ) / dsm1 * (1.-in.alpha(in.n_l)) * Nuc * dp_Ja1 ;
464
465 // Wall nucleation -------------------------------------------------------------------------------------------------------------------------------------------------------------------
466
467 GWn = ( 0.< in.hl - hPNVG_) ? Xai * Xi_h_* in.qp / A_c_ * (in.hl - hPNVG_)/( in.hlsat - hPNVG_ ) / in.Lvap : 0. ;
468 dak_GWn = ( 0.< in.hl - hPNVG_) ? da1_Xai * Xi_h_* in.qp / A_c_ * (in.hl - hPNVG_)/( in.hlsat - hPNVG_ ) / in.Lvap : 0. ;
469
470 // Balance for G1 ------------------------------------------------------------------------------------------------------------------------------------------------------------------
471
472 out.G1 = in.rho(in.n_g1) * (etaCo + etaPc ) + GWn;
473 out.etaph1 = etaCo + GWn / in.rho(in.n_g1) ;
474
475 out.dT_G1(in.n_g1) = in.rho(in.n_g1) * (dTk_etaPc + dTk_etaCo ) + dTk_GWn;
476 out.dT_G1(in.n_l) = in.rho(in.n_g1) * (dTl_etaPc + dTl_etaCo ) + dTl_GWn ;
477 out.dT_etaph1(in.n_g1) = dTk_etaCo + dTk_GWn / in.rho(in.n_g1) ;
478 out.dT_etaph1(in.n_l) = dTl_etaCo + dTl_GWn / in.rho(in.n_g1) ;
479
480
481 out.da_G1(in.n_g1) = in.rho(in.n_g1) * (dak_etaPc + dak_etaCo ) + dak_GWn ;
482 out.da_G1(in.n_l) = in.rho(in.n_g1) * (dal_etaPc + dal_etaCo ) + dal_GWn ;
483 out.da_etaph1(in.n_g1) = dak_etaCo + dak_GWn / in.rho(in.n_g1) ;
484 out.da_etaph1(in.n_l) = dal_etaCo + dal_GWn / in.rho(in.n_g1) ;
485
486 out.dp_G1 = in.rho(in.n_g1) * (dp_etaPc + dp_etaCo ) + dp_GWn ;
487 out.dp_etaph1 = dp_etaCo + dp_GWn / in.rho(in.n_g1) ;
488
489// Group 2 transfer ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
490
491 Reb = 0.35*std::pow((in.rho(in.n_l)-in.rho(in.n_g2))* g * in.dh / in.rho(in.n_l) , 1./4.) * in.rho(in.n_l) * dsm2 / in.mu(in.n_l);
492 Nuc = 0.185 * std::pow(Reb , 0.7) * std::sqrt(Prl) ;
493
494 // No condensation
495 // Phase change ---------------------------------------------------------------------------------------------------------------------------------------------------------------------
496
497 etaPc = - (6. * in.alpha(in.n_g2) / dsm2 ) /dsm2 * Nuc * Ja2 * (1.-in.alpha(in.n_l)) ;
498 dak_etaPc = - (6. / dsm2 ) / dsm2 * Nuc * Ja2 * (1.-in.alpha(in.n_l)) ;
499 dal_etaPc = (6. * in.alpha(in.n_g2) / dsm2 ) / dsm2 * Nuc * Ja2 ;
500 dTk_etaPc = 0. ;
501 dTl_etaPc = - (6. * in.alpha(in.n_g2) / dsm2 ) / dsm2 * Nuc * (1.-in.alpha(in.n_l)) * dTl_Ja2 ;
502 dp_etaPc = - (6. * in.alpha(in.n_g2) / dsm2 ) /dsm2 * Nuc * (1.-in.alpha(in.n_l)) * dp_Ja2 ;
503
504 // Wall nucleation -------------------------------------------------------------------------------------------------------------------------------------------------------------------
505
506 GWn = ( 0.< in.hl - hPNVG_) ? (1.-Xai) * Xi_h_* in.qp / A_c_ * (in.hl - hPNVG_)/( in.hlsat - hPNVG_ ) / in.Lvap : 0.;
507 dak_GWn = ( 0.< in.hl - hPNVG_) ? da2_1_Xai * Xi_h_* in.qp / A_c_ * (in.hl - hPNVG_)/( in.hlsat - hPNVG_ ) / in.Lvap : 0. ;
508
509 // Balance for G2 ------------------------------------------------------------------------------------------------------------------------------------------------------------------
510
511 out.G2 = in.rho(in.n_g2) * ( etaPc ) + GWn;
512 out.etaph2 = GWn / in.rho(in.n_g2) ;
513 out.dT_G2(in.n_g2) = in.rho(in.n_g2) * (dTk_etaPc ) + dTk_GWn;
514 out.dT_G2(in.n_l) = in.rho(in.n_g2) * (dTl_etaPc ) + dTl_GWn ;
515 out.dT_etaph2(in.n_g2) = dTk_GWn / in.rho(in.n_g2) ;
516 out.dT_etaph2(in.n_l) = dTl_GWn / in.rho(in.n_g2) ;
517
518 out.da_G2(in.n_g2) = in.rho(in.n_g2) * (dak_etaPc ) + dak_GWn ;
519 out.da_G2(in.n_l) = in.rho(in.n_g2) * (dal_etaPc ) + dal_GWn ;
520 out.da_etaph2(in.n_g2) = dak_GWn / in.rho(in.n_g2) ;
521 out.da_etaph2(in.n_l) = dal_GWn / in.rho(in.n_g2) ;
522
523 out.dp_G2 = in.rho(in.n_g2) * (dp_etaPc ) + dp_GWn ;
524 out.dp_etaph2 = dp_GWn / in.rho(in.n_g2) ;
525
526
527}
Class defining operators and methods for all reading operation in an input flow (file,...
Definition Entree.h:42
Two-group interfacial area transport source terms using the Smith et al. model.
void therm(const input_therms &input, output_therms &output) const override
Computes thermal source terms (condensation, phase change, wall nucleation).
static constexpr double alpha_coal_max_
Maximum void fraction for coalescence.
static constexpr double fac_sec_
Numerical security factor.
void coeffs(const input_coeffs &input, output_coeffs &output) const override
Computes coalescence/breakup source terms and their derivatives.
classe Flux_2groupes_base correlations de flux entre 2 groupes
const Nom & que_suis_je() const
renvoie la chaine identifiant la classe.
Definition Objet_U.cpp:104
virtual Entree & readOn(Entree &)
Lecture d'un Objet_U sur un flot d'entree Methode a surcharger.
Definition Objet_U.cpp:293
virtual Sortie & printOn(Sortie &) const
Ecriture de l'objet sur un flot de sortie Methode a surcharger.
Definition Objet_U.cpp:282
Classe de base des flux de sortie.
Definition Sortie.h:52