TrioCFD 1.9.8
TrioCFD documentation
Loading...
Searching...
No Matches
Corrige_flux_FT_base.cpp
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#include <Corrige_flux_FT_base.h>
17#include <DebogIJK.h>
18#include <Probleme_FTD_IJK.h>
19#include <IJK_Navier_Stokes_tools.h>
20#include <Intersection_Interface_ijk.h>
21#include <Param.h>
22
23
24Implemente_base_sans_constructeur(Corrige_flux_FT_base, "Corrige_flux_FT_base", Objet_U);
25
26Corrige_flux_FT_base::Corrige_flux_FT_base()
27{
28}
29
30
32{
33 Objet_U::printOn( os );
34 return os;
35}
36
38{
39 Objet_U::readOn( is );
40 return is;
41}
42
44 const IJK_Field_double& field,
45 const IJK_Interfaces& interfaces,
46 const Probleme_FTD_IJK_base& ijk_ft,
47 Intersection_Interface_ijk_face& intersection_ijk_face,
48 Intersection_Interface_ijk_cell& intersection_ijk_cell)
49{
50 /*
51 * TODO: est-ce que les pointeurs restent bien toujours les meme ?
52 * Si oui je peux ne les initialiser qu'une fois, sinon il faudra
53 * les mettre à jour.
54 */
55 interfaces_ = interfaces;
56 domaine_ = dom;
57 ref_ijk_ft_ = ijk_ft;
58 field_ = &field;
59 intersection_ijk_face_ = &intersection_ijk_face;
60 intersection_ijk_cell_ = &intersection_ijk_cell;
61}
62
64 const IJK_Field_double& field,
65 const IJK_Interfaces& interfaces,
66 const Probleme_FTD_IJK_base& ijk_ft,
67 Intersection_Interface_ijk_face& intersection_ijk_face,
68 Intersection_Interface_ijk_cell& intersection_ijk_cell,
69 IJK_One_Dimensional_Subproblems& thermal_local_subproblems)
70{
71 initialize(splitting, field, interfaces, ijk_ft, intersection_ijk_face, intersection_ijk_cell);
72}
73
75 const double rhocpv,
76 const double ldal,
77 const double ldav)
78{
79 rhocp_l_ = rhocpl;
80 rhocp_v_ = rhocpv;
81 lda_l_ = ldal;
82 lda_v_ = ldav;
83}
84
86{
87 const int& dir= parcours_.face();
88
89 const double velocity = ref_ijk_ft_->eq_ns().get_velocity(
90 )[dir](parcours_.i(), parcours_.j(), parcours_.k());
91 double stencil_inclut_interface = 1.;
92 int decal = 0;
93 if ( velocity > 0.)
94 decal = -1;
95
96 for (int c = 0; c < 3; c++)
97 {
98 const auto c_elem = parcours_.elem(c + decal);
99 stencil_inclut_interface *= ref_ijk_ft_->get_interface().I(
100 c_elem[0],
101 c_elem[1],
102 c_elem[2]);
103 }
104
105 // On considère que ce n'est pas grave s'il n'y a qu'un tout petit bout d'interface
106 return std::abs(1. - stencil_inclut_interface) > 0.05;
107}
108
110{
111 const int& dir= parcours_.face();
112
113 const double velocity = ref_ijk_ft_->eq_ns().get_velocity(
114 )[dir](parcours_.i(), parcours_.j(), parcours_.k());
115 double stencil_inclut_interface = 1.;
116 int decal = 0;
117 if ( velocity > 0.)
118 decal = -1;
119
120 for (int c = 0; c < 3; c++)
121 {
122 const auto c_elem = parcours_.elem(c + decal);
123 stencil_inclut_interface *= (
124 1. - ref_ijk_ft_->get_interface().I(
125 c_elem[0],
126 c_elem[1],
127 c_elem[2]));
128 }
129
130 // On considère que ce n'est pas grave s'il n'y a qu'un tout petit bout d'interface
131 return std::abs(1. - stencil_inclut_interface) > 0.05;
132}
133
: class Corrige_flux_FT API pour modifier un champ de flux à partir de donnees à l'interface....
Intersection_Interface_ijk_cell * intersection_ijk_cell_
virtual void initialize_with_subproblems(const Domaine_IJK &splitting, const IJK_Field_double &field, const IJK_Interfaces &interfaces, const Probleme_FTD_IJK_base &ijk_ft, Intersection_Interface_ijk_face &intersection_ijk_face, Intersection_Interface_ijk_cell &intersection_ijk_cell, IJK_One_Dimensional_Subproblems &thermal_local_subproblems)
bool test_if_stencil_inclut_bout_interface_vapeur() const
bool test_if_stencil_inclut_bout_interface_liquide() const
Intersection_Interface_ijk_face * intersection_ijk_face_
virtual void initialize(const Domaine_IJK &dom, const IJK_Field_double &field, const IJK_Interfaces &interfaces, const Probleme_FTD_IJK_base &ijk_ft, Intersection_Interface_ijk_face &intersection_ijk_face, Intersection_Interface_ijk_cell &intersection_ijk_cell)
const IJK_Field_double * field_
void set_physical_parameters(const double rhocpl, const double rhocpv, const double ldal, const double ldav)
This class encapsulates all the information related to the eulerian mesh for TrioIJK.
Definition Domaine_IJK.h:47
Class defining operators and methods for all reading operation in an input flow (file,...
Definition Entree.h:42
: class IJK_Interfaces
classe Objet_U Cette classe est la classe de base des Objets de TRUST
Definition Objet_U.h:73
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
Classe de base des flux de sortie.
Definition Sortie.h:52