TrioCFD 1.9.8
TrioCFD documentation
Loading...
Searching...
No Matches
Paroi_log_QDM.cpp
1/****************************************************************************
2* Copyright (c) 2015 - 2016, 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 <Paroi_log_QDM.h>
17#include <Param.h>
18
19// XD Paroi_log_QDM objet_u Paroi_log_QDM BRACE Must not and cannot be instantiated. Base class for the wall function.
20
21
23{
24 param.ajouter("Kappa", &Kappa_); // XD_ADD_P double
25 // XD_CONT Von Karman constant (default = 0.415)
26 param.ajouter("Erugu", &Erugu); // XD_ADD_P double
27 // XD_CONT Wall rugosity (default = 9.11)
28 param.ajouter("A_plus", &A_plus); // XD_ADD_P double
29 // XD_CONT Coefficient in the wall function (default = 26)
30}
31
33{
34
35 DoubleTab les_valeurs(40, 1);
36 DoubleVect les_params(40);
37
38 for (int i = 0; i < 40; i++)
39 les_params[i] = i + 1;
40
41 double val = 0;
42 for (int i = 0; i < 40; i++)
43 {
44 val += integrale(les_params[i] - 1, les_params[i], Kappa_, A_plus, &Fdypar);
45 les_valeurs(i, 0) = val*les_params[i];
46 }
47
48 table_hyd.remplir(les_params, les_valeurs);
49}
50
51double Paroi_log_QDM::calcul_lm_plus(double d_plus)
52{
53 return Kappa_*d_plus*(1 - exp(-d_plus/A_plus));
54}
55
56double Fdypar_direct(double lm_plus)
57{
58 return 2./(1 + sqrt(1.0 + 4*lm_plus*lm_plus));
59}
60
61double Fdypar(double d_plus, double kappa, double a_plus)
62{
63 const double lm_plus = kappa*d_plus*(1-exp(-d_plus/a_plus));
64 return 2./(1+sqrt(1.0+4*lm_plus*lm_plus));
65}
66
67double integrale(double a, double b, double param1, double param2,
68 double (*pf) (double, double, double))
69{
70 return 0.5*(pf(a, param1, param2) + pf(b, param1, param2))*(b - a);
71}
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
void init_lois_paroi_hydraulique_()
void set_param(Param &param) const
double calcul_lm_plus(double d_plus)