TrioCFD 1.9.9_beta
TrioCFD documentation
Loading...
Searching...
No Matches
Op_Conv_EF_Stab_PolyMAC_HFV_Elem.cpp
1/****************************************************************************
2* Copyright (c) 2026, 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 <Op_Conv_EF_Stab_PolyMAC_HFV_Elem.h>
17#include <Champ_Elem_PolyMAC_HFV.h>
18#include <Champ_Face_PolyMAC_HFV.h>
19#include <Masse_PolyMAC_HFV_Elem.h>
20#include <Convection_Diffusion_std.h>
21#include <Discretisation_base.h>
22#include <Dirichlet_homogene.h>
23#include <Domaine_Cl_PolyMAC_family.h>
24#include <Schema_Temps_base.h>
25#include <Domaine_Poly_base.h>
26#include <Option_PolyMAC_family.h>
27#include <Pb_Multiphase.h>
28#include <Probleme_base.h>
29#include <Matrix_tools.h>
30#include <Milieu_base.h>
31#include <Array_tools.h>
32#include <TRUSTLists.h>
33#include <Dirichlet.h>
34#include <Symetrie.h>
35#include <Param.h>
36#include <cfloat>
37#include <vector>
38#include <cmath>
39
40Implemente_instanciable(Op_Conv_EF_Stab_PolyMAC_HFV_Elem, "Op_Conv_EF_Stab_PolyMAC_HFV_Elem|Op_Conv_EF_Stab_PolyMAC_MPFA_Elem", Op_Conv_PolyMAC_CDO_base);
41Implemente_instanciable_sans_constructeur(Op_Conv_Amont_PolyMAC_HFV_Elem, "Op_Conv_Amont_PolyMAC_HFV_Elem|Op_Conv_Amont_PolyMAC_MPFA_Elem", Op_Conv_EF_Stab_PolyMAC_HFV_Elem);
42Implemente_instanciable_sans_constructeur(Op_Conv_Centre_PolyMAC_HFV_Elem, "Op_Conv_Centre_PolyMAC_HFV_Elem|Op_Conv_Centre_PolyMAC_MPFA_Elem", Op_Conv_EF_Stab_PolyMAC_HFV_Elem);
43// XD Op_Conv_EF_Stab_PolyMAC_HFV_Elem interprete Op_Conv_EF_Stab_PolyMAC_HFV_Elem BRACE Class
44// XD_CONT Op_Conv_EF_Stab_PolyMAC_HFV_Elem
45
46Op_Conv_Amont_PolyMAC_HFV_Elem::Op_Conv_Amont_PolyMAC_HFV_Elem() { alpha_ = 1.0; }
47Op_Conv_Centre_PolyMAC_HFV_Elem::Op_Conv_Centre_PolyMAC_HFV_Elem() { alpha_ = 0.0; }
48
52
55
57{
59 if (que_suis_je().debute_par("Op_Conv_EF_Stab") or que_suis_je().debute_par("Op_Conv_ALE")) //not in Op_Conv_Amont/Centre
60 {
61 Param param(que_suis_je());
62 param.ajouter("alpha", &alpha_); // XD_ADD_P double
63 // XD_CONT parameter adjusting stabilization from 0 (centered scheme) to 1 (upwind scheme)
64 param.lire_avec_accolades_depuis(is);
65 }
66
67 if (sub_type(Masse_Multiphase, equation())) //convection in Masse_Multiphase -> mass flow / title fields
68 {
69 const Pb_Multiphase& pb = ref_cast(Pb_Multiphase, equation().probleme());
70 noms_cc_phases_.dimensionner(pb.nb_phases());
71 cc_phases_.resize(pb.nb_phases());
72
73 noms_vd_phases_.dimensionner(pb.nb_phases());
74 vd_phases_.resize(pb.nb_phases());
75
76 noms_x_phases_.dimensionner(pb.nb_phases());
77 x_phases_.resize(pb.nb_phases());
78
79 for (int i = 0; i < pb.nb_phases(); i++)
80 {
81 noms_cc_phases_[i] = Nom("debit_") + pb.nom_phase(i);
82 noms_vd_phases_[i] = Nom("vitesse_debitante_") + pb.nom_phase(i);
83 noms_x_phases_[i] = Nom("titre_") + pb.nom_phase(i);
84 }
85 }
86 return is;
87}
88
90{
92
93 /* just in case... */
94 const Domaine_Poly_base& domaine = le_dom_poly_.valeur();
96 flux_bords_.resize(domaine.premiere_face_int(), (le_champ_inco ? le_champ_inco->valeurs() : equation().inconnue().valeurs()).line_size());
97
98 if (domaine.domaine().nb_joints() && domaine.domaine().joint(0).epaisseur() < 2)
99 {
100 Cerr << "Op_Conv_EF_Stab_PolyMAC_HFV_Elem : largeur de joint insuffisante (minimum 2)!" << finl;
102 }
103}
104
106{
107 const DoubleTab& vit = vitesse_->valeurs();
108 return calculer_dt_stab_gen(vit);
109}
110
112{
113 const Domaine_Poly_base& domaine = le_dom_poly_.valeur();
114 const DoubleVect& fs = domaine.face_surfaces(), &pf = equation().milieu().porosite_face(),
115 &ve = domaine.volumes(), &pe = equation().milieu().porosite_elem();
116 const DoubleTab* alp = sub_type(Pb_Multiphase, equation().probleme()) ?
117 &ref_cast(Pb_Multiphase, equation().probleme()).equation_masse().inconnue().passe() : nullptr;
118
119 const IntTab& e_f = domaine.elem_faces(), &f_e = domaine.face_voisins(), &fcl = ref_cast(Champ_Elem_PolyMAC_CDO, equation().inconnue()).fcl();
120 const int N = std::min(vit.line_size(), equation().inconnue().valeurs().line_size());
121
122 DoubleTrav flux(N); //sum of fluxes pf * |f| * vf
123 double dt = 1.e10;
124
125 for (int e = 0; e < domaine.nb_elem(); e++)
126 {
127 flux = 0.;
128 const double poro_vol = pe(e) * ve(e);
129 for (int i = 0; i < e_f.dimension(1); i++)
130 {
131 const int f = e_f(e, i);
132 if (f < 0) continue;
133
134 if (!Option_PolyMAC_family::TRAITEMENT_AXI || (Option_PolyMAC_family::TRAITEMENT_AXI && !(fcl(f, 0) == 4 || fcl(f, 0) == 5)))
135 for (int n = 0; n < N; n++)
136 {
137 const int idx_phase = idx_phase_transportante_ > -1 ? idx_phase_transportante_ : n;
138 flux(n) += pf(f) * fs(f) * std::max((e == f_e(f, 1) ? 1 : -1) * vit(f, idx_phase), 0.); //only the flux entering e counts
139 }
140 }
141
142 for (int n = 0; n < N; n++)
143 if ((!alp || (*alp)(e, n) > 1e-3) && std::abs(flux(n)) > 1e-12 /* avoid values 'very close to 0 but not completely zero' */)
144 dt = std::min(dt, poro_vol / flux(n));
145 }
146
147 return Process::mp_min(dt);
148}
149
150void Op_Conv_EF_Stab_PolyMAC_HFV_Elem::dimensionner_blocs(matrices_t mats, const tabs_t& semi_impl) const
151{
152 const Domaine_Poly_base& domaine = le_dom_poly_.valeur();
153 const Champ_Inc_base& cc = equation().champ_convecte();
154
155 const IntTab& f_e = domaine.face_voisins(), &fcl_v = ref_cast(Champ_Face_base, vitesse_.valeur()).fcl();
156 const int N = equation().inconnue().valeurs().line_size();
157
158 for (const auto &i_m : mats)
159 {
160 // Check conditions on "vitesse" or semi-implicit derivatives
161 if (i_m.first == "vitesse" || (cc.derivees().count(i_m.first) && !semi_impl.count(cc.le_nom().getString())))
162 {
163 Matrice_Morse mat;
164 Stencil stencil(0, 2);
165
166 int M = equation().probleme().get_champ(i_m.first.c_str()).valeurs().line_size();
167
168 if (i_m.first == "vitesse")
169 {
170 // Specific treatment for "vitesse"
171 for (int f = 0; f < domaine.nb_faces_tot(); f++)
172 if (fcl_v(f, 0) < 2) // boundary condition but not Dirichlet, or internal face
173 for (int i = 0; i < 2; i++)
174 {
175 int e = f_e(f, i);
176 if (e < 0) continue;
177
178 if (e < domaine.nb_elem())
179 for (int n = 0; n < N; n++)
180 {
181 const int idx_phase = idx_phase_transportante_ > -1 ? idx_phase_transportante_ : n * (M > 1);
182 stencil.append_line(N * e + n, M * f + idx_phase);
183 }
184 }
185 }
186 else
187 {
188 // Treatment for scalar unknowns
189 for (int f = 0; f < domaine.nb_faces_tot(); f++)
190 for (int i = 0; i < 2; i++)
191 {
192 int e = f_e(f, i);
193 if (e < 0) continue;
194
195 if (e < domaine.nb_elem())
196 for (int j = 0; j < 2; j++)
197 {
198 int eb = f_e(f, j);
199 if (eb < 0) continue;
200
201 int m = 0;
202 for (int n = 0; n < N; n++, m += (M > 1))
203 stencil.append_line(N * e + n, M * eb + m);
204 }
205 }
206 }
207
208 // Remove duplicates and allocate the matrix
209 tableau_trier_retirer_doublons(stencil);
210 Matrix_tools::allocate_morse_matrix(equation().inconnue().valeurs().size_totale(),
211 (i_m.first == "vitesse" ? vitesse_->valeurs().size_totale() : cc.derivees().at(i_m.first).size_totale()),
212 stencil, mat);
213
214 // Update the matrix in the collection
215 if (i_m.second->nb_colonnes())
216 *i_m.second += mat;
217 else
218 *i_m.second = mat;
219 }
220 }
221}
222
223void Op_Conv_EF_Stab_PolyMAC_HFV_Elem::ajouter_blocs(matrices_t mats, DoubleTab& secmem, const tabs_t& semi_impl) const
224{
225 const DoubleTab& vit = vitesse_->valeurs();
226 ajouter_blocs_gen(mats, secmem, vit, semi_impl);
227}
228
229// adds the convection contribution to the right-hand side resu
230// returns resu
231void Op_Conv_EF_Stab_PolyMAC_HFV_Elem::ajouter_blocs_gen(matrices_t mats, DoubleTab& secmem, const DoubleTab& vit, const tabs_t& semi_impl) const
232{
233 const Domaine_Poly_base& domaine = le_dom_poly_.valeur();
234 const Champ_Inc_base& cc = le_champ_inco ? le_champ_inco.valeur() : equation().champ_convecte();
235 const std::string& nom_cc = cc.le_nom().getString();
236 Matrice_Morse *m_vit = mats.count("vitesse") ? mats.at("vitesse") : nullptr;
237
238 const IntTab& f_e = domaine.face_voisins(),
239 &fcl = ref_cast(Champ_Inc_P0_base, equation().inconnue()).fcl(),
240 &fcl_v = ref_cast(Champ_Face_base, vitesse_.valeur()).fcl();
241
242 const DoubleVect& fs = domaine.face_surfaces(), &pf = equation().milieu().porosite_face();
243 const DoubleTab& vcc = semi_impl.count(nom_cc) ? semi_impl.at(nom_cc) : cc.valeurs(), bcc = cc.valeur_aux_bords();
244 const int N = vcc.line_size(), Mv = vit.line_size();
245
246 std::vector<std::tuple<const DoubleTab*, Matrice_Morse*, int>> d_cc; //list of cc derivatives to fill: pairs (cc derivative, matrix, number of variable components)
247
248 if (!semi_impl.count(nom_cc))
249 for (auto &i_m : mats)
250 if (cc.derivees().count(i_m.first))
251 d_cc.push_back(std::make_tuple(&cc.derivees().at(i_m.first), i_m.second, equation().probleme().get_champ(i_m.first.c_str()).valeurs().line_size()));
252
253 DoubleTrav dv_flux(N), dc_flux(2, N); //derivatives of the convective flux at the face with respect to velocity / upwind / downwind convected field
254
255 // Convection at internal faces, Neumann_val_ext or Dirichlet
256 for (int f = 0; f < domaine.nb_faces(); f++)
257 {
258 const bool traiter_face = (fcl(f, 0) == 0 || (fcl(f, 0) > 4 && fcl(f, 0) < 7));
259 if (traiter_face)
260 {
261 dv_flux = 0.;
262 dc_flux = 0.;
263
264 // Compute dv_flux and dc_flux
265 for (int i = 0; i < 2; i++)
266 {
267 int e = f_e(f, i);
268 int m = 0;
269
270 for (int n = 0; n < N; n++, m += (Mv > 1))
271 {
272 const int idx_phase = idx_phase_transportante_ > -1 ? idx_phase_transportante_ : m;
273 const double vit_f = vit(f, idx_phase);
274 const double v = vit_f ? vit_f : DBL_MIN;
275 const double fac = pf(f) * fs(f) * (1. + (v * (i ? -1 : 1) > 0 ? 1. : -1) * alpha_) / 2;
276
277 dv_flux(n) += fac * (e >= 0 ? vcc(e, n) : bcc(f, n)); // f is real -> trivial index in bcc
278 dc_flux(i, n) = e >= 0 ? fac * vit_f : 0;
279 }
280 }
281
282 // Update the right-hand side
283 for (int i = 0; i < 2; i++)
284 {
285 int e = f_e(f, i);
286 if (e < 0) continue;
287
288 if (e < domaine.nb_elem())
289 {
290 int m = 0;
291 for (int n = 0; n < N; n++, m += (Mv > 1))
292 {
293 const int idx_phase = idx_phase_transportante_ > -1 ? idx_phase_transportante_ : m;
294 secmem(e, n) -= (i ? -1 : 1) * dv_flux(n) * vit(f, idx_phase);
295 }
296 }
297 }
298
299 // Update derivatives: velocity
300 if (m_vit && fcl_v(f, 0) < 2)
301 for (int i = 0; i < 2; i++)
302 {
303 int e = f_e(f, i);
304 if (e < 0) continue;
305
306 if (e < domaine.nb_elem())
307 {
308 int m = 0;
309 for (int n = 0; n < N; n++, m += (Mv > 1))
310 {
311 const int idx_phase = idx_phase_transportante_ > -1 ? idx_phase_transportante_ : m;
312 (*m_vit)(N * e + n, Mv * f + idx_phase) += (i ? -1 : 1) * dv_flux(n);
313 }
314 }
315 }
316
317 // Update derivatives: convected field
318 for (auto &&d_m_i : d_cc)
319 {
320 int M = std::get<2>(d_m_i);
321 for (int i = 0; i < 2; i++)
322 {
323 int e = f_e(f, i);
324 if (e < 0) continue;
325
326 if (e < domaine.nb_elem())
327 for (int j = 0; j < 2; j++)
328 {
329 int eb = f_e(f, j);
330 if (eb < 0) continue;
331
332 int m = 0;
333 for (int n = 0; n < N; n++, m += (M > 1))
334 (*std::get<1>(d_m_i))(N * e + n, M * eb + m) += (i ? -1 : 1) * dc_flux(j, n) * (*std::get<0>(d_m_i))(eb, m);
335 }
336 }
337 }
338 }
339 }
340}
341
343{
345 Noms noms_compris;
346
347 if (sub_type(Masse_Multiphase, equation()))
348 {
349 const Pb_Multiphase& pb = ref_cast(Pb_Multiphase, equation().probleme());
350
351 for (int i = 0; i < pb.nb_phases(); i++)
352 {
353 noms_compris.add(noms_cc_phases_[i]);
354 noms_compris.add(noms_vd_phases_[i]);
355 noms_compris.add(noms_x_phases_[i]);
356 }
357 }
358 if (opt == DESCRIPTION)
359 Cerr << " Op_Conv_EF_Stab_PolyMAC_HFV_Elem : " << noms_compris << finl;
360 else
361 nom.add(noms_compris);
362}
363
365{
367
368 const int i = noms_cc_phases_.rang(motlu), j = noms_vd_phases_.rang(motlu), k = noms_x_phases_.rang(motlu);
369
370 if (i >= 0 && !cc_phases_[i])
371 {
372 equation().discretisation().discretiser_champ("vitesse", equation().domaine_dis(), noms_cc_phases_[i], "kg/m2/s", dimension, 1, 0, cc_phases_[i]);
373 champs_compris_.ajoute_champ(cc_phases_[i]);
374 }
375
376 if (j >= 0 && !vd_phases_[j])
377 {
378 equation().discretisation().discretiser_champ("vitesse", equation().domaine_dis(), noms_vd_phases_[j], "m/s", dimension, 1, 0, vd_phases_[j]);
379 champs_compris_.ajoute_champ(vd_phases_[j]);
380 }
381
382 if (k >= 0 && !x_phases_[k])
383 {
384 equation().discretisation().discretiser_champ("temperature", equation().domaine_dis(), noms_x_phases_[k], "m/s", 1, 1, 0, x_phases_[k]);
385 champs_compris_.ajoute_champ(x_phases_[k]);
386 }
387}
388
390{
391 const DoubleTab& vit = vitesse_->valeurs();
392 mettre_a_jour_gen(temps, vit);
393}
394
395void Op_Conv_EF_Stab_PolyMAC_HFV_Elem::mettre_a_jour_gen(double temps, const DoubleTab& vit)
396{
398
399 const Domaine_Poly_base& domaine = le_dom_poly_.valeur();
400 const Champ_Inc_base& cc = le_champ_inco ? le_champ_inco.valeur() : equation().champ_convecte();
401
402 const IntTab& f_e = domaine.face_voisins(), &e_f = domaine.elem_faces();
403
404 const DoubleVect& pf = equation().milieu().porosite_face(), &pe = equation().milieu().porosite_elem(),
405 &fs = domaine.face_surfaces(), &ve = domaine.volumes();
406
407 const DoubleTab& vcc = cc.valeurs(),
408 &bcc = cc.valeur_aux_bords(), &xv = domaine.xv(), &xp = domaine.xp();
409
410 DoubleTrav balp;
411
412 if (vd_phases_.size())
414
415 const int D = dimension, N = vcc.line_size(), M = vit.line_size();
416 DoubleTrav cc_f(N); //value of the convected field at faces
417
418 /* boundary fluxes */
419 for (int f = 0; f < domaine.premiere_face_int(); f++)
420 {
421 cc_f = 0.;
422 for (int i = 0; i < 2; i++)
423 {
424 int e = f_e(f, i);
425 int m = 0;
426 for (int n = 0; n < N; n++, m += (M > 1))
427 {
428 const int idx_phase = idx_phase_transportante_ > -1 ? idx_phase_transportante_ : m;
429 cc_f(n) += (1. + (vit(f, idx_phase) * (i ? -1 : 1) >= 0 ? 1. : -1.) * alpha_) / 2 * (e >= 0 ? vcc(e, n) : bcc(f, n));
430 }
431 }
432
433 int m = 0;
434 for (int n = 0; n < N; n++, m += (M > 1))
435 {
436 const int idx_phase = idx_phase_transportante_ > -1 ? idx_phase_transportante_ : m;
437 flux_bords_(f, n) = pf(f) * fs(f) * vit(f, idx_phase) * cc_f(n);
438 }
439 }
440
441 if (cc_phases_.size())
442 {
443 int m = 0;
444 for (int n = 0; n < N; n++, m += (M > 1))
445 if (cc_phases_[n]) /* update flow rate fields */
446 {
447 Champ_Face_PolyMAC_HFV& c_ph = ref_cast(Champ_Face_PolyMAC_HFV, cc_phases_[n].valeur());
448 DoubleTab& v_ph = c_ph.valeurs();
449
450 for (int f = 0; f < domaine.nb_faces(); f++)
451 {
452 v_ph(f) = 0.;
453 const int idx_phase = idx_phase_transportante_ > -1 ? idx_phase_transportante_ : m;
454 if (m != idx_phase) continue;
455 for (int i = 0; i < 2; i++)
456 {
457 int e = f_e(f, i);
458 double signe = (vit(f, m) * (i ? -1 : 1) >= 0) ? 1. : -1.;
459 double facteur = (1. + signe * alpha_) / 2.;
460
461 v_ph(f) += facteur * (e >= 0 ? vcc(e, n) : bcc(f, n));
462 }
463
464 v_ph(f) *= vit(f, m) * pf(f);
465 }
466
467 c_ph.changer_temps(temps);
468 }
469 }
470
471 if (vd_phases_.size())
472 {
473 int m = 0;
474 for (int n = 0; n < N; n++, m += (M > 1))
475 if (vd_phases_[n]) /* update superficial velocity fields */
476 {
477 const DoubleTab& alp = equation().inconnue().valeurs();
478 Champ_Face_PolyMAC_HFV& c_ph = ref_cast(Champ_Face_PolyMAC_HFV, vd_phases_[n].valeur());
479 DoubleTab& v_ph = c_ph.valeurs();
480
481 /* fill the face part, then ask the field to interpolate to elements */
482 for (int f = 0; f < domaine.nb_faces(); f++)
483 {
484 v_ph(f) = 0.;
485 const int idx_phase = idx_phase_transportante_ > -1 ? idx_phase_transportante_ : m;
486 if (m != idx_phase) continue;
487 for (int i = 0; i < 2; i++)
488 {
489 int e = f_e(f, i);
490 double signe = (vit(f, m) * (i ? -1 : 1) >= 0) ? 1. : -1.;
491 double facteur = (1. + signe * alpha_) / 2.;
492
493 v_ph(f) += facteur * (e >= 0 ? alp(e, n) : balp(f, n));
494
495 }
496 v_ph(f) *= vit(f, m) * pf(f);
497 }
498
499 c_ph.changer_temps(temps);
500 }
501 }
502
503 DoubleTrav G(N), v(N, D);
504 double Gt;
505
506 if (x_phases_.size())
507 for (int e = 0; e < domaine.nb_elem(); e++) // void fraction: at elements
508 {
509 v = 0.;
510 for (int i = 0; i < e_f.dimension(1); i++)
511 {
512 int f = e_f(e, i);
513 if (f < 0) continue;
514
515 for (int n = 0; n < N; n++)
516 for (int d = 0; d < D; d++)
517 v(n, d) += fs(f) * pf(f) * (xv(f, d) - xp(e, d)) * (e == f_e(f, 0) ? 1 : -1) * vit(f, n) / (pe(e) * ve(e));
518 }
519
520 Gt = 0.;
521 for (int n = 0; n < N; n++)
522 {
523 G(n) = vcc(e, n) * sqrt(domaine.dot(&v(n, 0), &v(n, 0)));
524 Gt += G(n);
525 }
526
527 for (int n = 0; n < N; n++)
528 if (x_phases_[n])
529 x_phases_[n]->valeurs()(e) = Gt ? G(n) / Gt : 0.;
530 }
531
532 if (x_phases_.size())
533 for (int n = 0; n < N; n++)
534 if (x_phases_[n])
535 x_phases_[n]->changer_temps(temps);
536}
: class Champ_Face_PolyMAC_HFV
: class Champ_Inc_P0_base
Class Champ_Inc_base.
double changer_temps(const double temps) override
Sets the time of the field.
DoubleTab & valeurs() override
Returns the array of field values at the current time.
const tabs_t & derivees() const
DoubleTab valeur_aux_bords() const override
Returns the field value at the boundary faces.
virtual DoubleTab & valeurs()=0
virtual void creer_champ(const Motcle &motlu)=0
virtual void get_noms_champs_postraitables(Noms &nom, Option opt=NONE) const =0
void discretiser_champ(const Motcle &directive, const Domaine_dis_base &z, const Nom &nom, const Nom &unite, int nb_comp, int nb_pas_dt, double temps, OWN_PTR(Champ_Inc_base)&champ, const Nom &sous_type=NOM_VIDE) const
class Domaine_Poly_base
virtual const DoubleVect & face_surfaces() const
Definition Domaine_VF.h:51
Class defining operators and methods for all reading operation in an input flow (file,...
Definition Entree.h:42
virtual const Milieu_base & milieu() const =0
const Discretisation_base & discretisation() const
Returns the discretization associated with the equation.
virtual const Champ_Inc_base & inconnue() const =0
Probleme_base & probleme()
Returns the problem associated with the equation.
virtual void init_champ_convecte() const
virtual Champ_Inc_base & champ_convecte() const
const Nom & le_nom() const override
Returns the name of the field.
Specialisation of Convection_Diffusion_std for multiphase flows where the transported scalar is the v...
Matrice_Morse class - Represents a (sparse) matrix M, not necessarily square,.
static void allocate_morse_matrix(const int nb_lines, const int nb_columns, const Stencil &stencil, Matrice_Morse &matrix, const bool &attach_stencil_to_matrix=false)
DoubleVect & porosite_elem()
Definition Milieu_base.h:58
DoubleVect & porosite_face()
Definition Milieu_base.h:62
const Equation_base & equation() const
Returns the reference to the equation pointed to by MorEqn::mon_equation.
Definition MorEqn.h:62
A character string (Nom) in uppercase.
Definition Motcle.h:26
const std::string & getString() const
Definition Nom.h:92
An array of character strings (VECT(Nom)).
Definition Noms.h:26
static int dimension
Definition Objet_U.h:94
const Nom & que_suis_je() const
Returns the string identifying the class.
Definition Objet_U.cpp:104
virtual Entree & readOn(Entree &)
Reads an Objet_U from an input stream. Virtual method to override.
Definition Objet_U.cpp:289
virtual Sortie & printOn(Sortie &) const
Writes the object to an output stream. Virtual method to override.
Definition Objet_U.cpp:278
: class Op_Conv_EF_Stab_PolyMAC_HFV_Elem
double calculer_dt_stab() const override
Computes dt_stab.
std::vector< OWN_PTR(Champ_Inc_base)> cc_phases_
void dimensionner_blocs(matrices_t matrices, const tabs_t &semi_impl={}) const override
void creer_champ(const Motcle &motlu) override
void get_noms_champs_postraitables(Noms &nom, Option opt=NONE) const override
void ajouter_blocs_gen(matrices_t mats, DoubleTab &secmem, const DoubleTab &vit, const tabs_t &semi_impl) const
std::vector< OWN_PTR(Champ_Inc_base)> x_phases_
void mettre_a_jour_gen(double temps, const DoubleTab &vit)
double calculer_dt_stab_gen(const DoubleTab &vit) const
void ajouter_blocs(matrices_t matrices, DoubleTab &secmem, const tabs_t &semi_impl={}) const override
void mettre_a_jour(double temps) override
DOES NOTHING - to override in derived classes.
std::vector< OWN_PTR(Champ_Inc_base)> vd_phases_
Champs_compris champs_compris_
DoubleTab flux_bords_
virtual void mettre_a_jour(double temps)
DOES NOTHING - to override in derived classes.
virtual void preparer_calcul()
const Champ_base & get_champ(const Motcle &nom) const override
Multiphase thermohydraulics problem of type "3*N equations":
const Nom & nom_phase(int i) const
int nb_phases() const
const Champ_base & get_champ(const Motcle &nom) const override
static double mp_min(double)
Definition Process.cpp:391
static void exit(int exit_code=-1)
Exit routine for TRUST within a Kokkos region.
Definition Process.cpp:466
Base class for output streams.
Definition Sortie.h:52
void append_line(_TYPE_)
Definition TRUSTTab.tpp:213
_SIZE_ dimension(int d) const
Definition TRUSTTab.tpp:133
int line_size() const
Definition TRUSTVect.tpp:67