TrioCFD 1.9.8
TrioCFD documentation
Loading...
Searching...
No Matches
Dispersion_bulles_turbulente_Bazin.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//Clément Bazin. Numerical and experimental studies of two-phase flows interacting with a bundle of tubes. 2023.
17
18#include <Dispersion_bulles_turbulente_Bazin.h>
19#include <Pb_Multiphase.h>
20#include <QDM_Multiphase.h>
21#include <Frottement_interfacial_base.h>
22#include <Masse_ajoutee_base.h>
23#include <math.h>
24
25Implemente_instanciable(Dispersion_bulles_turbulente_Bazin, "Dispersion_bulles_turbulente_Bazin", Dispersion_bulles_base);
26
28{
29 return os;
30}
31
33{
34 Param param(que_suis_je());
35 param.lire_avec_accolades_depuis(is);
36
38
39 const Pb_Multiphase& pbm = ref_cast(Pb_Multiphase, pb_.valeur());
40 if (pbm.has_correlation("frottement_interfacial")) correlation_drag_ = pbm.get_correlation("frottement_interfacial");
41 else Correlation_base::typer_lire_correlation(correlation_drag_, pbm, "frottement_interfacial", is);
42 if (pbm.has_correlation("masse_ajoutee")) correlation_masse_ajoutee_ = pbm.get_correlation("masse_ajoutee");
43 else Correlation_base::typer_lire_correlation(correlation_masse_ajoutee_, pbm, "masse_ajoutee", is);
44
45 return is;
46}
47
49{
50 const Frottement_interfacial_base& corr = ref_cast(Frottement_interfacial_base, correlation_drag_.valeur());
51 const Masse_ajoutee_base& corrCam = ref_cast(Masse_ajoutee_base, correlation_masse_ajoutee_.valeur());
52 int N = out.Ctd.dimension(0);
53
54 DoubleTab coeff_drag(N, N);
55 DoubleTab coeff_Cam(N); // a zero ?
56 corrCam.coeff(in.alpha, in.rho, coeff_Cam) ;
57 corr.coefficient_CD( in.alpha, in.p, in.T, in.rho, in.mu, in.sigma, in.dh, in.nv, in.d_bulles, coeff_drag);
58 out.Ctd = 0;
59
60 for (int k = 0; k < N; k++)
61 if (k!=n_l)
62 {
63
64 double gamma = 0.5 * in.rho[n_l] / in.rho[k] ;
65 double u_r = std::max(in.nv(k,n_l), 1e-4) ;
66 double tau_t = 3. / 2. * in.nut[n_l] / in.k_turb[n_l] / std::max(std::sqrt (1. + 2.07 * u_r * u_r / std::max(in.k_turb[n_l],1e-5)),1e-5) ;
67 double tau_f = ( 1. / (2. * gamma) + coeff_Cam(k) ) * 4./3. * in.d_bulles[k] / std::max( coeff_drag(k, n_l) * u_r ,1e-5) ;
68 double eta_r = tau_t / tau_f ;
69 double Dcrit = 4 * std::sqrt( in.sigma[n_l]/ g_ / std::abs(in.rho[n_l]-in.rho[k]) ) ;
70 double alpha_limited = std::max(((10. - 2. * eta_r) * gamma * gamma * gamma - (18. + 6. * eta_r) * gamma * gamma - (3. + 6. * eta_r) * gamma - (1.+ eta_r) * 2.) / ( (2. * gamma - 1.) * (2. * gamma - 1.) * ((4. + eta_r) *gamma + 1. + eta_r ) ), 0. ) ;
71 if (Dcrit < in.d_bulles[k])
72 {
73 alpha_limited = std::max(((35. - 49. * eta_r) * gamma * gamma * gamma - (161. + 77. * eta_r) * gamma * gamma - (11. + 32. * eta_r) * gamma - (1.+ eta_r) * 4.) / ( (2. * gamma - 1.) * ((91. + 49. )* gamma * gamma + (-14. + 7. * eta_r) * gamma - 2 * (1. + eta_r) ) ), 0. ) ;
74 }
75 alpha_limited = std::min( in.alpha[k] , alpha_limited ) ;
76 double Cam = ((1. + 2. * alpha_limited) * gamma + 1. - alpha_limited) / (2. * gamma * (1. - alpha_limited) + 2. + alpha_limited);
77 double b = (1. + Cam) / (1. / (2. * gamma) + Cam);
78
79 // Turbulent dispersion coefficient: added-mass, inertia, and kinetic energy contributions
80 double one_plus_eta = 1. + eta_r;
81 double drift_ratio = (b + eta_r) / one_plus_eta;
82 double conc_factor = alpha_limited / std::max(1. - alpha_limited, 1e-5);
83 double mixing = drift_ratio + conc_factor;
84
85 double term_added_mass = Cam * (b * (b - 1.) / one_plus_eta + eta_r * mixing);
86 double term_inertia = 1. / (2. * gamma) * ((b * b + eta_r) / one_plus_eta + eta_r * (drift_ratio + alpha_limited / std::max(1. - alpha_limited, 1e-3)));
87 double term_kinetic = mixing * in.rho[n_l] * 2. / 3. * in.k_turb[n_l];
88
89 out.Ctd(k, n_l) = term_added_mass + term_inertia - term_kinetic;
90 }
91}
static void typer_lire_correlation(OWN_PTR(Correlation_base)&, const Probleme_base &, const Nom &, Entree &)
classe Dispersion_bulles_base utilitaire pour les operateurs de dispersion turbulente ou la force
int find_liquid_phase() const
Finds the continuous liquid phase index in a multiphase problem.
Turbulent bubble dispersion model based on the Bazin model.
void coefficient(const input_t &input, output_t &output) const override
Class defining operators and methods for all reading operation in an input flow (file,...
Definition Entree.h:42
classe Frottement_interfacial_base utilitaire pour les operateurs de frottement interfacial prenant l...
virtual void coefficient_CD(const DoubleTab &alpha, const DoubleTab &p, const DoubleTab &T, const DoubleTab &rho, const DoubleTab &mu, const DoubleTab &sigma, double Dh, const DoubleTab &ndv, const DoubleTab &d_bulles, DoubleTab &coeff) const
classe Masse_ajoutee_base masse ajoutee de la forme
virtual void coeff(const DoubleTab &alpha, const DoubleTab &rho, DoubleTab &coeff) const =0
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
int has_correlation(std::string nom_correlation) const
const Correlation_base & get_correlation(std::string nom_correlation) const
Classe de base des flux de sortie.
Definition Sortie.h:52
_SIZE_ dimension(int d) const
Definition TRUSTTab.tpp:133