16#include <IJK_One_Dimensional_Subproblems_Interfaces_Fields.h>
17#include <Probleme_FTD_IJK.h>
18#include <IJK_One_Dimensional_Subproblems.h>
19#include <IJK_Navier_Stokes_tools.h>
23IJK_One_Dimensional_Subproblems_Interfaces_Fields::IJK_One_Dimensional_Subproblems_Interfaces_Fields()
101 ref_ijk_ft_ = ijk_ft;
107 liste.add(
"FT_INTERFACIAL_HEAT_FLUX");
108 liste.add(
"FT_INTERFACIAL_VELOCITY_MAGNITUDE");
109 liste.add(
"FT_INTERFACIAL_TEMPERATURE");
114 const char *lata_name,
120 const Nom interf_heat_flux(
"FT_INTERFACIAL_HEAT_FLUX_DENSITY");
121 if (liste_post_instantanes.
contient_(interf_heat_flux))
128 const Nom interf_heat_flux_interp(
"FT_INTERFACIAL_HEAT_FLUX_DENSITY_INTERP");
129 if (liste_post_instantanes.
contient_(interf_heat_flux_interp))
133 n++, dumplata_ft_field(lata_name,
"INTERFACES", interf_heat_flux_interp,
"SOM",
interfacial_heat_flux_, lata_step);
136 const Nom interf_velocity_magnitude(
"FT_INTERFACIAL_VELOCITY_MAGNITUDE");
137 if (liste_post_instantanes.
contient_(interf_velocity_magnitude))
141 n++, dumplata_ft_field(lata_name,
"INTERFACES", interf_velocity_magnitude,
"SOM",
velocity_magnitude_, lata_step);
144 const Nom interf_temperature(
"FT_INTERFACIAL_TEMPERATURE");
145 if (liste_post_instantanes.
contient_(interf_temperature))
149 n++, dumplata_ft_field(lata_name,
"INTERFACES", interf_temperature,
"SOM",
temperature_sol_, lata_step);
152 const Nom interf_temperature_gradient(
"FT_INTERFACIAL_TEMPERATURE_GRADIENT");
153 if (liste_post_instantanes.
contient_(interf_temperature_gradient))
157 n++, dumplata_ft_field(lata_name,
"INTERFACES", interf_temperature_gradient,
"SOM",
temperature_gradient_sol_, lata_step);
160 const Nom interf_temperature_interp(
"FT_INTERFACIAL_TEMPERATURE_INTERP");
161 if (liste_post_instantanes.
contient_(interf_temperature_interp))
165 n++, dumplata_ft_field(lata_name,
"INTERFACES", interf_temperature_interp,
"SOM",
temperature_, lata_step);
168 const Nom interf_temperature_gradient_interp(
"FT_INTERFACIAL_TEMPERATURE_GRADIENT_INTERP");
169 if (liste_post_instantanes.
contient_(interf_temperature_gradient_interp))
173 n++, dumplata_ft_field(lata_name,
"INTERFACES", interf_temperature_gradient_interp,
"SOM",
temperature_gradient_, lata_step);
183 if (surface_post_name ==
Nom(
"FT_INTERFACIAL_HEAT_FLUX_DENSITY"))
185 else if (surface_post_name ==
Nom(
"FT_INTERFACIAL_VELOCITY_MAGNITUDE"))
187 else if (surface_post_name ==
Nom(
"FT_INTERFACIAL_TEMPERATURE"))
189 else if (surface_post_name ==
Nom(
"FT_INTERFACIAL_TEMPERATURE_GRADIENT"))
191 else if (surface_post_name ==
Nom(
"FT_INTERFACIAL_TEMPERATURE_INTERP"))
193 else if (surface_post_name ==
Nom(
"FT_INTERFACIAL_TEMPERATURE_GRADIENT_INTERP"))
195 else if (surface_post_name ==
Nom(
"FT_INTERFACIAL_HEAT_FLUX_DENSITY_INTERP"))
203 int counter_val_elem = 0;
204 int counter_val_interf = 0;
205 static const double invalid_value = INVALID_TEST;
206 if (!has_been_updated)
210 surface_quantity.
reset();
217 const Domaine_IJK& splitting = ref_ijk_ft_->get_domaine_ft();
222 const ArrOfInt& index_elem = intersections.
index_elem();
224 const ArrOfInt& sommet_elem = maillage.
sommet_elem();
225 const IntTab& facettes = maillage.
facettes();
226 const DoubleTab& sommets = maillage.
sommets();
236 const int nb_vertices = sommets.
dimension(0);
237 const int nb_vertices_elem = sommet_elem.
size_array();
240 Cerr <<
"Nb vertices: " << nb_vertices << finl;
241 Cerr <<
"Nb vertices elem: " << nb_vertices_elem << finl;
244 surface_quantity.
resize(nb_vertices);
246 surface_quantity *= 0.;
248 int index_i, index_j, index_k;
250 for (
int m = 0; m < nb_subproblems; m++)
252 const double eulerian_value =
thermal_local_subproblems_->get_thermal_subproblem_value_at_ijk_index(m, index_i, index_j, index_k, val_index);
268 for (
int elem = 0; elem < nb_elem; elem++)
273 int index = index_elem[elem];
276 double eulerian_value = 0.;
278 const int& i = num_elem_ijk[DIRECTION_I];
279 const int& j = num_elem_ijk[DIRECTION_J];
280 const int& k = num_elem_ijk[DIRECTION_K];
288 if (abs(surface) > MIN_SURFACE)
289 for (
int l = 0; l < dim; l++)
291 const int som = facettes(num_facette, l);
293 const double surface_value = eulerian_value;
294 surface_quantity[som] += (surface_value * surface);
295 counter_val_interf++;
298 Cerr <<
"Small surface intersection detected: " << surface << finl;
305 has_been_updated =
true;
310 Cerr <<
"Elems contributing to interfacial post-processing: " << counter_val_elem << finl;
311 Cerr <<
"Facets contributing to interfacial post-processing: " << counter_val_interf << finl;
313 return true && has_been_updated;
319 for (
int m=0; m<size_array; m++)
321 const double surface_quantity_tmp = surface_quantity[m];
323 if (abs(surface_tot_som) > MIN_SURFACE)
324 surface_quantity[m] = surface_quantity_tmp / surface_tot_som;
327 Cerr <<
"Small interface portion detected" << finl;
328 Cerr <<
"Surface value of: " << surface_tot_som << finl;
335 static const double invalid_value = INVALID_TEST;
337 if (eulerian_value < invalid_value)
342 for (
int c=0; c<3; c++)
343 for (
int l=-1; l<=1; l++)
345 const int ii = select_dir(c, l, 0, 0);
346 const int jj = select_dir(c, 0, l, 0);
347 const int kk = select_dir(c, 0, 0, l);
349 if (local_val > INVALID_TEST)
352 avg_val += local_val;
359 eulerian_value = avg_val;
This class encapsulates all the information related to the eulerian mesh for TrioIJK.
int convert_ijk_cell_to_packed(const FixedVector< int, 3 > ijk) const
Converts the ijk index of an element to a cell index.
FixedVector< int, 3 > convert_packed_to_ijk_cell(int index) const
Convert the local index of an element to a vector with IJK indices.
classe Domaine_dis_base Cette classe est la base de la hierarchie des domaines discretisees.
const Domaine & domaine() const
Class defining operators and methods for all reading operation in an input flow (file,...
const Domaine_dis_base & get_domaine_dis() const
const Maillage_FT_IJK & maillage_ft_ijk() const
ArrOfDouble interfacial_heat_flux_
ArrOfDouble vertices_surface_
void set_subproblems_interfaces_fields(const int &interface_field_type)
ArrOfDouble interfacial_heat_flux_sol_
int interface_field_type_
void associer(const Probleme_FTD_IJK_base &ijk_ft)
bool updated_temperature_
IJK_Field_double tmp_field_val_
ArrOfDouble velocity_magnitude_
bool updated_velocity_magnitude_
bool updated_temperature_gradient_sol_
Motcles liste_post_instantanes_
ArrOfDouble eulerian_values_
IJK_Field_double tmp_ft_field_val_
bool updated_temperature_gradient_
bool retrieve_interfacial_surface_quantities(const Nom &surface_post_name)
ArrOfDouble temperature_gradient_sol_
void copy_previous_interface_state()
bool retrieve_interfacial_surface_quantity(ArrOfDouble &surface_quantity, bool &has_been_updated, const int &val_index)
bool updated_temperature_sol_
ArrOfDouble temperature_gradient_
bool updated_interfacial_heat_flux_
ArrOfDouble temperature_sol_
void initialise(const Domaine_IJK &splitting, IJK_One_Dimensional_Subproblems &thermal_local_subproblems, const int &debug)
void get_surrounding_value(const int &i, const int &j, const int &k, double &eulerian_value)
bool updated_interfacial_heat_flux_sol_
IJK_One_Dimensional_Subproblems * thermal_local_subproblems_
void averaged_by_vertex_surface(ArrOfDouble &surface_quantity)
int posttraiter_champs_instantanes(const Motcles &liste_post_instantanes, const char *lata_name, const int lata_step)
void posttraiter_tous_champs(Motcles &liste) const
double fraction_surface_intersection_
int index_facette_suivante_
: class Intersections_Elem_Facettes
const ArrOfInt & index_elem() const
Renvoie un tableau de taille domaine.
const Intersections_Elem_Facettes_Data & data_intersection(int index) const
Renvoie les donnees de l'intersection stockee a l'indice "index" dans le tableau "data" ( 0 <= index ...
const DoubleTab & sommets() const
renvoie le tableau des sommets (reels et virtuels) dimension(0) = nombre de sommets,
const Intersections_Elem_Facettes & intersections_elem_facettes() const
virtual const ArrOfDouble & get_update_surface_facettes() const
Calcule la grandeur demandee, stocke le resultat dans un tableau interne a la classe et renvoie le re...
const IntTab & facettes() const
renvoie le tableau des facettes (reelles et virtuelles) dimension(0) = nombre de facettes,
const ArrOfInt & sommet_elem() const
pour postraitement, renvoie sommet_elem_
Un tableau d'objets de la classe Motcle.
int contient_(const char *const ch) const
class Nom Une chaine de caractere pour nommer les objets de TRUST
classe Objet_U Cette classe est la classe de base des Objets de TRUST
virtual Entree & readOn(Entree &)
Lecture d'un Objet_U sur un flot d'entree Methode a surcharger.
virtual Sortie & printOn(Sortie &) const
Ecriture de l'objet sur un flot de sortie Methode a surcharger.
Motcles get_liste_post_instantanes() const
const Postprocessing_IJK & get_post() const
Classe de base des flux de sortie.
_SIZE_ size_array() const
void resize(_SIZE_ new_size, RESIZE_OPTIONS opt=RESIZE_OPTIONS::COPY_INIT)
_SIZE_ dimension(int d) const