TrioCFD 1.9.9_beta
TrioCFD documentation
Loading...
Searching...
No Matches
EDO_Pression_th_base.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 <Sortie_libre_pression_imposee_QC.h>
17#include <Fluide_Weakly_Compressible.h>
18#include <EDO_Pression_th_base.h>
19#include <Domaine_Cl_dis_base.h>
20
21#include <Cond_lim.h>
22
23Implemente_base(EDO_Pression_th_base, "EDO_Pression_th_base", Objet_U);
24
25Sortie& EDO_Pression_th_base::printOn(Sortie& os) const { return os; }
26
28
29/*! @brief Associates the fluid with the ODE.
30 *
31 * @param fl The dilatable fluid to associate.
32 */
34{
35 le_fluide_ = fl;
36}
37
39{
40 le_dom = ref_cast(Domaine_VF, dds);
41 le_dom_Cl = domaine_cl;
42}
43
45{
46 const DoubleTab& tab_ICh = le_fluide_->inco_chaleur().valeurs();
47 const double Pth = le_fluide_->pression_th();
48
49 if (Pth > -1.)
50 M0 = masse_totale(Pth, tab_ICh);
51 else
52 {
53 assert(sub_type(Fluide_Weakly_Compressible, le_dom.valeur()));
54 M0 = masse_totale(ref_cast(Fluide_Weakly_Compressible, le_dom.valeur()).pression_th_tab(), tab_ICh);
55 }
56
57 le_fluide_->checkTraitementPth(le_dom_Cl.valeur());
58}
59
61{
62 if (sub_type(Fluide_Weakly_Compressible, le_dom.valeur())) return; /* bof */
63
64 for (int n_bord = 0; n_bord < le_dom->nb_front_Cl(); n_bord++)
65 {
66 const Cond_lim& la_cl = le_dom_Cl->les_conditions_limites(n_bord);
67 if (sub_type(Sortie_libre_pression_imposee_QC, la_cl.valeur()))
68 {
69 Sortie_libre_pression_imposee_QC& cl = ref_cast_non_const(Sortie_libre_pression_imposee_QC, la_cl.valeur());
70 cl.set_Pth(P);
71 }
72 }
73}
class Cond_lim Generic class used to represent any class
Definition Cond_lim.h:31
class Domaine_Cl_dis_base Domaine_Cl_dis_base objects represent discretized boundary conditions
class Domaine_VF
Definition Domaine_VF.h:44
class Domaine_dis_base This class is the base of the hierarchy of discretized domains.
Base class of the ODE hierarchy for thermodynamic pressure associated with the scheme resolution for ...
void associer_fluide(const Fluide_Dilatable_base &)
Associates the fluid with the ODE.
virtual double masse_totale(double P, const DoubleTab &T)=0
void associer_domaines(const Domaine_dis_base &, const Domaine_Cl_dis_base &)
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_Weakly_Compressible class This class represents a weakly compressible fluid,...
Base class for TRUST objects (Objet_U).
Definition Objet_U.h:68
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
Open boundary with imposed pressure condition, derived from Neumann_sortie_libre.
Base class for output streams.
Definition Sortie.h:52