TrioCFD 1.9.9_beta
TrioCFD documentation
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 //Reading rho is made mandatory here
55 param.supprimer("rho");
56 param.ajouter("rho",&ch_rho_,Param::REQUIRED);
57}
58
59/*! @brief Verifies that the fields read have been set correctly.
60 *
61 * @throws density (rho) is not of type Champ_Uniforme
62 * @throws heat capacity (Cp) is not of 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}
Champ_Uniforme Represents a field that is constant in space and time.
Class defining operators and methods for all reading operation in an input flow (file,...
Definition Entree.h:42
Represents an incompressible fluid and its properties:
void set_param(Param &param) const override
void verifier_coherence_champs(int &err, Nom &message) override
Verifies that the fields read have been set correctly.
Base class for an incompressible fluid and its properties:
Definition Fluide_base.h:36
void set_param(Param &param) const override
void verifier_coherence_champs(int &err, Nom &message) override
Verifies that the fields read have been set correctly.
class Nom: a character string for naming TRUST objects.
Definition Nom.h:31
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
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
Base class for output streams.
Definition Sortie.h:52