TRUST 1.9.8
HPC thermohydraulic platform
Loading...
Searching...
No Matches
grad_Champ_Face_PolyMAC_MPFA.h
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#ifndef grad_Champ_Face_PolyMAC_MPFA_included
17#define grad_Champ_Face_PolyMAC_MPFA_included
18
19#include <Champ_Fonc_Face_PolyMAC_CDO.h>
20#include <Champ_Face_PolyMAC_MPFA.h>
21#include <Domaine_Cl_PolyMAC_family.h>
22#include <TRUST_Ref.h>
23
24/*! @brief class grad_Champ_Face_PolyMAC_MPFA for the calculation of the gradient This field is a Champ_Fonc_Face_PolyMAC_MPFA that calculates the gradient of a velocity field
25 *
26 * grad_u(f, n*D + dU) returns the gradient of the dU velocity component in the phase n at face f
27 * grad_u(nf_tot + e*D + dX, n*D + dU) returns the gradient of the dU velocity component in the phase n in element e along the dX component
28 * (i.e. = dU/dX)
29 * In 2D, the gradient at the element e in phase n is equal to :
30 * | grad_u(nf_tot + e*D + 0, n*D + 0) grad_u(nf_tot + e*D + 1, n*D + 0) |
31 * grad_u = | |
32 * | grad_u(nf_tot + e*D + 0, n*D + 1) grad_u(nf_tot + e*D + 1, n*D + 1) |
33 *
34 * The gradient is calculated using past values of the velocity
35 * We compute the gradient at the faces for all velocity components, then interpolate it to obtain the gradient at the elements
36 *
37 */
39{
40 Declare_instanciable(grad_Champ_Face_PolyMAC_MPFA);
41public:
42 int fixer_nb_valeurs_nodales(int n) override;
43 void mettre_a_jour(double) override;
44 void me_calculer(double);
45
46 inline virtual Champ_Face_PolyMAC_MPFA& champ_a_deriver() { return champ_.valeur(); }
47 inline virtual const Champ_Face_PolyMAC_MPFA& champ_a_deriver() const { return champ_.valeur(); }
48 inline void associer_champ(const Champ_Face_PolyMAC_MPFA& ch) { champ_ = ch; }
49 inline void associer_domaine_Cl_dis_base(const Domaine_Cl_dis_base& le_dom_Cl_dis_base)
50 {
51 le_Dom_Cl_PolyMAC_HFV = static_cast<const Domaine_Cl_PolyMAC_family&>(le_dom_Cl_dis_base);
52 }
53
54 // Interpolation du gradient de la vitesse
55 mutable IntTab gradve_d, gradve_e; // Tables utilisees dans fgrad pour obtenir le grad aux faces de la vitesse aux elems
56 mutable DoubleTab gradve_w;
57 void update_tab_grad(int full_stencil); // Mise a jour des tables utilisees dans fgrad
58 void calc_gradfve(); // Mise a jour du gradient aux faces de la vitesse aux elements
59 void update_ge(); // Calcul du gradient aux elements a partir du gradient aux faces ; base sur la methode similaire de Champ_Face_PolyMAC_MPFA
60 void init_grad();
61
62protected:
63 OBS_PTR(Domaine_Cl_PolyMAC_family) le_Dom_Cl_PolyMAC_HFV;
65
66 int is_init = 0;
67 void init_ge2() const; //ordre 2 -> avec une matrice
68 mutable IntTab ve2d, ve2j, ve2bj;
69 mutable DoubleTab ve2c, ve2bc;
70 void update_ge2(DoubleTab& val, int incr = 0) const;
71};
72
73#endif /* grad_Champ_Face_PolyMAC_MPFA_included */
: class Champ_Face_PolyMAC_MPFA
classe Domaine_Cl_dis_base Les objets Domaine_Cl_dis_base representent les conditions aux limites
class grad_Champ_Face_PolyMAC_MPFA for the calculation of the gradient This field is a Champ_Fonc_Fac...
void associer_champ(const Champ_Face_PolyMAC_MPFA &ch)
void update_ge2(DoubleTab &val, int incr=0) const
void associer_domaine_Cl_dis_base(const Domaine_Cl_dis_base &le_dom_Cl_dis_base)
int fixer_nb_valeurs_nodales(int n) override
Fixe le nombre de degres de liberte par composante.
OBS_PTR(Champ_Face_PolyMAC_MPFA) champ_
virtual const Champ_Face_PolyMAC_MPFA & champ_a_deriver() const
OBS_PTR(Domaine_Cl_PolyMAC_family) le_Dom_Cl_PolyMAC_HFV
void mettre_a_jour(double) override
Mise a jour en temps du champ.
virtual Champ_Face_PolyMAC_MPFA & champ_a_deriver()