TrioCFD 1.9.8
TrioCFD documentation
Loading...
Searching...
No Matches
Source_Forchheimer_VDF_Face.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 <Source_Forchheimer_VDF_Face.h>
17#include <Probleme_base.h>
18#include <Milieu_base.h>
19#include <Domaine_Cl_VDF.h>
20
21#include <Domaine_VDF.h>
22#include <Param.h>
23
24Implemente_instanciable_sans_constructeur(Source_Forchheimer_VDF_Face,"Forchheimer_VDF_Face",Terme_Source_VDF_base);
25// XD forchheimer source_base forchheimer NO_BRACE Class to add the source term of Forchheimer -Cf/sqrt(K)*V2 in the
26// XD_CONT Navier-Stokes equations. We must precise a permeability model : constant or Ergun\'s law. Moreover we can
27// XD_CONT give the constant Cf : by default its value is 1. Forchheimer source term is available also for quasi
28// XD_CONT compressible calculation. A new keyword is aded for porosity (porosite).
29// XD attr bloc bloc_lecture bloc REQ Description.
30
32
34{
35 Param param(que_suis_je());
36 set_param(param);
37 param.lire_avec_accolades_depuis(is);
38 set_fichier("Forcheimer");
39 set_description("Forchheimer term = Integral(-Cf/K*abs(vitesse)*vitesse*dv) [m/s2]");
40 return is;
41}
42
44{
45 param.ajouter_non_std("modele_K",(this),Param::REQUIRED);
46 param.ajouter_non_std("Cf",(this),Param::REQUIRED);
47 param.ajouter_non_std("porosite",(this),Param::REQUIRED);
48}
49
51{
52 if (mot=="modele_K")
53 {
54 Motcle motlu;
55 is >> motlu;
56 eval().modK_.typer(motlu);
57 is >> eval().modK_.valeur();
58 return 1;
59 }
60 else if (mot=="Cf")
61 {
62 double c;
63 is >> c;
64 eval().setCf(c);
65 return 1;
66 }
67 else if (mot=="porosite")
68 {
69 double c;
70 is >> c;
71 eval().setPorosite(c);
72 return 1;
73 }
74 else
75 {
76 Cerr << "Unknown keyword in Source_Forchheimer_VDF_Face " << finl;
78 }
79 return -1;
80}
81
82
84{
85 const Domaine_VDF& zvdf = ref_cast(Domaine_VDF,domaine_dis);
86 const Domaine_Cl_VDF& zclvdf = ref_cast(Domaine_Cl_VDF,domaine_cl_dis);
87 iter_->associer_domaines(zvdf, zclvdf);
88 eval().associer_domaines(zvdf, zclvdf );
89}
90
92{
93 const Champ_Inc_base& vit = pb.equation(0).inconnue();
94 eval().associer(vit);
95}
Classe Champ_Inc_base.
class Domaine_Cl_VDF
classe Domaine_Cl_dis_base Les objets Domaine_Cl_dis_base representent les conditions aux limites
class Domaine_VDF
Definition Domaine_VDF.h:64
classe Domaine_dis_base Cette classe est la base de la hierarchie des domaines discretisees.
Class defining operators and methods for all reading operation in an input flow (file,...
Definition Entree.h:42
virtual const Champ_Inc_base & inconnue() const =0
void associer(const Champ_Inc_base &vit)
void associer_domaines(const Domaine_dis_base &domaine, const Domaine_Cl_dis_base &domaine_cl)
Une chaine de caractere (Nom) en majuscules.
Definition Motcle.h:26
friend class Entree
Definition Objet_U.h:76
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
Helper class to factorize the readOn method of Objet_U classes.
Definition Param.h:112
@ REQUIRED
Definition Param.h:115
void ajouter_non_std(const char *keyword, const Objet_U *value, Param::Nature nat=Param::OPTIONAL)
Register a keyword handled by Objet_U::lire_motcle_non_standard.
Definition Param.cpp:489
classe Probleme_base C'est un Probleme_U qui n'est pas un couplage.
virtual const Equation_base & equation(int) const =0
static void exit(int exit_code=-1)
Routine de sortie de TRUST dans une region Kokkos.
Definition Process.cpp:455
Classe de base des flux de sortie.
Definition Sortie.h:52
class Source_Forchheimer_VDF_Face Cette classe represente le terme de Forchheimer pour les ecoulement...
void associer_pb(const Probleme_base &) override
Eval_Forchheimer_VDF_Face & eval()
void set_param(Param &param) const override
void associer_domaines(const Domaine_dis_base &, const Domaine_Cl_dis_base &) override
int lire_motcle_non_standard(const Motcle &, Entree &) override
Lecture des parametres de type non simple d'un objet_U a partir d'un flot d'entree.
void set_fichier(const Nom &)
void set_description(const Nom &nom)
Definition Source_base.h:83