TRUST 1.9.8
HPC thermohydraulic platform
Loading...
Searching...
No Matches
Champ_val_tot_sur_vol_base.cpp
1/****************************************************************************
2* Copyright (c) 2023, 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 <Champ_val_tot_sur_vol_base.h>
17#include <Interprete.h>
18#include <Domaine.h>
19#include <Domaine_VF.h>
20#include <Sous_Domaine.h>
21
22Implemente_base(Champ_val_tot_sur_vol_base,"Champ_val_tot_sur_vol_base",Champ_Uniforme_Morceaux);
23// XD valeur_totale_sur_volume champ_uniforme_morceaux valeur_totale_sur_volume INHERITS_BRACE Similar as
24// XD_CONT Champ_Uniforme_Morceaux with the same syntax. Used for source terms when we want to specify a source term
25// XD_CONT with a value given for the volume (eg: heat in Watts) and not a value per volume unit (eg: heat in Watts/m3).
26
28
30
31//Evaluation du champ sur le domaine par defaut et les sous domaines specifiees
32//-Pour chacun des sous domaines et pour le domaine complet on calcul CONTRIB_loc:
33// loc designe une localisation (sous domaine i ou domaine par defaut)
34// cas VDF : CONTRIB_loc = somme de volume(elem)*porosite(elem) pour les elements de loc
35// cas VEF : CONTRIB_loc = somme de vol_entrelaces(face)*por_face(face) pour les faces de loc
36//-On retranche CONTRIB_loc de chaque sous domaine a celle du domaine complet
37//-Estimation de la puissance aux elements pour chaque localisation par la relation :
38// P(elem,compo) = P_lue/CONTRIB_loc
39//
41{
42 const int nb_elem = zdis.nb_elem();
43 DoubleVect vol_glob_pond;
44 vol_glob_pond = eval_contrib_loc(zdis,zcldis,vol_glob_pond);
45
46 for(int elem=0; elem<nb_elem; elem++)
47 for (int k=0; k<nb_compo_; k++)
48 valeurs_(elem,k) /= vol_glob_pond(0);
49
50 int cpt=1;
51
52 for (auto& itr : les_sous_domaines)
53 {
54 const Sous_Domaine& sz = itr.valeur();
55 int size_sz = sz.nb_elem_tot();
56 int el;
57 for (int elem=0; elem<size_sz; elem++)
58 {
59 el = sz(elem);
60 for (int k=0; k<nb_compo_; k++)
61 {
62 valeurs_(el,k) *= vol_glob_pond(0);
63 valeurs_(el,k) /= vol_glob_pond(cpt);
64 }
65 }
66
67 cpt++;
68 }
69
71}
DoubleTab & valeurs() override
Surcharge Champ_base::valeurs() Renvoie le tableau des valeurs.
DoubleTab valeurs_
classe Champ_Uniforme_Morceaux Cette classe represente champ constant par morceaux dans l'espace
classe Champ_val_tot_sur_vol_base Classe de base derivee de Champ_Uniforme_Morceaux qui represente le...
void evaluer(const Domaine_dis_base &zdis, const Domaine_Cl_dis_base &zcldis)
virtual DoubleVect & eval_contrib_loc(const Domaine_dis_base &zdis, const Domaine_Cl_dis_base &zcldis, DoubleVect &vol)=0
classe Domaine_Cl_dis_base Les objets Domaine_Cl_dis_base representent les conditions aux limites
classe Domaine_dis_base Cette classe est la base de la hierarchie des domaines discretisees.
Class defining operators and methods for all reading operation in an input flow (file,...
Definition Entree.h:42
int nb_compo_
Definition Field_base.h:95
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
int_t nb_elem_tot() const
virtual void echange_espace_virtuel(IsExchangeBlocking exchange_type=IsExchangeBlocking::DefaultBlocking, const std::string kernel_name="noname")