TrioCFD 1.9.8
TrioCFD documentation
Loading...
Searching...
No Matches
Cut_cell_convection_auxiliaire.cpp
1/****************************************************************************
2* Copyright (c) 2015 - 2016, 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 <Cut_cell_convection_auxiliaire.h>
17#include <IJK_Field_vector.h>
18#include <Cut_cell_FT_Disc.h>
19#include <IJK_Thermal_base.h>
20#include <Process.h>
21#include <Probleme_FTD_IJK_cut_cell.h>
22
23#include <IJK_Navier_Stokes_tools.h>
24#include <IJK_Navier_Stokes_tools_cut_cell.h>
25#include <Param.h>
26
27Implemente_instanciable_sans_constructeur(Cut_cell_convection_auxiliaire, "Cut_cell_convection_auxiliaire", Cut_cell_schema_auxiliaire) ;
28
29Cut_cell_convection_auxiliaire::Cut_cell_convection_auxiliaire()
30{
31 methode_valeur_remplissage_ = METHODE_TEMPERATURE_REMPLISSAGE::NON_INITIALISE;
32 correction_petites_cellules_ = CORRECTION_PETITES_CELLULES::CORRECTION_SYMETRIQUE;
33
34 no_static_update_ = true;
35}
36
38{
40 return os;
41}
42
44{
45 Param param(que_suis_je());
46 set_param(param);
47 param.lire_avec_accolades(is);
48 return is;
49}
50
55
56double Cut_cell_convection_auxiliaire::dying_cells_flux(int num_face, int phase, int n, const Cut_field_vector3_double& cut_field_total_velocity, const Cut_field_double& cut_field)
57{
58 const Cut_cell_FT_Disc& cut_cell_disc = cut_field.get_cut_cell_disc();
59
60 Int3 ijk = cut_cell_disc.get_ijk(n);
61 int i = ijk[0];
62 int j = ijk[1];
63 int k = ijk[2];
64
65 int dir = num_face%3;
66 int decalage = num_face/3;
67 int sign = decalage*2 -1;
68
69 int di = decalage*(dir == 0);
70 int dj = decalage*(dir == 1);
71 int dk = decalage*(dir == 2);
72 int di_decale = sign*(dir == 0);
73 int dj_decale = sign*(dir == 1);
74 int dk_decale = sign*(dir == 2);
75
76 double next_indicatrice_decale = cut_cell_disc.get_interfaces().In(i+di_decale,j+dj_decale,k+dk_decale);
77
78 double valeur_centre = (phase == 0) ? cut_field.diph_v_(n) : cut_field.diph_l_(n);
79
80 double valeur_decale = -1e37;
81 int n_decale = cut_cell_disc.get_n(i+di_decale, j+dj_decale, k+dk_decale);
82 if (n_decale >= 0)
83 {
84 valeur_decale = (phase == 0) ? cut_field.diph_v_(n_decale) : cut_field.diph_l_(n_decale);
85 }
86 else
87 {
88 valeur_decale = (phase == (IJK_Interfaces::convert_indicatrice_to_phase(next_indicatrice_decale)))*cut_field.pure_(i+di_decale,j+dj_decale,k+dk_decale);
89 }
90
91 double total_velocity = cut_field_total_velocity[dir].from_ijk_and_phase(i+di,j+dj,k+dk, phase);
92
93 int n_face = cut_cell_disc.get_n_face(num_face, n, i, j, k);
94 if (n_face >= 0)
95 {
96 double surface_efficace = (phase == 0) ? 1 - cut_cell_disc.get_interfaces().get_indicatrice_surfacique_efficace_face()(n_face, dir) : cut_cell_disc.get_interfaces().get_indicatrice_surfacique_efficace_face()(n_face, dir);
97 if (surface_efficace > 0)
98 {
99 double valeur = (sign*total_velocity < 0) ? valeur_decale : valeur_centre;
100 return -sign*surface_efficace*valeur*total_velocity;
101 }
102 else
103 {
104 return 0.;
105 }
106 }
107 else
108 {
109 double surface_efficace = (phase == 0) ? 1 - cut_cell_disc.get_interfaces().I(i+di,j+dj,k+dk) : cut_cell_disc.get_interfaces().I(i+di,j+dj,k+dk);
110 assert((surface_efficace == 0) || (surface_efficace == 1));
111 if (surface_efficace > 0)
112 {
113 double valeur = (sign*total_velocity < 0) ? valeur_decale : valeur_centre;
114 return -sign*surface_efficace*valeur*total_velocity;
115 }
116 else
117 {
118 return 0.;
119 }
120 }
121}
122
123double Cut_cell_convection_auxiliaire::small_nascent_cells_flux(int num_face, int phase, int n, const Cut_field_vector3_double& cut_field_total_velocity, const Cut_field_double& cut_field)
124{
125 const Cut_cell_FT_Disc& cut_cell_disc = cut_field.get_cut_cell_disc();
126
127 Int3 ijk = cut_cell_disc.get_ijk(n);
128 int i = ijk[0];
129 int j = ijk[1];
130 int k = ijk[2];
131
132 int dir = num_face%3;
133 int decalage = num_face/3;
134 int sign = decalage*2 -1;
135
136 int di = decalage*(dir == 0);
137 int dj = decalage*(dir == 1);
138 int dk = decalage*(dir == 2);
139 int di_decale = sign*(dir == 0);
140 int dj_decale = sign*(dir == 1);
141 int dk_decale = sign*(dir == 2);
142
143 double next_indicatrice_decale = cut_cell_disc.get_interfaces().In(i+di_decale,j+dj_decale,k+dk_decale);
144
145 double valeur_decale = -1e37;
146 int n_decale = cut_cell_disc.get_n(i+di_decale, j+dj_decale, k+dk_decale);
147 if (n_decale >= 0)
148 {
149 valeur_decale = (phase == 0) ? cut_field.diph_v_(n_decale) : cut_field.diph_l_(n_decale);
150 }
151 else
152 {
153 valeur_decale = (phase == (IJK_Interfaces::convert_indicatrice_to_phase(next_indicatrice_decale)))*cut_field.pure_(i+di_decale,j+dj_decale,k+dk_decale);
154 }
155
156 double total_velocity = cut_field_total_velocity[dir].from_ijk_and_phase(i+di,j+dj,k+dk, phase);
157
158 int n_face = cut_cell_disc.get_n_face(num_face, n, i, j, k);
159 if (n_face >= 0)
160 {
161 double surface_efficace = (phase == 0) ? 1 - cut_cell_disc.get_interfaces().get_indicatrice_surfacique_efficace_face()(n_face, dir) : cut_cell_disc.get_interfaces().get_indicatrice_surfacique_efficace_face()(n_face, dir);
162 if (surface_efficace > 0)
163 {
164 double valeur = valeur_decale;
165 return -sign*surface_efficace*valeur*total_velocity;
166 }
167 else
168 {
169 return 0.;
170 }
171 }
172 else
173 {
174 double surface_efficace = (phase == 0) ? 1 - cut_cell_disc.get_interfaces().In(i+di,j+dj,k+dk) : cut_cell_disc.get_interfaces().In(i+di,j+dj,k+dk);
175 assert((surface_efficace == 0) || (surface_efficace == 1));
176 if (surface_efficace > 0)
177 {
178 double valeur = valeur_decale;
179 return -sign*surface_efficace*valeur*total_velocity;
180 }
181 else
182 {
183 return 0.;
184 }
185 }
186}
187
const IJK_Interfaces & get_interfaces() const
Int3 get_ijk(int n) const
int get_n_face(int num_face, int n, int i, int j, int k) const
int get_n(int i, int j, int k) const
double dying_cells_flux(int num_face, int phase, int n, const Cut_field_vector3_double &cut_field_total_velocity, const Cut_field_double &cut_field) override
void set_param(Param &param) const override
double small_nascent_cells_flux(int num_face, int phase, int n, const Cut_field_vector3_double &cut_field_total_velocity, const Cut_field_double &cut_field) override
CORRECTION_PETITES_CELLULES correction_petites_cellules_
void set_param(Param &param) const override
METHODE_TEMPERATURE_REMPLISSAGE methode_valeur_remplissage_
_TYPE_ & pure_(int i, int j, int k)
Definition Cut_field.h:116
const Cut_cell_FT_Disc & get_cut_cell_disc() const
Definition Cut_field.h:78
TRUSTTabFT_cut_cell< _TYPE_ > diph_l_
Definition Cut_field.h:49
TRUSTTabFT_cut_cell< _TYPE_ > diph_v_
Definition Cut_field.h:50
Class defining operators and methods for all reading operation in an input flow (file,...
Definition Entree.h:42
const DoubleTabFT_cut_cell_vector3 & get_indicatrice_surfacique_efficace_face() const
const IJK_Field_double & I() const
const IJK_Field_double & In() const
static int convert_indicatrice_to_phase(double indicatrice)
const Nom & que_suis_je() const
renvoie la chaine identifiant la classe.
Definition Objet_U.cpp:104
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
Helper class to factorize the readOn method of Objet_U classes.
Definition Param.h:112
Classe de base des flux de sortie.
Definition Sortie.h:52