TrioCFD 1.9.9_beta
TrioCFD documentation
Loading...
Searching...
No Matches
Source_Generique_VEF.cpp
1/****************************************************************************
2* Copyright (c) 2024, 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_Generique_VEF.h>
17#include <Domaine_VEF.h>
18#include <Domaine_Cl_VEF.h>
19
20#include <Dirichlet.h>
21#include <Dirichlet_homogene.h>
22#include <Equation_base.h>
23#include <Champ_base.h>
24#include <Milieu_base.h>
25
26Implemente_instanciable(Source_Generique_VEF,"Source_Generique_VEF_P1NC",Source_Generique_base);
27
28
30{
31 return os << que_suis_je() ;
32}
33
35{
37 return is;
38}
39
40DoubleTab& Source_Generique_VEF::ajouter(DoubleTab& resu) const
41{
42 OWN_PTR(Champ_base) espace_stockage;
43 const Champ_base& champ_calc = ch_source_->get_champ(espace_stockage);
44 const DoubleTab& valeurs_calc = champ_calc.valeurs();
45
46 int nb_faces = le_dom_VEF->nb_faces();
47 const DoubleVect& vol_entrelaces = le_dom_VEF->volumes_entrelaces();
48 const DoubleVect& vol_entrelaces_Cl = la_zcl_VEF->volumes_entrelaces_Cl();
49 const DoubleVect& poro_face = equation().milieu().porosite_face();
50 int nb_front_cl = le_dom_VEF->nb_front_Cl();
51 int premiere_face_interne = le_dom_VEF->premiere_face_int();
52 int num_face;
53 int nb_comp = resu.line_size();
54
55 for (int num_cl =0; num_cl<nb_front_cl; num_cl++)
56 {
57 const Cond_lim& la_cl = la_zcl_VEF->les_conditions_limites(num_cl);
58 const Front_VF& le_bord = ref_cast(Front_VF,la_cl->frontiere_dis());
59 int ndeb = le_bord.num_premiere_face();
60 int nfin = ndeb + le_bord.nb_faces();
61
62 if ((sub_type(Dirichlet, la_cl.valeur())) || (sub_type(Dirichlet_homogene, la_cl.valeur())))
63 { /* Do nothing */}
64 else
65 for (num_face=ndeb; num_face<nfin; num_face++)
66 {
67 for (int nc=0; nc<nb_comp; nc++)
68 resu(num_face,nc) += valeurs_calc(num_face,nc)*vol_entrelaces_Cl(num_face)*poro_face(num_face);
69 }
70 }
71
72 for (num_face=premiere_face_interne; num_face<nb_faces; num_face++)
73 for (int nc=0; nc<nb_comp; nc++)
74 resu(num_face,nc) += valeurs_calc(num_face,nc)*vol_entrelaces(num_face)*poro_face(num_face);
75
76 return resu;
77}
78
80 const Domaine_Cl_dis_base& zcl_dis)
81{
82 le_dom_VEF = ref_cast(Domaine_VEF,domaine_dis);
83 la_zcl_VEF = ref_cast(Domaine_Cl_VEF,zcl_dis);
84}
85
virtual DoubleTab & valeurs()=0
class Champ_base This class is the base of the fields hierarchy.
Definition Champ_base.h:43
class Cond_lim Generic class used to represent any class
Definition Cond_lim.h:31
Classe Dirichlet_homogene This class is the base class of the hierarchy of homogeneous Dirichlet-type...
Dirichlet This class is the base class of the hierarchy of Dirichlet-type boundary conditions.
Definition Dirichlet.h:31
class Domaine_Cl_dis_base Domaine_Cl_dis_base objects represent discretized boundary conditions
class Domaine_VEF
Definition Domaine_VEF.h:53
class Domaine_dis_base This class is the base of the hierarchy of discretized domains.
Class defining operators and methods for all reading operation in an input flow (file,...
Definition Entree.h:42
virtual const Milieu_base & milieu() const =0
class Front_VF
Definition Front_VF.h:36
int nb_faces() const
Definition Front_VF.h:53
int num_premiere_face() const
Definition Front_VF.h:63
DoubleVect & porosite_face()
Definition Milieu_base.h:62
const Equation_base & equation() const
Returns the reference to the equation pointed to by MorEqn::mon_equation.
Definition MorEqn.h:62
class Nom: a character string for naming TRUST objects.
Definition Nom.h:31
const Nom & que_suis_je() const
Returns the string identifying the class.
Definition Objet_U.cpp:104
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
Base class for output streams.
Definition Sortie.h:52
class Source_Generique_VEF
DoubleTab & ajouter(DoubleTab &) const override
void associer_domaines(const Domaine_dis_base &, const Domaine_Cl_dis_base &) override
Source_Generique_base This class is the base of the source term hierarchy carrying.
OWN_PTR(Champ_Generique_base) ch_source_
int line_size() const
Definition TRUSTVect.tpp:67