TrioCFD 1.9.8
TrioCFD documentation
Loading...
Searching...
No Matches
T_paroi_Champ_P0_VDF.h
1/****************************************************************************
2* Copyright (c) 2025, 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 T_paroi_Champ_P0_VDF_included
17#define T_paroi_Champ_P0_VDF_included
18
19#include <Echange_externe_radiatif.h>
20#include <Champ_Fonc_P0_VDF.h>
21#include <Domaine_Cl_VDF.h>
22#include <TRUST_Ref.h>
23
24class Champ_P0_VDF;
25
27{
28 Declare_instanciable(T_paroi_Champ_P0_VDF);
29public:
30 void mettre_a_jour(double) override;
31 void associer_champ(const Champ_P0_VDF&);
32 const Domaine_Cl_dis_base& domaine_Cl_dis_base() const { return le_dom_Cl_VDF.valeur(); }
33
34 inline const Champ_P0_VDF& mon_champ() const { return mon_champ_.valeur(); }
35
36 inline void associer_domaine_Cl_dis_base(const Domaine_Cl_dis_base& le_dom_Cl_dis_base)
37 {
38 le_dom_Cl_VDF = ref_cast(Domaine_Cl_VDF, le_dom_Cl_dis_base);
39 }
40
41protected:
42 void me_calculer(double);
43 OBS_PTR(Champ_P0_VDF) mon_champ_;
44 OBS_PTR(Domaine_Cl_VDF) le_dom_Cl_VDF;
45};
46
47inline double newton_T_paroi_VDF(double eps, double h, double T_ext, double lambda, double e, double T0)
48{
49 double Tb = T0;
50 const double it_max = 100, tolerance = 1e-8;
51 for (int i = 0; i < it_max; i++)
52 {
53 const double f = COEFF_STEFAN_BOLTZMANN * eps * (T_ext * T_ext * T_ext * T_ext - Tb * Tb * Tb * Tb) + h * (T_ext - Tb) - lambda / e * (Tb - T0);
54 const double f_p = -4 * COEFF_STEFAN_BOLTZMANN * eps * Tb * Tb * Tb - h - lambda / e;
55 const double Tb_new = Tb - f / f_p;
56 if (std::abs(Tb_new - Tb) < tolerance)
57 return Tb_new;
58 Tb = Tb_new;
59 }
60 Process::exit("newton_T_paroi_VDF : newton did not converge !");
61 return Tb;
62}
63
64#endif /* T_paroi_Champ_P0_VDF_included */
classe Champ_Fonc_P0_VDF
classe Champ_P0_VDF Classe qui represente un champ discret P0 par element associe a un domaine discre...
class Domaine_Cl_VDF
classe Domaine_Cl_dis_base Les objets Domaine_Cl_dis_base representent les conditions aux limites
static void exit(int exit_code=-1)
Routine de sortie de TRUST dans une region Kokkos.
Definition Process.cpp:455
const Domaine_Cl_dis_base & domaine_Cl_dis_base() const
void associer_champ(const Champ_P0_VDF &)
void mettre_a_jour(double) override
Mise a jour en temps du champ.
OBS_PTR(Domaine_Cl_VDF) le_dom_Cl_VDF
OBS_PTR(Champ_P0_VDF) mon_champ_
const Champ_P0_VDF & mon_champ() const
void associer_domaine_Cl_dis_base(const Domaine_Cl_dis_base &le_dom_Cl_dis_base)