TrioCFD 1.9.8
TrioCFD documentation
Loading...
Searching...
No Matches
Op_Conv_ALE_PolyMAC_HFV_Elem.cpp
1/****************************************************************************
2* Copyright (c) 2022, 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 <Op_Conv_ALE_PolyMAC_HFV_Elem.h>
17#include <Domaine_ALE.h>
18#include <Probleme_base.h>
19
20Implemente_instanciable(Op_Conv_ALE_PolyMAC_HFV_Elem, "Op_Conv_ALE_PolyMAC_HFV_Elem|Op_Conv_ALE_PolyMAC_MPFA_Elem", Op_Conv_EF_Stab_PolyMAC_HFV_Elem);
21
23
25
27{
28 const DoubleTab& u = vitesse_->valeurs();
29 const DoubleTab& w = ref_cast(Domaine_ALE, equation().inconnue().domaine()).vitesse_faces();
30 DoubleTab u_moins_w(u);
31 if (w.nb_dim() == 1) return u_moins_w;
32
33 const Domaine_VF& domaine = ref_cast(Domaine_VF, equation().probleme().domaine_dis());
34 const DoubleTab& nf = domaine.face_normales();
35 const DoubleVect& fs = domaine.face_surfaces();
36 const int nface = domaine.nb_faces(), D = dimension, N = u.line_size();
37 for (int f = 0; f < nface; f++)
38 {
39 double w_n = 0.;
40 if (fs(f) > 0.)
41 for (int d = 0; d < D; d++) w_n += w(f, d) * nf(f, d) / fs(f);
42 for (int n = 0; n < N; n++) u_moins_w(f, n) -= w_n;
43 }
44
45 return u_moins_w;
46}
47
49{
50 DoubleTab u_minus_w = get_u_minus_w();
51 return calculer_dt_stab_gen(u_minus_w);
52}
53
54void Op_Conv_ALE_PolyMAC_HFV_Elem::ajouter_blocs(matrices_t matrices, DoubleTab& secmem, const tabs_t& semi_impl) const
55{
56 DoubleTab u_minus_w = get_u_minus_w();
57 ajouter_blocs_gen(matrices, secmem, u_minus_w, semi_impl);
58}
59
61{
62 DoubleTab u_minus_w = get_u_minus_w();
63 mettre_a_jour_gen(temps, u_minus_w);
64}
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
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
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
void mettre_a_jour(double temps) override
DOES NOTHING - to override in derived classes.
void ajouter_blocs(matrices_t matrices, DoubleTab &secmem, const tabs_t &semi_impl={}) const override
double calculer_dt_stab() const override
Calcul dt_stab.
: class Op_Conv_EF_Stab_PolyMAC_HFV_Elem
void ajouter_blocs_gen(matrices_t mats, DoubleTab &secmem, const DoubleTab &vit, const tabs_t &semi_impl) const
void mettre_a_jour_gen(double temps, const DoubleTab &vit)
double calculer_dt_stab_gen(const DoubleTab &vit) const
Classe de base des flux de sortie.
Definition Sortie.h:52
int nb_dim() const
Definition TRUSTTab.h:199
int line_size() const
Definition TRUSTVect.tpp:67