TrioCFD 1.9.8
TrioCFD documentation
Loading...
Searching...
No Matches
Source_Fluide_Dilatable_VDF_Proto.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_Fluide_Dilatable_VDF_Proto.h>
17#include <Dirichlet_homogene.h>
18#include <Equation_base.h>
19#include <Milieu_base.h>
20#include <Domaine_Cl_VDF.h>
21
22#include <Dirichlet.h>
23#include <TRUSTTab.h>
24#include <Domaine_VDF.h>
25
27{
28 le_dom = ref_cast(Domaine_VDF,dds);
29 le_dom_Cl = ref_cast(Domaine_Cl_VDF,domaine_cl);
30}
31
32void Source_Fluide_Dilatable_VDF_Proto::associer_volume_porosite_impl(const Domaine_dis_base& dds, DoubleVect& volumes, DoubleVect& porosites)
33{
34 volumes.ref(ref_cast(Domaine_VF,dds).volumes());
35 porosites.ref(le_dom_Cl->equation().milieu().porosite_elem());
36}
37
38void Source_Fluide_Dilatable_VDF_Proto::ajouter_impl(const DoubleVect& g,const double rho_m,
39 const DoubleTab& tab_rho, DoubleTab& resu) const
40{
41
42 const int nb_faces = le_dom->nb_faces(), premiere_face_interne = le_dom->premiere_face_int();
43 const IntVect& orientation = le_dom->orientation();
44 const DoubleVect& volumes_entrelaces = le_dom->volumes_entrelaces(), porosite_surf=le_dom_Cl->equation().milieu().porosite_face();
45
46 for (int num_cl=0 ; num_cl<le_dom->nb_front_Cl() ; num_cl++)
47 {
48 const Cond_lim& la_cl = le_dom_Cl->les_conditions_limites(num_cl);
49 const Front_VF& le_bord = ref_cast(Front_VF,la_cl->frontiere_dis());
50 const int ndeb = le_bord.num_premiere_face(), nfin = ndeb + le_bord.nb_faces();
51
52 if (sub_type(Dirichlet,la_cl.valeur()) || sub_type(Dirichlet_homogene,la_cl.valeur())) { /* Do nothing */ }
53 else
54 {
55 for (int face=ndeb ; face<nfin ; face++)
56 resu(face) += (tab_rho(face)-rho_m)*g(orientation(face)) * volumes_entrelaces(face)*porosite_surf(face);
57 }
58 }
59
60 for (int face=premiere_face_interne ; face<nb_faces; face++)
61 resu(face) += (tab_rho(face)-rho_m)*g(orientation(face)) * volumes_entrelaces(face)*porosite_surf(face);
62
63}
classe Cond_lim Classe generique servant a representer n'importe quelle classe
Definition Cond_lim.h:31
Classe Dirichlet_homogene Cette classe est la classe de base de la hierarchie des conditions aux limi...
classe Dirichlet Cette classe est la classe de base de la hierarchie des conditions aux limites de ty...
Definition Dirichlet.h:31
class Domaine_Cl_VDF
classe Domaine_Cl_dis_base Les objets Domaine_Cl_dis_base representent les conditions aux limites
class Domaine_VDF
Definition Domaine_VDF.h:64
class Domaine_VF
Definition Domaine_VF.h:44
classe Domaine_dis_base Cette classe est la base de la hierarchie des domaines discretisees.
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
void associer_volume_porosite_impl(const Domaine_dis_base &domaine, DoubleVect &volumes, DoubleVect &porosites)
void ajouter_impl(const DoubleVect &g, const double rho_m, const DoubleTab &tab_rho, DoubleTab &resu) const
void associer_domaines_impl(const Domaine_dis_base &domaine, const Domaine_Cl_dis_base &domaine_cl)
virtual void ref(const TRUSTVect &)