TrioCFD 1.9.8
TrioCFD documentation
Loading...
Searching...
No Matches
Masse_ajoutee_Cai.cpp
1/****************************************************************************
2* Copyright (c) 2022, 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
17//Xiaolong Cai, Graham B. Wallis, A more general cell model for added mass in two-phase flow, Chemical Engineering Science, 1994,https://doi.org/10.1016/0009-2509(93)E0042-B.
18
19///////////////////////////////////////////////////////////////////////////////
20
21#include <Masse_ajoutee_Cai.h>
22#include <Pb_Multiphase.h>
23
24Implemente_instanciable(Masse_ajoutee_Cai, "Masse_ajoutee_Cai", Masse_ajoutee_base);
25
27{
28 return os;
29}
30
32{
33 Param param(que_suis_je());
34 param.ajouter("beta", &beta);
35 param.ajouter("inj_ajoutee_liquide", &inj_ajoutee_liquide_);
36 param.ajouter("inj_ajoutee_gaz", &inj_ajoutee_gaz_);
37 param.ajouter("limiter_liquid", &limiter_liquid_);
38 param.lire_avec_accolades_depuis(is);
39
41
42 return is;
43}
44
45double Masse_ajoutee_Cai::compute_Cai_coefficient(double alpha_k, double rho_l, double rho_k) const
46{
47 const double gamma = 0.5 * rho_l / rho_k;
48 return beta * 2. * ((1. + 2. * alpha_k) * gamma + 1. - alpha_k) / (2. * gamma * (1. - alpha_k) + 2. + alpha_k);
49}
50
51void Masse_ajoutee_Cai::ajouter(const double *alpha, const double *rho, DoubleTab& a_r) const
52{
53 int k, N = a_r.dimension(0);
54 for (k = 0; k < N; k++)
55 if (n_l != k)
56 {
57 const double coeff_loc = compute_Cai_coefficient(alpha[k], rho[n_l], rho[k]);
58 const double ma = std::min(coeff_loc * rho[n_l] * alpha[k], limiter_liquid_ * rho[n_l] * alpha[n_l]);
59 a_r(k, k ) += ma;
60 a_r(k, n_l) -= ma;
61 a_r(n_l,n_l)+= ma;
62 a_r(n_l, k) -= ma;
63 }
64}
65
66void Masse_ajoutee_Cai::ajouter_inj(const double *flux_alpha, const double *alpha, const double *rho, DoubleTab& f_a_r) const
67{
68 int N = f_a_r.dimension(0);
69 for (int k = 0; k < N; k++)
70 if (n_l != k)
71 {
72 const double coeff_loc = compute_Cai_coefficient(alpha[k], rho[n_l], rho[k]);
73 const double flux_ma = (alpha[k] < 1.e-4) ? coeff_loc * rho[n_l] * flux_alpha[k] : std::min(coeff_loc * rho[n_l] * flux_alpha[k], limiter_liquid_ * rho[n_l] * alpha[n_l] * flux_alpha[k] / alpha[k]);
74 f_a_r(k, k ) += inj_ajoutee_gaz_ * flux_ma;
75 f_a_r(n_l, k) -= inj_ajoutee_liquide_ * flux_ma;
76 }
77}
78
79void Masse_ajoutee_Cai::coeff(const DoubleTab& alpha, const DoubleTab& rho, DoubleTab& coeff) const
80{
81 int k, N = coeff.dimension(0);
82 for (k = 0; k < N; k++)
83 if (n_l != k)
84 {
85 const double coeff_loc = compute_Cai_coefficient(alpha[k], rho[n_l], rho[k]);
86 coeff(k) = (alpha[k] > 1.e-6) ? std::min(coeff_loc, limiter_liquid_ * alpha[n_l] / alpha[k]) : coeff_loc;
87 }
88}
Class defining operators and methods for all reading operation in an input flow (file,...
Definition Entree.h:42
Cai-Wallis added mass for bubbly two-phase flow.
double compute_Cai_coefficient(double alpha_k, double rho_l, double rho_k) const
void ajouter_inj(const double *flux_alpha, const double *alpha, const double *rho, DoubleTab &f_a_r) const override
void ajouter(const double *alpha, const double *rho, DoubleTab &a_r) const override
void coeff(const DoubleTab &alpha, const DoubleTab &rho, DoubleTab &coeff) const override
classe Masse_ajoutee_base masse ajoutee de la forme
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
Classe de base des flux de sortie.
Definition Sortie.h:52
_SIZE_ dimension(int d) const
Definition TRUSTTab.tpp:133