TrioCFD 1.9.8
TrioCFD documentation
Loading...
Searching...
No Matches
Convection_Diffusion_Espece_Binaire_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_Binaire_base.h>
17#include <Navier_Stokes_Fluide_Dilatable_base.h>
18#include <Fluide_Dilatable_base.h>
19#include <Op_Conv_negligeable.h>
20#include <Discretisation_base.h>
21#include <Probleme_base.h>
22#include <TRUSTTrav.h>
23#include <Perf_counters.h>
24
25Implemente_base(Convection_Diffusion_Espece_Binaire_base,"Convection_Diffusion_Espece_Binaire_base",Convection_Diffusion_Espece_Fluide_Dilatable_base);
26
28{
30}
31
33{
35 terme_convectif.set_fichier("Convection_Espece_Binaire");
36 terme_convectif.set_description((Nom)"Convective flux =Integral(-rho*Y*u*ndS) [kg/s] if SI units used");
37 terme_diffusif.set_fichier("Diffusion_Espece_Binaire");
38 terme_diffusif.set_description((Nom)"Diffusive flux=Integral(rho*D*grad(Y)*ndS) [kg/s] if SI units used");
39
40 //On modifie le nom ici pour que le champ puisse etre reconnu si une sonde de fraction_massique est demandee
41 if (le_fluide->type_fluide()=="Melange_Binaire") l_inco_ch->nommer("fraction_massique");
42 else
43 {
44 Cerr << "Error in your data file !" << finl;
45 Cerr << "The equation " << que_suis_je() << " should only be used with the EOS Melange_Binaire";
47 }
48 champs_compris_.ajoute_champ(l_inco_ch);
49 return is;
50}
51
56
58{
59 if (mot=="diffusion")
60 {
61 /*
62 * The diffusive term is div(rho*D*grad(Y))
63 * recall that mu_sur_Sc = rho*D and nu_sur_Sc = D
64 */
65
66 Cerr << "Reading and typing of the diffusion operator : " << finl;
67 terme_diffusif.associer_diffusivite(diffusivite_pour_transport());
68 ref_cast_non_const(Champ_base,terme_diffusif.diffusivite()).nommer("mu_sur_Schmidt");
69 is >> terme_diffusif;
70 terme_diffusif.associer_diffusivite_pour_pas_de_temps(diffusivite_pour_pas_de_temps());
71 return 1;
72 }
73 else
75
76}
77
79{
80 return le_fluide->nu_sur_Schmidt(); // D (diffusion coefficient)
81}
82
84{
85 const Navier_Stokes_std& eqn_hydr = ref_cast(Navier_Stokes_std,probleme().equation(0));
86 return eqn_hydr.rho_la_vitesse() /* rho * u and not u */;
87}
88
90{
92 zcl_modif_->les_conditions_limites().set_modifier_val_imp(0);
93 return 1;
94}
95
100
102{
103 derivee=0.;
104 return derivee_en_temps_inco_sans_solveur_masse_impl(*this,derivee,true /* explicit */);
105}
106
107void Convection_Diffusion_Espece_Binaire_base::assembler( Matrice_Morse& matrice,const DoubleTab& inco, DoubleTab& resu)
108{
110}
111
112void Convection_Diffusion_Espece_Binaire_base::assembler_blocs_avec_inertie(matrices_t matrices, DoubleTab& secmem, const tabs_t& semi_impl)
113{
114 statistics().begin_count(STD_COUNTERS::ajouter_blocs,statistics().get_last_opened_counter_level()+1);
115 Convection_Diffusion_Fluide_Dilatable_Proto::assembler_blocs(*this, matrices, secmem, semi_impl);
116 schema_temps().ajouter_blocs(matrices, secmem, *this);
117 if (!discretisation().is_poly_family())
118 {
119 const std::string& nom_inco = inconnue().le_nom().getString();
120 Matrice_Morse *mat = matrices.count(nom_inco) ? matrices.at(nom_inco) : nullptr;
121 modifier_pour_Cl(*mat,secmem);
122 }
123 statistics().end_count(STD_COUNTERS::ajouter_blocs);
124
125}
classe Champ_base Cette classe est la base de la hierarchie des champs.
Definition Champ_base.h:43
classe Convection_Diffusion_Espece_Binaire_base Cas particulier de Convection_Diffusion_Espece_Fluide...
void completer() override
Complete la construction (initialisation) des objets associes a l'equation.
void assembler_blocs_avec_inertie(matrices_t matrices, DoubleTab &secmem, const tabs_t &semi_impl) override
int preparer_calcul() override
Tout ce qui ne depend pas des autres problemes eventuels.
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.
void assembler(Matrice_Morse &mat_morse, const DoubleTab &present, DoubleTab &secmem) override
DoubleTab & derivee_en_temps_inco(DoubleTab &) override
Returns the time derivative of the unknown I of the equation: dI/dt = M-1*(sum(operators(I) + sources...
classe Convection_Diffusion_Espece_Fluide_Dilatable_base Cas particulier de Convection_Diffusion_std ...
int preparer_calcul() override
Tout ce qui ne depend pas des autres problemes eventuels.
DoubleTab & derivee_en_temps_inco_sans_solveur_masse_impl(Convection_Diffusion_Fluide_Dilatable_base &eqn, DoubleTab &derivee, const bool is_expl)
Renvoie la derivee en temps de l'inconnue de l'equation.
public_for_cuda void assembler_impl(Convection_Diffusion_Fluide_Dilatable_base &eqn, Matrice_Morse &mat_morse, const DoubleTab &present, DoubleTab &secmem)
void assembler_blocs(Convection_Diffusion_Fluide_Dilatable_base &eqn, matrices_t matrices, DoubleTab &secmem, const tabs_t &semi_impl)
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
const Discretisation_base & discretisation() const
Renvoie la discretisation associee a l'equation.
virtual void completer()
Complete la construction (initialisation) des objets associes a l'equation.
virtual void modifier_pour_Cl(Matrice_Morse &mat_morse, DoubleTab &secmem) const
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.
Schema_Temps_base & schema_temps()
Renvoie le schema en temps associe a l'equation.
Champs_compris champs_compris_
const Nom & le_nom() const override
Renvoie le nom du champ.
Classe Matrice_Morse Represente une matrice M (creuse), non necessairement carree.
Une chaine de caractere (Nom) en majuscules.
Definition Motcle.h:26
classe Navier_Stokes_std Cette classe porte les termes de l'equation de la dynamique
virtual const Champ_Inc_base & rho_la_vitesse() const
const std::string & getString() const
Definition Nom.h:92
const Nom & que_suis_je() const
renvoie la chaine identifiant la classe.
Definition Objet_U.cpp:104
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
static void exit(int exit_code=-1)
Routine de sortie de TRUST dans une region Kokkos.
Definition Process.cpp:455
virtual void ajouter_blocs(matrices_t matrices, DoubleTab &secmem, const Equation_base &eqn, const tabs_t &semi_impl={}) const
Classe de base des flux de sortie.
Definition Sortie.h:52