TRUST 1.9.8
HPC thermohydraulic platform
Loading...
Searching...
No Matches
Frottement_interfacial_bulles_constant.cpp
1/****************************************************************************
2* Copyright (c) 2025, 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_bulles_constant.h>
17#include <Pb_Multiphase.h>
18#include <TRUSTTab.h>
19#include <Milieu_MUSIG.h>
20
21Implemente_instanciable(Frottement_interfacial_bulles_constant, "Frottement_interfacial_bulles_constant", Frottement_interfacial_base);
22
24{
25 return os;
26}
27
29{
30 Param param(que_suis_je());
31 param.ajouter("coeff_derive", &C_d_, Param::REQUIRED);
32 param.ajouter("rayon_bulle", &r_bulle_);
33 param.lire_avec_accolades_depuis(is);
34
35 const Pb_Multiphase *pbm = sub_type(Pb_Multiphase, pb_.valeur()) ? &ref_cast(Pb_Multiphase, pb_.valeur()) : nullptr;
36
37 if (!pbm || pbm->nb_phases() == 1) Process::exit(que_suis_je() + " : not needed for single-phase flow!");
38
39 for (int n = 0; n < pbm->nb_phases(); n++) //recherche de n_l, n_g : phase {liquide,gaz}_continu en priorite
40 if (pbm->nom_phase(n).debute_par("liquide") && (n_l < 0 || pbm->nom_phase(n).finit_par("continu"))) n_l = n;
41 if (n_l < 0) Process::exit(que_suis_je() + " : liquid phase not found!");
42
43 // Traitement milieu MUSIG (phase dispersee)
44 const Milieu_MUSIG *milMusig = sub_type(Milieu_MUSIG, pbm->milieu()) ? &ref_cast(Milieu_MUSIG, pbm->milieu()) : nullptr;
45 if (milMusig)
46 {
47 for (int k = 0; k < pbm->nb_phases(); k++)
48 {
49 if (milMusig->has_carrier_gas(k)) n_l = k;
50 if (milMusig->has_carrier_liquid(k)) n_l = k;
51 }
52 }
53
54 return is;
55}
56
58{
59 const Pb_Multiphase *pbm = sub_type(Pb_Multiphase, pb_.valeur()) ? &ref_cast(Pb_Multiphase, pb_.valeur()) : nullptr;
60 if ((r_bulle_<0.) && (!pbm->has_champ("diametre_bulles"))) Process::exit(que_suis_je() + " : there must be a bubble diameter defined in the problem or a bubble radius defined in the force !");
61}
62
63void Frottement_interfacial_bulles_constant::coefficient(const DoubleTab& alpha, const DoubleTab& p, const DoubleTab& T,
64 const DoubleTab& rho, const DoubleTab& mu, const DoubleTab& sigma, double Dh,
65 const DoubleTab& ndv, const DoubleTab& d_bulles, DoubleTab& coeff) const
66{
67 int k,N = ndv.dimension(0);
68
69 coeff = 0.;
70
71 for (k = 0; k < N; k++)
72 if (k!=n_l)
73 {
74 if (r_bulle_>0) coeff(k, n_l, 1) = 3. / 8. * C_d_ * alpha(k) / r_bulle_ * rho(n_l) ;
75 else coeff(k, n_l, 1) = 3. / 4. * C_d_ * alpha(k) / d_bulles(k) * rho(n_l) ;
76 coeff(n_l, k, 1) = coeff(k, n_l, 1);
77 coeff(k, n_l, 0) = coeff(k, n_l, 1) * ndv(n_l,k);
78 coeff(n_l, k, 0) = coeff(n_l, k, 1) * ndv(n_l,k);
79 }
80}
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...
classe Frottement_interfacial_bulles coefficients de frottement interfacial d'un ecoulement a bulles
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
bool has_carrier_gas(int k) const
bool has_carrier_liquid(int k) const
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
@ REQUIRED
Definition Param.h:115
classe Pb_Multiphase Cette classe represente un probleme de thermohydraulique multiphase de type "3*N...
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
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