TrioCFD 1.9.9_beta
TrioCFD documentation
Loading...
Searching...
No Matches
Flux_interfacial_Zeitoun.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#include <Flux_interfacial_Zeitoun.h>
17#include <Pb_Multiphase.h>
18
19Implemente_instanciable(Flux_interfacial_Zeitoun, "Flux_interfacial_Zeitoun", Flux_interfacial_base);
20
22{
23 return os;
24}
25
27{
28 Param param(que_suis_je());
29 param.ajouter("dv_min", &dv_min_);
30 param.lire_avec_accolades_depuis(is);
31 return is;
32}
33
35{
36 Pb_Multiphase *pbm = sub_type(Pb_Multiphase, pb_.valeur()) ? &ref_cast(Pb_Multiphase, pb_.valeur()) : nullptr;
37
38 if (!pbm || pbm->nb_phases() == 1) Process::exit(que_suis_je() + " : not needed for single-phase flow!");
39 for (int n = 0; n < pbm->nb_phases(); n++) //search for n_l, n_g: continuous {liquid,gas} phase with priority
40 if (pbm->nom_phase(n).debute_par("liquide") && (n_l < 0 || pbm->nom_phase(n).finit_par("continu"))) n_l = n;
41
42 if (n_l < 0) Process::exit(que_suis_je() + " : liquid phase not found!");
43
44 if (!pbm->has_champ("diametre_bulles")) Process::exit("Flux_interfacial_Ranz_Mashall : bubble diameter needed !");
45
46 if (a_res_ < 1.e-12)
47 {
48 a_res_ = ref_cast(QDM_Multiphase, pb_->equation(0)).alpha_res();
49 a_res_ = std::max(1.e-4, a_res_*10.);
50 }
51
52 a_res_ = -1.;
53}
54
55
57{
58 out.hi = 0.;
59 out.da_hi= 0.;
60 out.dp_hi = 0.;
61 out.dT_hi= 0.;
62
63 int k, N = out.hi.dimension(0);
64 for (k = 0; k < N; k++)
65 if (k != n_l)
66 {
67 int ind_trav = (k>n_l) ? (n_l*(N-1)-(n_l-1)*(n_l)/2) + (k-n_l-1) : (k*(N-1)-(k-1)*(k)/2) + (n_l-k-1);
68 if ( in.T[k] > in.T[n_l]) // Cas condensation
69 {
70 double Re_b = in.rho[n_l] * in.nv[N * n_l + k] * in.d_bulles[k] / in.mu[n_l];
71
72 double Ja = std::max(in.T[k] - in.T[n_l], 2.) * in.rho[n_l] * in.Cp[n_l] / (in.rho[k] * in.Lvap[ind_trav] );
73 double dP_Ja = std::max(in.T[k] - in.T[n_l], 2.) * in.rho[n_l] * in.Cp[n_l] / in.rho[k] * -in.dP_Lvap[ind_trav]/(in.Lvap[ind_trav]*in.Lvap[ind_trav]) ;
74 double dTk_Ja = (in.T[k] - in.T[n_l] > 2.) ? in.rho[n_l] * in.Cp[n_l] / (in.rho[k] * in.Lvap[ind_trav] ) : 0. ;
75 double dTl_Ja = (in.T[k] - in.T[n_l] > 2.) ? - in.rho[n_l] * in.Cp[n_l] / (in.rho[k] * in.Lvap[ind_trav] ) : 0. ;
76
77 double Nu = 2.04* std::pow(Re_b, .61)* std::pow(std::max(in.alpha[k], a_min_coeff), 0.328)* std::pow(Ja, -0.308);
78 double da_Nu = 2.04* std::pow(Re_b, .61)*( (in.alpha[k] > a_min_coeff) ? 0.328*std::pow(in.alpha[k], 0.328-1.) : 0. )* std::pow(Ja, -1.308);
79 double dP_Nu = 2.04* std::pow(Re_b, .61)* std::pow(std::max(in.alpha[k], a_min_coeff), 0.328)* -.308*dP_Ja *std::pow(Ja, -1.308);
80 double dTk_Nu = 2.04* std::pow(Re_b, .61)* std::pow(std::max(in.alpha[k], a_min_coeff), 0.328)* -.308*dTk_Ja *std::pow(Ja, -1.308);
81 double dTl_Nu = 2.04* std::pow(Re_b, .61)* std::pow(std::max(in.alpha[k], a_min_coeff), 0.328)* -.308*dTl_Ja *std::pow(Ja, -1.308);
82
83 out.hi(n_l, k) = Nu * in.lambda[n_l] * 6. / (in.d_bulles[k]*in.d_bulles[k]) * std::max(in.alpha[k], a_min); // std::max() to ensure non-zero interfacial flux
84 out.da_hi(n_l, k, k) = (in.alpha[k] > a_min ?
85 Nu * in.lambda[n_l] * 6. / (in.d_bulles[k]*in.d_bulles[k]) :
86 0.)
87 + da_Nu* in.lambda[n_l] * 6. / (in.d_bulles[k]*in.d_bulles[k]) * std::max(in.alpha[k], a_min);
88 out.dp_hi(n_l, k) = dP_Nu * in.lambda[n_l] * 6. / (in.d_bulles[k]*in.d_bulles[k]) * std::max(in.alpha[k], a_min);
89 out.dT_hi(n_l, k,n_l)= dTl_Nu * in.lambda[n_l] * 6. / (in.d_bulles[k]*in.d_bulles[k]) * std::max(in.alpha[k], a_min);
90 out.dT_hi(n_l, k, k) = dTk_Nu * in.lambda[n_l] * 6. / (in.d_bulles[k]*in.d_bulles[k]) * std::max(in.alpha[k], a_min);
91 out.hi(k, n_l) = 1e8;
92 if (in.alpha[k] < a_res_)
93 {
94 double hi_loc = out.hi(n_l, k);
95 out.hi(n_l, k) = 1.e8*(1-in.alpha[k]/a_res_) + out.hi(n_l, k) * in.alpha[k]/a_res_;
96 out.da_hi(n_l, k, k) = -1.e8/a_res_ + out.da_hi(n_l, k, k) * in.alpha[k]/a_res_ + hi_loc/a_res_;
97 out.dp_hi(n_l, k) = out.dp_hi(n_l, k) * in.alpha[k]/a_res_ ;
98 }
99 }
100 else // Cas flashing
101 {
102 out.hi(n_l, k) = 1.e8;
103 out.da_hi(n_l, k, k) = 0.;
104 out.dp_hi(n_l, k) = 0.;
105 out.dT_hi(n_l, k,n_l)= 0.;
106 out.dT_hi(n_l, k, k) = 0.;
107 out.hi(k, n_l) = 1e8;
108 }
109 }
110}
Class defining operators and methods for all reading operation in an input flow (file,...
Definition Entree.h:42
Zeitoun interfacial heat flux correlation.
void coeffs(const input_t &in, output_t &out) const override
Base class for interfacial heat flux correlations of the form:
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
Multiphase thermohydraulics problem of type "3*N equations":
const Nom & nom_phase(int i) const
int nb_phases() const
bool has_champ(const Motcle &nom, OBS_PTR(Champ_base) &ref_champ) const override
static void exit(int exit_code=-1)
Exit routine for TRUST within a Kokkos region.
Definition Process.cpp:466
Carries the terms of the momentum equation for multiphase flow without turbulence modelling.
Base class for output streams.
Definition Sortie.h:52
_SIZE_ dimension(int d) const
Definition TRUSTTab.tpp:133