TrioCFD 1.9.8
TrioCFD documentation
Loading...
Searching...
No Matches
Hibiki_Ishii_nucleation_site_density.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// Hibiki, Ishii, "Active nucleation site density in boiling systems", IJHMT, 2003
17
18#include <Hibiki_Ishii_nucleation_site_density.h>
19#include <algorithm>
20#include <cmath>
21
22// Physical constants for the Hibiki-Ishii correlation
23static constexpr double N_bar = 4.72e5; // Maximum site density [sites/m^2]
24static constexpr double mu_angle = 0.722 * 180 / M_PI; // Mean cavity half-cone angle parameter [degrees]
25static constexpr double mu2 = mu_angle * mu_angle; // Squared mean angle
26static constexpr double lambda_prime = 2.5e-6; // Characteristic length for cavity size distribution [m]
27static constexpr double R_gas_universal = 8.314462618; // Universal gas constant [J/(mol.K)]
28
29// Computes the intermediate quantities shared by the function and its derivative
30static void compute_intermediates(double rho_v, double rho_l, double T_ref, double p,
31 double L_vap, double T_sat, double sigma,
32 double theta, double molar_mass,
33 double& f_rho_plus, double& inv_Rc, double& theta_factor)
34{
35 const double R = R_gas_universal / molar_mass;
36
37 const double rho_p = std::log((rho_l - rho_v) / rho_v);
38 f_rho_plus = -0.01064 + 0.48246 * rho_p - 0.22712 * rho_p * rho_p + 0.05468 * rho_p * rho_p * rho_p;
39
40 inv_Rc = p * (-1 + std::exp(L_vap * std::max(T_ref - T_sat, 0.) / (R * T_ref * T_sat))) / (2. * sigma * (1 + rho_v / rho_l));
41
42 theta_factor = 1 - std::exp(-theta * theta / (8. * mu2));
43}
44
45double Hibiki_Ishii_site_density(double rho_v, double rho_l, double T_ref, double p,
46 double L_vap, double T_sat, double sigma,
47 double theta, double molar_mass)
48{
49 double f_rho_plus, inv_Rc, theta_factor;
50 compute_intermediates(rho_v, rho_l, T_ref, p, L_vap, T_sat, sigma, theta, molar_mass,
51 f_rho_plus, inv_Rc, theta_factor);
52
53 return N_bar * theta_factor * (-1. + std::exp(f_rho_plus * lambda_prime * inv_Rc));
54}
55
56double dT_ref_Hibiki_Ishii_site_density(double rho_v, double rho_l, double T_ref, double p,
57 double L_vap, double T_sat, double sigma,
58 double theta, double molar_mass)
59{
60 double f_rho_plus, inv_Rc, theta_factor;
61 compute_intermediates(rho_v, rho_l, T_ref, p, L_vap, T_sat, sigma, theta, molar_mass,
62 f_rho_plus, inv_Rc, theta_factor);
63
64 double dT_ref_inv_Rc = 0.;
65 if (T_ref - T_sat > 0.)
66 {
67 const double R = R_gas_universal / molar_mass;
68 dT_ref_inv_Rc = p * L_vap / (R * T_ref * T_ref) * std::exp(L_vap * (T_ref - T_sat) / (R * T_ref * T_sat)) / (2. * sigma * (1 + rho_v / rho_l));
69 }
70
71 return N_bar * theta_factor * f_rho_plus * lambda_prime * dT_ref_inv_Rc * std::exp(f_rho_plus * lambda_prime * inv_Rc);
72}