TrioCFD 1.9.8
TrioCFD documentation
Loading...
Searching...
No Matches
Perte_Charge_Reguliere.h
1/****************************************************************************
2* Copyright (c) 2024, 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_Reguliere_included
17#define Perte_Charge_Reguliere_included
18
19#include <Perte_Charge.h>
20#include <TRUSTVect.h>
21#include <math.h>
22
23/*! @brief Classe Perte_Charge_Reguliere Cette classe derivee de Perte_Charge est utiliseelorsque l'on veut
24 *
25 * modeliser un domaine de l'ecoulement dans lequel des obstacles sont
26 * immerges (faisceau de tubes par exemple)
27 *
28 * @sa Perte_Charge Perte_Charge_Singuliere
29 */
31{
32
33public :
35 inline double correction_direction(DoubleVect& , int) const ;
36 inline double calculer_Cf_blasius(double ) const;
38 inline double D() const;
39 inline double d() const;
40 inline double a() const;
41 inline double b() const;
42 inline double CF() const;
43
44protected :
45
46 double D_;
47 double d_;
48 double a_;
49 double b_;
50 double Cf_;
51
54 double xo,yo,zo;
55 int dir[3] ;
56 double h0, h ;
57
58};
59
60
61/*! @brief
62 *
63 * @return (double)
64 */
65inline double Perte_Charge_Reguliere::D() const
66{
67 return D_;
68}
69
70
71/*! @brief
72 *
73 * @return (double)
74 */
75inline double Perte_Charge_Reguliere::d() const
76{
77 return d_;
78}
79
80
81/*! @brief
82 *
83 * @return (double)
84 */
85inline double Perte_Charge_Reguliere::a() const
86{
87 return a_;
88}
89
90
91/*! @brief
92 *
93 * @return (double)
94 */
95inline double Perte_Charge_Reguliere::b() const
96{
97 return b_;
98}
99
100inline double Perte_Charge_Reguliere::CF() const
101{
102 return Cf_;
103}
104
105/*! @brief
106 *
107 * @return (double)
108 */
110{
111 double Cf = 0.;
112 if (Re > 1.e-12)
113 Cf= a_*pow(Re,-b_);
114 return Cf;
115}
116
117inline double Perte_Charge_Reguliere::correction_direction(DoubleVect& xp, int k) const
118{
119 double cor_dir = 1 ;
120
121 if (couronne_tube == 1)
122 {
123 int dimension = xp.size() ;
124
125 double x1 = (xp(0) - xo)*dir[0] ;
126 double y1 = (xp(1) - yo)*dir[1] ;
127 double z1 = 0. ;
128 if (dimension == 3 ) z1 = (xp(2) - zo)*dir[2] ;
129 double scale = sqrt(x1*x1 + y1*y1 + z1*z1);
130
131 // if (k == 0 ) cor_dir = x1/scale ;
132 // if (k == 1 ) cor_dir = y1/scale ;
133 // if (k == 2 ) cor_dir = z1/scale ;
134 if (k == 0 ) cor_dir = std::fabs(x1)/scale ;
135 if (k == 1 ) cor_dir = std::fabs(y1)/scale ;
136 if (k == 2 ) cor_dir = std::fabs(z1)/scale ;
137
138 }
139
140 return cor_dir;
141}
142
143
144#endif
Class defining operators and methods for all reading operation in an input flow (file,...
Definition Entree.h:42
double calculer_Cf_blasius(double) const
Entree & lire_donnees(Entree &)
Lit les specifications d'une perte de charge reguliere a partir d'un flot d'entree.
double correction_direction(DoubleVect &, int) const
Classe Perte_Charge Cette classe represente un terme de perte de charge quiest introduit.
_SIZE_ size() const
Definition TRUSTVect.tpp:45