TrioCFD 1.9.9_beta
TrioCFD documentation
Loading...
Searching...
No Matches
Flux_parietal_Hibiki.cpp
1/****************************************************************************
2* Copyright (c) 2021, 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//Caleb S. Brooks, Takashi Hibiki, Wall nucleation modeling in subcooled boiling flow, International Journal of Heat and Mass Transfer, 2015, https://doi.org/10.1016/j.ijheatmasstransfer.2015.03.005
17
18#include <Flux_parietal_Hibiki.h>
19#include <Hibiki_Ishii_nucleation_site_density.h>
20#include <Flux_parietal_adaptatif.h>
21#include <Loi_paroi_adaptative.h>
22#include <Correlation_base.h>
23#include <Pb_Multiphase.h>
24#include <Domaine_dis_base.h>
25#include <Domaine_VF.h>
26#include <TRUSTTrav.h>
27#include <Milieu_composite.h>
28#include <Saturation_base.h>
29
30#include <cmath>
31
32Implemente_instanciable(Flux_parietal_Hibiki, "Flux_parietal_Hibiki", Flux_parietal_base);
33
35
37{
38 const Pb_Multiphase& pbm = ref_cast(Pb_Multiphase, pb_.valeur());
39 Correlation_base::typer_lire_correlation(correlation_monophasique_, pbm, "Flux_parietal", is);
40 Cout << que_suis_je() << " : single-phase wall heat flux is " << correlation_monophasique_->que_suis_je() << finl;
41
42 Param param(que_suis_je());
43 param.ajouter("contact_angle_deg",&theta_);
44 param.ajouter("molar_mass",&molar_mass_,Param::REQUIRED);
45 param.ajouter("Qw",&Qw_,Param::REQUIRED);
46 param.ajouter("G",&G_,Param::REQUIRED);
47 param.lire_avec_accolades(is);
48
49 if ( !sub_type(Milieu_composite, pb_->milieu())) Process::exit("Flux_parietal_Hibiki::readOn : the medium must be composite !");
50 if (!pbm.nom_phase(0).debute_par("liquide")) Process::exit("Flux_parietal_Hibiki::readOn : the first phase must be liquid !");
51
52 for (int n = 0; n < pbm.nb_phases(); n++) //recherche de n_l, n_g : phase {liquide,gaz}_continu en priorite
53 {
54 if (pbm.nom_phase(n).debute_par("liquide") && (n_l < 0 || pbm.nom_phase(n).finit_par("continu"))) n_l = n;
55 if (( pbm.nom_phase(n).finit_par("group1"))) n_g1 = n;
56 if (( pbm.nom_phase(n).finit_par("group2"))) n_g2 = n;
57 }
58 if (n_l < 0) Process::exit(que_suis_je() + " : liquid phase not found!");
59 if (n_g1 < 0) Process::exit(que_suis_je() + " : group 1 not found!");
60 if (n_g2 < 0) Process::exit(que_suis_je() + " : group 2 not found!");
61
62 return is;
63}
64
66{
67 correlation_monophasique_->completer();
68}
69
70void Flux_parietal_Hibiki::qp(const input_t& in, output_t& out) const
71{
72 // On met tout a 0 a tout hasard
73 if (out.qpk) (*out.qpk) = 0.;
74 if (out.da_qpk) (*out.da_qpk) = 0.;
75 if (out.dp_qpk) (*out.dp_qpk) = 0.;
76 if (out.dv_qpk) (*out.dv_qpk) = 0.;
77 if (out.dTf_qpk) (*out.dTf_qpk)= 0.;
78 if (out.dTp_qpk) (*out.dTp_qpk)= 0.;
79 if (out.qpi) (*out.qpi) = 0.;
80 if (out.da_qpi) (*out.da_qpi) = 0.;
81 if (out.dp_qpi) (*out.dp_qpi) = 0.;
82 if (out.dv_qpi) (*out.dv_qpi) = 0.;
83 if (out.dTf_qpi) (*out.dTf_qpi)= 0.;
84 if (out.dTp_qpi) (*out.dTp_qpi)= 0.;
85 if (out.nonlinear) (*out.nonlinear) = 1;
86
87 // On remplit le monophasique ; pas besoin du flux interfacial normalement
88 ref_cast(Flux_parietal_base, correlation_monophasique_.valeur()).qp(in, out);
89
90 // Ici la phase liquide est forcement la phase 0 car la correlation monophasique ne remplit que la phase 0
91 const Milieu_composite& milc = ref_cast(Milieu_composite, pb_->milieu());
92
93 if (milc.has_saturation(n_l, n_g1))
94 {
95 int ind_sat = n_g1<n_l ? ( n_g1 *(in.N-1)-( n_g1 -1)*( n_g1 )/2) + (n_l- n_g1 -1) :
96 (n_l*(in.N-1)-(n_l-1)*(n_l)/2) + ( n_g1 -n_l-1);
97
98 double Delta_T_sup = in.Tp - in.Tsat[ind_sat]; // Wall superheat
99
100 if (Delta_T_sup > 0) // Else : no wall superheat => no nucleation => single phase heat transfer only
101 {
102
103 double JaT = in.Cp[n_l] * std::max(in.Tp - in.T[n_l], 0.) / in.Lvap[ind_sat] ;
104 double dTp_JaT = in.Tp - in.T[n_l] > 0. ? in.Cp[n_l] * std::max(in.Tp , 1.e-8) / in.Lvap[ind_sat] : 0. ;
105 double dTl_JaT = in.Tp - in.T[n_l] > 0. ? - in.Cp[n_l] * in.T[n_l] / in.Lvap[ind_sat] : 0. ;
106 double Jaw = in.Cp[n_l] * std::max(in.Tp - in.Tsat[ind_sat], 1.e-8) / in.Lvap[ind_sat] ;
107 double dTp_Jaw = in.Tp - in.Tsat[ind_sat] > 0. ? in.Cp[n_l] * in.Tp / in.Lvap[ind_sat] : 0. ;
108 double Prl = (in.mu[n_l]*in.Cp[n_l])/in.lambda[n_l];
109 double Bo = Qw_ / G_ / in.Lvap[ind_sat] ;
110
111
112 // Nucleation site density (Hibiki Ishii 2003) — T_ref = T_v (gas temperature)
113 const double N_sites = Hibiki_Ishii_site_density(in.rho[n_g1], in.rho[n_l], in.T[n_g1], in.p, in.Lvap[ind_sat], in.Tsat[ind_sat], in.Sigma[ind_sat], theta_, molar_mass_);
114 const double dTg_N_sites = dT_ref_Hibiki_Ishii_site_density(in.rho[n_g1], in.rho[n_l], in.T[n_g1], in.p, in.Lvap[ind_sat], in.Tsat[ind_sat], in.Sigma[ind_sat], theta_, molar_mass_);
115 const double dTp_N_sites = 0.; // Site density does not depend on wall temperature in Hibiki model
116 const double dTl_N_sites = 0.; // Site density does not depend on liquid temperature
117
118 // Departure diameter
119 double D_d = in.Tp - in.T[n_l] > 0.? 2.11e-3 * std::pow(JaT,-0.49) * std::pow(in.rho[n_g1]/in.rho[n_l],-0.78) * std::pow(Bo,0.44) * std::pow(Prl,1.72) : 1e-8 ;
120 double dTp_D_d = in.Tp - in.T[n_l] > 0. ? 2.11e-3 * -0.49 * dTp_JaT * std::pow(JaT,-1.49) * std::pow(in.rho[n_g1]/in.rho[n_l],-0.78) * std::pow(Bo,0.44) * std::pow(Prl,1.72) : 0.;
121 double dTl_D_d = in.Tp - in.T[n_l] > 0. ? 2.11e-3 * -0.49 * dTl_JaT *std::pow(JaT,-1.49) * std::pow(in.rho[n_g1]/in.rho[n_l],-0.78) * std::pow(Bo,0.44) * std::pow(Prl,1.72) : 0.;
122
123 // Bubble departure frequency
124 double f_dep = in.Tp - in.T[n_l] > 0.? D_d * D_d / (in.lambda[n_l]/(in.rho[n_l]*in.Cp[n_l])) * std::pow(Jaw,2.28) * std::pow(in.rho[n_g1]/in.rho[n_l],-0.93) * std::pow(JaT,-1.46) * std::pow(Prl,2.36) : 0. ;
125 double dTp_f_dep = in.Tp - in.T[n_l] > 0. ? 2. * D_d * dTp_D_d / (in.lambda[n_l]/(in.rho[n_l]*in.Cp[n_l])) * std::pow(Jaw,2.28) * std::pow(in.rho[n_g1]/in.rho[n_l],-0.93) * std::pow(JaT,-1.46) * std::pow(Prl,2.36)
126 + D_d * D_d / (in.lambda[n_l]/(in.rho[n_l]*in.Cp[n_l])) * 2.28 * dTp_Jaw * std::pow(Jaw,1.28) * std::pow(in.rho[n_g1]/in.rho[n_l],-0.93) * std::pow(JaT,-1.46) * std::pow(Prl,2.36)
127 + D_d * D_d / (in.lambda[n_l]/(in.rho[n_l]*in.Cp[n_l])) * std::pow(Jaw,2.28) * std::pow(in.rho[n_g1]/in.rho[n_l],-0.93) * -1.46 * dTp_JaT * std::pow(JaT,-2.46) * std::pow(Prl,2.36) : 0. ;
128 double dTl_f_dep = in.Tp - in.T[n_l] > 0. ? 2. * D_d * dTl_D_d / (in.lambda[n_l]/(in.rho[n_l]*in.Cp[n_l])) * std::pow(Jaw,2.28) * std::pow(in.rho[n_g1]/in.rho[n_l],-0.93) * std::pow(JaT,-1.46) * std::pow(Prl,2.36)
129 + D_d * D_d / (in.lambda[n_l]/(in.rho[n_l]*in.Cp[n_l])) * std::pow(Jaw,2.28) * std::pow(in.rho[n_g1]/in.rho[n_l],-0.93) * -1.46 *dTl_JaT * std::pow(JaT,-2.46) * std::pow(Prl,2.36) : 0. ;
130
131
132 // Evaporation
133 if (out.qpi) (*out.qpi)(n_l, n_g1) = 1./6.*M_PI * in.rho[n_g1] * in.Lvap[ind_sat] * std::pow(D_d,3.) * f_dep * N_sites;
134 if (out.dTp_qpi) (*out.dTp_qpi)(n_l, n_g1) =1./6.*M_PI * in.rho[n_g1] * in.Lvap[ind_sat] * (3.*dTp_D_d * std::pow(D_d,2.) * f_dep * N_sites
135 + std::pow(D_d,3.) * dTp_f_dep * N_sites
136 + std::pow(D_d,3.) * f_dep * dTp_N_sites);
137 if (out.dTf_qpi) (*out.dTf_qpi)(n_l, n_g1, n_l) = 1./6.*M_PI * in.rho[n_g1] * in.Lvap[ind_sat] * (3.*dTl_D_d * std::pow(D_d,2.) * f_dep * N_sites+ std::pow(D_d,3.) * dTl_f_dep * N_sites + std::pow(D_d,3.) * f_dep * dTl_N_sites);
138 if (out.dTf_qpi) (*out.dTf_qpi)(n_l, n_g1, n_g1) = 1./6.*M_PI * in.rho[n_g1] * in.Lvap[ind_sat] * ( std::pow(D_d,3.) * f_dep * dTg_N_sites);
139
140 if (out.d_nuc) (*out.d_nuc)(n_g1) = D_d;
141
142 }
143 }
144}
static void typer_lire_correlation(OWN_PTR(Correlation_base)&, const Probleme_base &, const Nom &, Entree &)
Class defining operators and methods for all reading operation in an input flow (file,...
Definition Entree.h:42
Wall heat flux correlation for subcooled boiling using the Hibiki model.
double molar_mass_
Molar mass [kg/mol].
double G_
Mass flux [kg/m^2/s].
int n_l
Liquid phase index.
double Qw_
Wall heat flux [W/m^2].
int n_g1
Gas group 1 index.
void qp(const input_t &input, output_t &output) const override
double theta_
Contact angle on the surface [degrees].
int n_g2
Gas group 2 index.
Base class for wall heat flux correlations of the form:
Composite medium representing a multiphase fluid and its properties:
bool has_saturation(int k, int l) const
virtual int finit_par(const char *const n) const
Definition Nom.cpp:319
virtual int debute_par(const char *const n) const
Definition Nom.cpp:314
const Nom & que_suis_je() const
Returns the string identifying the class.
Definition Objet_U.cpp:104
virtual Entree & readOn(Entree &)
Reads an Objet_U from an input stream. Virtual method to override.
Definition Objet_U.cpp:289
virtual Sortie & printOn(Sortie &) const
Writes the object to an output stream. Virtual method to override.
Definition Objet_U.cpp:278
@ REQUIRED
Definition Param.h:115
const Nom & nom_phase(int i) const
int nb_phases() const
static void exit(int exit_code=-1)
Exit routine for TRUST within a Kokkos region.
Definition Process.cpp:466
Base class for output streams.
Definition Sortie.h:52