TrioCFD 1.9.8
TrioCFD documentation
Loading...
Searching...
No Matches
Cond_lim_omega_dix.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 <Cond_lim_omega_dix.h>
17#include <Echelle_temporelle_turbulente.h>
18#include <Taux_dissipation_turbulent.h>
19#include <Loi_paroi_adaptative.h>
20#include <Equation_base.h>
21#include <Pb_Multiphase.h>
22#include <Domaine_VF.h>
23#include <TRUSTTrav.h>
24#include <Motcle.h>
25#include <math.h>
26
27Implemente_instanciable(Cond_lim_omega_dix, "Cond_lim_omega_dix", Dirichlet_loi_paroi);
28// XD Cond_lim_omega_dix condlim_base Cond_lim_omega_dix BRACE Adaptive wall law boundary condition for turbulent
29// XD_CONT dissipation rate
30
32{
33 return s << que_suis_je() << "\n";
34}
35
37{
38 Param param(que_suis_je());
39 param.ajouter("beta_omega", &beta_omega_);
40 param.ajouter("beta_k", &beta_k_);
41 param.ajouter("von_karman", &von_karman_);
42 param.ajouter("facteur_paroi", &facteur_paroi_);
43 param.lire_avec_accolades_depuis(s);
44
45 le_champ_front.typer("Champ_front_vide");
46
47 return s;
48}
49
51{
52 if (sub_type(Echelle_temporelle_turbulente, domaine_Cl_dis().equation()))
53 Process::exit(que_suis_je() + " : you cannot define such a BC for tau equation, only for omega. Use scalaire_impose_paroi Champ_front_uniforme 1 0 for tau.");
54 else if (!sub_type(Taux_dissipation_turbulent, domaine_Cl_dis().equation()))
55 Process::exit(que_suis_je() + " : equation must be tau/omega !");
56
57 const int N = domaine_Cl_dis().equation().inconnue().valeurs().line_size();
58 if (N > 1)
59 Process::exit(que_suis_je() + " : Only one phase for turbulent wall law is coded for now");
60
61 correlation_loi_paroi_ = domaine_Cl_dis().equation().probleme().get_correlation("Loi_paroi");
62}
63
65{
66 Loi_paroi_adaptative& corr_loi_paroi = ref_cast(Loi_paroi_adaptative, correlation_loi_paroi_.valeur());
67 const Domaine_VF& domaine = ref_cast(Domaine_VF, domaine_Cl_dis().equation().domaine_dis());
68 const DoubleTab& u_tau = corr_loi_paroi.get_tab("u_tau");
69 const DoubleTab& nu_visc = ref_cast(Convection_diffusion_turbulence_multiphase, domaine_Cl_dis().equation()).diffusivite_pour_pas_de_temps().passe();
70
71 const int cnu = nu_visc.dimension(0) == 1;
72 const int nf = la_frontiere_dis->frontiere().nb_faces();
73 const int f1 = la_frontiere_dis->frontiere().num_premiere_face();
74 const IntTab& f_e = domaine.face_voisins();
75
76 int n = 0 ; // Carrying phase is 0 for turbulent flows
77
78 for (int f = 0; f < nf; f++)
79 {
80 const int f_domaine = f + f1; // number of the face in the domaine
81 const int e_domaine = (f_e(f_domaine,0) >= 0) ? f_e(f_domaine, 0) : f_e(f_domaine, 1); // Make orientation vdf-proof
82 const double y_loc = f_e(f_domaine,0) >= 0 ? domaine.dist_face_elem0(f_domaine, e_domaine) : domaine.dist_face_elem1(f_domaine, e_domaine);
83
84 d_(f, n) = facteur_paroi_*calc_omega(y_loc, u_tau(f_domaine, n), nu_visc(!cnu * e_domaine, n));
85 }
86 d_.echange_espace_virtuel();
87}
88
89double Cond_lim_omega_dix::calc_omega(const double y, const double u_tau, const double visc)
90{
91 return 6 * visc / (beta_omega_ * y * y);
92}
DoubleTab & valeurs() override
Renvoie le tableau des valeurs du champ au temps courant.
Domaine_Cl_dis_base & domaine_Cl_dis()
Renvoie le domaine des conditions aux limites discretisee dont l'objet fait partie.
Classe Cond_lim_tau_omega_simple_demi.
void me_calculer() override
virtual void completer() override
NE FAIT RIEN A surcharger dans les classes derivees.
double calc_omega(const double y, const double u_tau, const double visc)
classe Convection_diffusion_turbulence_multiphase Equation de transport des quantites turbulentes (k,...
Classe Dirichlet_loi_paroi Classe de base pour les valeurs impose pour une condition aux limites des ...
class Domaine_VF
Definition Domaine_VF.h:44
classe Echelle_temporelle_turbulente Equation de transport de l'echelle temporelle turbulente (modele...
Class defining operators and methods for all reading operation in an input flow (file,...
Definition Entree.h:42
virtual const Champ_Inc_base & inconnue() const =0
Probleme_base & probleme()
Renvoie le probleme associe a l'equation.
classe Loi_paroi_adaptative correlation pour une loi de paroi adaptative qui calcule u_tau et du y_pl...
DoubleTab & get_tab(std::string str)
const Equation_base & equation() const
Renvoie la reference sur l'equation pointe par MorEqn::mon_equation.
Definition MorEqn.h:62
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
const Correlation_base & get_correlation(std::string nom_correlation) 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
int line_size() const
Definition TRUSTVect.tpp:67
classe Taux_dissipation_turbulent Equation de transport du taux de dissipation turbulen (modele k-ome...