TrioCFD 1.9.9_beta
TrioCFD documentation
Loading...
Searching...
No Matches
Echange_global_impose.h
1/****************************************************************************
2* Copyright (c) 2025, 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_included
17#define Echange_global_impose_included
18
19#include <Echange_impose_base.h>
20
21/*! @brief Classe Echange_global_impose This class represents the special case of the class
22 *
23 * Echange_impose_base where the total heat exchange is computed using the
24 * global heat exchange coefficient provided by the user.
25 *
26 * WARNING, in the case of discretizations where T is located at the element centre (VDF),
27 * this corresponds to modelling an exchange wall whose thickness extends to half
28 * of the first mesh cell.
29 *
30 * h_t : total exchange coefficient
31 * h_imp_: global exchange coefficient (user input)
32 * We have: h_t = h_imp
33 * The fields h_imp and T_ext are uniform
34 *
35 *
36 * @sa Echange_impose_base Echange_externe_impose
37 */
39{
40 Declare_instanciable(Echange_global_impose);
41public:
42 int compatible_avec_discr(const Discretisation_base& discr) const override { return 1; }
43 void completer() override;
44 void set_temps_defaut(double temps) override;
45 void changer_temps_futur(double temps, int i) override;
46 int avancer(double temps) override;
47 int reculer(double temps) override;
48 void mettre_a_jour(double temps) override;
49 int initialiser(double temps) override;
50
51 inline Champ_front_base& derivee_phi_ext() { return derivee_phi_ext_; }
52 inline const Champ_front_base& derivee_phi_ext() const { return derivee_phi_ext_; }
53 inline Champ_front_base& phi_ext() { return phi_ext_; }
54 inline const Champ_front_base& phi_ext() const { return phi_ext_; }
55
56 virtual double champ_exterieur(int i, int j, const Champ_front_base& champ_ext) const;
57 virtual double champ_exterieur(int i, const Champ_front_base& champ_ext) const;
58
59 virtual double flux_exterieur_impose(int i) const;
60 virtual double flux_exterieur_impose(int i, int j) const;
61
62 virtual double derivee_flux_exterieur_imposee(int i) const;
63 virtual double derivee_flux_exterieur_imposee(int i, int j) const;
64
65 const bool& has_phi_ext() const { return phi_ext_lu_; }
66
67protected:
68 bool phi_ext_lu_ = false;
69 OWN_PTR(Champ_front_base) derivee_phi_ext_, phi_ext_;
70};
71
72#endif
class Champ_front_base Base class for the hierarchy of boundary fields.
class Discretisation_base This class represents a spatial discretization scheme, which
Classe Echange_global_impose This class represents the special case of the class.
virtual double flux_exterieur_impose(int i) const
void set_temps_defaut(double temps) override
Changes the i-th future time of the BC.
OWN_PTR(Champ_front_base) derivee_phi_ext_
void mettre_a_jour(double temps) override
Performs a time update of the boundary condition.
int reculer(double temps) override
Rotates the wheel of the BC.
const Champ_front_base & phi_ext() const
Champ_front_base & derivee_phi_ext()
Champ_front_base & phi_ext()
void completer() override
DOES NOTHING must be overridden in derived classes.
int avancer(double temps) override
Rotates the wheel of the BC.
const bool & has_phi_ext() const
int initialiser(double temps) override
Initialization at the beginning of the calculation.
int compatible_avec_discr(const Discretisation_base &discr) const override
Returns 1 if the boundary condition is compatible with the discretization passed as parameter.
virtual double derivee_flux_exterieur_imposee(int i) const
virtual double champ_exterieur(int i, int j, const Champ_front_base &champ_ext) const
void changer_temps_futur(double temps, int i) override
Changes the i-th future time of the BC.
const Champ_front_base & derivee_phi_ext() const
Echange_impose_base: This boundary condition is used only for the energy equation.