TrioCFD 1.9.9_beta
TrioCFD documentation
Loading...
Searching...
No Matches
Loi_Etat_Binaire_GP_QC.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_Quasi_Compressible.h>
17#include <Loi_Etat_Binaire_GP_QC.h>
18#include <Debog.h>
19
20Implemente_instanciable(Loi_Etat_Binaire_GP_QC,"Loi_Etat_Binaire_Gaz_Parfait_QC",Loi_Etat_Binaire_GP_base);
21// XD binaire_gaz_parfait_QC loi_etat_gaz_parfait_base binaire_gaz_parfait_QC INHERITS_BRACE Class for perfect gas
22// XD_CONT binary mixtures state law used with a quasi-compressible fluid under the iso-thermal and iso-bar assumptions.
23// XD attr molar_mass1 double molar_mass1 REQ Molar mass of species 1 (in kg/mol).
24// XD attr molar_mass2 double molar_mass2 REQ Molar mass of species 2 (in kg/mol).
25// XD attr mu1 double mu1 REQ Dynamic viscosity of species 1 (in kg/m.s).
26// XD attr mu2 double mu2 REQ Dynamic viscosity of species 2 (in kg/m.s).
27// XD attr temperature double temperature REQ Temperature (in Kelvin) which will be constant during the simulation since
28// XD_CONT this state law only works for iso-thermal conditions.
29// XD attr diffusion_coeff double diffusion_coeff REQ Diffusion coefficient assumed the same for both species (in m2/s).
30
32{
33 os <<que_suis_je()<< finl;
34 return os;
35}
36
38{
39 Cerr<<"Reading the binary mixture equation of state QC ... "<<finl;
41}
42
47
48/*! @brief Recomputes the density.
49 *
50 */
52{
53 const DoubleTab& tab_Y1 = le_fluide->inco_chaleur().valeurs();
54 DoubleTab& tab_rho = le_fluide->masse_volumique().valeurs();
55 double Pth = le_fluide->pression_th();
56
57 const int n = tab_rho.size();
58 for (int som=0 ; som<n ; som++)
59 {
60 tab_rho_np1(som) = calculer_masse_volumique(Pth,tab_Y1(som,0));
61 tab_rho(som,0) = 0.5 * ( tab_rho_n(som) + tab_rho_np1(som) );
62 }
63
64 const Champ_base& rho_m=le_fluide->get_champ("rho_gaz");
65 ref_cast_non_const(DoubleTab,rho_m.valeurs()) = tab_rho_np1;
66 tab_rho.echange_espace_virtuel();
67 tab_rho_np1.echange_espace_virtuel();
68 le_fluide->calculer_rho_face(tab_rho_np1);
69 Debog::verifier("Loi_Etat_Binaire_GP_QC::calculer_masse_volumique, tab_rho_np1",tab_rho_np1);
70 Debog::verifier("Loi_Etat_Binaire_GP_QC::calculer_masse_volumique, tab_rho",tab_rho);
71}
virtual DoubleTab & valeurs()=0
class Champ_base This class is the base of the fields hierarchy.
Definition Champ_base.h:43
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
State law class for binary ideal-gas mixtures in the quasi-compressible (QC) framework.
void calculer_masse_volumique() override
Recomputes the density.
Base state law class for binary ideal-gas mixtures, defining a dilatable binary fluid with the equati...
void calculer_masse_volumique() override=0
Recomputes the density (masse volumique).
DoubleTab tab_rho_np1
DoubleTab tab_rho_n
const Nom & que_suis_je() const
Returns the string identifying the class.
Definition Objet_U.cpp:104
virtual Entree & readOn(Entree &)
Reads an Objet_U from an input stream. Virtual method to override.
Definition Objet_U.cpp:289
virtual Sortie & printOn(Sortie &) const
Writes the object to an output stream. Virtual method to override.
Definition Objet_U.cpp:278
Base class for output streams.
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")