TrioCFD 1.9.8
TrioCFD documentation
Loading...
Searching...
No Matches
Portance_interfaciale_Sugrue_Modifiee.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
16#include <Portance_interfaciale_Sugrue_Modifiee.h>
17#include <Frottement_interfacial_base.h>
18#include <Pb_Multiphase.h>
19#include <Sources_helpers_Multiphase.h>
20#include <math.h>
21
22Implemente_instanciable(Portance_interfaciale_Sugrue_Modifiee, "Portance_interfaciale_Sugrue_Modifiee", Portance_interfaciale_base);
23
25{
26 return os;
27}
28
30{
31 Param param(que_suis_je());
32 param.ajouter("constante_gravitation", &g_);
33 param.lire_avec_accolades_depuis(is);
34
36
37 return is;
38}
39
41{
42 const int N = out.Cl.dimension(0);
43 const Pb_Multiphase& pbm = ref_cast(Pb_Multiphase, pb_.valeur());
44
45 for (int k = 0; k < N; k++)
46 if (k != n_l) // k gas phase
47 {
48 const int ind_trav = sigma_pair_index(k, n_l, N);
49
50 DoubleTab alpha_l(N);
51
52 // Newton method to determine dv along gravity
53 double dv0 = 0.2, epsilon = 1.e-4; // Initialize dv at random
54 int step = 1, iter_max = 20;
55 DoubleTab dv(N, N), coeff(N, N, 2);
56 const Frottement_interfacial_base& correlation_fi = ref_cast(Frottement_interfacial_base,
57 pbm.get_correlation("frottement_interfacial"));
58 double sum_alpha = 0;
59 for (int n = 0; n < N ; n++)
60 {
61 alpha_l(n)= std::max(in.alpha(n), alpha_lim_);
62 sum_alpha += alpha_l(n);
63 }
64 for (int n = 0; n < N ; n++)
65 alpha_l(n) /= sum_alpha;
66
67 do
68 {
69 dv(k,n_l) = dv0;
70 dv(n_l,k) = dv0;
71 correlation_fi.coefficient(alpha_l, in.p, in.T, in.rho, in.mu, in.sigma, in.dh, dv, in.d_bulles, coeff);
72 dv0 = dv0 - (coeff(n_l, k, 0)*dv0 - g_*alpha_l(k)*(in.rho[n_l]*in.alpha[n_l]+in.rho[k]*in.alpha[k] - in.rho[k])) / (coeff(n_l, k, 1)*dv0 + coeff(n_l, k, 0));
73 step = step+1;
74 if(step > iter_max) Process::exit(que_suis_je() + " : Newton algorithm not converging to find relative velocity !");
75 }
76 while(std::abs(coeff(n_l, k, 0)*dv0 - g_*alpha_l(k)*(in.rho[n_l]*in.alpha[n_l]+in.rho[k]*in.alpha[k]- in.rho[k])) > epsilon);
77
78 // Rest of the correlation
79 const double Eo = eotvos_number(g_, in.rho[n_l], in.rho[k], in.d_bulles[k], in.sigma[ind_trav]);
80 const double Wo = std::min(Eo * in.k_turb[n_l]/std::max(dv0*dv0, 1.e-8) , 6.); // Experimental validation up to Wo=6
81 const double f_Wo = std::min(0.03, 5.0404 - 5.0781*std::pow(Wo, 0.0108));
82 const double f_alp = in.alpha[k] < .7 ? 1 : (in.alpha[k] > .95 ? 0 : (.95 - in.alpha[k])/.25);
83 const double Cl = f_Wo*f_alp ;
84
85 out.Cl(k, n_l) = Cl * in.rho[n_l] * in.alpha[k] ;
86 out.Cl(n_l, k) = out.Cl(k, n_l);
87 }
88}
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(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 =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
classe Pb_Multiphase Cette classe represente un probleme de thermohydraulique multiphase de type "3*N...
Modified Sugrue lift coefficient for deformable bubbly flow.
void coefficient(const input_t &input, output_t &output) const override
classe Portance_interfaciale_base utilitaire pour les operateurs de frottement interfacial prenant la...
int find_liquid_phase() const
Finds the continuous liquid phase index in a multiphase problem.
const Correlation_base & get_correlation(std::string nom_correlation) const
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