TRUST 1.9.8
HPC thermohydraulic platform
Loading...
Searching...
No Matches
Fluide_Incompressible.cpp
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#include <Fluide_Incompressible.h>
17#include <Motcle.h>
18
19#include <Champ_Uniforme.h>
20#include <Champ_Fonc_Tabule.h>
21#include <Probleme_base.h>
22#include <Discretisation_base.h>
23#include <Equation_base.h>
24#include <Schema_Temps_base.h>
25#include <Param.h>
26#include <Champ_Fonc_MED.h>
27
28Implemente_instanciable_sans_constructeur(Fluide_Incompressible,"Fluide_Incompressible",Fluide_base);
29// XD fluide_incompressible fluide_base fluide_incompressible INHERITS_BRACE Class for non-compressible fluids.
30// XD attr beta_th field_base beta_th OPT Thermal expansion (K-1).
31// XD attr mu field_base mu OPT Dynamic viscosity (kg.m-1.s-1).
32// XD attr beta_co field_base beta_co OPT Volume expansion coefficient values in concentration.
33// XD attr rho field_base rho OPT Density (kg.m-3).
34// XD attr cp field_base cp OPT Specific heat (J.kg-1.K-1).
35// XD attr lambda field_base lambda_u OPT Conductivity (W.m-1.K-1).
36// XD attr porosites bloc_lecture porosites OPT Porosity (optional)
37
39
41{
42 return Fluide_base::printOn(os);
43}
44
46{
48 return is;
49}
50
52{
54 //La lecture de rho est rendue obligatoire ici
55 param.supprimer("rho");
56 param.ajouter("rho",&ch_rho_,Param::REQUIRED);
57}
58
59/*! @brief Verifie que les champs lus l'ont ete correctement.
60 *
61 * @throws la masse volumique (rho) n'est pas de type Champ_Uniforme
62 * @throws la capacite calorifique (Cp) n'est pas de type Champ_Uniforme
63 */
65{
66 msg="";
67 if (ch_rho_)
68 {
69 if (!sub_type(Champ_Uniforme,ch_rho_.valeur()))
70 {
71 msg += "The density rho is not of type Champ_Uniforme. \n";
72 err = 1;
73 }
74 }
75 if (ch_Cp_)
76 {
77 if (!sub_type(Champ_Uniforme,ch_Cp_.valeur()))
78 {
79 msg += "Cp is not of type Champ_Uniforme. \n";
80 err = 1;
81 }
82 }
84}
classe Champ_Uniforme Represente un champ constant dans l'espace et dans le temps.
Class defining operators and methods for all reading operation in an input flow (file,...
Definition Entree.h:42
classe Fluide_Incompressible Cette classe represente un d'un fluide incompressible ainsi que
void set_param(Param &param) const override
void verifier_coherence_champs(int &err, Nom &message) override
Verifie que les champs lus l'ont ete correctement.
classe Fluide_base Cette classe represente un d'un fluide incompressible ainsi que
Definition Fluide_base.h:38
void set_param(Param &param) const override
void verifier_coherence_champs(int &err, Nom &message) override
Verifie que les champs lus l'ont ete correctement.
class Nom Une chaine de caractere pour nommer les objets de TRUST
Definition Nom.h:31
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
Helper class to factorize the readOn method of Objet_U classes.
Definition Param.h:112
void ajouter(const char *keyword, const int *value, Param::Nature nat=Param::OPTIONAL)
Register an integer parameter.
Definition Param.cpp:364
@ REQUIRED
Definition Param.h:115
void supprimer(const char *keyword)
Remove a previously-registered keyword from this Param.
Definition Param.cpp:339
Classe de base des flux de sortie.
Definition Sortie.h:52