TRUST 1.9.8
HPC thermohydraulic platform
Loading...
Searching...
No Matches
Convection_Diffusion_Espece_Multi_base.cpp
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#include <Convection_Diffusion_Espece_Multi_base.h>
17#include <Fluide_Dilatable_base.h>
18#include <Probleme_base.h>
19#include <Param.h>
20
21Implemente_base(Convection_Diffusion_Espece_Multi_base,"Convection_Diffusion_Espece_Multi_base",Convection_Diffusion_Espece_Fluide_Dilatable_base);
22
24{
26}
27
29{
32 Nom conv = "Convection_", diff = "Diffusion_";
33 conv += alias_;
34 diff += alias_;
35 terme_convectif.set_fichier(conv);
36 terme_convectif.set_description((Nom)"Convective flux =Integral(-rho*Y*u*ndS) [kg/s] if SI units used");
37 terme_diffusif.set_fichier(diff);
38 terme_diffusif.set_description((Nom)"Diffusive flux=Integral(rho*D*grad(Y)*ndS) [kg/s] if SI units used");
39 l_inco_ch->add_synonymous(alias_);
40 champs_compris_.ajoute_champ(l_inco_ch);
41 return is;
42}
43
49
50// FIXME : TODO : factorize
52{
53 if (mot=="diffusion")
54 {
55 Cerr << "Reading and typing of the diffusion operator : " << finl;
56 //associe mu_sur_Sc dans la diffusivite
57 terme_diffusif.associer_diffusivite(diffusivite_pour_transport());
58 ref_cast_non_const(Champ_base,terme_diffusif.diffusivite()).nommer("mu_sur_Schmidt");
59 is >> terme_diffusif;
60 // Il faut appeler associer_diffusivite_pour_pas_de_temps
61 terme_diffusif.associer_diffusivite_pour_pas_de_temps(diffusivite_pour_pas_de_temps());
62 return 1;
63 }
64 else
66}
67
68bool Convection_Diffusion_Espece_Multi_base::has_champ(const Motcle& nom, OBS_PTR(Champ_base)& ref_champ) const
69{
71 return true;
72
73 // a revoir ..... a mon avis
74 if (probleme().equation(0).has_champ(nom, ref_champ))
75 return true;
76
77 return false; /* rien trouve */
78}
79
81{
83 return true;
84
85 // a revoir ..... a mon avis
86 if (probleme().equation(0).has_champ(nom))
87 return true;
88
89 return false; /* rien trouve */
90}
91
93{
94 OBS_PTR(Champ_base) ref_champ;
95
97 return ref_champ;
98
99 // a revoir ..... a mon avis
100 if (probleme().equation(0).has_champ(nom, ref_champ))
101 return ref_champ;
102
103 throw std::runtime_error(std::string("Field ") + nom.getString() + std::string(" not found !"));
104}
classe Champ_base Cette classe est la base de la hierarchie des champs.
Definition Champ_base.h:43
virtual bool has_champ(const Motcle &nom, OBS_PTR(Champ_base)&ref_champ) const =0
classe Convection_Diffusion_Espece_Fluide_Dilatable_base Cas particulier de Convection_Diffusion_std ...
const Champ_base & diffusivite_pour_pas_de_temps() const override=0
classe Convection_Diffusion_Espece_Multi_base Cas particulier de Convection_Diffusion_Espece_Fluide_D...
bool has_champ(const Motcle &nom, OBS_PTR(Champ_base) &ref_champ) const override
int lire_motcle_non_standard(const Motcle &, Entree &) override
Lecture des parametres de type non simple d'un objet_U a partir d'un flot d'entree.
const Champ_base & get_champ(const Motcle &nom) const override
OBS_PTR(Fluide_Dilatable_base) le_fluide
Class defining operators and methods for all reading operation in an input flow (file,...
Definition Entree.h:42
virtual void set_param(Param &titi) const override
Probleme_base & probleme()
Renvoie le probleme associe a l'equation.
int lire_motcle_non_standard(const Motcle &, Entree &) override
Lecture des parametres de type non simple d'un objet_U a partir d'un flot d'entree.
Champs_compris champs_compris_
const Nom & le_nom() const override
Renvoie le nom du champ.
Une chaine de caractere (Nom) en majuscules.
Definition Motcle.h:26
const std::string & getString() const
Definition Nom.h:92
virtual Entree & readOn(Entree &)
Lecture d'un Objet_U sur un flot d'entree Methode a surcharger.
Definition Objet_U.cpp:293
virtual Sortie & printOn(Sortie &) const
Ecriture de l'objet sur un flot de sortie Methode a surcharger.
Definition Objet_U.cpp:282
Helper class to factorize the readOn method of Objet_U classes.
Definition Param.h:112
void ajouter(const char *keyword, const int *value, Param::Nature nat=Param::OPTIONAL)
Register an integer parameter.
Definition Param.cpp:364
Classe de base des flux de sortie.
Definition Sortie.h:52