TrioCFD 1.9.9_beta
TrioCFD documentation
Loading...
Searching...
No Matches
Echange_global_impose_turbulent.h
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#ifndef Echange_global_impose_turbulent_included
17#define Echange_global_impose_turbulent_included
18
19#include <Echange_global_impose.h>
20#include <Correlation_base.h>
21#include <TRUST_Ref.h>
22#include <TRUSTTab.h>
23
24/*! @brief Base class for turbulent boundary conditions of type Echange_global_impose.
25 *
26 * Used only for turbulence in Pb_Multiphase.
27 *
28 */
30{
32public:
33 int compatible_avec_eqn(const Equation_base&) const override;
34 virtual int initialiser(double temps) override;
35 virtual int avancer(double temps) override { return 1; } // avancer does nothing because the field is updated in mettre_a_jour
36 void mettre_a_jour(double tps) override;
37 virtual void liste_faces_loi_paroi(IntTab&) override;
38
39 void associer_fr_dis_base(const Frontiere_dis_base& fr) override { la_frontiere_dis = fr; }
40 void associer_domaine_cl_dis_base(const Domaine_Cl_dis_base& zcl) override { mon_dom_cl_dis = zcl; }
41
42 // cond_lim_base functions that require champ_front, set to zero since we abstract away from champ_front
43 void fixer_nb_valeurs_temporelles(int nb_cases) override { }
44 inline Frontiere_dis_base& frontiere_dis() override { return la_frontiere_dis; }
45 inline const Frontiere_dis_base& frontiere_dis() const override { return la_frontiere_dis; }
46 void changer_temps_futur(double temps, int i) override { }
47 void set_temps_defaut(double temps) override { }
48 void calculer_coeffs_echange(double temps) override { }
49 void verifie_ch_init_nb_comp() const override { }
50
52 {
53 Process::exit(que_suis_je() + " : You shouldn't go through T_ext ! ");
55 }
56
57 const Champ_front_base& T_ext() const override
58 {
59 Process::exit(que_suis_je() + " : You shouldn't go through T_ext ! ");
61 }
62
63 inline virtual Champ_front_base& h_imp() override
64 {
65 Process::exit(que_suis_je() + " : You shouldn't go through h_imp ! ");
67 }
68
69 inline virtual const Champ_front_base& h_imp() const override
70 {
71 Process::exit(que_suis_je() + " : You shouldn't go through h_imp ! ");
73 }
74
75 bool has_h_imp_grad() const override { return true; }
76
77 double h_imp(int i) const override { return h_(i, 0); }
78 double h_imp(int i, int j) const override { return h_(i, j); }
79 double h_imp_grad(int i) const override { return h_grad_(i, 0); }
80 double h_imp_grad(int i, int j) const override { return h_grad_(i, j); }
81 double T_ext(int i) const override { return T_(i, 0); }
82 double T_ext(int i, int k) const override { return T_(i, k); }
83
84protected :
85 virtual void me_calculer()=0;
86
87 OBS_PTR(Correlation_base) correlation_loi_paroi_;
88 OBS_PTR(Frontiere_dis_base) la_frontiere_dis;
89
90 double mon_temps = -1.e8;
91
92 DoubleTab h_, h_grad_, T_;
93};
94
95#endif /* Echange_global_impose_turbulent_included */
class Champ_front_base Base class for the hierarchy of boundary fields.
class Domaine_Cl_dis_base Domaine_Cl_dis_base objects represent discretized boundary conditions
Base class for turbulent boundary conditions of type Echange_global_impose.
virtual int initialiser(double temps) override
Initialization at the beginning of the calculation.
int compatible_avec_eqn(const Equation_base &) const override
void associer_domaine_cl_dis_base(const Domaine_Cl_dis_base &zcl) override
Associates the Domaine_Cl_dis_base (domain of discretized boundary conditions) with the object.
virtual void liste_faces_loi_paroi(IntTab &) override
double h_imp(int i) const override
Returns the value of the imposed heat exchange coefficient on the i-th component.
double T_ext(int i) const override
Returns the value of the imposed temperature on the i-th component of the boundary field.
const Champ_front_base & T_ext() const override
double h_imp_grad(int i, int j) const override
void associer_fr_dis_base(const Frontiere_dis_base &fr) override
Associates the boundary with the object.
OBS_PTR(Correlation_base) correlation_loi_paroi_
virtual int avancer(double temps) override
Rotates the wheel of the BC.
void fixer_nb_valeurs_temporelles(int nb_cases) override
Called by Conds_lim::completer. Calls cha_front_base::fixer_nb_valeurs_temporelles.
void mettre_a_jour(double tps) override
Performs a time update of the boundary condition.
void verifie_ch_init_nb_comp() const override
Calls the verification of the field read through the equation for which the boundary condition is con...
Frontiere_dis_base & frontiere_dis() override
Returns the discretized boundary to which the boundary conditions apply.
Champ_front_base & T_ext() override
Returns the T_ext field of temperature imposed at the boundary.
double T_ext(int i, int k) const override
Returns the value of the imposed temperature on the (i,j)-th component of the boundary field.
void calculer_coeffs_echange(double temps) override
Computation of exchange coefficients for coupling via Champ_front_contact_VEF.
void set_temps_defaut(double temps) override
Changes the i-th future time of the BC.
virtual const Champ_front_base & h_imp() const override
void changer_temps_futur(double temps, int i) override
Changes the i-th future time of the BC.
double h_imp(int i, int j) const override
Returns the value of the imposed heat exchange coefficient on the i-th component.
virtual Champ_front_base & h_imp() override
const Frontiere_dis_base & frontiere_dis() const override
Returns the discretized boundary to which the boundary conditions apply.
OBS_PTR(Frontiere_dis_base) la_frontiere_dis
Classe Echange_global_impose This class represents the special case of the class.
virtual Champ_front_base & h_imp()
virtual Champ_front_base & T_ext()
Returns the T_ext field of temperature imposed at the boundary.
class Equation_base The role of an equation is the calculation of one or more fields....
class Frontiere_dis_base Class representing a discretized boundary.
const Nom & que_suis_je() const
Returns the string identifying the class.
Definition Objet_U.cpp:104
static void exit(int exit_code=-1)
Exit routine for TRUST within a Kokkos region.
Definition Process.cpp:466