TrioCFD 1.9.9_beta
TrioCFD documentation
Loading...
Searching...
No Matches
Cond_lim_base.h
1/****************************************************************************
2* Copyright (c) 2026, 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 Cond_lim_base_included
17#define Cond_lim_base_included
18
19#include <Champ_front_base.h>
20#include <TRUST_Ref.h>
21#include <Motcle.h>
22#include <vector>
23
28class Equation_base;
29
30/*! @brief class Cond_lim_base Base class for the hierarchy of classes that represent the different boundary conditions (Dirichlet, Neumann ...).
31 *
32 * A boundary condition object serves to define, for a given equation, the boundary conditions to apply on a boundary of a domain.
33 * Each Cond_lim_base object contains a reference to the Domaine_Cl_dis_base object it is part of.
34 * Each object also contains an OWN_PTR(Champ_front_base) object containing the values to impose on the boundary.
35 *
36 * @sa Cond_lim Domaine_Cl_dis_base Frontiere_dis_base, Abstract class from which all objects representing boundary conditions must derive.,
37 * Abstract method:, int compatible_avec_eqn(const Equation_base&) const
38 */
39class Cond_lim_base : public Objet_U
40{
41 Declare_base(Cond_lim_base);
42public:
43 virtual void completer();
44 virtual int initialiser(double temps);
45 virtual void mettre_a_jour(double temps);
46 virtual void resetTime(double time);
47 virtual void calculer_coeffs_echange(double temps);
48 virtual void verifie_ch_init_nb_comp() const;
49 virtual inline Frontiere_dis_base& frontiere_dis();
50 virtual inline const Frontiere_dis_base& frontiere_dis() const;
51 virtual void associer_fr_dis_base(const Frontiere_dis_base&);
53 inline const Domaine_Cl_dis_base& domaine_Cl_dis() const;
56 inline const Champ_front_base& champ_front() const;
57
58 virtual void set_temps_defaut(double temps);
59 virtual void fixer_nb_valeurs_temporelles(int nb_cases);
60
61 virtual void champ_front(int, DoubleVect&) const;
62 virtual int compatible_avec_eqn(const Equation_base&) const ;
63 virtual int compatible_avec_discr(const Discretisation_base&) const;
64 virtual void injecter_dans_champ_inc(const Champ_Inc_base&) const;
65
66 virtual int a_mettre_a_jour_ss_pas_dt();
67
68 // method to set the modifier_val_impl flag
69 inline void set_modifier_val_imp(int);
70 virtual void changer_temps_futur(double temps, int i);
71 virtual int avancer(double temps);
72 virtual int reculer(double temps);
73
74 // virtual methods for radiation BCs! Note: Cond_lim_rayo_milieu_transp and Cond_lim_rayo_semi_transp do not derive from Objet_U
76 {
77 return false; /* not radiation by default! */
78 }
79
81 {
82 return false; /* not radiation by default! */
83 }
84
85protected:
86 std::vector<Motcle> app_domains;
87 std::vector<Nom> supp_discs;
88 OWN_PTR(Champ_front_base) le_champ_front;
90 void err_pas_compatible(const Equation_base&) const;
91 void err_pas_compatible(const Discretisation_base&) const;
92
93 // flag to indicate whether or not to modify the imposed value on the boundary condition
95};
96
97/*! @brief Returns the discretized boundary to which the boundary conditions apply.
98 *
99 * @return (Frontiere_dis_base&) the discretized boundary to which the boundary conditions are associated
100 */
102{
103 return le_champ_front->frontiere_dis();
104}
105
106/*! @brief Returns the discretized boundary to which the boundary conditions apply.
107 *
108 * (const version)
109 *
110 * @return (Frontiere_dis_base&) the discretized boundary to which the boundary conditions are associated
111 */
113{
114 return le_champ_front->frontiere_dis();
115}
116
117/*! @brief Returns the domain of discretized boundary conditions to which the object belongs.
118 *
119 * @return (Domaine_Cl_dis_base&) the domain of discretized boundary conditions to which the object belongs
120 */
122{
123 return mon_dom_cl_dis.valeur();
124}
125
126/*! @brief Returns the domain of discretized boundary conditions to which the object belongs.
127 *
128 * (const version)
129 *
130 * @return (Domaine_Cl_dis_base&) the domain of discretized boundary conditions to which the object belongs
131 */
133{
134 return mon_dom_cl_dis.valeur();
135}
136
138{
139 return le_champ_front;
140}
141
143{
144 return le_champ_front;
145}
146
147/*! @brief Sets the modifier_val_imp flag to the given value: - if drap == 1: modifier_val_imp=1
148 *
149 * - otherwise : modifier_val_imp=0
150 * This flag allows the BC to know whether it should return the stored value
151 * as-is, or whether it should translate it for the calling object.
152 * It is up to the BC to then decide what translation to perform.
153 * See application in Temperature_imposee_paroi_H, where the BC returns the enthalpy
154 * by default (modifier_val_imp=1), or the temperature otherwise (case of the diffusion operator).
155 * The flag is set in equation.derivee_en_temps_inco
156 * according to the operator that will be called.
157 *
158 * @param (drap) value to assign to the flag
159 */
161{
162 // set the flag to 0 or 1
163 modifier_val_imp = (drap==1);
164}
165
166#endif /* Cond_lim_base_included */
Class Champ_Inc_base.
class Champ_front_base Base class for the hierarchy of boundary fields.
class Cond_lim_base Base class for the hierarchy of classes that represent the different boundary con...
OBS_PTR(Domaine_Cl_dis_base) mon_dom_cl_dis
std::vector< Nom > supp_discs
virtual void changer_temps_futur(double temps, int i)
Changes the i-th future time of the BC.
virtual int compatible_avec_eqn(const Equation_base &) const
virtual void mettre_a_jour(double temps)
Performs a time update of the boundary condition.
virtual void fixer_nb_valeurs_temporelles(int nb_cases)
Called by Conds_lim::completer. Calls cha_front_base::fixer_nb_valeurs_temporelles.
virtual bool is_bc_rayo_semi_transp(Cond_lim_rayo_semi_transp *&la_cl_rayo)
virtual void calculer_coeffs_echange(double temps)
Computation of exchange coefficients for coupling via Champ_front_contact_VEF.
virtual void associer_fr_dis_base(const Frontiere_dis_base &)
Associates the boundary with the object.
virtual bool is_bc_rayo_milieu_transp(Cond_lim_rayo_milieu_transp *&la_cl_rayo)
OWN_PTR(Champ_front_base) le_champ_front
virtual int a_mettre_a_jour_ss_pas_dt()
Indicates whether this boundary condition must be updated during sub-time steps of a time scheme such...
virtual int avancer(double temps)
Rotates the wheel of the BC.
void err_pas_compatible(const Equation_base &) const
This method is called when the boundary condition is not compatible with the equation on which we try...
Domaine_Cl_dis_base & domaine_Cl_dis()
Returns the domain of discretized boundary conditions to which the object belongs.
virtual int compatible_avec_discr(const Discretisation_base &) const
Returns 1 if the boundary condition is compatible with the discretization passed as parameter.
virtual void verifie_ch_init_nb_comp() const
Calls the verification of the field read through the equation for which the boundary condition is con...
virtual int reculer(double temps)
Rotates the wheel of the BC.
virtual void injecter_dans_champ_inc(const Champ_Inc_base &) const
virtual void completer()
DOES NOTHING must be overridden in derived classes.
std::vector< Motcle > app_domains
virtual int initialiser(double temps)
Initialization at the beginning of the calculation.
virtual Frontiere_dis_base & frontiere_dis()
Returns the discretized boundary to which the boundary conditions apply.
void set_modifier_val_imp(int)
Sets the modifier_val_imp flag to the given value: - if drap == 1: modifier_val_imp=1.
Champ_front_base & champ_front()
virtual void resetTime(double time)
virtual void set_temps_defaut(double temps)
Changes the i-th future time of the BC.
virtual void associer_domaine_cl_dis_base(const Domaine_Cl_dis_base &)
Associates the Domaine_Cl_dis_base (domain of discretized boundary conditions) with the object.
Base class for semi-transparent radiation boundary conditions.
class Discretisation_base This class represents a spatial discretization scheme, which
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.
Objet_U()
Default constructor: assigns a unique identifier to the object (object_id_) and registers the object ...
Definition Objet_U.cpp:54