TrioCFD 1.9.9_beta
TrioCFD documentation
Loading...
Searching...
No Matches
Pb_rayo_semi_transp.h
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#ifndef Pb_rayo_semi_transp_included
17#define Pb_rayo_semi_transp_included
18
19#include <Eq_rayo_semi_transp.h>
20#include <Probleme_base.h>
21
22/*! @brief Semi-transparent radiation problem. Pb_rayo_semi_transp is a Probleme_base with 4 specific features:
23 *
24 * * Its equation must be typed according to the discretisation.
25 * This requires deferring certain initialisations until the discretisation is known.
26 * * It shares its domain with a hydraulic-type problem.
27 * * There is only one time value (future = present).
28 * It should ideally be made time-independent.
29 * * It holds a reference to the hydraulic problem, used extensively.
30 *
31 *
32 * @sa Pb_Couple_rayo_semi_transp Eq_rayo_semi_transp
33 */
35{
36 Declare_instanciable(Pb_rayo_semi_transp);
37public:
38 void terminate() override { finir(); }
39
40 double computeTimeStep(bool& stop) const override
41 {
42 stop=false;
43 return DMAXFLOAT;
44 }
45
46 bool initTimeStep(double dt) override;
47 bool iterateTimeStep(bool& converged) override;
48 void validateTimeStep() override;
49
50 void completer() override { }
51 int nombre_d_equations() const override { return 1; }
52
53 double calculer_pas_de_temps() const override { return DMAXFLOAT; }
54
55 // This method should not be used: use the Problem interface instead
56 void mettre_a_jour(double temps) override { Process::exit(); }
57
58 void preparer_calcul() override;
59 void associer_sch_tps_base(const Schema_Temps_base&) override;
60
61 const Champ_front_base& flux_radiatif(const Nom& nom_bord) const;
63
65 void get_noms_champs_postraitables(Noms& nom,Option opt=NONE) const override;
66 void creer_champ(const Motcle& motlu) override { }
67
68 inline Probleme_base& probleme_fluide() { return pb_fluide_.valeur(); }
69 inline const Probleme_base& probleme_fluide() const { return pb_fluide_.valeur(); }
70 inline const double& valeur_sigma() const { return sigma_; }
71 inline void associer_probleme_fluide(Probleme_base& Pb) { pb_fluide_ = Pb; }
72 void typer_lire_milieu(Entree& is) override;
73
74 inline const Equation_base& equation(int i) const override
75 {
76 assert(i==0);
77 return eq_rayo_;
78 }
79
80 inline Equation_base& equation(int i) override
81 {
82 assert(i==0);
83 return eq_rayo_;
84 }
85
86 inline const Equation_base& get_equation_by_name(const Nom& un_nom) const override
87 {
88 assert(Motcle(un_nom)==Motcle("Eq_rayo_semi_transp"));
89 return eq_rayo_;
90 }
91
92 inline Equation_base& getset_equation_by_name(const Nom& un_nom) override
93 {
94 assert(Motcle(un_nom)==Motcle("Eq_rayo_semi_transp"));
95 return eq_rayo_;
96 }
97
98 inline Eq_rayo_semi_transp& eq_rayo() { return eq_rayo_; }
99 inline const Eq_rayo_semi_transp& eq_rayo() const { return eq_rayo_; }
100
101protected :
102 static constexpr double sigma_ = 5.67e-8;
105};
106
107#endif /* Pb_rayo_semi_transp_included */
class Champ_front_base Base class for the hierarchy of boundary fields.
Class defining operators and methods for all reading operation in an input flow (file,...
Definition Entree.h:42
class Equation_base The role of an equation is the calculation of one or more fields....
A character string (Nom) in uppercase.
Definition Motcle.h:26
class Nom: a character string for naming TRUST objects.
Definition Nom.h:31
An array of character strings (VECT(Nom)).
Definition Noms.h:26
Semi-transparent radiation problem. Pb_rayo_semi_transp is a Probleme_base with 4 specific features:
double calculer_pas_de_temps() const override
Computes the value of the next time step for the problem.
void preparer_calcul() override
Prepares the computation: initializes the medium parameters and prepares the computation of each equa...
void creer_champ(const Motcle &motlu) override
Equation_base & equation(int i) override
void associer_probleme_fluide(Probleme_base &Pb)
const Champ_front_base & flux_radiatif(const Nom &nom_bord) const
OBS_PTR(Probleme_base) pb_fluide_
bool iterateTimeStep(bool &converged) override
In the case solveTimeStep uses an iterative process, this method executes a single iteration.
void terminate() override
This method is called once at the end, after any other one.
void validateTimeStep() override
Validates the calculated unknown by moving the present time at the end of the time step.
void get_noms_champs_postraitables(Noms &nom, Option opt=NONE) const override
double computeTimeStep(bool &stop) const override
Compute the value the Problem would like for the next time step.
void typer_lire_milieu(Entree &is) override
int nombre_d_equations() const override
Eq_rayo_semi_transp & eq_rayo()
const double & valeur_sigma() const
Probleme_base & probleme_fluide()
void mettre_a_jour(double temps) override
Performs a time update of the problem.
static constexpr double sigma_
Equation_base & getset_equation_by_name(const Nom &un_nom) override
(B. Math): Virtual method added for problems having several equations of the same type (Probleme_FT_D...
void associer_sch_tps_base(const Schema_Temps_base &) override
Associates a time scheme with the problem.
bool initTimeStep(double dt) override
This method allocates and initializes the unknown and given fields for the future time step.
const Equation_base & equation(int i) const override
const Probleme_base & probleme_fluide() const
const Eq_rayo_semi_transp & eq_rayo() const
void completer() override
Completes the equations associated with the problem.
const Equation_base & get_equation_by_name(const Nom &un_nom) const override
(B. Math): Virtual method added for problems having several equations of the same type (Probleme_FT_D...
Eq_rayo_semi_transp eq_rayo_
class Probleme_base It is a Probleme_U that is not a coupling.
virtual void finir()
Finalizes post-processing and saves the problem to a file.
static void exit(int exit_code=-1)
Exit routine for TRUST within a Kokkos region.
Definition Process.cpp:466
class Schema_Temps_base