TrioCFD 1.9.8
TrioCFD documentation
Loading...
Searching...
No Matches
Frottement_interfacial_Tomiyama_complet.cpp
1/****************************************************************************
2* Copyright (c) 2023, 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// NeptuneCFD like force no publication
16
17#include <Frottement_interfacial_Tomiyama_complet.h>
18#include <Pb_Multiphase.h>
19#include <Milieu_composite.h>
20#include <Sources_helpers_Multiphase.h>
21#include <math.h>
22
23Implemente_instanciable(Frottement_interfacial_Tomiyama_complet, "Frottement_interfacial_Tomiyama_complet", Frottement_interfacial_base);
24
26{
27 return os;
28}
29
31{
32 Param param(que_suis_je());
33 param.ajouter("beta", &beta_);
34 param.ajouter("constante_gravitation", &g_);
35 param.ajouter("contamination", &contamination_);
36 param.lire_avec_accolades_depuis(is);
37 if (! ((contamination_==0)|(contamination_==1)|(contamination_==2) )) Process::exit("Frottement_interfacial_Tomiyama_complet : only 3 contamination levels exist : 0,1,2 !");
38
39 const Pb_Multiphase *pbm = sub_type(Pb_Multiphase, pb_.valeur()) ? &ref_cast(Pb_Multiphase, pb_.valeur()) : nullptr;
40
41 if (!pbm) Process::exit(que_suis_je() + " : not needed for single-phase flow!");
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_complet : 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_complet : there must be a bubble diameter field !");
54}
55
56std::pair<double, double> Frottement_interfacial_Tomiyama_complet::compute_Cd(double Re, double dndv_Re, double Eo, double alpha_k) const
57{
58 // Stokes and cap coefficients per contamination level:
59 // contamination_ 0 (pure): Stokes coeff = 16, cap coeff = 48
60 // contamination_ 1 (moderate): Stokes coeff = 24, cap coeff = 72
61 // contamination_ 2 (fully cont): Stokes coeff = 24, no cap limit
62 static constexpr double stokes_coeff[] = {16., 24., 24.};
63 static constexpr double cap_coeff[] = {48., 72., 1e300};
64
65 const double minCdelli_cap = std::min(
66 2. / 3. * std::sqrt(Eo) * std::pow((1 + 17.67 * std::pow(1 - alpha_k, 9. / 7.)) / (18.67 * std::pow(1 - alpha_k, 3. / 2.)), 2.),
67 8. * Eo / (3. * (Eo + 4.)) * (1 - alpha_k) * (1 - alpha_k));
68
69 const double sc = stokes_coeff[contamination_];
70 const double cc = cap_coeff[contamination_];
71 const double Re_power = std::pow(Re, 0.687);
72 const double Cd_stokes = sc / Re * (1 + 0.15 * Re_power);
73 const double Cd_cap = cc / Re;
74 const double Cd_viscous = std::min(Cd_stokes, Cd_cap);
75 const double Cd = beta_ * std::max(Cd_viscous, minCdelli_cap);
76
77 double dndv_Cd = 0.;
78 if (Cd_viscous > minCdelli_cap)
79 {
80 if (Cd_stokes <= Cd_cap)
81 dndv_Cd = beta_ * (-sc * dndv_Re / (Re * Re) * (1 + 0.15 * Re_power) + sc / Re * 0.15 * dndv_Re * 0.687 * std::pow(Re, 0.687 - 1.));
82 else
83 dndv_Cd = beta_ * (-cc * dndv_Re / (Re * Re));
84 }
85
86 return {Cd, dndv_Cd};
87}
88
89void Frottement_interfacial_Tomiyama_complet::coefficient(const DoubleTab& alpha, const DoubleTab& p, const DoubleTab& T,
90 const DoubleTab& rho, const DoubleTab& mu, const DoubleTab& sigma, double Dh,
91 const DoubleTab& ndv, const DoubleTab& d_bulles, DoubleTab& coeff) const
92{
93 const int N = ndv.dimension(0);
94
95 coeff = 0;
96
97 for (int k = 0; k < N; k++)
98 if (k != n_l)
99 {
100 const int ind_trav = sigma_pair_index(k, n_l, N);
101
102 const double Re = rho(n_l) * std::max(ndv(n_l, k), 1.e-6) * d_bulles(k) / mu(n_l);
103 const double dndv_Re = rho(n_l) * (ndv(n_l, k) > 1.e-6 ? 1. : 0.) * d_bulles(k) / mu(n_l);
104 const double Eo = eotvos_number(g_, rho(n_l), rho(k), d_bulles(k), sigma(ind_trav));
105
106 const auto [Cd, dndv_Cd] = compute_Cd(Re, dndv_Re, Eo, alpha(k));
107
108 if (alpha(n_l) > 1.e-6)
109 {
110 coeff(k, n_l, 0) = 3. / 4. * Cd / d_bulles(k) * alpha(k) * rho(n_l) * ndv(n_l, k);
111 coeff(n_l, k, 0) = coeff(k, n_l, 0);
112 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);
113 coeff(n_l, k, 1) = coeff(k, n_l, 1);
114 }
115 else
116 {
117 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;
118 coeff(n_l, k, 0) = coeff(k, n_l, 0);
119 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;
120 coeff(n_l, k, 1) = coeff(k, n_l, 1);
121 }
122 }
123}
124
125
126void Frottement_interfacial_Tomiyama_complet::coefficient_CD(const DoubleTab& alpha, const DoubleTab& p, const DoubleTab& T,
127 const DoubleTab& rho, const DoubleTab& mu, const DoubleTab& sigma, double Dh,
128 const DoubleTab& ndv, const DoubleTab& d_bulles, DoubleTab& coeff) const
129{
130 const int N = ndv.dimension(0);
131
132 coeff = 0;
133
134 for (int k = 0; k < N; k++)
135 if (k != n_l)
136 {
137 const int ind_trav = sigma_pair_index(k, n_l, N);
138
139 const double Re = rho(n_l) * std::max(ndv(n_l, k), 1.e-6) * d_bulles(k) / mu(n_l);
140 const double Eo = eotvos_number(g_, rho(n_l), rho(k), d_bulles(k), sigma(ind_trav));
141
142 const auto [Cd, dndv_Cd] = compute_Cd(Re, 0., Eo, alpha(k));
143
144 coeff(k, n_l) = (coeff(n_l, k) = Cd);
145 }
146}
Class defining operators and methods for all reading operation in an input flow (file,...
Definition Entree.h:42
Interfacial friction coefficients for bubbly flows using the Tomiyama correlation.
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
Computes drag coefficients Cd only (no derivatives).
int contamination_
Contamination level: 0=pure, 1=moderate, 2=fully contaminated.
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
Computes friction coefficients and their derivatives with respect to relative velocity.
classe Frottement_interfacial_base utilitaire pour les operateurs de frottement interfacial prenant l...
int find_liquid_phase() const
Finds the continuous liquid phase index in a multiphase problem.
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 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