TrioCFD 1.9.9_beta
TrioCFD documentation
Loading...
Searching...
No Matches
Perte_Charge_Gen.h
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#ifndef Perte_Charge_Gen_included
17#define Perte_Charge_Gen_included
18
19#include <Perte_Charge_Singuliere.h>
20#include <Domaine_forward.h>
21#include <Champ_Don_base.h>
22#include <Source_base.h>
23#include <TRUST_Ref.h>
24#include <Parser_U.h>
25
27class Domaine_VF;
28class Champ_Inc_base;
29class Fluide_base;
30class Param;
31
33{
34 Declare_base(Perte_Charge_Gen);
35public:
36
37 void dimensionner_blocs(matrices_t matrices, const tabs_t& semi_impl = {}) const override { } // nothing
38
39 void associer_pb(const Probleme_base&) override; //!< associates le_fluide and la_vitesse
40 void completer() override;
41 void mettre_a_jour(double t) override;
42 int sauvegarder(Sortie& os) const override;
43 int reprendre(Entree& is) override;
44
45protected:
46
47 virtual void set_param(Param& param) const override;
48 int lire_motcle_non_standard(const Motcle&, Entree&) override;
49 void associer_domaines(const Domaine_dis_base&,const Domaine_Cl_dis_base&) override;
50
51 //! Called for each face by ajouter()
52 /**
53 Uses computation intermediates: u, norme_u, dh_valeur, reynolds
54 Returns the computed result in p_charge.
55
56 Advantage: good factorization.
57 Drawback: cost of a virtual method call
58 inside a loop.
59
60 \param u The velocity at the current face. 2 or 3 components
61 \param pos position
62 \param t time
63 \param norme_u The norm of the velocity at the current face
64 \param dh The hydraulic diameter at the current face (taken from diam_hydr)
65 \param nu the kinematic viscosity
66 \param reynolds The Reynolds number at the current face: norme_u * dh_valeur / nu
67 \param coeff_ortho coefficient in the orthogonal direction
68 \param coeff_long coefficient in the longitudinal direction
69 \param u_l velocity in the longitudinal direction
70 \param v_valeur longitudinal direction, pressure drop with 2 or 3 components
71 The pressure drop equals -coeff_long*u_l*v_valeur -coeff_ortho(u -u_v*v_valeur)
72 */
73 virtual void coeffs_perte_charge(const DoubleVect& u, const DoubleVect& pos,
74 double t, double norme_u, double dh, double nu, double reynolds,
75 double& coeff_ortho, double& coeff_long, double& u_l, DoubleVect& v_valeur) const = 0;
76
77 //! Hydraulic diameter used in the pressure drop computation
79 //! Fluid associated with the problem
80 OBS_PTR(Fluide_base) le_fluide;
81 //! Velocity associated with the solved equation
83 //! Domain in which the pressure drop applies
84 OBS_PTR(Domaine_VF) le_dom_vf_;
86
87 // Sub-domain case
88 bool sous_domaine = false; //!< Is the term limited to a sub-domain?
89 Nom nom_sous_domaine; //!< Name of the sub-domain, initialized in readOn()
90 OBS_PTR(Sous_Domaine) le_sous_domaine; //!< Initialized in completer()
91 int implicite_ = 1;
92
94
95 IntVect num_faces, sgn; //if the pressure drop is regulated
96};
97
98#endif /* Perte_Charge_Gen_included */
class Champ_Don_base base class of Given Fields (not calculated)
Class Champ_Inc_base.
class Domaine_Cl_dis_base Domaine_Cl_dis_base objects represent discretized boundary conditions
class Domaine_VF
Definition Domaine_VF.h:44
Base class for an incompressible fluid and its properties:
Definition Fluide_base.h:36
class Nom: a character string for naming TRUST objects.
Definition Nom.h:31
friend class Entree
Definition Objet_U.h:71
friend class Sortie
Definition Objet_U.h:70
Helper class to factorize the readOn method of Objet_U classes.
Definition Param.h:112
class Parser_U Version of the Parser class, deriving from Objet_U.
Definition Parser_U.h:32
void associer_domaines(const Domaine_dis_base &, const Domaine_Cl_dis_base &) override
virtual void set_param(Param &param) const override
void associer_pb(const Probleme_base &) override
associates le_fluide and la_vitesse
void mettre_a_jour(double t) override
DOES NOTHING - to override in derived classes.
int reprendre(Entree &is) override
Restores an Objet_U from an input stream. Virtual method to override.
void dimensionner_blocs(matrices_t matrices, const tabs_t &semi_impl={}) const override
virtual void coeffs_perte_charge(const DoubleVect &u, const DoubleVect &pos, double t, double norme_u, double dh, double nu, double reynolds, double &coeff_ortho, double &coeff_long, double &u_l, DoubleVect &v_valeur) const =0
Called for each face by ajouter().
void completer() override
Updates internal references of the Source_base object.
OWN_PTR(Champ_Don_base) diam_hydr
Hydraulic diameter used in the pressure drop computation.
bool sous_domaine
Is the term limited to a sub-domain?
OBS_PTR(Domaine_VF) le_dom_vf_
Domain in which the pressure drop applies.
int sauvegarder(Sortie &os) const override
Saves an Objet_U to an output stream. Virtual method to override.
Nom nom_sous_domaine
Name of the sub-domain, initialized in readOn().
OBS_PTR(Domaine_Cl_dis_base) le_dom_Cl_dis_
OBS_PTR(Champ_Inc_base) la_vitesse
Velocity associated with the solved equation.
OBS_PTR(Sous_Domaine) le_sous_domaine
Initialized in completer().
int lire_motcle_non_standard(const Motcle &, Entree &) override
Reads non-simple-type parameters of an Objet_U from an input stream.
OBS_PTR(Fluide_base) le_fluide
Fluid associated with the problem.
Classe Perte_Charge_Singuliere This class derived from Perte_Charge is used when one wants.
Source_base A Source_base object is a term appearing on the right-hand side of an.
Definition Source_base.h:42