TRUST 1.9.8
HPC thermohydraulic platform
Loading...
Searching...
No Matches
Fluide_Quasi_Compressible.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 Fluide_Quasi_Compressible_included
17#define Fluide_Quasi_Compressible_included
18
19#include <Fluide_Dilatable_base.h>
20
21/*! @brief classe Fluide_Quasi_Compressible Cette classe represente un d'un fluide quasi compressible
22 *
23 * c'est a dire heritant de fluide dilatable
24 *
25 * @sa Milieu_base Fluide_Dilatable_base
26 */
27
29{
30 Declare_instanciable(Fluide_Quasi_Compressible);
31public :
32 void set_param(Param& param) const override;
33 void completer(const Probleme_base&) override;
34 void discretiser(const Probleme_base& pb, const Discretisation_base& dis) override;
35 int lire_motcle_non_standard(const Motcle&, Entree&) override;
36
37 // Methodes inlines
38 inline void Resoudre_EDO_PT() override;
39 inline void secmembre_divU_Z(DoubleTab& ) const override;
41
42protected :
43 int traitement_rho_gravite_ = 0; // 0 : gravite = rho*g, 1 : gravite =(rho-rho_moy)*g
45 mutable DoubleTab tab_W_old_;
46
47private :
48 public_for_cuda
49 void remplir_champ_pression_tot(int n, const DoubleTab& PHydro, DoubleTab& PTot) override;
50};
51
53{
54 Pth_n_ = Pth_;
55
56 if (traitement_PTh_ != 2)
57 {
58 Pth_ = EDO_Pth_->resoudre(Pth_);
59
60 if (Pth_<=0)
61 {
62 Cerr<<"Error : the pressure calculated by Resoudre_EDO_PT method is negative : "<< Pth_ << finl;
63 abort();
64 }
65
66 EDO_Pth_->mettre_a_jour_CL(Pth_);
67 }
68}
69
70//Calcule W=-dZ/dt, 2nd membre de l'equation div(rhoU) = W
71inline void Fluide_Quasi_Compressible::secmembre_divU_Z(DoubleTab& tab_W) const
72{
73 double temps=ch_vitesse_->temps();
75 {
76 eos_tools_->secmembre_divU_Z(tab_W);
77 if (tab_W_old_.size_totale() > 0) // Relaxation eventuelle:
78 {
79 tab_W *= omega_drho_dt_;
81 }
82 tab_W_old_ = tab_W;
83 }
84 else
85 {
86 if (je_suis_maitre())
87 Cerr<<" The drho_dt term is not taken into account for time smaller than " <<temps_debut_prise_en_compte_drho_dt_<<finl;
88 tab_W=0;
89 }
90}
91
92#endif /* Fluide_Quasi_Compressible_included */
classe Discretisation_base Cette classe represente un schema de discretisation en espace,...
Class defining operators and methods for all reading operation in an input flow (file,...
Definition Entree.h:42
classe Fluide_Dilatable_base Cette classe represente un d'un fluide dilatable,
classe Fluide_Quasi_Compressible Cette classe represente un d'un fluide quasi compressible
void completer(const Probleme_base &) override
Complete le fluide avec les champs inconnus associes au probleme.
void secmembre_divU_Z(DoubleTab &) const override
void discretiser(const Probleme_base &pb, const Discretisation_base &dis) 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.
void set_param(Param &param) const override
Une chaine de caractere (Nom) en majuscules.
Definition Motcle.h:26
Helper class to factorize the readOn method of Objet_U classes.
Definition Param.h:112
classe Probleme_base C'est un Probleme_U qui n'est pas un couplage.
static void abort()
Routine de sortie de Trio-U sur une erreur abort().
Definition Process.cpp:570
static int je_suis_maitre()
renvoie 1 si on est sur le processeur maitre du groupe courant (c'est a dire me() == 0),...
Definition Process.cpp:86
void ajoute_sans_ech_esp_virt(_SCALAR_TYPE_ alpha, const TRUSTVect &y, Mp_vect_options opt=VECT_REAL_ITEMS)