TrioCFD 1.9.8
TrioCFD documentation
Loading...
Searching...
No Matches
Source_Dissipation_HZDR_PolyMAC_MPFA.cpp
1/****************************************************************************
2* Copyright (c) 2021, 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 <Source_Dissipation_HZDR_PolyMAC_MPFA.h>
17
18#include <Champ_Elem_PolyMAC_MPFA.h>
19#include <Domaine_PolyMAC_MPFA.h>
20#include <Sources_helpers_Multiphase.h>
21
22Implemente_instanciable(Source_Dissipation_HZDR_PolyMAC_MPFA,"Source_Dissipation_HZDR_Elem_PolyMAC_MPFA", Source_base);
23// XD Source_Dissipation_HZDR source_base Source_Dissipation_HZDR INHERITS_BRACE Additional source terms in the
24// XD_CONT turbulent dissipation (omega) equation to model the fluctuations induced by bubbles.
25
27{
28 return os;
29}
30
32{
33 Param param(que_suis_je());
34 param.ajouter("constante_gravitation", &g_); // XD_ADD_P floattant
35 // XD_CONT not_set
36 param.ajouter("C_k", &C_k_); // XD_ADD_P floattant
37 // XD_CONT not_set
38 param.ajouter("C_epsilon", &C_epsilon_); // XD_ADD_P floattant
39 // XD_CONT not_set
40 param.lire_avec_accolades_depuis(is);
41
42 n_l_ = find_liquid_phase(ref_cast(Pb_Multiphase, equation().probleme()), que_suis_je());
43
44 return is;
45}
46
47void Source_Dissipation_HZDR_PolyMAC_MPFA::dimensionner_blocs(matrices_t matrices, const tabs_t& semi_impl) const
48{
49// empty : no derivative to add in the blocks
50}
51
52void Source_Dissipation_HZDR_PolyMAC_MPFA::ajouter_blocs(matrices_t matrices, DoubleTab& secmem, const tabs_t& semi_impl) const
53{
54 // le terme de dissipation s'écrit : C_epsilon / (C_nu * d_b * sqrt(k)) Prod_HZDR ; avec Prod_HZDR = C_k * (3/4 C_drag/d_b * alpha * rho_l * |u_r|**3) / (alpha_l * rho_l)
55 // Le coefficient de trainée C_drag sera calculé avec le modèle de Tomiyama (codé en dur)
56
57 const Domaine_PolyMAC_MPFA& domaine = ref_cast(Domaine_PolyMAC_MPFA, equation().domaine_dis());
58 const DoubleTab& tab_rho = equation().probleme().get_champ("masse_volumique").passe();
59 const DoubleTab& tab_alp = equation().probleme().get_champ("alpha").passe();
60 const DoubleTab& vit = equation().probleme().get_champ("vitesse").passe();
61 const DoubleTab& diam = equation().probleme().get_champ("diametre_bulles").valeurs();
62 const DoubleTab& nu = equation().probleme().get_champ("viscosite_cinematique").passe();
63 const Champ_Elem_PolyMAC_MPFA& ch_k = ref_cast(Champ_Elem_PolyMAC_MPFA, equation().probleme().get_champ("k")); // Champ k
64 const DoubleTab& k_passe = ch_k.passe();
65
66 const DoubleVect& pe = equation().milieu().porosite_elem();
67 const DoubleVect& ve = domaine.volumes();
68 const int N = ref_cast(Pb_Multiphase, equation().probleme()).nb_phases();
69 const int ne = domaine.nb_elem();
70 const int nf_tot = domaine.nb_faces_tot();
71 const int D = dimension;
72
73 // Surface tension table
74 const Milieu_composite& milc = ref_cast(Milieu_composite, equation().milieu());
75 const DoubleTab& press = equation().probleme().get_champ("pression").passe();
76 const DoubleTab& temp = equation().probleme().get_champ("temperature").passe();
77 const int nb_max_sat = N * (N - 1) / 2;
78 DoubleTrav Sigma_tab(ne, nb_max_sat);
79 compute_sigma_table(milc, press, temp, ne, N, Sigma_tab);
80
81 // Diss_HZDR = C_epsilon / (C_mu * d_b * sqrt(k)) * Prod_HZDR
82 for (int e = 0 ; e < ne ; e++)
83 for (int k = 0 ; k < N ; k++)
84 if (k != n_l_)
85 {
86 const double u_r = relative_velocity_norm(vit, nf_tot, D, e, k, n_l_);
87 const double Reb = diam(e, k) * u_r / nu(e, n_l_);
88 const double Eo = g_ * std::abs(tab_rho(e, n_l_) - tab_rho(e, k)) * diam(e, k) * diam(e, k) / Sigma_tab(e, sigma_pair_index(k, n_l_, N));
89 const double Cd = Tomiyama_Cd(Reb, Eo);
90 const double prod_HZDR = C_k_ * (3. / 4.) * Cd / diam(e, k) * tab_alp(e, k) / tab_alp(e, n_l_) * u_r * u_r * u_r;
91 secmem(e, n_l_) += ve(e) * pe(e) * C_epsilon_ / C_mu_ / diam(e, k) / std::sqrt(k_passe(e, n_l_)) * prod_HZDR;
92 }
93}
: class Champ_Elem_PolyMAC_MPFA
DoubleTab & passe(int i=1) override
Renvoie les valeurs du champs a l'instant t-i.
virtual DoubleTab & valeurs()=0
virtual DoubleTab & passe(int i=1)
Definition Champ_Proto.h:50
Class defining operators and methods for all reading operation in an input flow (file,...
Definition Entree.h:42
virtual const Milieu_base & milieu() const =0
Probleme_base & probleme()
Renvoie le probleme associe a l'equation.
DoubleVect & porosite_elem()
Definition Milieu_base.h:58
Classe Milieu_composite Cette classe represente un fluide reel ainsi que.
const Equation_base & equation() const
Renvoie la reference sur l'equation pointe par MorEqn::mon_equation.
Definition MorEqn.h:62
static int dimension
Definition Objet_U.h:99
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...
const Champ_base & get_champ(const Motcle &nom) const override
Classe de base des flux de sortie.
Definition Sortie.h:52
Classe Source_Dissipation_HZDR_PolyMAC_MPFA : Cette classe implemente, dans PolyMAC_MPFA,...
void ajouter_blocs(matrices_t matrices, DoubleTab &secmem, const tabs_t &semi_impl={}) const override
void dimensionner_blocs(matrices_t matrices, const tabs_t &semi_impl={}) const override
classe Source_base Un objet Source_base est un terme apparaissant au second membre d'une
Definition Source_base.h:42
const Champ_base & get_champ(const Motcle &nom) const override