TrioCFD 1.9.9_beta
TrioCFD documentation
Loading...
Searching...
No Matches
Convection_Diffusion_Espece_Fluide_Dilatable_base.cpp
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#include <Convection_Diffusion_Espece_Fluide_Dilatable_base.h>
17#include <Fluide_Dilatable_base.h>
18#include <Neumann_sortie_libre.h>
19#include <Discret_Thyd.h>
20
21Implemente_base(Convection_Diffusion_Espece_Fluide_Dilatable_base,"Convection_Diffusion_Espece_Fluide_Dilatable_base",Convection_Diffusion_Fluide_Dilatable_base);
22
24{
26}
27
29{
31}
32
34{
36
37 // fill the modified boundary condition domain with 1 everywhere on the boundary...
38 zcl_modif_=(domaine_Cl_dis());
39
40 Conds_lim& condlims=zcl_modif_->les_conditions_limites();
41 int nb=condlims.size();
42 for (int i=0; i<nb; i++)
43 {
44 // for each boundary condition, retrieve the front field and set it to 1
45 // even if the boundary condition is a flux (in that case convection will remain zero)
46 DoubleTab& T=condlims[i]->champ_front().valeurs();
47 T=1.;
48 if (sub_type(Neumann_sortie_libre,condlims[i].valeur()))
49 ref_cast(Neumann_sortie_libre,condlims[i].valeur()).tab_ext()=1;
50 }
51 zcl_modif_->les_conditions_limites().set_modifier_val_imp(0);
52 return 1;
53}
54
56{
57 int nb_valeurs_temp = schema_temps().nb_valeurs_temporelles();
58 double temps = schema_temps().temps_courant();
59 const Discret_Thyd& dis=ref_cast(Discret_Thyd, discretisation());
60 Cerr << "Massic fraction equation discretization ..." << finl;
61 // Use temperature directive since the discretization is identical
62 dis.discretiser_champ("temperature",domaine_dis(),"fraction_massique","sans_dimension",
63 1 /* nb_composantes */,nb_valeurs_temp,temps,l_inco_ch);
65 Cerr << "Convection_Diffusion_Espece_Fluide_Dilatable_base::discretiser() ok" << finl;
66}
67
72
77
79{
80 int bytes=0;
81 bytes += Equation_base::sauvegarder(os);
82 return bytes;
83}
84
90
91/*! @brief Returns the name of the equation's application domain.
92 *
93 * Here "Fraction_massique".
94 *
95 * @return Name of the equation's application domain.
96 */
98{
99 static Motcle domaine ="Fraction_massique";
100 return domaine;
101}
class Conds_lim This class represents a vector of boundary conditions.
Definition Conds_lim.h:32
void set_modifier_val_imp(int)
Sets the modifier_val_imp flag for all boundary conditions in the vector.
Definition Conds_lim.h:107
Particular case of Convection_Diffusion_std for a dilatable fluid when the transported scalar is the ...
std::vector< YAML_data > data_a_sauvegarder() const override
for PDI IO: retrieve name, type and dimensions of the data to save/restore. This has to be overrode f...
int sauvegarder(Sortie &) const override
Saves an Objet_U to an output stream. Virtual method to override.
int preparer_calcul() override
Everything that does not depend on other possible problems.
int reprendre(Entree &) override
Restores an Objet_U from an input stream. Virtual method to override.
const Motcle & domaine_application() const override
Returns the name of the equation's application domain.
void calculer_div_rho_u_impl(DoubleTab &res, const Convection_Diffusion_Fluide_Dilatable_base &eqn) const
Base class for convection-diffusion equations for a dilatable fluid.
class Discret_Thyd This class is the base class representing a discretization
void discretiser_champ(const Motcle &directive, const Domaine_dis_base &z, const Nom &nom, const Nom &unite, int nb_comp, int nb_pas_dt, double temps, OWN_PTR(Champ_Inc_base)&champ, const Nom &sous_type=NOM_VIDE) const
Class defining operators and methods for all reading operation in an input flow (file,...
Definition Entree.h:42
int reprendre(Entree &) override
We resume the unknown from an input stream.
virtual std::vector< YAML_data > data_a_sauvegarder() const
for PDI IO: retrieve name, type and dimensions of the data to save/restore. This has to be overrode f...
const Discretisation_base & discretisation() const
Returns the discretization associated with the equation.
virtual int preparer_calcul()
Everything that does not depend on other possible problems.
int sauvegarder(Sortie &) const override
We save the unknown, then the source terms to an output stream.
virtual Domaine_Cl_dis_base & domaine_Cl_dis()
Returns the discretized boundary condition domain associated with the equation.
Schema_Temps_base & schema_temps()
Returns the time scheme associated with the equation.
virtual void discretiser()
Discretizes the equation.
Domaine_dis_base & domaine_dis()
Returns the discretized domain associated with the equation.
A character string (Nom) in uppercase.
Definition Motcle.h:26
Neumann_sortie_libre This class represents an open boundary without imposed velocity.
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
double temps_courant() const
Returns the current time.
virtual int nb_valeurs_temporelles() const =0
Base class for output streams.
Definition Sortie.h:52