TrioCFD 1.9.8
TrioCFD documentation
Loading...
Searching...
No Matches
Loi_Etat_Binaire_GP_WC.cpp
1/****************************************************************************
2* Copyright (c) 2024, 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 <Fluide_Weakly_Compressible.h>
17#include <Loi_Etat_Binaire_GP_WC.h>
18#include <Debog.h>
19
20Implemente_instanciable(Loi_Etat_Binaire_GP_WC,"Loi_Etat_Binaire_Gaz_Parfait_WC",Loi_Etat_Binaire_GP_base);
21// XD binaire_gaz_parfait_WC loi_etat_gaz_parfait_base binaire_gaz_parfait_WC INHERITS_BRACE Class for perfect gas
22// XD_CONT binary mixtures state law used with a weakly-compressible fluid under the iso-thermal and iso-bar
23// XD_CONT assumptions.
24// XD attr molar_mass1 double molar_mass1 REQ Molar mass of species 1 (in kg/mol).
25// XD attr molar_mass2 double molar_mass2 REQ Molar mass of species 2 (in kg/mol).
26// XD attr mu1 double mu1 REQ Dynamic viscosity of species 1 (in kg/m.s).
27// XD attr mu2 double mu2 REQ Dynamic viscosity of species 2 (in kg/m.s).
28// XD attr temperature double temperature REQ Temperature (in Kelvin) which will be constant during the simulation since
29// XD_CONT this state law only works for iso-thermal conditions.
30// XD attr diffusion_coeff double diffusion_coeff REQ Diffusion coefficient assumed the same for both species (in m2/s).
31
33{
34 os <<que_suis_je()<< finl;
35 return os;
36}
37
39{
40 Cerr<<"Lecture de la loi d'etat Melange Binaire WC ... "<<finl;
42}
43
48
49/*! @brief Calcule la masse volumique
50 *
51 */
53{
54 const DoubleTab& tab_Y1 = le_fluide->inco_chaleur().valeurs();
55 Fluide_Weakly_Compressible& FWC = ref_cast(Fluide_Weakly_Compressible,le_fluide.valeur());
56 DoubleTab& tab_rho = le_fluide->masse_volumique().valeurs();
57 const DoubleTab& pres = FWC.pression_th_tab();
58 const int n = tab_rho.size();
59 for (int som=0 ; som<n ; som++)
60 {
61 tab_rho_np1(som) = calculer_masse_volumique(pres(som,0),tab_Y1(som,0));
62 tab_rho(som,0) = 0.5 * ( tab_rho_n(som) + tab_rho_np1(som) );
63 }
64 tab_rho.echange_espace_virtuel();
65 tab_rho_np1.echange_espace_virtuel();
66 le_fluide->calculer_rho_face(tab_rho_np1);
67 Debog::verifier("Loi_Etat_Binaire_GP_WC::calculer_masse_volumique, tab_rho_np1",tab_rho_np1);
68 Debog::verifier("Loi_Etat_Binaire_GP_WC::calculer_masse_volumique, tab_rho",tab_rho);
69}
static void verifier(const char *const msg, double)
Definition Debog.cpp:21
Class defining operators and methods for all reading operation in an input flow (file,...
Definition Entree.h:42
classe Fluide_Weakly_Compressible Cette classe represente un d'un fluide faiblement compressible
const DoubleTab & pression_th_tab() const
classe Loi_Etat_Binaire_GP_WC Cette classe represente la loi d'etat pour les melanges binaires.
void calculer_masse_volumique() override
Calcule la masse volumique.
classe Loi_Etat_Binaire_GP_base Cette classe represente la loi d'etat pour les melanges binaires.
void calculer_masse_volumique() override=0
Recalcule la masse volumique.
DoubleTab tab_rho_np1
DoubleTab tab_rho_n
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
Classe de base des flux de sortie.
Definition Sortie.h:52
_SIZE_ size() const
Definition TRUSTVect.tpp:45
virtual void echange_espace_virtuel(IsExchangeBlocking exchange_type=IsExchangeBlocking::DefaultBlocking, const std::string kernel_name="noname")