TrioCFD 1.9.9_beta
TrioCFD documentation
Loading...
Searching...
No Matches
Frottement_interfacial_Rusche.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_Rusche.h>
17#include <Pb_Multiphase.h>
18#include <Milieu_composite.h>
19#include <math.h>
20
21Implemente_instanciable(Frottement_interfacial_Rusche, "Frottement_interfacial_Rusche", Frottement_interfacial_base);
22
24{
25 return os;
26}
27
29{
30 Correlation_base::typer_lire_correlation(frottement_bulle_seule_, pb_.valeur(), "frottement_interfacial", is);
31
32 const Pb_Multiphase *pbm = sub_type(Pb_Multiphase, pb_.valeur()) ? &ref_cast(Pb_Multiphase, pb_.valeur()) : nullptr;
33
34 if (!pbm || pbm->nb_phases() == 1) Process::exit(que_suis_je() + " : not needed for single-phase flow!");
35 for (int n = 0; n < pbm->nb_phases(); n++) //search for n_l, n_g: continuous {liquid,gas} phase with priority
36 if (pbm->nom_phase(n).debute_par("liquide") && (n_l < 0 || pbm->nom_phase(n).finit_par("continu"))) n_l = n;
37 if (n_l < 0) Process::exit(que_suis_je() + " : liquid phase not found!");
38
39 return is;
40}
41
42void Frottement_interfacial_Rusche::coefficient(const DoubleTab& alpha, const DoubleTab& p, const DoubleTab& T,
43 const DoubleTab& rho, const DoubleTab& mu, const DoubleTab& sigma, double Dh,
44 const DoubleTab& ndv, const DoubleTab& d_bulles, DoubleTab& coeff) const
45{
46 int N = ndv.dimension(0);
47
48 coeff = 0;
49
50 ref_cast(Frottement_interfacial_base, frottement_bulle_seule_.valeur()).coefficient(alpha, p, T,
51 rho, mu, sigma, Dh,
52 ndv, d_bulles, coeff);
53
54
55 for (int k = 0; k < N; k++)
56 if (k!=n_l)
57 {
58 double correction = std::exp(K1_ * alpha(k)) + std::pow( alpha(k), K2_) ;
59
60 coeff(k, n_l, 1) *= correction ;
61 coeff(k, n_l, 0) *= correction ;
62 coeff(n_l, k, 0) *= correction ;
63 coeff(n_l, k, 1) *= correction ;
64
65 }
66}
static void typer_lire_correlation(OWN_PTR(Correlation_base)&, const Probleme_base &, const Nom &, Entree &)
Class defining operators and methods for all reading operation in an input flow (file,...
Definition Entree.h:42
Rusche interfacial friction coefficients for bubbly flows, accounting for density.
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
Frottement_interfacial_base class: utility for interfacial friction operators taking the form.
virtual int debute_par(const char *const n) const
Definition Nom.cpp:314
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
const Nom & nom_phase(int i) const
int nb_phases() const
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