TrioCFD 1.9.8
TrioCFD documentation
Loading...
Searching...
No Matches
Source_rayo_semi_transp_VEF.cpp
1/****************************************************************************
2* Copyright (c) 2015 - 2016, 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 <Source_rayo_semi_transp_VEF.h>
17#include <Pb_rayo_semi_transp.h>
18#include <Champ_Uniforme.h>
19#include <Domaine_VEF.h>
20#include <Fluide_base.h>
21
22Implemente_instanciable(Source_rayo_semi_transp_VEF, "Source_rayo_semi_transp_VEF_P1NC|Source_rayo_semi_transp_QC_VEF_P1NC", Source_rayo_semi_transp_base);
23
25
27
28DoubleTab& Source_rayo_semi_transp_VEF::ajouter(DoubleTab& resu) const
29{
30 statistics().end_count(STD_COUNTERS::source_terms,0,0);
31 const Eq_rayo_semi_transp& eq_rayo = pb_rayo_semi_transp_->eq_rayo();
32 const double sigma = pb_rayo_semi_transp_->valeur_sigma();
33 const Domaine_VEF& zvef = ref_cast(Domaine_VEF, eq_rayo.domaine_dis());
34 const int nb_faces = zvef.nb_faces();
35
36 const Fluide_base& fluide = eq_rayo.fluide();
37 const DoubleTab& kappa = fluide.kappa().valeurs();
38 const DoubleTab& temperature = equation().inconnue().valeurs();
39 const DoubleTab& indice = fluide.indice().valeurs();
40 const DoubleTab& G = eq_rayo.inconnue().valeurs();
41 const DoubleVect& volumes_entrelaces = zvef.volumes_entrelaces();
42
43 for (int face = 0; face < nb_faces; face++)
44 {
45 double n, k;
46 assert(fluide.indice().nb_comp() == 1);
47 if (sub_type(Champ_Uniforme, fluide.indice()))
48 n = indice(0, 0);
49 else
50 n = indice(face, 0);
51
52 assert(fluide.kappa().nb_comp() == 1);
53 if (sub_type(Champ_Uniforme, fluide.kappa()))
54 k = kappa(0, 0);
55 else
56 k = kappa(face, 0);
57
58 double T = temperature(face);
59 double vol = volumes_entrelaces(face);
60 resu[face] += k * (G(face) - 4 * n * n * sigma * pow(T, 4)) * vol;
61 }
62 statistics().begin_count(STD_COUNTERS::source_terms, statistics().get_last_opened_counter_level() + 1);
63 return resu;
64}
DoubleTab & valeurs() override
Surcharge Champ_base::valeurs() Renvoie le tableau des valeurs.
DoubleTab & valeurs() override
Renvoie le tableau des valeurs du champ au temps courant.
classe Champ_Uniforme Represente un champ constant dans l'espace et dans le temps.
class Domaine_VEF
Definition Domaine_VEF.h:54
int nb_faces() const
renvoie le nombre global de faces.
Definition Domaine_VF.h:471
DoubleVect & volumes_entrelaces()
Definition Domaine_VF.h:99
Class defining operators and methods for all reading operation in an input flow (file,...
Definition Entree.h:42
const Champ_Inc_base & inconnue() const override
virtual const Champ_Inc_base & inconnue() const =0
Domaine_dis_base & domaine_dis()
Renvoie le domaine discretise associe a l'equation.
virtual int nb_comp() const
Definition Field_base.h:56
classe Fluide_base Cette classe represente un d'un fluide incompressible ainsi que
Definition Fluide_base.h:38
Champ_Don_base & kappa()
Definition Fluide_base.h:70
Champ_Don_base & indice()
Definition Fluide_base.h:75
const Equation_base & equation() const
Renvoie la reference sur l'equation pointe par MorEqn::mon_equation.
Definition MorEqn.h:62
const Nom & que_suis_je() const
renvoie la chaine identifiant la classe.
Definition Objet_U.cpp:104
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
DoubleTab & ajouter(DoubleTab &resu) const override
classe Source_rayo_semi_transp_base Classe de base de la hierarchie des termes sources de l'eqution d...