TrioCFD 1.9.8
TrioCFD documentation
Loading...
Searching...
No Matches
Paroi_frottante_loi.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 <Paroi_frottante_loi.h>
17
18#include <Viscosite_turbulente_k_omega.h>
19#include <Op_Dift_Multiphase_VDF_Face.h>
20#include <Viscosite_turbulente_k_tau.h>
21#include <Op_Diff_PolyMAC_MPFA_base.h>
22#include <Loi_paroi_adaptative.h>
23#include <Frontiere_dis_base.h>
24#include <Navier_Stokes_std.h>
25#include <Pb_Multiphase.h>
26#include <Domaine_VF.h>
27#include <Frontiere.h>
28#include <Motcle.h>
29
30#include <math.h>
31
32Implemente_instanciable(Paroi_frottante_loi,"Paroi_frottante_loi", Paroi_frottante_simple);
33// XD Paroi_frottante_loi condlim_base Paroi_frottante_loi BRACE Adaptive wall-law boundary condition for velocity
34
36{
37 return s << que_suis_je() << "\n";
38}
39
41{
42 if (app_domains.size() == 0)
43 app_domains = { Motcle("turbulence") };
44
45 Param param(que_suis_je());
46 param.ajouter("y_p_prod_k", &y_p_prod_k_);
47 param.ajouter("fac_prod_k", &fac_prod_k_);
48 param.ajouter("y_p_prod_k_grand", &y_p_prod_k_grand_);
49 param.ajouter("fac_prod_k_grand", &fac_prod_k_grand_);
50 param.lire_avec_accolades_depuis(s);
51
52 le_champ_front.typer("Champ_front_vide");
53
54 return s;
55}
56
58{
59 if (!ref_cast(Operateur_Diff_base,
60 domaine_Cl_dis().equation().operateur(0).l_op_base())
61 .is_turb())
62 Process::exit(que_suis_je() + " : diffusion operator must be turbulent !");
63
64 if (sub_type(Viscosite_turbulente_k_tau, (*ref_cast(Operateur_Diff_base, domaine_Cl_dis().equation().operateur(0).l_op_base()).correlation_viscosite_turbulente())))
65 {
66 if (fac_prod_k_ < -1.e7)
67 fac_prod_k_ = 1.2;
68
69 if (y_p_prod_k_ < -1.e7)
70 y_p_prod_k_ = 4.;
71
72 if (fac_prod_k_grand_ < -1.e7)
74
75 if (y_p_prod_k_grand_ < -1.e7)
76 y_p_prod_k_grand_ = 150.;
77 }
78 else if sub_type(Viscosite_turbulente_k_omega, (*ref_cast(Operateur_Diff_base, domaine_Cl_dis().equation().operateur(0).l_op_base()).correlation_viscosite_turbulente()))
79 {
80 if (fac_prod_k_ < -1.e7)
81 fac_prod_k_ = 1.0;
82
83 if (y_p_prod_k_ < -1.e7)
84 y_p_prod_k_ = 4.;
85
86 if (fac_prod_k_grand_ < -1.e7)
88
89 if (y_p_prod_k_grand_ < -1.e7)
90 y_p_prod_k_grand_ = 120.;
91 }
92 else
93 {
94 if (fac_prod_k_ < -1.e7)
95 fac_prod_k_ = 0.;
96
97 if (y_p_prod_k_ < -1.e7)
98 y_p_prod_k_ = 4.;
99
100 if (fac_prod_k_grand_ < -1.e7)
102
103 if (y_p_prod_k_grand_ < -1.e7)
104 y_p_prod_k_grand_ = 120.;
105 }
106}
107
109{
110 const double tmp1 = (y_p/y_p_prod_k_)*(y_p/y_p_prod_k_);
111 const double tmp2 = (y_p/y_p_prod_k_grand_)*(y_p/y_p_prod_k_grand_)*(y_p/y_p_prod_k_grand_);
112 return 1 + fac_prod_k_ * std::tanh(tmp1) - fac_prod_k_grand_ * std::tanh(tmp2);
113}
Domaine_Cl_dis_base & domaine_Cl_dis()
Renvoie le domaine des conditions aux limites discretisee dont l'objet fait partie.
std::vector< Motcle > app_domains
Class defining operators and methods for all reading operation in an input flow (file,...
Definition Entree.h:42
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 Operateur_Diff_base Cette classe est la base de la hierarchie des operateurs representant
Classe Paroi_frottante_loi Cette condition limite correspond a un flux impose pour une condition aux ...
void completer() override
NE FAIT RIEN A surcharger dans les classes derivees.
double fac_coeff_grad(double y_p) const override
Classe Paroi_frottante_simple Cette condition limite correspond a un flux impose pour une condition a...
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
classe Viscosite_turbulente_k_omega Turbulent viscosity for a "k-omega" model : nu_t = k / omega
classe Viscosite_turbulente_k_tau Viscosite turbulente pour un modele "k-tau" : nu_t = k * tau