TrioCFD 1.9.9_beta
TrioCFD documentation
Loading...
Searching...
No Matches
Flux_parietal_Nusselt.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 <Flux_parietal_Nusselt.h>
17#include <Milieu_composite.h>
18#include <Pb_Multiphase.h>
19#include <cmath>
20
21Implemente_instanciable(Flux_parietal_Nusselt, "Flux_parietal_Nusselt", Flux_parietal_base);
22// XD flux_parietal_nusselt flux_parietal_base nusselt INHERITS_BRACE not_set
23
25{
26 return os;
27}
28
30{
31 Param param(que_suis_je());
32 param.ajouter_non_std("formula", this, Param::REQUIRED); // XD_ADD_P chaine
33 // XD_CONT Nusselt formula as a function of Re and Pr
34 param.lire_avec_accolades_depuis(is);
35 return is;
36}
37
39{
40 if (mot == "formula")
41 {
42 Nom tmp;
43 is >> tmp;
44 Cerr << "Reading and interpreting the function " << tmp << " ... ";
45 nusselt_.setNbVar(2);
46 nusselt_.setString(tmp);
47 nusselt_.addVar("Re");
48 nusselt_.addVar("Pr");
49 nusselt_.parseString();
50 return 1;
51 }
52 else
54}
55
56void Flux_parietal_Nusselt::qp(const input_t& in, output_t& out) const
57{
58 const double Re = in.rho[0] * in.v[0] * in.D_h / in.mu[0], Pr = in.mu[0] * in.Cp[0] / in.lambda[0];
59 nusselt_.setVar("Re", Re);
60 nusselt_.setVar("Pr", Pr);
61 const double Nu = nusselt_.eval();
62
63 double DT = in.Tp - in.T[0], dTf_DT = -1.0, dTp_DT = 1.0, dp_DT = 0.0;
64 if (out.qpk) (*out.qpk)(0) = in.lambda[0] / in.D_ch * Nu * DT;
65 if (out.dTf_qpk) (*out.dTf_qpk)(0, 0) = in.lambda[0] / in.D_ch * Nu * dTf_DT;
66 if (out.dTp_qpk) (*out.dTp_qpk)(0) = in.lambda[0] / in.D_ch * Nu * dTp_DT;
67 if (out.dp_qpk) (*out.dp_qpk)(0) = in.lambda[0] / in.D_ch * Nu * dp_DT;
68}
Class defining operators and methods for all reading operation in an input flow (file,...
Definition Entree.h:42
Class Flux_parietal_Nusselt Correlation of parietal heat flux using the Nusselt number (with Nusselt ...
void qp(const input_t &input, output_t &output) const override
int lire_motcle_non_standard(const Motcle &mot, Entree &is) override
Reads non-simple-type parameters of an Objet_U from an input stream.
Base class for wall heat flux correlations of the form:
A character string (Nom) in uppercase.
Definition Motcle.h:26
class Nom: a character string for naming TRUST objects.
Definition Nom.h:31
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
friend class Entree
Definition Objet_U.h:71
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
@ REQUIRED
Definition Param.h:115
Base class for output streams.
Definition Sortie.h:52