TrioCFD 1.9.8
TrioCFD documentation
Loading...
Searching...
No Matches
Prepro_IBM_base.h
1/****************************************************************************
2* Copyright (c) 2026, 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 Prepro_IBM_base_included
17#define Prepro_IBM_base_included
18
19#include <Discretisation_base.h>
20#include <Champ_Don_base.h>
21#include <Probleme_base.h>
22#include <Equation_base.h>
23#include <Octree_Double.h>
24#include <Champ_base.h>
25#include <TRUST_Ref.h>
26#include <Param.h>
27#include <Debog.h>
28
29using namespace std;
30
32class Source_PDF_base;
33
35{
36 Declare_base(Prepro_IBM_base);
37
38public:
39 virtual void associer_pb(const Probleme_base&);
40 void discretiser() ;
42 void compute_h_max_elem();
43 void compute_NeighNode(int);
44 inline const DoubleTab& get_champ_aire() {return champ_aire_->valeurs();}
45 inline const DoubleTab& get_champ_rotation() {return champ_rotation_->valeurs();}
46 inline const DoubleTab& get_champ_barycentre() {return champ_bary_->valeurs();}
47 inline const DoubleTab& get_champ_solid_points() {return solid_points_->valeurs();}
48 inline const DoubleTab& get_champ_fluid_points() {return fluid_points_->valeurs();}
49 inline const DoubleTab& get_champ_solid_elems() {return solid_elems_->valeurs();}
50 inline const DoubleTab& get_champ_fluid_elems() {return fluid_elems_->valeurs();}
51 inline const DoubleTab& get_champ_corresp_elems() {return corresp_elems_->valeurs();}
52 inline const DoubleTab& get_isNodeDirichlet() {return isNodeDirichlet_->valeurs();}
53 inline const DoubleTab& get_h_max_elem() {return h_max_elem_->valeurs();}
54 inline const DoubleTab& get_h_max_node() {return h_max_node_->valeurs();}
55 inline void set_champ_aire(DoubleTab& champ_aire) {champ_aire_->valeurs() = champ_aire;}
56 inline void set_champ_rotation(DoubleTab& champ_rotation) {champ_rotation_->valeurs() = champ_rotation;}
57 inline void set_champ_barycentre(DoubleTab& champ_bary) {champ_bary_->valeurs() = champ_bary;}
58 void calculer_normal_proj_solid(DoubleTab&, DoubleTab&);
59 virtual void compute_solid_fluid(int);
60
61protected:
62 void set_param(Param&) const override;
63 int lire_motcle_non_standard(const Motcle&, Entree&) override;
64 void computeLocalFrame(const DoubleTab&, DoubleTab&, DoubleTab&, int);
65 void computeMatRot(const DoubleTab&, DoubleTab&, DoubleTab&, int);
66 void computeAire2();
67 void Save_Med_File();
69 void intersectPolyPoly2D(MEDCouplingUMesh *, MEDCouplingUMesh *, DoubleTab&, IntTab&, double, int&);
70 void intersectSegPoly2D(MEDCouplingUMesh *, DoubleTab&, DoubleTab&, double, MCAuto<MEDCoupling::DataArrayDouble>, int&);
71 void intersectSegSeg2D(DoubleTab&, DoubleTab&, DoubleTab&, DoubleTab&, DoubleTab&, double, int&);
74 Domaine dom_med_IB_;
75 MCAuto<MEDCoupling::MEDCouplingUMesh> aSkinUMesh_ = nullptr; // Mesh MedCoupling IBM
76 DoubleTab barySurf_; // Barycentres maillage Lagrangien
77 DoubleTab normalArr_; // Normales maillage Lagrangien
78 DoubleTab coordsSur3D_; // Coord maillage Lagrangien
79
80 double eps_ = 1.0e-12; // precision geometrique
81 double eps_effec_ = 1.0e-12; // precision geometrique effective
82 double c_prepro_ = 0.; // facteur multiplicatif pour la recherche du ptr fluide
83 IntTab dimTab_ ; // choix des directions de recherche du pt fluide
84 bool save_prepro_ = false; // Sauvegarde des résultats dans un fichier MED
85 bool verify_results_prepro_ = false; // Verification champ calcules par prepro versus champs lu fichier MED (source_PDF)
86
87 // Champs produits par les prepro_IBM
88 OWN_PTR(Champ_Don_base) champ_rotation_, champ_aire_; // Rotation et Aire IBM maillage Eulerien
89 OWN_PTR(Champ_Don_base) champ_bary_; // Barycentres IBM maillage Eulerien
90 OWN_PTR(Champ_Don_base) champ_normal_; // Normales IBM maillage Eulerien
91
92 OWN_PTR(Champ_Don_base) isNodeDirichlet_ ;
93 OWN_PTR(Champ_Don_base) fluid_points_;
94 OWN_PTR(Champ_Don_base) fluid_elems_;
95 OWN_PTR(Champ_Don_base) solid_points_;
96 OWN_PTR(Champ_Don_base) solid_elems_;
97 OWN_PTR(Champ_Don_base) corresp_elems_;
98
99 OWN_PTR(Champ_Don_base) h_max_elem_;
101
103
105
106 int verbose_=0;
107
108 friend class Source_PDF_base;
109};
110
111#endif /* Prepro_IBM_base_included */
classe Champ_Don_base classe de base des Champs donnes (non calcules)
classe Domaine_dis_base Cette classe est la base de la hierarchie des domaines discretisees.
Class defining operators and methods for all reading operation in an input flow (file,...
Definition Entree.h:42
Une chaine de caractere (Nom) en majuscules.
Definition Motcle.h:26
class Nom Une chaine de caractere pour nommer les objets de TRUST
Definition Nom.h:31
Objet_U()
Constructeur par defaut : attribue un numero d'identifiant unique a l'objet (object_id_),...
Definition Objet_U.cpp:55
Helper class to factorize the readOn method of Objet_U classes.
Definition Param.h:112
OWN_PTR(Champ_Don_base) corresp_elems_
const DoubleTab & get_h_max_node()
const DoubleTab & get_champ_rotation()
OWN_PTR(Champ_Don_base) h_max_node_
const DoubleTab & get_isNodeDirichlet()
int lire_motcle_non_standard(const Motcle &, Entree &) override
Lecture des parametres de type non simple d'un objet_U a partir d'un flot d'entree.
void computeLocalFrame(const DoubleTab &, DoubleTab &, DoubleTab &, int)
void intersectPolyPoly2D(MEDCouplingUMesh *, MEDCouplingUMesh *, DoubleTab &, IntTab &, double, int &)
void intersectSegPoly2D(MEDCouplingUMesh *, DoubleTab &, DoubleTab &, double, MCAuto< MEDCoupling::DataArrayDouble >, int &)
OWN_PTR(Champ_Don_base) champ_rotation_
OWN_PTR(Champ_Don_base) champ_bary_
const DoubleTab & get_champ_fluid_elems()
OWN_PTR(Champ_Don_base) solid_points_
friend class Source_PDF_base
void set_champ_aire(DoubleTab &champ_aire)
const DoubleTab & get_h_max_elem()
OWN_PTR(Champ_Don_base) h_max_elem_
void intersectSegSeg2D(DoubleTab &, DoubleTab &, DoubleTab &, DoubleTab &, DoubleTab &, double, int &)
const DoubleTab & get_champ_barycentre()
void set_champ_rotation(DoubleTab &champ_rotation)
const DoubleTab & get_champ_solid_elems()
OWN_PTR(Champ_Don_base) isNodeDirichlet_
const DoubleTab & get_champ_fluid_points()
const DoubleTab & get_champ_solid_points()
MCAuto< MEDCoupling::MEDCouplingUMesh > aSkinUMesh_
void set_param(Param &) const override
const DoubleTab & get_champ_aire()
void calculer_normal_proj_solid(DoubleTab &, DoubleTab &)
virtual void compute_solid_fluid(int)
void set_champ_barycentre(DoubleTab &champ_bary)
void computeMatRot(const DoubleTab &, DoubleTab &, DoubleTab &, int)
virtual void associer_pb(const Probleme_base &)
OBS_PTR(Probleme_base) mon_pb_
OWN_PTR(Champ_Don_base) fluid_elems_
OWN_PTR(Champ_Don_base) fluid_points_
DoubleTab coordsSur3D_
OWN_PTR(Champ_Don_base) solid_elems_
OWN_PTR(Champ_Don_base) champ_normal_
const DoubleTab & get_champ_corresp_elems()
IntLists sommets_voisins_
classe Probleme_base C'est un Probleme_U qui n'est pas un couplage.
class Source_PDF_base Base class for the source terms for the penalisation of the momentum in the Imm...