TrioCFD 1.9.8
TrioCFD documentation
Loading...
Searching...
No Matches
IJK_switch.h
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#ifndef IJK_switch_included
17#define IJK_switch_included
18
19#include <Domaine_IJK.h>
20#include <IJK_Field_vector.h>
21#include <Interprete.h>
22#include <Linear_algebra_tools.h>
23#include <Param.h>
24#include <Interprete_bloc.h>
25#include <SFichier.h>
26
27#include <IJK_Lata_writer.h>
28#include <IJK_Navier_Stokes_tools.h>
29#include <communications.h>
30#include <LecFicDiffuse_JDD.h>
31#include <IJK_Field.h>
32#include <TRUSTList.h>
33
34
35/*
36 * Interprete permettant d'interpoler vitesse et rho d'un maillage sur un autre
37 */
39{
40 Declare_base(Switch_double);
41
42public:
43 Entree& interpreter(Entree&) override;
44 void run();
45
46protected:
47 virtual void initialise();
48 virtual void allocate_fields(double& sz_arr);
49 virtual void prepare_run();
50 virtual void set_param(Param& param) const override;
51 virtual void ecrire_fichier_reprise(const char *fichier_sauvegarde, const bool and_lata=true) = 0;
52 virtual void set_param_reprise(Param& param);
53 int lire_motcle_non_standard(const Motcle& mot, Entree& is) override;
54 virtual void lire_fichier_reprise(const char *fichier_reprise);
55 virtual void ecrire_header_lata(const Nom lata_name); // const;
56 virtual void compute_and_write_extra_fields(const Nom& lata_name, DoubleTab& coeff_i, IntTab Indice_i,
57 DoubleTab& coeff_j, IntTab Indice_j,
58 DoubleTab& coeff_k, IntTab Indice_k) = 0;
60 DoubleTab& coeff_i, IntTab Indice_i,
61 DoubleTab& coeff_j, IntTab Indice_j,
62 DoubleTab& coeff_k, IntTab Indice_k) = 0;
63
64 // overriden in FT - to be brought here at some point once merge with thermic BC is done ...
65 virtual void init_thermals() { }
66 virtual void prepare_thermals(const Nom lata_name) {}
67
68 void write_velocity(const Nom lata_name) const;
71 void calculer_coords_Vi(const int dir);
73 void calculer_coeff(DoubleTab& coeff_i,IntTab& Indice_i,
74 DoubleTab& coeff_j,IntTab& Indice_j ,
75 DoubleTab& coeff_k,IntTab& Indice_k ) ;
76 void switch_vit(DoubleTab coeff_i, IntTab Indice_i,
77 DoubleTab coeff_j ,IntTab Indice_j,
78 DoubleTab coeff_k ,IntTab Indice_k,
79 const int dir); //faces
80 void switch_scalar_field(const IJK_Field_double& oldf, IJK_Field_double& newf,
81 DoubleTab coeff_i, IntTab Indice_i,
82 DoubleTab coeff_j ,IntTab Indice_j,
83 DoubleTab coeff_k ,IntTab Indice_k) const;
84 void switch_scalar_field_direct(SFichier& binary_file,
85 const IJK_Field_double& fld,
86 DoubleTab coeff_i, IntTab Indice_i,
87 DoubleTab coeff_j ,IntTab Indice_j,
88 DoubleTab coeff_k ,IntTab Indice_k);
89
90 void switch_vit_direct(SFichier& binary_file);
91
92 // maillages
96
97 // direct_write_ = 1 => ecrit les fichiers a la volee sans alouer la memoire
98 // direct_write_ = 0 => ancien algo avec allocation de new_velocity_
100
101 int perio_k_ = 1;
102
103 // vitesses
104 IJK_Field_vector3_double new_velocity_;
105 IJK_Field_vector3_double old_velocity_;
106
107 // masse volumiques
108 IJK_Field_double new_rho_;
109 IJK_Field_double old_rho_;
110
111 // coord en x,y et z;
112 ArrOfDouble_with_ghost old_x_;
113 ArrOfDouble_with_ghost new_x_;
114 ArrOfDouble_with_ghost old_y_;
115 ArrOfDouble_with_ghost new_y_;
116 ArrOfDouble_with_ghost old_z_;
117 ArrOfDouble_with_ghost new_z_;
118
119 // Pour alleger le code.
120 int old_ni_ = 0;
121 int old_nj_ = 0;
122 int old_nk_ = 0;
123
124 int new_ni_ = 0;
125 int new_nj_ = 0;
126 int new_nk_ = 0;
127
128 // pour compatibiliter des fonctions.
129 double current_time_ = 0.;
132 // nom des fichiers.
135
136 // GAB : gabriel.ramirez@cea.fr
137 /*
138 init_forcage_THI forcage_;
139 double vap_velocity_tmoy_ = 0.;
140 double liq_velocity_tmoy_ = 0.;
141 double qdm_source_ = 0.;
142 double last_source_qdm_update_time_ = 0.;
143 int offset_list_index_ = 0.;
144 int size_listes_source_;
145 ArrOfDouble liste_instants_;
146 ArrOfDouble liste_vap_dl_; // liste des v_v * dt
147 ArrOfDouble liste_liq_dl_; // liste des v_l * dt
148 double reprise_v_target_ = 0.;
149 int list_index_ = 0.;
150 */
151 // GAB : gabriel.ramirez@cea.fr
152
153 // Le jeu de donnees doit fournir soit des fichiers de reprise: ..
156
158};
159
160#endif
This class encapsulates all the information related to the eulerian mesh for TrioIJK.
Definition Domaine_IJK.h:47
Localisation
Localisation sub class.
Definition Domaine_IJK.h:53
Classe de base des objets "interprete".
Definition Interprete.h:38
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
friend class Entree
Definition Objet_U.h:76
Helper class to factorize the readOn method of Objet_U classes.
Definition Param.h:112
Cette classe est a la classe C++ ofstream ce que la classe Sortie est a la classe C++ ostream Elle re...
Definition SFichier.h:27
virtual void ecrire_fichier_reprise(const char *fichier_sauvegarde, const bool and_lata=true)=0
int lire_motcle_non_standard(const Motcle &mot, Entree &is) override
Lecture des parametres de type non simple d'un objet_U a partir d'un flot d'entree.
void calculer_coeff(DoubleTab &coeff_i, IntTab &Indice_i, DoubleTab &coeff_j, IntTab &Indice_j, DoubleTab &coeff_k, IntTab &Indice_k)
virtual void set_param_reprise(Param &param)
virtual void compute_and_write_extra_fields(const Nom &lata_name, DoubleTab &coeff_i, IntTab Indice_i, DoubleTab &coeff_j, IntTab Indice_j, DoubleTab &coeff_k, IntTab Indice_k)=0
void switch_vit_direct(SFichier &binary_file)
double current_time_
Definition IJK_switch.h:129
void switch_vit(DoubleTab coeff_i, IntTab Indice_i, DoubleTab coeff_j, IntTab Indice_j, DoubleTab coeff_k, IntTab Indice_k, const int dir)
void remplir_gost()
virtual void ecrire_header_lata(const Nom lata_name)
Domaine_IJK old_mesh_
Definition IJK_switch.h:95
void calculer_coords_Vi(const int dir)
ArrOfDouble_with_ghost new_x_
Definition IJK_switch.h:113
virtual void initialise()
double terme_source_acceleration_
Definition IJK_switch.h:130
ArrOfDouble_with_ghost old_z_
Definition IJK_switch.h:116
virtual void lire_fichier_reprise(const char *fichier_reprise)
IJK_Field_vector3_double new_velocity_
Definition IJK_switch.h:104
virtual void prepare_run()
double terme_source_acceleration_z_
Definition IJK_switch.h:131
int timestep_reprise_vitesse_
Definition IJK_switch.h:157
ArrOfDouble_with_ghost old_x_
Definition IJK_switch.h:112
Nom fichier_old_vitesse_
Definition IJK_switch.h:154
IJK_Field_vector3_double old_velocity_
Definition IJK_switch.h:105
void calculer_coords_elem()
virtual void init_thermals()
Definition IJK_switch.h:65
Entree & interpreter(Entree &) override
void switch_scalar_field_direct(SFichier &binary_file, const IJK_Field_double &fld, DoubleTab coeff_i, IntTab Indice_i, DoubleTab coeff_j, IntTab Indice_j, DoubleTab coeff_k, IntTab Indice_k)
IJK_Field_double new_rho_
Definition IJK_switch.h:108
IJK_Field_double old_rho_
Definition IJK_switch.h:109
virtual void set_param(Param &param) const override
virtual void compute_and_write_extra_fields_direct(SFichier &file, DoubleTab &coeff_i, IntTab Indice_i, DoubleTab &coeff_j, IntTab Indice_j, DoubleTab &coeff_k, IntTab Indice_k)=0
virtual void allocate_fields(double &sz_arr)
void write_velocity(const Nom lata_name) const
ArrOfDouble_with_ghost old_y_
Definition IJK_switch.h:114
Nom fichier_new_vitesse_
Definition IJK_switch.h:155
void switch_scalar_field(const IJK_Field_double &oldf, IJK_Field_double &newf, DoubleTab coeff_i, IntTab Indice_i, DoubleTab coeff_j, IntTab Indice_j, DoubleTab coeff_k, IntTab Indice_k) const
ArrOfDouble_with_ghost new_z_
Definition IJK_switch.h:117
virtual void prepare_thermals(const Nom lata_name)
Definition IJK_switch.h:66
void calculer_coords(const Domaine_IJK::Localisation loc)
Domaine_IJK new_mesh_
Definition IJK_switch.h:94
ArrOfDouble_with_ghost new_y_
Definition IJK_switch.h:115