TrioCFD 1.9.9_beta
TrioCFD documentation
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 Fluide_Quasi_Compressible class This class represents a quasi-compressible fluid,
22 *
23 * i.e. inheriting from the dilatable fluid class
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 */
class Discretisation_base This class represents a spatial discretization scheme, which
Class defining operators and methods for all reading operation in an input flow (file,...
Definition Entree.h:42
Base class for a dilatable fluid, inheriting from Fluide_base.
Fluide_Quasi_Compressible class This class represents a quasi-compressible fluid,.
void completer(const Probleme_base &) override
Completes the fluid with the unknown fields associated with the problem.
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
Reads non-simple-type parameters of an Objet_U from an input stream.
void set_param(Param &param) const override
A character string (Nom) in uppercase.
Definition Motcle.h:26
Helper class to factorize the readOn method of Objet_U classes.
Definition Param.h:112
class Probleme_base It is a Probleme_U that is not a coupling.
static void abort()
Abort routine for TRUST on a fatal error.
Definition Process.cpp:573
static int je_suis_maitre()
Returns 1 if on the master processor of the current group (i.e. me() == 0), 0 otherwise.
Definition Process.cpp:82
void ajoute_sans_ech_esp_virt(_SCALAR_TYPE_ alpha, const TRUSTVect &y, Mp_vect_options opt=VECT_REAL_ITEMS)