TrioCFD 1.9.8
TrioCFD documentation
Loading...
Searching...
No Matches
Source_Masse_Ajoutee.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_Masse_Ajoutee.h>
17#include <Probleme_base.h>
18#include <Schema_Temps_base.h>
19
20Implemente_instanciable_sans_constructeur(Source_Masse_Ajoutee,"Masse_Ajoutee",Source_Action_Particules);
21
26
28{
29 return s << que_suis_je() ;
30}
31
32
34{
35 return s;
36}
37
38//L expression codee est precisee dans l entete de la classe
39DoubleTab& Source_Masse_Ajoutee::ajouter(DoubleTab& resu) const
40{
41 const DoubleTab& vitesse_f = vitesse_fluide();
42 const DoubleTab& rho_f = rho_fluide();
43 const DoubleTab& vitesse_p = vitesse_particules();
44 const DoubleTab& delta_vit = delta_v();
45 const DoubleTab& volume_p = volumes_particules();
46 const int dim0 = vitesse_p.dimension(0);
47 const int dim1 = Objet_U::dimension;
49 //const double& dt =eq.probleme().schema_temps().pas_de_temps();
50 const double dt = eq.dela_t();
51 double derivee;
52 const int impl = eq.resol_implicite();
53
54 if (!impl)
55 {
56 for (int i=0; i<dim0; i++)
57 {
58 for (int j=0; j<dim1; j++)
59 {
60
61 derivee = (vitesse_f(i,j)-vitesse_p(i,j)-delta_vit(i,j))/dt;
62 resu(i,j) += C_MA*rho_f(i)*volume_p(i,0)*derivee;
63 }
64 }
65 }
66 else
67 {
68 for (int i=0; i<dim0; i++)
69 {
70 for (int j=0; j<dim1; j++)
71 {
72
73 derivee = (vitesse_f(i,j)-delta_vit(i,j))/dt;
74 resu(i,j) += C_MA*rho_f(i)*volume_p(i,0)*derivee;
75 }
76 }
77 }
78
79 return resu;
80}
81
82
83DoubleTab& Source_Masse_Ajoutee::calculer(DoubleTab& resu) const
84{
85 resu = 0;
86 return ajouter(resu);
87}
88
Class defining operators and methods for all reading operation in an input flow (file,...
Definition Entree.h:42
const Equation_base & equation() const
Renvoie la reference sur l'equation pointe par MorEqn::mon_equation.
Definition MorEqn.h:62
static int dimension
Definition Objet_U.h:99
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
Classe Source_Action_Particules Classe mere des classes designant une force exercee par le fluide sur...
const DoubleTab & delta_v() const
const DoubleTab & vitesse_fluide() const
const DoubleTab & volumes_particules() const
const DoubleTab & rho_fluide() const
const DoubleTab & vitesse_particules() const
class Source_Masse_Ajoutee Calcul de la force de masse ajoutee (expression vectorielle) :
DoubleTab & calculer(DoubleTab &) const override
DoubleTab & ajouter(DoubleTab &) const override
_SIZE_ dimension(int d) const
Definition TRUSTTab.tpp:133
const double & dela_t() const
const int & resol_implicite() const