TrioCFD 1.9.9_beta
TrioCFD documentation
Loading...
Searching...
No Matches
Convection_Diffusion_std.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 Convection_Diffusion_std_included
17#define Convection_Diffusion_std_included
18
19#include <Schema_Temps_base.h>
20#include <Operateur_Conv.h>
21#include <Operateur_Diff.h>
22#include <Equation_base.h>
23#include <TRUST_Ref.h>
24
25
26class Champ_Inc_base;
27
28/*! @brief Convection_Diffusion_std This class is the base for equations modelling the transport
29 *
30 * of a scalar.
31 * This class carries the terms common to the scalar
32 * transport equation in laminar regime.
33 * The incompressible fluid hypothesis is assumed.
34 * DT/dt = div(viscous term) + source terms/rho_0
35 * where DT/dt: material derivative of the scalar
36 * Note: the class implementation allows neglecting
37 * certain terms of the equation (diffusive term,
38 * convective term, any given source term).
39 *
40 * @sa Equation_base, Abstract class, Abstract methods:, Entree& lire(const Motcle&, Entree&), const Champ_Inc_base& inconnue() const, Champ_Inc_base& inconnue()
41 */
43{
44 Declare_base(Convection_Diffusion_std);
45
46public :
47
48 void set_param(Param& titi) const override;
49 int lire_motcle_non_standard(const Motcle&, Entree&) override;
50 int nombre_d_operateurs() const override;
51 const Operateur& operateur(int) const override;
52 Operateur& operateur(int) override;
53 inline void associer_vitesse(const Champ_base& );
54 inline const Champ_Inc_base& vitesse_transportante() const;
55 const Champ_Inc_base& inconnue() const override =0;
56 Champ_Inc_base& inconnue() override =0;
57 virtual const Champ_Don_base& diffusivite_pour_transport() const;
58 virtual const Champ_base& diffusivite_pour_pas_de_temps() const;
59 virtual const Champ_base& vitesse_pour_transport() const;
60 // E. Saikali: useful methods for virtual inheritance (diamond inheritance)
61 int sauvegarder_base(Sortie&) const;
63 std::vector<YAML_data> data_a_sauvegarder_base() const;
64
65protected :
66
67 OBS_PTR(Champ_Inc_base) la_vitesse_transportante;
71};
72
73
74/*! @brief Returns a reference to the field representing the transporting velocity.
75 *
76 * @brief Returns a reference to the transporting velocity field.
77 * @return (Champ_Inc_base&) the field representing the transporting velocity
78 */
80{
81 return la_vitesse_transportante.valeur();
82}
83
84
85/*! @brief Associates the transporting velocity with the equation.
86 *
87 * @param vit the field to assign as the transporting velocity
88 */
90{
91 la_vitesse_transportante = ref_cast(Champ_Inc_base,vit);
92}
93#endif
class Champ_Don_base base class of Given Fields (not calculated)
Class Champ_Inc_base.
class Champ_base This class is the base of the fields hierarchy.
Definition Champ_base.h:43
Convection_Diffusion_std This class is the base for equations modelling the transport.
std::vector< YAML_data > data_a_sauvegarder_base() const
void associer_vitesse(const Champ_base &)
Associates the transporting velocity with the equation.
const Champ_Inc_base & inconnue() const override=0
Champ_Inc_base & inconnue() override=0
virtual const Champ_Don_base & diffusivite_pour_transport() const
virtual const Champ_base & diffusivite_pour_pas_de_temps() const
const Operateur & operateur(int) const override
Returns the operator at the given index: returns terme_diffusif if i = 0,.
void set_param(Param &titi) const override
const Champ_Inc_base & vitesse_transportante() const
Returns a reference to the field representing the transporting velocity.
int nombre_d_operateurs() const override
Returns the number of operators in the equation: 2 for a diffusion equation.
virtual const Champ_base & vitesse_pour_transport() const
int lire_motcle_non_standard(const Motcle &, Entree &) override
Reads non-simple-type parameters of an Objet_U from an input stream.
OBS_PTR(Champ_Inc_base) la_vitesse_transportante
class Equation_base The role of an equation is the calculation of one or more fields....
A character string (Nom) in uppercase.
Definition Motcle.h:26
friend class Entree
Definition Objet_U.h:71
friend class Sortie
Definition Objet_U.h:70
Operateur_Conv Generic class of the hierarchy of operators representing a convection term.
Operateur_Diff Generic class of the hierarchy of operators representing a diffusion.
class Operateur Generic class of the operator hierarchy.
Definition Operateur.h:39
Helper class to factorize the readOn method of Objet_U classes.
Definition Param.h:112