TRUST 1.9.8
HPC thermohydraulic platform
Loading...
Searching...
No Matches
Frottement_interfacial_Tomiyama.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 <Frottement_interfacial_Tomiyama.h>
17#include <Pb_Multiphase.h>
18#include <Milieu_composite.h>
19#include <math.h>
20
21Implemente_instanciable(Frottement_interfacial_Tomiyama, "Frottement_interfacial_Tomiyama", Frottement_interfacial_base);
22
24{
25 return os;
26}
27
29{
30 Param param(que_suis_je());
31 param.ajouter("beta", &beta_);
32 param.ajouter("constante_gravitation", &g_);
33 param.ajouter("contamination", &contamination_);
34 param.lire_avec_accolades_depuis(is);
35 if (! ((contamination_==0)|(contamination_==1)|(contamination_==2) )) Process::exit("Frottement_interfacial_Tomiyama : only 3 contamination levels exist : 0,1,2 !");
36
37 const Pb_Multiphase *pbm = sub_type(Pb_Multiphase, pb_.valeur()) ? &ref_cast(Pb_Multiphase, pb_.valeur()) : nullptr;
38
39 if (!pbm || pbm->nb_phases() == 1) Process::exit(que_suis_je() + " : not needed for single-phase flow!");
40 for (int n = 0; n < pbm->nb_phases(); n++) //recherche de n_l, n_g : phase {liquide,gaz}_continu en priorite
41 if (pbm->nom_phase(n).debute_par("liquide") && (n_l < 0 || pbm->nom_phase(n).finit_par("continu"))) n_l = n;
42 if (n_l < 0) Process::exit(que_suis_je() + " : liquid phase not found!");
43
44 for (int k = 0; k < pbm->nb_phases(); k++)
45 if (k != n_l)
46 if (!(ref_cast(Milieu_composite, pbm->milieu()).has_interface(n_l, k))) Process::exit("Frottement_interfacial_Tomiyama : one must define an interface and have a surface tension !");
47
48 return is;
49}
50
52{
53 if (!pb_->has_champ("diametre_bulles")) Process::exit("Frottement_interfacial_Tomiyama : there must be a bubble diameter field !");
54}
55
56
57void Frottement_interfacial_Tomiyama::coefficient(const DoubleTab& alpha, const DoubleTab& p, const DoubleTab& T,
58 const DoubleTab& rho, const DoubleTab& mu, const DoubleTab& sigma, double Dh,
59 const DoubleTab& ndv, const DoubleTab& d_bulles, DoubleTab& coeff) const
60{
61 int N = ndv.dimension(0);
62
63 coeff = 0;
64
65 for (int k = 0; k < N; k++)
66 if (k!=n_l)
67 {
68 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);
69
70 double Re = rho(n_l) * std::max(ndv(n_l,k), 1.e-6) * d_bulles(k)/mu(n_l);
71 double dndv_Re = rho(n_l) * (ndv(n_l,k)> 1.e-6 ? 1. : 0. ) * d_bulles(k)/mu(n_l);
72 double Eo = g_ * std::abs(rho(n_l)-rho(k)) * d_bulles(k)*d_bulles(k)/sigma(ind_trav);
73
74 double Cd = -1;
75 double dndv_Cd = 0.;
76 if (contamination_==0) Cd = beta_ * std::max( std::min( 16./Re*(1+0.15*std::pow(Re, 0.687)) , 48./Re ) , 8.*Eo/(3.*(Eo+4.)));
77 if (contamination_==1) Cd = beta_ * std::max( std::min( 24./Re*(1+0.15*std::pow(Re, 0.687)) , 72./Re ) , 8.*Eo/(3.*(Eo+4.)));
78 if (contamination_==2) Cd = beta_ * std::max( 24./Re*(1+0.15*std::pow(Re, 0.687)) , 8.*Eo/(3.*(Eo+4.)));
79
80 if ((contamination_==0) && (16./Re*(1+0.15*std::pow(Re, 0.687)) < 48./Re ) && (16./Re*(1+0.15*std::pow(Re, 0.687)) > 8.*Eo/(3.*(Eo+4.))) )
81 dndv_Cd = beta_ * -16.*dndv_Re/(Re*Re)*(1+0.15*std::pow(Re, 0.687)) + beta_ * 16./Re*0.15*dndv_Re*0.687*std::pow(Re, 0.687-1.);
82 else if ((contamination_==0) && (16./Re*(1+0.15*std::pow(Re, 0.687)) > 48./Re ) && (48./Re > 8.*Eo/(3.*(Eo+4.))) )
83 dndv_Cd = beta_ * -48.*dndv_Re/(Re*Re);
84 else if ((contamination_==1) && (24./Re*(1+0.15*std::pow(Re, 0.687)) < 72./Re ) && (24./Re*(1+0.15*std::pow(Re, 0.687)) > 8.*Eo/(3.*(Eo+4.))) )
85 dndv_Cd = beta_ * -24.*dndv_Re/(Re*Re)*(1+0.15*std::pow(Re, 0.687)) + beta_ * 24./Re*0.15*dndv_Re*0.687*std::pow(Re, 0.687-1.);
86 else if ((contamination_==1) && (24./Re*(1+0.15*std::pow(Re, 0.687)) > 72./Re ) && (72./Re > 8.*Eo/(3.*(Eo+4.))) )
87 dndv_Cd = beta_ * -72.*dndv_Re/(Re*Re);
88 else if ((contamination_==2) && (24./Re*(1+0.15*std::pow(Re, 0.687)) > 8.*Eo/(3.*(Eo+4.))) )
89 dndv_Cd = beta_ * -24.*dndv_Re/(Re*Re)*(1+0.15*std::pow(Re, 0.687)) + beta_ * 24./Re*0.15*dndv_Re*0.687*std::pow(Re, 0.687-1.);
90
91 if (alpha(n_l) > 1.e-6)
92 {
93 coeff(k, n_l, 0) = 3./4.*Cd/d_bulles(k) * alpha(k) * rho(n_l) * ndv(n_l,k);
94 coeff(n_l, k, 0) = coeff(k, n_l, 0);
95 coeff(k, n_l, 1) = 3./4.*Cd/d_bulles(k) * alpha(k) * rho(n_l) + 3./4.*dndv_Cd/d_bulles(k) * alpha(k) * rho(n_l) * ndv(n_l,k);
96 coeff(n_l, k, 1) = coeff(k, n_l, 1);
97 }
98 else
99 {
100 coeff(k, n_l, 0) = 3./4.*Cd/d_bulles(k) * alpha(k) * rho(n_l) * ndv(n_l,k) * alpha(n_l) * 1.e6;
101 coeff(n_l, k, 0) = coeff(k, n_l, 0);
102 coeff(k, n_l, 1) = (3./4.*Cd/d_bulles(k) * alpha(k) * rho(n_l) + 3./4.*dndv_Cd/d_bulles(k) * alpha(k) * rho(n_l) * ndv(n_l,k) )* alpha(n_l) * 1.e6;
103 coeff(n_l, k, 1) = coeff(k, n_l, 1);
104 }
105 }
106}
107
108
109void Frottement_interfacial_Tomiyama::coefficient_CD(const DoubleTab& alpha, const DoubleTab& p, const DoubleTab& T,
110 const DoubleTab& rho, const DoubleTab& mu, const DoubleTab& sigma, double Dh,
111 const DoubleTab& ndv, const DoubleTab& d_bulles, DoubleTab& coeff) const
112{
113 int N = ndv.dimension(0);
114
115 coeff = 0;
116
117 for (int k = 0; k < N; k++)
118 if (k!=n_l)
119 {
120 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);
121
122 double Re = rho(n_l) * std::max(ndv(n_l,k), 1.e-6) * d_bulles(k)/mu(n_l);
123 double Eo = g_ * std::abs(rho(n_l)-rho(k)) * d_bulles(k)*d_bulles(k)/sigma(ind_trav);
124 double Cd = -1;
125 if (contamination_==0) Cd = beta_ * std::max( std::min( 16./Re*(1+0.15*std::pow(Re, 0.687)) , 48./Re ) , 8.*Eo/(3.*(Eo+4.)));
126 if (contamination_==1) Cd = beta_ * std::max( std::min( 24./Re*(1+0.15*std::pow(Re, 0.687)) , 72./Re ) , 8.*Eo/(3.*(Eo+4.)));
127 if (contamination_==2) Cd = beta_ * std::max( 24./Re*(1+0.15*std::pow(Re, 0.687)) , 8.*Eo/(3.*(Eo+4.)));
128
129 coeff(k, n_l) = (coeff(n_l, k) = Cd);
130 }
131}
Class defining operators and methods for all reading operation in an input flow (file,...
Definition Entree.h:42
classe Frottement_interfacial_Tomiyama coefficients de frottement interfacial d'un ecoulement a bulle...
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 override
void coefficient(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 override
classe Frottement_interfacial_base utilitaire pour les operateurs de frottement interfacial prenant l...
virtual int debute_par(const char *const n) const
Definition Nom.cpp:319
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
const Nom & nom_phase(int i) const
int nb_phases() const
virtual const Milieu_base & milieu() const
Renvoie le milieu physique associe au probleme.
static void exit(int exit_code=-1)
Routine de sortie de TRUST dans une region Kokkos.
Definition Process.cpp:455
Classe de base des flux de sortie.
Definition Sortie.h:52
_SIZE_ dimension(int d) const
Definition TRUSTTab.tpp:133