TrioCFD 1.9.8
TrioCFD documentation
Loading...
Searching...
No Matches
corrections_qdm.h
1/****************************************************************************
2* Copyright (c) 2021, 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 consigne_initiale_included
17#define consigne_initiale_included
18
19#include <FixedVector.h>
20#include <IJK_Field.h>
21#include <Objet_U.h>
22#include <string>
23#include <iostream>
24#include <math.h>
25
26/*! @brief : class consigne_initiale
27 *
28 * < S'OCCUPE DE CALCULER v_cible_ et qdm_cible_ UNIQUEMENT
29 * qdm_cible = qdm_du_premier_pas_de_temps
30 * TODO v_cible_ : est-ce que je le sort ?
31 * >
32 *
33 *
34 *
35 */
37{
38
39 Declare_instanciable( consigne_initiale ) ;
40
41public :
42 void initialise();
43 void set_time(int time_iteration) {time_iteration_ = time_iteration;};
44 double get_qdm_cible() {return qdm_cible_;};
45 void compute_qdm_cible(double qdm_initiale);
46
47 int get_need_for_vl_vv() {return 0;};
48 int get_need_for_rho_l() {return 0;};
49protected :
51 double qdm_cible_ = 0;
52};
53
54#endif /* consigne_initiale_included */
55
56/////////////////////////////////////////////////////////////////////////////////////////
57// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ////////////////////////////////
58/////////////////////////////////////////////////////////////////////////////////////////
59
60
61#ifndef cible_donnee_included
62#define cible_donnee_included
63
64#include <FixedVector.h>
65#include <IJK_Field.h>
66#include <Objet_U.h>
67#include <string>
68#include <iostream>
69#include <math.h>
70
71/*! @brief : class cible_donnee
72 *
73 * < S'OCCUPE DE CALCULER v_cible_ et qdm_cible_ UNIQUEMENT
74 * qdm_cible = alpha_l rho_l v_cible_
75 * v_cible_ : constante utilisateur ou .sauv
76 * >
77 *
78 *
79 *
80 */
81class cible_donnee : public Objet_U
82{
83
84 Declare_instanciable_sans_constructeur( cible_donnee ) ;
85
86public :
88 void set_time() {/* does nothing */;};
89 void set_rho_l(double rho_liq) {rho_liq_ = rho_liq;};
90 double get_v_cible() {return v_cible_;};
91 double get_qdm_cible() {return qdm_cible_;};
92 void compute_qdm_cible(double alpha_l);
93
94 int get_need_for_vl_vv() {return 0;};
95 int get_need_for_rho_l() {return 1;};
96protected :
97 double rho_liq_;
98 double v_cible_;
99 double qdm_cible_;
100};
101
102#endif /* cible_donnee_included */
103
104/////////////////////////////////////////////////////////////////////////////////////////
105// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ////////////////////////////////
106/////////////////////////////////////////////////////////////////////////////////////////
107
108#ifndef moyenne_par_morceaux_included
109#define moyenne_par_morceaux_included
110
111#include <FixedVector.h>
112#include <IJK_Field.h>
113#include <Objet_U.h>
114#include <string>
115#include <iostream>
116#include <math.h>
117
118/*! @brief : class moyenne_par_morceaux
119 *
120 * <S'OCCUPE DE CALCULER v_cible_ et qdm_cible_ UNIQUEMENT
121 * qdm_cible = alpha_l rho_l v_cible_
122 * Pour (n-1)*duree_morceaux < t < (n)*duree_morceaux :
123 * v_cible_ = 1/duree_morceau sum_{morceau_precedent} v_liq-v_vap
124 * qdm_cible_ = 1/duree_morceau sum_{morceau_precedent} a_l rho_l * (v_liq-v_vap)
125 * Pour t = n*duree_morceaux
126 * n <-- n+1 ...
127 * ATTENTION AUX DIMENSION : v_cible_ vaut alpha_l*v_liq (03.03.22)
128 * >
129 *
130 *
131 *
132 */
134{
135
136 Declare_instanciable_sans_constructeur( moyenne_par_morceaux ) ;
137
138public :
140 void initialise();
141 void set_time(double time, double time_step, int time_iteration);
142 void set_rho_l(double rho_liq) {rho_liq_ = rho_liq;};
143 void compute_qdm_cible(double alpha_l, double vitesse_relative);
144 double get_qdm_cible() {return qdm_cible_;};
145
146 int get_need_for_vl_vv() {return 1;};
147 int get_need_for_rho_l() {return 1;};
148
149protected :
150 // Fetch from Probleme_FTD_IJK_base
151 double timestep_;
152 double time_;
154 double rho_liq_;
155 // Only here
156 //double duree_morceau_effective_;
161 double v_cible_;
163};
164
165#endif /* moyenne_par_morceaux_included */
166
167/////////////////////////////////////////////////////////////////////////////////////////
168// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ////////////////////////////////
169/////////////////////////////////////////////////////////////////////////////////////////
170
171#ifndef moyenne_glissante_included
172#define moyenne_glissante_included
173
174#include <FixedVector.h>
175#include <IJK_Field.h>
176#include <Objet_U.h>
177#include <string>
178#include <iostream>
179#include <math.h>
180
181/*! @brief : class moyenne_glissante
182 *
183 * < S'OCCUPE DE CALCULER v_cible_ et qdm_cible_ UNIQUEMENT
184 * qdm_cible = alpha_l rho_l v_cible_
185 * Pour t < duree_demandee_morceau_glissant_ :
186 * v_cible_ = 1/t sum_{t} v_liq-v_vap
187 * Pour t >= duree_demandee_morceau_glissant_ :
188 * v_cible_ = 1/(t-tm) sum_{tm;t} v_liq-v_vap
189 * tm = duree_effective_morceau_glissant_
190 * ATTENTION AUX DIMENSIONS : v_cible_ = \ol{u}^liq - \ol{u}^vap
191 * >
192 *
193 *
194 */
196{
197
198 Declare_instanciable_sans_constructeur( moyenne_glissante ) ;
199
200public :
201
203 void initialise();
204 void set_time(double time, double time_step, int time_iteration);
205 void set_rho_l(double rho_liq) {rho_liq_ = rho_liq;};
207 double get_qdm_cible() {return qdm_cible_;};
208 double get_v_cible() {return v_cible_;};
209 void compute_qdm_cible(double alpha_liq);
210 void compute_v_cible(double vitesse_relative);
211
212 int get_need_for_vl_vv() {return 1;};
213 int get_need_for_rho_l() {return 1;};
214
215protected :
218 ArrOfDouble liste_instants_;
219 ArrOfDouble liste_v_cible_dl_;
220 ArrOfDouble liste_v_cible_;
221 double rho_liq_;
222
224 double time_;
225 double timestep_;
226 double v_cible_;
230};
231
232#endif /* moyenne_glissante_included */
233
234/////////////////////////////////////////////////////////////////////////////////////////
235// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ////////////////////////////////
236/////////////////////////////////////////////////////////////////////////////////////////
237
238#ifndef correction_one_direction_included
239#define correction_one_direction_included
240
241#include <FixedVector.h>
242#include <IJK_Field.h>
243#include <Objet_U.h>
244#include <string>
245#include <iostream>
246#include <math.h>
247
248/*! @brief : class correction_one_direction
249 *
250 * < Correction : "vitesse_corrigee_ = vitesse - vitesse_correction_"
251 *
252 * A partir de qdm_cible, calcule vitesse_correction_ et vitesse_corrigee_ pour une direction
253 *
254 * u_i * = u_i - {u_correction}_i
255 * correct_velocity_ = vel_ijk_t - value_correction_
256 * value_correction_= ({rho u}_i _moyen - qdm_cible) / rho_moyen
257 *
258 * qdm_cible : calculee par une des sous-classes.
259 * >
260 *
261 *
262 */
264{
265
266 Declare_instanciable_sans_constructeur( correction_one_direction ) ;
267
268public :
270 void set_correction(correction_one_direction& correction_in);
271// initialise_perp_g();
272// Entree& interpreter(Entree&);
275 double get_value() {return value_correction_;};
276 void set_time_for_correction(double time, double time_step, int time_iteration);
277 void set_rho_moyen_alpha_l_for_correction(double rho_moyen, double alpha_l);
278 void set_rho_vel_moyen_for_correction(double rho_vel_moyen);
279 void set_mean_values_for_correction(double rho_vel_moyen, double rho_moyen, double alpha_l);
281 void compute_correct_velocity(double vel_ijk_t);
285
289
290 void set_rho_liq(double rho_liquide);
291 void set_vl_vv(double vl_vv);
292
297
298protected :
303 /* Compute from IJK */
306 double alpha_l_;
307 /* Compute here */
310
315}
316;
317
318#endif /* correction_one_direction_included */
319
320/////////////////////////////////////////////////////////////////////////////////////////
321// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ////////////////////////////////
322/////////////////////////////////////////////////////////////////////////////////////////
323
324#ifndef corrections_qdm_included
325#define corrections_qdm_included
326
327#include <FixedVector.h>
328#include <IJK_Field.h>
329#include <Objet_U.h>
330#include <string>
331#include <iostream>
332#include <math.h>
333
334/*! @brief : class corrections_qdm
335 *
336 * <Corrections to comply with the mean momentum budget in the three directions.>
337 *
338 *
339 *
340 */
342{
343
344 Declare_instanciable_sans_constructeur( corrections_qdm ) ;
345
346public :
349 correction_one_direction& in_corr_y_ ,
350 correction_one_direction& in_corr_z_);
351 void set_time(double time, double time_step, int time_iteration);
352 void set_vitesse_relative(int direction, double vitesse_relative);
353 void set_rho_liquide(double rho_liquide);
354 void set_rho_moyen_alpha_l(double rho_moyen, double alpha_l);
355 void set_rho_vel_moyen(int direction, double rho_vel_moyen);
356 void set_mean_values_for_corrections(double rho_vel_moyen, double rho_moyen, double alpha_l);
358 void compute_correct_velocity_one_direction(int dir, double vel_ijk_t);
359 Vecteur3 get_correct_velocities(); // u - v_corr
360 Vecteur3 get_velocity_corrections(); // mean(rho u) - qdm_cible / mean(rho)
361 Vecteur3 get_correction_values(); // qdm_cible
363 int get_need_for_vitesse_relative(int direction);
365
367 type_dict_ get_type_() const;
368
369 int is_type_gb() const;
370 int is_type_gr() const;
371 int is_type_none() const;
372
373 int write_me() const;
374protected :
375 int type_;
376 bool write_me_ = false;
380};
381
382#endif /* corrections_qdm_included */
383
384/////////////////////////////////////////////////////////////////////////////////////////
385// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ////////////////////////////////
386/////////////////////////////////////////////////////////////////////////////////////////
Objet_U()
Constructeur par defaut : attribue un numero d'identifiant unique a l'objet (object_id_),...
Definition Objet_U.cpp:55
: class cible_donnee
double get_v_cible()
void compute_qdm_cible(double alpha_l)
void set_rho_l(double rho_liq)
int get_need_for_vl_vv()
int get_need_for_rho_l()
double get_qdm_cible()
: class consigne_initiale
void compute_qdm_cible(double qdm_initiale)
void set_time(int time_iteration)
: class correction_one_direction
moyenne_glissante parametres_moyenne_glissante_
void set_rho_vel_moyen_for_correction(double rho_vel_moyen)
void set_vl_vv(double vl_vv)
type_correction get_type_corr() const
moyenne_glissante get_moyenne_glissante() const
cible_donnee get_cible_constante() const
moyenne_par_morceaux get_moyenne_par_morceaux() const
consigne_initiale get_consigne_initiale() const
void set_mean_values_for_correction(double rho_vel_moyen, double rho_moyen, double alpha_l)
moyenne_par_morceaux parametres_moyenne_par_morceaux_
void set_rho_liq(double rho_liquide)
consigne_initiale parametres_consigne_initiale_
cible_donnee parametres_cible_constante_
void set_rho_moyen_alpha_l_for_correction(double rho_moyen, double alpha_l)
void compute_correct_velocity(double vel_ijk_t)
void set_correction(correction_one_direction &correction_in)
void set_time_for_correction(double time, double time_step, int time_iteration)
Vecteur3 get_velocity_corrections()
double get_correct_velocitiy_one_direction(int dir)
void set_rho_liquide(double rho_liquide)
int get_need_for_vitesse_relative(int direction)
void set_mean_values_for_corrections(double rho_vel_moyen, double rho_moyen, double alpha_l)
correction_one_direction correction_z_
type_dict_ get_type_() const
int get_need_to_compute_correction_value_one_direction(int direction)
void set_rho_moyen_alpha_l(double rho_moyen, double alpha_l)
void set_corrections(correction_one_direction &in_corr_x_, correction_one_direction &in_corr_y_, correction_one_direction &in_corr_z_)
void compute_correction_value_one_direction(int dir)
Vecteur3 get_correct_velocities()
void set_rho_vel_moyen(int direction, double rho_vel_moyen)
correction_one_direction correction_y_
Vecteur3 get_correction_values()
correction_one_direction correction_x_
void set_vitesse_relative(int direction, double vitesse_relative)
void compute_correct_velocity_one_direction(int dir, double vel_ijk_t)
void set_time(double time, double time_step, int time_iteration)
int is_type_none() const
: class moyenne_glissante
void compute_qdm_cible(double alpha_liq)
void set_time(double time, double time_step, int time_iteration)
double compute_v_cible()
ArrOfDouble liste_instants_
double duree_effective_morceau_glissant_
void set_rho_l(double rho_liq)
ArrOfDouble liste_v_cible_
double duree_demandee_morceau_glissant_
ArrOfDouble liste_v_cible_dl_
: class moyenne_par_morceaux
void set_rho_l(double rho_liq)
void compute_qdm_cible(double alpha_l, double vitesse_relative)
void set_time(double time, double time_step, int time_iteration)