TrioCFD 1.9.9_beta
TrioCFD documentation
Loading...
Searching...
No Matches
Op_Conv_EF_VEF_P1NC_Stab.h
1/****************************************************************************
2* Copyright (c) 2025, 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#ifndef Op_Conv_EF_VEF_P1NC_Stab_included
17#define Op_Conv_EF_VEF_P1NC_Stab_included
18
19#include <Op_Conv_VEF_Face.h>
20#include <Equation_base.h>
21#include <TRUSTTabs.h>
22#include <TRUSTList.h>
23#include <TRUST_Ref.h>
24
25class Sous_domaine_VF;
26class Matrice_Morse;
27/*! @brief class Op_Conv_EF_VEF_P1NC_Stab
28 *
29 * This class represents the convection operator associated with a scalar transport equation.
30 * The discretization is VEF.
31 * The convected field is a scalar or vector of type Champ_P1NC.
32 * The convection scheme is derived from the paper
33 * "High-resolution FEM-TVD schemes based on a fully multidimensional flux limiter"
34 * D.Kuzmin and S.Turek.
35 * Inherits from Op to recover upwind implicitation.
36 *
37 *
38 * @sa Operateur_Conv_base
39 */
40
41
43{
44
45 Declare_instanciable(Op_Conv_EF_VEF_P1NC_Stab);
46
47public:
48
49 //Auxiliary methods
50 void remplir_fluent() const override;
51 int is_compressible() const;
52 void completer() override;
53
54 //Methods for explicit scheme
55 DoubleTab& ajouter(const DoubleTab& , DoubleTab& ) const override;
56
57 //Methods for implicit scheme
58 void contribuer_a_avec(const DoubleTab&, Matrice_Morse&) const override;
59 void ajouter_contribution(const DoubleTab&, Matrice_Morse&) const override;
60
61 //test
62 void modifier_pour_Cl(Matrice_Morse&, DoubleTab&) const override;
63
64 public_for_cuda
65 void calculer_flux_bords(const DoubleTab&, const DoubleTab&, const DoubleTab&) const;
66 void calculer_coefficients_operateur_centre(DoubleTab&,const int, const DoubleTab& vitesse) const;
67 DoubleTab& ajouter_partie_compressible(const DoubleTab&, DoubleTab&, const DoubleTab& vitesse) const;
68 DoubleTab& ajouter_operateur_centre(const DoubleTab&, const DoubleTab&, DoubleTab&) const;
69 DoubleTab& ajouter_diffusion(const DoubleTab&, const DoubleTab&, DoubleTab&) const;
70 DoubleTab& ajouter_antidiffusion(const DoubleTab&, const DoubleTab&, DoubleTab&) const;
71 void ajouter_contribution_operateur_centre(const DoubleTab&, const DoubleTab&, Matrice_Morse&) const;
72 void ajouter_contribution_diffusion(const DoubleTab&, const DoubleTab&, Matrice_Morse&) const;
73 void mettre_a_jour_pour_periodicite(DoubleTab&) const;
74
75private :
76
77 //Auxiliary methods
78
79 //Methods for explicit scheme
80 void reinit_conv_pour_Cl(const DoubleTab&,const IntList&, const DoubleTabs&, const DoubleTab&, DoubleTab&) const;
81
82 KOKKOS_INLINE_FUNCTION void calculer_senseur(CDoubleTabView3, CDoubleArrView, const int, const int, CIntTabView, CIntTabView, CIntTabView, double*, double*, double*, double*) const;
83 inline void calculer_senseur(const DoubleTab&, const DoubleVect&, const int, const int, const IntTab&, const IntTab&, const IntTab&, ArrOfDouble&, ArrOfDouble&, ArrOfDouble&, ArrOfDouble&) const;
84 void ajouter_old(const DoubleTab& , DoubleTab&, const DoubleTab& vitesse) const;
85 void calculer_data_pour_dirichlet();
86
87 //Methods for implicit scheme
88 void ajouter_contribution_antidiffusion(const DoubleTab&,const DoubleTab&,Matrice_Morse&) const;
89 void ajouter_contribution_partie_compressible(const DoubleTab&,const DoubleTab&,Matrice_Morse&) const;
90
91 //Test methods
92 void test(const DoubleTab&,const DoubleTab&, const DoubleTab& vitesse) const;
93 void test_difference_Kij(const DoubleTab&,DoubleTab&,DoubleTab&, const DoubleTab& vitesse) const;
94 void test_difference_resu(const DoubleTab&,const DoubleTab&,const DoubleTab&,const DoubleTab&,const DoubleTab& vitesse) const;
95 void test_implicite() const;
96
97 //Class attributes
98 ArrOfInt elem_nb_faces_dirichlet_;
99 IntTab elem_faces_dirichlet_;
100 ArrsOfInt elem_faces_frontiere;
101
102 ArrOfDouble alpha_tab_;
103 ArrOfDouble beta_; // equals zero for faces where upwind (Amont) degeneration is desired.
104 // mutable DoubleTab limiteurs_;//array storing for each face the algebraic mean of the limiter
105
106 double alpha_ = 1.;
107
108 int is_compressible_ = 0;
109 int test_ = 0;
110 int old_ = 0;
111 int volumes_etendus_ = 1;
112
113 bool sous_domaine = false; // Sub-domain case to define so that EF_Stab degenerates to upwind (Amont)
114 int new_jacobienne_ = 0;
115 Nom nom_sous_domaine;
116 OBS_PTR(Sous_domaine_VF) le_sous_domaine_dis;
117
118 int nb_ssz_alpha = -1;
119 DoubleVect alpha_ssz;
120 Noms noms_ssz_alpha;
121 bool ssz_alpha = false;
122};
123
124inline void Op_Conv_EF_VEF_P1NC_Stab::contribuer_a_avec(const DoubleTab& inco,
125 Matrice_Morse& matrice) const
126{
127 ajouter_contribution(inco, matrice);
128}
129
131{
132 return is_compressible_;
133}
134
135#endif
Matrice_Morse class - Represents a (sparse) matrix M, not necessarily square,.
class Nom: a character string for naming TRUST objects.
Definition Nom.h:31
An array of character strings (VECT(Nom)).
Definition Noms.h:26
class Op_Conv_EF_VEF_P1NC_Stab
DoubleTab & ajouter(const DoubleTab &, DoubleTab &) const override
DoubleTab & ajouter_diffusion(const DoubleTab &, const DoubleTab &, DoubleTab &) const
void completer() override
Associates the operator with the domaine_dis, the domaine_Cl_dis, and the unknown of its equation.
void ajouter_contribution_diffusion(const DoubleTab &, const DoubleTab &, Matrice_Morse &) const
void calculer_coefficients_operateur_centre(DoubleTab &, const int, const DoubleTab &vitesse) const
public_for_cuda void calculer_flux_bords(const DoubleTab &, const DoubleTab &, const DoubleTab &) const
void ajouter_contribution_operateur_centre(const DoubleTab &, const DoubleTab &, Matrice_Morse &) const
DoubleTab & ajouter_operateur_centre(const DoubleTab &, const DoubleTab &, DoubleTab &) const
void contribuer_a_avec(const DoubleTab &, Matrice_Morse &) const override
DOES NOTHING - to override in derived classes.
DoubleTab & ajouter_partie_compressible(const DoubleTab &, DoubleTab &, const DoubleTab &vitesse) const
DoubleTab & ajouter_antidiffusion(const DoubleTab &, const DoubleTab &, DoubleTab &) const
void modifier_pour_Cl(Matrice_Morse &, DoubleTab &) const override
DOES NOTHING - to override in derived classes.
void mettre_a_jour_pour_periodicite(DoubleTab &) const
void ajouter_contribution(const DoubleTab &, Matrice_Morse &) const override
const Champ_Inc_base & vitesse() const
This abstract class contains the geometrical subdomain information common to finite-volume methods (V...