TrioCFD 1.9.9_beta
TrioCFD documentation
Loading...
Searching...
No Matches
Op_Conv_Muscl_New_VEF_Face.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_Muscl_New_VEF_Face_included
17#define Op_Conv_Muscl_New_VEF_Face_included
18
19#include <Op_Conv_VEF_Face.h>
20#include <TRUSTTabs.h>
21#include <TRUSTList.h>
22#include <TRUST_Ref.h>
23class Matrice_Morse;
24class Sous_domaine_VF;
25
26/*! @brief class Op_Conv_Muscl_New_VEF_Face
27 *
28 * This class represents the convection operator associated with a scalar transport equation.
29 * The discretization is VEF.
30 * The convected field is a scalar or vector of type Champ_P1NC.
31 * The convection scheme is derived from the paper
32 * "High-resolution FEM-TVD schemes based on a fully multidimensional flux limiter"
33 * D.Kuzmin and S.Turek.
34 * Inherits from Op to recover upwind implicitation.
35 *
36 *
37 * @sa Operateur_Conv_base
38 */
39
40
42{
43
44 Declare_instanciable(Op_Conv_Muscl_New_VEF_Face);
45
46public:
47
48 //Auxiliary methods
49 void remplir_fluent() const override;
50 //int is_compressible() const { return 1;/* is_compressible_; */ }
51
52 void completer() override;
53
54 //Methods for explicit assembly
55 DoubleTab& ajouter(const DoubleTab& , DoubleTab& ) const override;
56 double calculer_dt_stab() const override;
57
58 //Methods for implicit assembly
59 void contribuer_a_avec(const DoubleTab&, Matrice_Morse&) const override;
60 void ajouter_contribution(const DoubleTab&, Matrice_Morse&) const override;
61
62 //test
63 void modifier_pour_Cl(Matrice_Morse&, DoubleTab&) const override;
64
65 public_for_cuda
66 void calculer_flux_bords(const DoubleTab&, const DoubleTab&, const DoubleTab&) const;
67 void calculer_coefficients_operateur_centre(DoubleTab&,DoubleTab&,DoubleTab&,DoubleTab&,const int, const DoubleTab& vitesse) const;
68 void calculer_flux_operateur_centre(DoubleTab&,const DoubleTab&,const DoubleTab&,const DoubleTab&,const DoubleTab&,const int,const DoubleTab&,const DoubleTab&) const;
69 DoubleTab& ajouter_operateur_centre(const DoubleTab&,const DoubleTab&, const DoubleTab&, DoubleTab&) const;
70 DoubleTab& ajouter_diffusion(const DoubleTab&,const DoubleTab&, const DoubleTab&, DoubleTab&) const;
71 DoubleTab& ajouter_antidiffusion_v1(const DoubleTab&, const DoubleTab&, const DoubleTab&, DoubleTab&) const;
72 DoubleTab& ajouter_antidiffusion_v2(const DoubleTab&, const DoubleTab&, const DoubleTab&, DoubleTab&) const;
73 void mettre_a_jour_pour_periodicite(const DoubleTab&,const DoubleTab&,DoubleTab&) const;
74
75private :
76
77 //Auxiliary methods
78
79 //Methods for explicit assembly
80
81 void modifier_flux_operateur_centre(DoubleTab&,const DoubleTab&,const DoubleTab&,const DoubleTab&,const DoubleTab&,const int,const DoubleTab&,const DoubleTab&) const;
82
83 DoubleTab& ajouter_antidiffusion(const DoubleTab&, const DoubleTab&, const DoubleTab&, DoubleTab&) const;
84
85
86 KOKKOS_INLINE_FUNCTION void calculer_senseur(CDoubleTabView3, CDoubleTabView4, CDoubleArrView, const int, const int, const int, CIntTabView, CIntTabView, CIntTabView, double&, double&, double&, double&) const;
87 void calculer_data_pour_dirichlet();
88
89 //Class attributes
90 IntTab is_element_for_upwinding_;
91 IntVect is_dirichlet_faces_;
92
93 //ArrOfDouble alpha_tab;
94 //ArrOfDouble beta_; // zero on faces where upwind (Amont) degeneration is desired.
95 // mutable DoubleTab limiteurs_;//array storing for each face the algebraic mean of the limiter
96
97 double max_limiteur_ = 1.;
98 int centered_ = 1;
99 int upwind_ = 1;
100 int stabilized_ = 1;
101 int old_centered_ = 0;
102 int version_ = 2;
103 int facsec_auto_ = 0;
104
105 // bool sous_domaine; // Sub-domain case to define so that EF_Stab degenerates to upwind (Amont)
106 Nom nom_sous_domaine;
107 //OBS_PTR(Sous_domaine_VF) le_sous_domaine_dis;
108
109 //double (*limiteur_)(double)=nullptr;
110
111};
112
113inline void Op_Conv_Muscl_New_VEF_Face::contribuer_a_avec(const DoubleTab& inco,
114 Matrice_Morse& matrice) const
115{
116 ajouter_contribution(inco, matrice);
117}
118
119#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
class Op_Conv_Muscl_New_VEF_Face
void contribuer_a_avec(const DoubleTab &, Matrice_Morse &) const override
DOES NOTHING - to override in derived classes.
public_for_cuda void calculer_flux_bords(const DoubleTab &, const DoubleTab &, const DoubleTab &) const
DoubleTab & ajouter_antidiffusion_v1(const DoubleTab &, 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 modifier_pour_Cl(Matrice_Morse &, DoubleTab &) const override
DOES NOTHING - to override in derived classes.
DoubleTab & ajouter_antidiffusion_v2(const DoubleTab &, const DoubleTab &, const DoubleTab &, DoubleTab &) const
void calculer_flux_operateur_centre(DoubleTab &, const DoubleTab &, const DoubleTab &, const DoubleTab &, const DoubleTab &, const int, const DoubleTab &, const DoubleTab &) const
void calculer_coefficients_operateur_centre(DoubleTab &, DoubleTab &, DoubleTab &, DoubleTab &, const int, const DoubleTab &vitesse) const
void ajouter_contribution(const DoubleTab &, Matrice_Morse &) const override
double calculer_dt_stab() const override
Computes dt_stab.
void mettre_a_jour_pour_periodicite(const DoubleTab &, const DoubleTab &, DoubleTab &) const
DoubleTab & ajouter(const DoubleTab &, DoubleTab &) const override
DoubleTab & ajouter_operateur_centre(const DoubleTab &, const DoubleTab &, const DoubleTab &, DoubleTab &) const
DoubleTab & ajouter_diffusion(const DoubleTab &, const DoubleTab &, const DoubleTab &, DoubleTab &) const
const Champ_Inc_base & vitesse() const
This abstract class contains the geometrical subdomain information common to finite-volume methods (V...