TrioCFD 1.9.9_beta
TrioCFD documentation
Loading...
Searching...
No Matches
Frottement_interfacial_Ishii_Zuber_Deformable.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 <Frottement_interfacial_Ishii_Zuber_Deformable.h>
17#include <Pb_Multiphase.h>
18#include <Milieu_composite.h>
19#include <math.h>
20
21Implemente_instanciable(Frottement_interfacial_Ishii_Zuber_Deformable, "Frottement_interfacial_Ishii_Zuber_Deformable", Frottement_interfacial_base);
22
24{
25 return os;
26}
27
29{
30 Param param(que_suis_je());
31 param.ajouter("beta", &beta_);
32 param.ajouter("constante_gravitation", &g_);
33 param.lire_avec_accolades_depuis(is);
34
36
37 const Pb_Multiphase& pbm = ref_cast(Pb_Multiphase, pb_.valeur());
38 for (int k = 0; k < pbm.nb_phases(); k++)
39 if (k != n_l)
40 if (!(ref_cast(Milieu_composite, pbm.milieu()).has_interface(n_l, k)))
41 Process::exit(que_suis_je() + " : one must define an interface and have a surface tension !");
42
43 return is;
44}
45
46void Frottement_interfacial_Ishii_Zuber_Deformable::coefficient(const DoubleTab& alpha, const DoubleTab& p, const DoubleTab& T,
47 const DoubleTab& rho, const DoubleTab& mu, const DoubleTab& sigma, double Dh,
48 const DoubleTab& ndv, const DoubleTab& d_bulles, DoubleTab& coeff) const
49{
50 const int N = ndv.dimension(0);
51
52 coeff = 0;
53
54 for (int k = 0; k < N; k++)
55 if (k != n_l)
56 {
57 const int ind_trav = (k > n_l)
58 ? (n_l*(N-1)-(n_l-1)*(n_l)/2) + (k-n_l-1)
59 : (k*(N-1)-(k-1)*(k)/2) + (n_l-k-1);
60
61 const double capillary = std::sqrt((rho[n_l] - rho[k])*9.81/sigma[ind_trav]);
62 const double bubbly = alpha[k]*rho[n_l]*0.5*capillary*std::pow(std::max(1-alpha[k], 1.e-3), -.5);
63
64 coeff(k, n_l, 1) = bubbly ;
65 coeff(k, n_l, 0) = bubbly * ndv(n_l,k);
66 coeff(n_l, k, 0) = coeff(k, n_l, 0);
67 coeff(n_l, k, 1) = coeff(k, n_l, 1);
68 }
69}
70
71void Frottement_interfacial_Ishii_Zuber_Deformable::coefficient_CD(const DoubleTab& alpha, const DoubleTab& p, const DoubleTab& T,
72 const DoubleTab& rho, const DoubleTab& mu, const DoubleTab& sigma, double Dh,
73 const DoubleTab& ndv, const DoubleTab& d_bulles, DoubleTab& coeff) const
74{
75 const int N = ndv.dimension(0);
76
77 coeff = 0;
78
79 for (int k = 0; k < N; k++)
80 if (k != n_l)
81 {
82 const int ind_trav = (k > n_l)
83 ? (n_l*(N-1)-(n_l-1)*(n_l)/2) + (k-n_l-1)
84 : (k*(N-1)-(k-1)*(k)/2) + (n_l-k-1);
85
86 const double capillary = std::sqrt((rho[n_l]-rho[k])*9.81/sigma[ind_trav]);
87 const double bubbly = alpha[k]*rho[n_l]*0.5*capillary*std::pow(1-alpha[k], -.5);
88
89 const double Cd = bubbly / (3./4./d_bulles(k) * alpha(k) * rho(n_l));
90
91 coeff(k, n_l) = (coeff(n_l, k) = Cd);
92 }
93}
Class defining operators and methods for all reading operation in an input flow (file,...
Definition Entree.h:42
Ishii-Zuber interfacial drag for deformable (cap/slug) bubbles.
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
void coefficient_CD(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
Frottement_interfacial_base class: utility for interfacial friction operators taking the form.
int find_liquid_phase() const
Finds the continuous liquid phase index in a multiphase problem.
const Nom & que_suis_je() const
Returns the string identifying the class.
Definition Objet_U.cpp:104
virtual Entree & readOn(Entree &)
Reads an Objet_U from an input stream. Virtual method to override.
Definition Objet_U.cpp:289
virtual Sortie & printOn(Sortie &) const
Writes the object to an output stream. Virtual method to override.
Definition Objet_U.cpp:278
int nb_phases() const
virtual const Milieu_base & milieu() const
Returns the physical medium associated with the problem (const version).
static void exit(int exit_code=-1)
Exit routine for TRUST within a Kokkos region.
Definition Process.cpp:466
Base class for output streams.
Definition Sortie.h:52
_SIZE_ dimension(int d) const
Definition TRUSTTab.tpp:133