TRUST 1.9.8
HPC thermohydraulic platform
Loading...
Searching...
No Matches
Frottement_interfacial_bulles_composant.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_bulles_composant.h>
17#include <Pb_Multiphase.h>
18#include <TRUSTTab.h>
19
20Implemente_instanciable(Frottement_interfacial_bulles_composant, "Frottement_interfacial_bulles_composant|Frottement_interfacial_bulles", Frottement_interfacial_base);
21
23{
24 return os;
25}
26
28{
29 Param param(que_suis_je());
30 param.ajouter("coeff_derive", &C_d_, Param::REQUIRED);
31 param.ajouter("rayon_bulle", &r_bulle_, Param::REQUIRED);
32 param.lire_avec_accolades_depuis(is);
33
34 const Pb_Multiphase *pbm = sub_type(Pb_Multiphase, pb_.valeur()) ? &ref_cast(Pb_Multiphase, pb_.valeur()) : nullptr;
35
36 if (!pbm || pbm->nb_phases() == 1) Process::exit(que_suis_je() + " : not needed for single-phase flow!");
37
38 return is;
39}
40
41void Frottement_interfacial_bulles_composant::coefficient(const DoubleTab& alpha, const DoubleTab& p, const DoubleTab& T,
42 const DoubleTab& rho, const DoubleTab& mu, const DoubleTab& sigma, double Dh,
43 const DoubleTab& ndv, const DoubleTab& d_bulles, DoubleTab& coeff) const
44{
45 int k,l,N = ndv.dimension(0);
46
47 coeff = 0.;
48
49// case r_bulle < 0 <=> sedimentation test case, robust
50 double rho_m = 0;
51 for (k = 0; k < N; k++) rho_m += alpha(k) * rho(k);
52 for (k = 0; k < N; k++)
53 for (l = 0; l < N; l++)
54 if (l != k)
55 if (r_bulle_>0) coeff(k, l, 0) = (coeff(k, l, 1) = 1. / 8 * C_d_ * 3 * alpha(k) * alpha(l) / r_bulle_ * rho_m) * ndv(k, l);
56}
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
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
int nb_phases() 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