TRUST 1.9.8
HPC thermohydraulic platform
Loading...
Searching...
No Matches
Champ_front_debit_massique.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
17#include <Champ_front_debit_massique.h>
18
19#include <Champ_Inc_base.h>
20#include <Champ_Uniforme.h>
21#include <Equation_base.h>
22#include <Milieu_base.h>
23#include <Domaine_VF.h>
24#include <TRUSTTrav.h>
25
26Implemente_instanciable(Champ_front_debit_massique,"Champ_front_debit_massique",Champ_front_debit);
27// XD champ_front_debit_massique front_field_base champ_front_debit_massique NO_BRACE This field is used to define a
28// XD_CONT flow rate field using the density
29// XD attr ch front_field_base ch REQ uniform field in space to define the flow rate. It could be, for example,
30// XD_CONT champ_front_uniforme, ch_front_input_uniform or champ_front_fonc_txyz that depends only on time.
32{
34}
35
37{
39}
40
42{
45 if (sub_type(Champ_Uniforme, *ch_rho)) //rho constant : on calcule le coeff maintenant, puis on ne le fait plus
46 update_coeff(temps), update_coeff_ = false;
47 else update_coeff_ = true;
48}
49
51{
52 int i, fb, n, N = coeff_.line_size(), cR = sub_type(Champ_Uniforme, *ch_rho);
53 DoubleTab rho_bord = cR ? ch_rho->valeurs() : ch_rho->valeur_aux_bords(); /* si rho uniforme, on ne peut pas appeler valeur_aux_bords() */
54 const Domaine_VF& domaine = ref_cast(Domaine_VF, domaine_dis());
55 const Front_VF& le_bord= ref_cast(Front_VF,frontiere_dis());
56 for(i = 0; i < le_bord.nb_faces_tot(); i++)
57 for (fb = domaine.fbord(le_bord.num_face(i)), n = 0; n < N; ++n)
58 coeff_(i, n) = 1. / rho_bord(!cR * fb, n);
59}
Classe Champ_Inc_base.
classe Champ_Uniforme Represente un champ constant dans l'espace et dans le temps.
virtual const Frontiere_dis_base & frontiere_dis() const
Renvoie la frontiere discretisee associee au champ.
virtual const Domaine_dis_base & domaine_dis() const
class Champ_front_debit_massique
void initialiser_coefficient(const Champ_Inc_base &inco, double temps) override
void update_coeff(double temps) override
class Champ_front_debit
virtual void initialiser_coefficient(const Champ_Inc_base &inco, double tps)
class Domaine_VF
Definition Domaine_VF.h:44
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_tot() const
Definition Front_VF.h:58
int num_face(const int) const
Definition Front_VF.h:68
virtual const Champ_base & masse_volumique() const
Renvoie la masse volumique du milieu.
const Equation_base & equation() const
Renvoie la reference sur l'equation pointe par MorEqn::mon_equation.
Definition MorEqn.h:62
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