TrioCFD 1.9.8
TrioCFD documentation
Loading...
Searching...
No Matches
Flux_parietal_adaptatif.cpp
1/****************************************************************************
2* Copyright (c) 2021, 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 <Flux_parietal_adaptatif.h>
17#include <Loi_paroi_adaptative.h>
18#include <Pb_Multiphase.h>
19#include <Correlation_base.h>
20#include <math.h>
21
22Implemente_instanciable(Flux_parietal_adaptatif, "Flux_parietal_adaptatif", Flux_parietal_base);
23
26
28{
29 correlation_loi_paroi_ = pb_->get_correlation("Loi_paroi");
30}
31
32void Flux_parietal_adaptatif::qp(const input_t& in, output_t& out) const
33{
34 const Loi_paroi_adaptative& corr_loi_paroi = ref_cast(Loi_paroi_adaptative, correlation_loi_paroi_.valeur());
35
36 const double eps = std::numeric_limits<double>::epsilon();
37 const double u_tau =std::max( corr_loi_paroi.get_utau((in.f)), eps);
38
39 const double theta_plus = calc_theta_plus(in.y, u_tau, in.mu[0], in.lambda[0], in.rho[0], in.Cp[0], in.D_h);
40 const double fac = in.rho[0] * in.Cp[0] * u_tau / theta_plus ;
41
42 if (out.qpk)
43 (*out.qpk)(0) = fac * (in.Tp - in.T[0]);
44
45 if (out.dTf_qpk)
46 (*out.dTf_qpk)(0,0) = -fac;
47
48 if (out.dTp_qpk)
49 (*out.dTp_qpk)(0) = fac;
50
51}
52
53double Flux_parietal_adaptatif::calc_theta_plus(const double y, const double u_tau, const double mu,
54 const double lambda, const double rho,
55 const double Cp, const double Diam_hyd_) const
56{
57 const double Prandtl = mu*Cp/lambda;
58 const double visc = mu/rho;
59 const double y_plus = y * u_tau/visc;
60 const double beta = std::pow(3.85*std::cbrt(Prandtl) - 1.3, 2) + 2.12*std::log(Prandtl);
61 const double gamma = 0.01*(Prandtl*y_plus)*(Prandtl*y_plus)*(Prandtl*y_plus)*(Prandtl*y_plus)/(1+5*Prandtl*Prandtl*Prandtl*y_plus);
62 constexpr double y_on_D_h = 0.;
63 return Prandtl*y_plus*std::exp(-gamma) + (2.12*std::log((1 + y_plus)*1.5*(2 - y_on_D_h)/(1 + 2*(1 - y_on_D_h)*(1 - y_on_D_h))) + beta)*std::exp(-1/gamma);
64}
Class defining operators and methods for all reading operation in an input flow (file,...
Definition Entree.h:42
classe Flux_parietal_adaptatif classe qui implemente une correlation de flux parietal monophasique
virtual void qp(const input_t &input, output_t &output) const override
virtual void completer() override
double calc_theta_plus(const double y, const double u_tau, const double mu, const double lambda, const double rho, const double Cp, const double Diam_hyd_) const
classe Flux_parietal_base correlations de flux parietal de la forme
classe Loi_paroi_adaptative correlation pour une loi de paroi adaptative qui calcule u_tau et du y_pl...
double get_utau(int f) const
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
Classe de base des flux de sortie.
Definition Sortie.h:52