TrioCFD 1.9.9_beta
TrioCFD documentation
Loading...
Searching...
No Matches
Dirichlet_loi_paroi.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 Dirichlet_loi_paroi_included
17#define Dirichlet_loi_paroi_included
18
19#include <Frontiere_dis_base.h>
20#include <Correlation_base.h>
21#include <TRUST_Ref.h>
22#include <Dirichlet.h>
23#include <TRUSTTab.h>
24#include <Param.h>
25
26/*! @brief Classe Dirichlet_loi_paroi Base class for imposed values in a boundary condition of the turbulence equations
27 *
28 * The imposed flux is computed from the adaptive wall-law correlation.
29 *
30 * @sa Neumann
31 */
33{
34 Declare_base(Dirichlet_loi_paroi);
35public:
36
37 virtual int initialiser(double temps) override;
38 virtual void liste_faces_loi_paroi(IntTab&);
39 int compatible_avec_eqn(const Equation_base&) const override;
40 virtual int avancer(double temps) override {return 1;} // avancer does nothing because the field is updated in mettre_a_jour
41 void mettre_a_jour(double tps) override;
42
43 virtual void associer_correlation(const Correlation_base& corr) { correlation_loi_paroi_ = corr; }
44 void associer_fr_dis_base(const Frontiere_dis_base& fr) override { la_frontiere_dis = fr; }
45 void associer_domaine_cl_dis_base(const Domaine_Cl_dis_base& zcl) override { mon_dom_cl_dis = zcl; }
46
47 // functions of cond_lim_base that require the champ_front which we set to zero because we abstract away the champ_front
48 virtual void completer() override { }
49 virtual void fixer_nb_valeurs_temporelles(int nb_cases) override { }
50 virtual inline Frontiere_dis_base& frontiere_dis() override { return la_frontiere_dis; }
51 virtual inline const Frontiere_dis_base& frontiere_dis() const override { return la_frontiere_dis; }
52 virtual void changer_temps_futur(double temps, int i) override { }
53 virtual void set_temps_defaut(double temps) override { }
54 virtual void calculer_coeffs_echange(double temps) override { }
55 void verifie_ch_init_nb_comp() const override { }
56
57 virtual double val_imp(int i) const override {return d_(i,0);}
58 virtual double val_imp(int i, int j) const override {return d_(i,j);}
59 virtual double val_imp_au_temps(double temps, int i) const override
60 {
61 Process::exit(que_suis_je() + " : You shouldn't go through val_imp_au_temps but through val_imp ! ");
62 return 1.;
63 }
64 virtual double val_imp_au_temps(double temps, int i, int j) const override
65 {
66 Process::exit(que_suis_je() + " : You shouldn't go through val_imp_au_temps but through val_imp ! ");
67 return 1.;
68 }
69
70protected:
71 virtual void me_calculer()=0;
72
73 OBS_PTR(Correlation_base) correlation_loi_paroi_;
74 OBS_PTR(Frontiere_dis_base) la_frontiere_dis;
75 double mon_temps = -1.e8;
76 DoubleTab d_;
77};
78
79#endif
Classe Dirichlet_loi_paroi Base class for imposed values in a boundary condition of the turbulence eq...
virtual void fixer_nb_valeurs_temporelles(int nb_cases) override
Called by Conds_lim::completer. Calls cha_front_base::fixer_nb_valeurs_temporelles.
virtual Frontiere_dis_base & frontiere_dis() override
Returns the discretized boundary to which the boundary conditions apply.
virtual double val_imp(int i, int j) const override
Returns the imposed value on the (i,j)-th component of the field at the boundary at the default time ...
void mettre_a_jour(double tps) override
Performs a time update of the boundary condition.
virtual void completer() override
DOES NOTHING must be overridden in derived classes.
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...
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.
int compatible_avec_eqn(const Equation_base &) const override
virtual void me_calculer()=0
virtual void set_temps_defaut(double temps) override
Changes the i-th future time of the BC.
virtual double val_imp_au_temps(double temps, int i) const override
Returns the imposed value on the i-th component of the field at the boundary at the specified time.
virtual double val_imp_au_temps(double temps, int i, int j) const override
Returns the imposed value on the (i,j)-th component of the field at the boundary at the specified tim...
virtual const Frontiere_dis_base & frontiere_dis() const override
Returns the discretized boundary to which the boundary conditions apply.
OBS_PTR(Correlation_base) correlation_loi_paroi_
virtual void changer_temps_futur(double temps, int i) override
Changes the i-th future time of the BC.
virtual void associer_correlation(const Correlation_base &corr)
virtual void liste_faces_loi_paroi(IntTab &)
OBS_PTR(Frontiere_dis_base) la_frontiere_dis
virtual int initialiser(double temps) override
Initialization at the beginning of the calculation.
virtual double val_imp(int i) const override
Returns the imposed value on the i-th component of the field at the boundary at the default time of c...
virtual void calculer_coeffs_echange(double temps) override
Computation of exchange coefficients for coupling via Champ_front_contact_VEF.
virtual int avancer(double temps) override
Rotates the wheel of the BC.
void associer_fr_dis_base(const Frontiere_dis_base &fr) override
Associates the boundary with the object.
Dirichlet This class is the base class of the hierarchy of Dirichlet-type boundary conditions.
Definition Dirichlet.h:31
class Domaine_Cl_dis_base Domaine_Cl_dis_base objects represent discretized boundary conditions
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