TrioCFD 1.9.9_beta
TrioCFD documentation
Loading...
Searching...
No Matches
Perte_Charge_Circulaire_PolyMAC_CDO_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 <Perte_Charge_Circulaire_PolyMAC_CDO_Face.h>
17#include <Motcle.h>
18#include <Param.h>
19
20Implemente_instanciable(Perte_Charge_Circulaire_PolyMAC_CDO_Face, "Perte_Charge_Circulaire_Face_PolyMAC_CDO", Perte_Charge_PolyMAC_CDO);
21
23
25{
27 if (v->nb_comp() != dimension)
28 {
29 Cerr << "The direction field must be defined with " << dimension << " components" << finl;
31 }
32 return s;
33}
34
36{
38 param.ajouter_non_std("lambda_ortho", (this), Param::REQUIRED);
39 param.ajouter("diam_hydr_ortho", &diam_hydr_ortho, Param::REQUIRED);
40 param.ajouter("direction", &v, Param::REQUIRED);
41}
42
44{
45 if (mot == "lambda")
46 {
47 lambda.addVar("Re_tot");
48 lambda.addVar("Re_long");
50 }
51 else if (mot == "lambda_ortho")
52 return lire_motcle_non_standard_impl(mot, is);
53 else
55}
56
57void Perte_Charge_Circulaire_PolyMAC_CDO_Face::coeffs_perte_charge(const DoubleVect& u, const DoubleVect& pos, double t, double norme_u,
58 double dh, double nu, double reynolds, double& coeff_ortho,
59 double& coeff_long, double& u_l, DoubleVect& av_valeur) const
60{
61 coeffs_perte_charge_impl(u, pos, t, norme_u, dh, nu, reynolds, K_, coeff_ortho, coeff_long, u_l, av_valeur, lambda);
62}
63
64/////////////////////////////////////////////////
65
66Implemente_instanciable(Perte_Charge_Circulaire_PolyMAC_HFV_Face, "Perte_Charge_Circulaire_Face_PolyMAC_HFV|Perte_Charge_Circulaire_Face_PolyMAC_MPFA", Perte_Charge_PolyMAC_HFV);
67
69
71{
73 if (v->nb_comp() != dimension)
74 {
75 Cerr << "The direction field must be defined with " << dimension << " components" << finl;
77 }
78 return s;
79}
80
82{
84 param.ajouter_non_std("lambda_ortho", (this), Param::REQUIRED);
85 param.ajouter("diam_hydr_ortho", &diam_hydr_ortho, Param::REQUIRED);
86 param.ajouter("direction", &v, Param::REQUIRED);
87}
88
90{
91 if (mot == "lambda")
92 {
93 lambda.addVar("Re_tot");
94 lambda.addVar("Re_long");
96 }
97 else if (mot == "lambda_ortho")
98 return lire_motcle_non_standard_impl(mot, is);
99 else
101}
102
103void Perte_Charge_Circulaire_PolyMAC_HFV_Face::coeffs_perte_charge(const DoubleVect& u, const DoubleVect& pos, double t, double norme_u,
104 double dh, double nu, double reynolds, double& coeff_ortho,
105 double& coeff_long, double& u_l, DoubleVect& av_valeur) const
106{
107 coeffs_perte_charge_impl(u, pos, t, norme_u, dh, nu, reynolds, K_, coeff_ortho, coeff_long, u_l, av_valeur, lambda);
108}
Class defining operators and methods for all reading operation in an input flow (file,...
Definition Entree.h:42
A character string (Nom) in uppercase.
Definition Motcle.h:26
virtual void set_param(Param &) const
Definition Objet_U.h:130
virtual int lire_motcle_non_standard(const Motcle &motlu, Entree &is)
Reads non-simple-type parameters of an Objet_U from an input stream.
Definition Objet_U.cpp:115
static int dimension
Definition Objet_U.h:94
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
v
Direction vector of the pressure drop.
int lire_motcle_non_standard_impl(const Motcle &, Entree &)
void coeffs_perte_charge_impl(const DoubleVect &, const DoubleVect &, double, double, double, double, double, double, double &, double &, double &, DoubleVect &, Parser_U &) const
Implements the effective computation of the pressure drop for a given location.
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 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
Anisotropic pressure drop (along a unit vector v and in the plane orthogonal to this vector).
int lire_motcle_non_standard(const Motcle &, Entree &) override
Reads non-simple-type parameters of an Objet_U from an input stream.
void coeffs_perte_charge(const DoubleVect &, const DoubleVect &, double, double, double, double, double, double &, double &, double &, DoubleVect &) const override
Implements the effective computation of the pressure drop for a given location.
int lire_motcle_non_standard(const Motcle &, Entree &) override
Reads non-simple-type parameters of an Objet_U from an input stream.
void coeffs_perte_charge(const DoubleVect &, const DoubleVect &, double, double, double, double, double, double &, double &, double &, DoubleVect &) const override
Called for each face by ajouter().
Factorises the features of several pressure drop classes in VEF, face velocity.
static void exit(int exit_code=-1)
Exit routine for TRUST within a Kokkos region.
Definition Process.cpp:466
Base class for output streams.
Definition Sortie.h:52