TrioCFD 1.9.9_beta
TrioCFD documentation
Loading...
Searching...
No Matches
Eval_centre_PolyMAC_CDO_Elem.h
1/****************************************************************************
2* Copyright (c) 2025, 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 Eval_centre_PolyMAC_CDO_Elem_included
17#define Eval_centre_PolyMAC_CDO_Elem_included
18
19#include <Eval_Conv_PolyMAC_CDO.h>
20#include <Eval_PolyMAC_CDO_Elem.h>
21#include <Domaine_PolyMAC_CDO.h>
22#include <Champ_Elem_PolyMAC_CDO.h>
23
24/*! @brief class Eval_centre_PolyMAC_CDO_Elem
25 *
26 * @brief PolyMAC_CDO evaluator for convection with a scalar convected field (Champ_Elem_PolyMAC_CDO),
27 * using a centered convection scheme.
28 * Note: convective flux evaluators actually compute the convective term that appears on the
29 * right-hand side of the evolution equation, i.e., the opposite of the convective flux.
30 *
31 */
33{
34
35public:
36
38
39 inline int calculer_flux_faces_echange_externe_impose() const override { return 0; }
40 inline int calculer_flux_faces_echange_global_impose() const override { return 0; }
41 inline int calculer_flux_faces_entree_fluide() const override { return 1; }
42 inline int calculer_flux_faces_paroi() const override { return 0; }
43 inline int calculer_flux_faces_paroi_adiabatique() const override { return 0; }
44 inline int calculer_flux_faces_paroi_defilante() const override { return 0; }
45 inline int calculer_flux_faces_paroi_fixe() const override { return 0; }
46 inline int calculer_flux_faces_sortie_libre() const override { return 1; }
47 inline int calculer_flux_faces_symetrie() const override { return 0; }
48 inline int calculer_flux_faces_periodique() const override { return 1; }
49
50 // Functions that compute the flux of scalar quantities
51 // They return a double and return the flux
52
53 inline double flux_face(const DoubleTab&, int, const Dirichlet_entree_fluide&, int) const override;
54 inline double flux_face(const DoubleTab&, int, const Dirichlet_paroi_defilante&, int) const override { return 0; }
55 inline double flux_face(const DoubleTab&, int, const Dirichlet_paroi_fixe&, int) const override { return 0; }
56 inline double flux_face(const DoubleTab&, int, int, int, const Echange_externe_impose&, int) const override { return 0; }
57 inline double flux_face(const DoubleTab&, int, const Echange_global_impose&, int) const override { return 0; }
58 inline double flux_face(const DoubleTab&, int, const Neumann_paroi&, int) const override { return 0; }
59 inline double flux_face(const DoubleTab&, int, const Neumann_paroi_adiabatique&, int) const override { return 0; }
60 inline double flux_face(const DoubleTab&, int, const Neumann_sortie_libre&, int) const override;
61 inline double flux_face(const DoubleTab&, int, const Symetrie&, int) const override { return 0; }
62 inline double flux_face(const DoubleTab&, int, const Periodique&, int) const override;
63 inline double flux_faces_interne(const DoubleTab&, int) const override;
64
65 // Functions that compute the flux of vector quantities
66 // They are void and fill the flux array
67
68 inline void flux_face(const DoubleTab&, int, const Symetrie&, int, DoubleVect& flux) const override { }
69 inline void flux_face(const DoubleTab&, int, const Periodique&, int, DoubleVect& flux) const override;
70 inline void flux_face(const DoubleTab&, int, const Neumann_sortie_libre&, int, DoubleVect& flux) const override;
71 inline void flux_face(const DoubleTab&, int, const Dirichlet_entree_fluide&, int, DoubleVect& flux) const override;
72 inline void flux_face(const DoubleTab&, int, const Dirichlet_paroi_fixe&, int, DoubleVect& flux) const override { }
73 inline void flux_face(const DoubleTab&, int, const Dirichlet_paroi_defilante&, int, DoubleVect& flux) const override { }
74 inline void flux_face(const DoubleTab&, int, const Neumann_paroi_adiabatique&, int, DoubleVect& flux) const override { }
75 inline void flux_face(const DoubleTab&, int, const Neumann_paroi&, int, DoubleVect& flux) const override { }
76 inline void flux_face(const DoubleTab&, int, int, int, const Echange_externe_impose&, int, DoubleVect& flux) const override { }
77 inline void flux_face(const DoubleTab&, int, const Echange_global_impose&, int, DoubleVect& flux) const override { }
78
79 inline void flux_faces_interne(const DoubleTab&, int, DoubleVect& flux) const override;
80
81 // Functions that compute the matrix coefficients for scalar quantities.
82
83 inline void coeffs_face(int, int, const Symetrie&, double& aii, double& ajj) const override { }
84 inline void coeffs_face(int, int, const Neumann_sortie_libre&, double& aii, double& ajj) const override;
85 inline void coeffs_face(int, int, const Dirichlet_entree_fluide&, double& aii, double& ajj) const override;
86 inline void coeffs_face(int, int, const Dirichlet_paroi_fixe&, double& aii, double& ajj) const override { }
87 inline void coeffs_face(int, int, const Dirichlet_paroi_defilante&, double& aii, double& ajj) const override { }
88 inline void coeffs_face(int, int, const Neumann_paroi_adiabatique&, double& aii, double& ajj) const override { }
89 inline void coeffs_face(int, int, const Neumann_paroi&, double& aii, double& ajj) const override { }
90 inline void coeffs_face(int, int, int, int, const Echange_externe_impose&, double& aii, double& ajj) const override { }
91 inline void coeffs_face(int, int, const Echange_global_impose&, double& aii, double& ajj) const override { }
92 inline void coeffs_face(int, int, const Periodique&, double& aii, double& ajj) const override;
93 inline void coeffs_faces_interne(int, double& aii, double& ajj) const override;
94
95 // Functions that compute the boundary condition contribution
96 // to the right-hand side for implicit scalar quantities.
97
98 inline double secmem_face(int, const Symetrie&, int) const override { return 0; }
99 inline double secmem_face(int, const Neumann_sortie_libre&, int) const override;
100 inline double secmem_face(int, const Dirichlet_entree_fluide&, int) const override;
101 inline double secmem_face(int, const Dirichlet_paroi_fixe&, int) const override { return 0; }
102 inline double secmem_face(int, const Dirichlet_paroi_defilante&, int) const override { return 0; }
103 inline double secmem_face(int, const Neumann_paroi_adiabatique&, int) const override { return 0; }
104 inline double secmem_face(int, const Neumann_paroi&, int) const override { return 0; }
105 inline double secmem_face(int, int, int, const Echange_externe_impose&, int) const override { return 0; }
106 inline double secmem_face(int, const Echange_global_impose&, int) const override { return 0; }
107 inline double secmem_face(int, const Periodique&, int) const override { return 0; }
108 inline double secmem_faces_interne(int) const override { return 0; }
109
110 // Functions that compute the matrix coefficients for vector quantities.
111
112 inline void coeffs_face(int, int, const Symetrie&, DoubleVect& aii, DoubleVect& ajj) const override { }
113 inline void coeffs_face(int, int, const Neumann_sortie_libre&, DoubleVect& aii, DoubleVect& ajj) const override;
114 inline void coeffs_face(int, int, const Dirichlet_entree_fluide&, DoubleVect& aii, DoubleVect& ajj) const override;
115 inline void coeffs_face(int, int, const Dirichlet_paroi_fixe&, DoubleVect& aii, DoubleVect& ajj) const override { }
116 inline void coeffs_face(int, int, const Dirichlet_paroi_defilante&, DoubleVect& aii, DoubleVect& ajj) const override { }
117 inline void coeffs_face(int, int, const Neumann_paroi_adiabatique&, DoubleVect& aii, DoubleVect& ajj) const override { }
118 inline void coeffs_face(int, int, const Neumann_paroi&, DoubleVect& aii, DoubleVect& ajj) const override { }
119 inline void coeffs_face(int, int, int, int, const Echange_externe_impose&, DoubleVect& aii, DoubleVect& ajj) const override { }
120 inline void coeffs_face(int, int, const Echange_global_impose&, DoubleVect& aii, DoubleVect& ajj) const override { }
121 inline void coeffs_face(int, int, const Periodique&, DoubleVect& aii, DoubleVect& ajj) const override;
122
123 inline void coeffs_faces_interne(int, DoubleVect& aii, DoubleVect& ajj) const override;
124
125 // Functions that compute the boundary condition contribution
126 // to the right-hand side for implicit vector quantities.
127
128 inline void secmem_face(int, const Symetrie&, int, DoubleVect&) const override { }
129 inline void secmem_face(int, const Neumann_sortie_libre&, int, DoubleVect&) const override;
130 inline void secmem_face(int, const Dirichlet_entree_fluide&, int, DoubleVect&) const override;
131 inline void secmem_face(int, const Dirichlet_paroi_fixe&, int, DoubleVect&) const override { }
132 inline void secmem_face(int, const Dirichlet_paroi_defilante&, int, DoubleVect&) const override { }
133 inline void secmem_face(int, const Neumann_paroi_adiabatique&, int, DoubleVect&) const override { }
134 inline void secmem_face(int, const Neumann_paroi&, int, DoubleVect&) const override { }
135 inline void secmem_face(int, int, int, const Echange_externe_impose&, int, DoubleVect&) const override { }
136 inline void secmem_face(int, const Echange_global_impose&, int, DoubleVect&) const override { }
137 inline void secmem_face(int, const Periodique&, int, DoubleVect&) const override { }
138 inline void secmem_faces_interne(int, DoubleVect&) const override { }
139
140protected:
141
142 inline int amont_amont(int, int) const;
143 inline double qcentre(const double, const int, const int, const int, const int, const int, const DoubleTab&) const;
144 inline void qcentre(const double, const int, const int, const int, const int, const int, const DoubleTab&, ArrOfDouble&) const;
145
146};
147
148inline double Eval_centre_PolyMAC_CDO_Elem::flux_face(const DoubleTab& inco, int face, const Dirichlet_entree_fluide& la_cl, int num1) const
149{
150 int n0 = elem_(face, 0);
151 int n1 = elem_(face, 1);
152 double flux;
153 double psc = dt_vitesse[face] * surface(face) * porosite(face);
154 double T_imp = la_cl.val_imp(face - num1);
155 if (n0 != -1)
156 {
157 if (psc > 0)
158 flux = psc * inco[n0];
159 else
160 flux = psc * T_imp;
161 }
162 else // n1 != -1
163 {
164 if (psc > 0)
165 flux = psc * T_imp;
166 else
167 flux = psc * inco[n1];
168 }
169 return -flux;
170}
171
172inline void Eval_centre_PolyMAC_CDO_Elem::coeffs_face(int face, int num1, const Dirichlet_entree_fluide& la_cl, double& aii, double& ajj) const
173{
174 int i = elem_(face, 0);
175 double psc = dt_vitesse[face] * surface[face] * porosite[face];
176
177 if (i != -1)
178 {
179 if (psc > 0)
180 aii = -psc;
181 }
182 else // j != -1
183 {
184 if (psc < 0)
185 ajj = -psc;
186 }
187}
188
189inline double Eval_centre_PolyMAC_CDO_Elem::secmem_face(int face, const Dirichlet_entree_fluide& la_cl, int num1) const
190{
191 int i = elem_(face, 0);
192 double psc = dt_vitesse[face] * surface[face] * porosite[face];
193 double flux = 0;
194 double T_imp = la_cl.val_imp(face - num1);
195 if (i != -1)
196 {
197 if (psc < 0)
198 flux = psc * T_imp;
199 }
200 else // j != -1
201 {
202 if (psc > 0)
203 flux = psc * T_imp;
204 }
205 return -flux;
206}
207
208inline double Eval_centre_PolyMAC_CDO_Elem::flux_face(const DoubleTab& inco, int face, const Neumann_sortie_libre& la_cl, int num1) const
209{
210 int n0 = elem_(face, 0);
211 int n1 = elem_(face, 1);
212 double flux;
213 double psc = dt_vitesse[face] * surface(face) * porosite(face);
214 if (n0 != -1)
215 {
216 if (psc > 0)
217 flux = psc * inco[n0];
218 else
219 flux = psc * la_cl.val_ext(face - num1);
220 }
221 else // n1 != -1
222 {
223 if (psc > 0)
224 flux = psc * la_cl.val_ext(face - num1);
225 else
226 flux = psc * inco[n1];
227 }
228 return -flux;
229}
230
231inline void Eval_centre_PolyMAC_CDO_Elem::coeffs_face(int face, int num1, const Neumann_sortie_libre& la_cl, double& aii, double& ajj) const
232{
233 int i = elem_(face, 0);
234 double psc = dt_vitesse[face] * surface(face) * porosite(face);
235 if (i != -1)
236 {
237 if (psc > 0)
238 aii = -psc;
239 }
240 else // n1 != -1
241 {
242 if (psc < 0)
243 ajj = -psc;
244 }
245}
246
247inline double Eval_centre_PolyMAC_CDO_Elem::secmem_face(int face, const Neumann_sortie_libre& la_cl, int num1) const
248{
249 double flux = 0;
250 int i = elem_(face, 0);
251 double psc = dt_vitesse[face] * surface(face) * porosite(face);
252 if (i != -1)
253 {
254 if (psc < 0)
255 flux = psc * la_cl.val_ext(face - num1);
256 }
257 else // j != -1
258 {
259 if (psc > 0)
260 flux = psc * la_cl.val_ext(face - num1);
261 }
262 return -flux;
263}
264
265inline double Eval_centre_PolyMAC_CDO_Elem::flux_face(const DoubleTab& inco, int face, const Periodique& la_cl, int) const
266{
267 // 30/05/2002 : Codage Periodicite.
268 // ALEX C.
269 double flux;
270 double psc = dt_vitesse[face] * surface(face) * porosite(face);
271 int n0 = elem_(face, 0);
272 int n1 = elem_(face, 1);
273 int n0_0 = amont_amont(face, 0);
274 int n1_1 = amont_amont(face, 1);
275
276 // apply the centered2 scheme
277 flux = qcentre(psc, n0, n1, n0_0, n1_1, face, inco);
278 return -flux;
279}
280
281inline void Eval_centre_PolyMAC_CDO_Elem::coeffs_face(int face, int, const Periodique& la_cl, double& aii, double& ajj) const
282{
283 // 30/05/2002 : Periodicity coding.
284 // // ALEX C.
285 int i = elem_(face, 0);
286 int j = elem_(face, 1);
287 int i0_0 = amont_amont(face, 0);
288 int j1_1 = amont_amont(face, 1);
289 double psc = dt_vitesse[face] * surface[face] * porosite[face];
290
291 // apply the centered scheme
292 if (psc > 0)
293 aii = -qcentre(psc, i, j, i0_0, j1_1, face, inconnue->valeurs());
294 else
295 ajj = -qcentre(psc, i, j, i0_0, j1_1, face, inconnue->valeurs());
296}
297
298inline double Eval_centre_PolyMAC_CDO_Elem::flux_faces_interne(const DoubleTab& inco, int face) const
299{
300 double flux;
301 double psc = dt_vitesse[face] * surface(face) * porosite(face);
302 int n0 = elem_(face, 0);
303 int n1 = elem_(face, 1);
304 int n0_0 = amont_amont(face, 0);
305 int n1_1 = amont_amont(face, 1);
306
307 flux = qcentre(psc, n0, n1, n0_0, n1_1, face, inco);
308 return -flux;
309}
310
311inline void Eval_centre_PolyMAC_CDO_Elem::coeffs_faces_interne(int face, double& aii, double& ajj) const
312{
313 int i = elem_(face, 0);
314 int j = elem_(face, 1);
315 int i0_0 = amont_amont(face, 0);
316 int j1_1 = amont_amont(face, 1);
317 double psc = dt_vitesse[face] * surface[face] * porosite[face];
318
319 if ((i0_0 == -1) || (j1_1 == -1)) // apply the upwind scheme
320 if (psc > 0)
321 aii = -psc;
322 else
323 ajj = -psc;
324
325 else // apply the centered scheme
326 if (psc > 0)
327 aii = -qcentre(psc, i, j, i0_0, j1_1, face, inconnue->valeurs());
328 else
329 ajj = -qcentre(psc, i, j, i0_0, j1_1, face, inconnue->valeurs());
330}
331
332inline void Eval_centre_PolyMAC_CDO_Elem::flux_face(const DoubleTab& inco, int face, const Dirichlet_entree_fluide& la_cl, int num1, DoubleVect& flux) const
333{
334 int k;
335 int n0 = elem_(face, 0);
336 int n1 = elem_(face, 1);
337 double psc = dt_vitesse(face) * surface(face) * porosite(face);
338
339 if (n0 != -1)
340 {
341 if (psc > 0)
342 for (k = 0; k < flux.size(); k++)
343 flux(k) = -psc * inco(n0, k);
344 else
345 for (k = 0; k < flux.size(); k++)
346 flux(k) = -psc * la_cl.val_imp(face - num1, k);
347 }
348 else // n1 != -1
349 {
350 if (psc > 0)
351 for (k = 0; k < flux.size(); k++)
352 flux(k) = -psc * la_cl.val_imp(face - num1, k);
353 else
354 for (k = 0; k < flux.size(); k++)
355 flux(k) = -psc * inco(n1, k);
356 }
357}
358
359inline void Eval_centre_PolyMAC_CDO_Elem::coeffs_face(int face, int num1, const Dirichlet_entree_fluide& la_cl, DoubleVect& aii, DoubleVect& ajj) const
360{
361 int k;
362 int i = elem_(face, 0);
363 double psc = dt_vitesse[face] * surface(face) * porosite(face);
364 if (i != -1)
365 {
366 if (psc > 0)
367 for (k = 0; k < aii.size(); k++)
368 aii(k) = -psc;
369 }
370 else // j != -1
371 {
372 if (psc < 0)
373 for (k = 0; k < ajj.size(); k++)
374 ajj(k) = -psc;
375 }
376}
377
378inline void Eval_centre_PolyMAC_CDO_Elem::secmem_face(int face, const Dirichlet_entree_fluide& la_cl, int num1, DoubleVect& flux) const
379{
380 int k;
381 int i = elem_(face, 0);
382 double psc = dt_vitesse[face] * surface(face) * porosite(face);
383 if (i != -1)
384 {
385 if (psc < 0)
386 for (k = 0; k < flux.size(); k++)
387 flux(k) = -psc * la_cl.val_imp(face - num1);
388 }
389 else // j != -1
390 {
391 if (psc > 0)
392 for (k = 0; k < flux.size(); k++)
393 flux(k) = -psc * la_cl.val_imp(face - num1);
394 }
395}
396
397inline void Eval_centre_PolyMAC_CDO_Elem::flux_face(const DoubleTab& inco, int face, const Neumann_sortie_libre& la_cl, int num1, DoubleVect& flux) const
398{
399 int k;
400 int n0 = elem_(face, 0);
401 int n1 = elem_(face, 1);
402 double psc = dt_vitesse[face] * surface(face) * porosite(face);
403 if (n0 != -1)
404 {
405 if (psc > 0)
406 for (k = 0; k < flux.size(); k++)
407 flux(k) = -psc * inco(n0, k);
408 else
409 for (k = 0; k < flux.size(); k++)
410 flux(k) = -psc * la_cl.val_ext(face - num1, k);
411 }
412 else // n1 != -1
413 {
414 if (psc > 0)
415 for (k = 0; k < flux.size(); k++)
416 flux(k) = -psc * la_cl.val_ext(face - num1, k);
417 else
418 for (k = 0; k < flux.size(); k++)
419 flux(k) = -psc * inco(n1, k);
420 }
421}
422
423inline void Eval_centre_PolyMAC_CDO_Elem::coeffs_face(int face, int num1, const Neumann_sortie_libre& la_cl, DoubleVect& aii, DoubleVect& ajj) const
424{
425 int k;
426 int i = elem_(face, 0);
427 double psc = dt_vitesse[face] * surface(face) * porosite(face);
428 if (i != -1)
429 {
430 if (psc > 0)
431 for (k = 0; k < aii.size(); k++)
432 aii(k) = -psc;
433 }
434 else // n1 != -1
435 {
436 if (psc < 0)
437 for (k = 0; k < ajj.size(); k++)
438 ajj(k) = -psc;
439 }
440}
441
442inline void Eval_centre_PolyMAC_CDO_Elem::secmem_face(int face, const Neumann_sortie_libre& la_cl, int num1, DoubleVect& flux) const
443{
444 int k;
445 int i = elem_(face, 0);
446 double psc = dt_vitesse[face] * surface(face) * porosite(face);
447 if (i != -1)
448 {
449 if (psc < 0)
450 for (k = 0; k < flux.size(); k++)
451 flux(k) = -psc * la_cl.val_ext(face - num1);
452 }
453 else // j != -1
454 {
455 if (psc > 0)
456 for (k = 0; k < flux.size(); k++)
457 flux(k) = -psc * la_cl.val_ext(face - num1);
458 }
459}
460
461inline void Eval_centre_PolyMAC_CDO_Elem::flux_face(const DoubleTab& inco, int face, const Periodique& la_cl, int, DoubleVect& flux) const
462{
463 int k;
464 double psc = dt_vitesse[face] * surface(face) * porosite(face);
465 int n0 = elem_(face, 0);
466 int n1 = elem_(face, 1);
467 int n0_0 = amont_amont(face, 0);
468 int n1_1 = amont_amont(face, 1);
469
470 // apply the centered scheme
471 qcentre(psc, n0, n1, n0_0, n1_1, face, inco, flux);
472 for (k = 0; k < flux.size(); k++)
473 flux(k) *= -1;
474}
475
476inline void Eval_centre_PolyMAC_CDO_Elem::coeffs_face(int face, int, const Periodique& la_cl, DoubleVect& aii, DoubleVect& ajj) const
477{
478 int k;
479 int i = elem_(face, 0);
480 int j = elem_(face, 1);
481 int i0_0 = amont_amont(face, 0);
482 int j1_1 = amont_amont(face, 1);
483 double psc = dt_vitesse[face] * surface[face] * porosite[face];
484 ArrOfDouble flux(aii.size());
485
486 // apply the centered2 scheme
487 qcentre(psc, i, j, i0_0, j1_1, face, inconnue->valeurs(), flux);
488 if (psc > 0)
489 for (k = 0; k < aii.size(); k++)
490 aii(k) = -flux[k];
491 else
492 for (k = 0; k < ajj.size(); k++)
493 ajj(k) = -flux[k];
494}
495
496inline void Eval_centre_PolyMAC_CDO_Elem::flux_faces_interne(const DoubleTab& inco, int face, DoubleVect& flux) const
497{
498 int k;
499 double psc = dt_vitesse[face] * surface(face) * porosite(face);
500 int n0 = elem_(face, 0);
501 int n1 = elem_(face, 1);
502 int n0_0 = amont_amont(face, 0);
503 int n1_1 = amont_amont(face, 1);
504
505 qcentre(psc, n0, n1, n0_0, n1_1, face, inco, flux);
506 for (k = 0; k < flux.size(); k++)
507 flux(k) *= -1;
508}
509
510inline void Eval_centre_PolyMAC_CDO_Elem::coeffs_faces_interne(int face, DoubleVect& aii, DoubleVect& ajj) const
511{
512 int k;
513 int i = elem_(face, 0);
514 int j = elem_(face, 1);
515 int i0_0 = amont_amont(face, 0);
516 int j1_1 = amont_amont(face, 1);
517 double psc = dt_vitesse[face] * surface[face] * porosite[face];
518 ArrOfDouble flux(aii.size());
519
520 qcentre(psc, i, j, i0_0, j1_1, face, inconnue->valeurs(), flux);
521 if (psc > 0)
522 for (k = 0; k < aii.size(); k++)
523 aii(k) = -flux[k];
524 else
525 for (k = 0; k < ajj.size(); k++)
526 ajj(k) = -flux[k];
527}
528
529inline int Eval_centre_PolyMAC_CDO_Elem::amont_amont(int face, int i) const
530{
531 return 0; //le_domaine->upstream_upstream(face, i);
532}
533
534inline double Eval_centre_PolyMAC_CDO_Elem::qcentre(const double psc, const int num0, const int num1, const int num0_0, const int num1_1, const int face, const DoubleTab& transporte) const
535{
536 double flux;
537
538 double T0 = transporte[num0];
539 double T1 = transporte[num1];
540
541 flux = 0.5 * (T0 + T1);
542
543 return flux * psc;
544}
545
546inline void Eval_centre_PolyMAC_CDO_Elem::qcentre(const double psc, const int num0, const int num1, const int num0_0, const int num1_1, const int face, const DoubleTab& transporte,
547 ArrOfDouble& flux) const
548{
549
550 int k;
551 int ncomp = flux.size_array();
552
553 ArrOfDouble T0(ncomp);
554 ArrOfDouble T0_0(ncomp);
555 ArrOfDouble T1(ncomp);
556 ArrOfDouble T1_1(ncomp);
557
558 for (k = 0; k < ncomp; k++)
559 {
560 T0[k] = transporte(num0, k);
561 T0_0[k] = transporte(num0_0, k);
562 T1[k] = transporte(num1, k);
563 T1_1[k] = transporte(num1_1, k);
564 }
565
566 for (k = 0; k < ncomp; k++)
567 flux[k] = 0.5 * (T0[k] + T1[k]) * psc;
568}
569
570#endif /* Eval_centre_PolyMAC_CDO_Elem_included */
Dirichlet_entree_fluide This class represents a boundary condition imposing a quantity.
Dirichlet_paroi_defilante Imposes the wall velocity in an equation of type Navier_Stokes.
Dirichlet_paroi_fixe Represents a fixed wall in a Navier-Stokes type equation.
virtual double val_imp(int i) const
Returns the imposed value on the i-th component of the field at the boundary at the default time of c...
Definition Dirichlet.cpp:35
Classe Echange_externe_impose: This class represents the special case of the class.
Classe Echange_global_impose This class represents the special case of the class.
Eval_Conv_PolyMAC_CDO()
Default constructor.
double flux_faces_interne(const DoubleTab &, int) const override
int calculer_flux_faces_entree_fluide() const override
void coeffs_faces_interne(int, double &aii, double &ajj) const override
void coeffs_face(int, int, const Neumann_paroi &, DoubleVect &aii, DoubleVect &ajj) const override
void coeffs_face(int, int, const Neumann_paroi_adiabatique &, double &aii, double &ajj) const override
void flux_face(const DoubleTab &, int, int, int, const Echange_externe_impose &, int, DoubleVect &flux) const override
int calculer_flux_faces_sortie_libre() const override
double flux_face(const DoubleTab &, int, const Dirichlet_paroi_fixe &, int) const override
void flux_face(const DoubleTab &, int, const Dirichlet_paroi_defilante &, int, DoubleVect &flux) const override
double flux_face(const DoubleTab &, int, int, int, const Echange_externe_impose &, int) const override
double secmem_face(int, const Dirichlet_paroi_fixe &, int) const override
int calculer_flux_faces_paroi_defilante() const override
double flux_face(const DoubleTab &, int, const Echange_global_impose &, int) const override
void coeffs_face(int, int, const Neumann_paroi_adiabatique &, DoubleVect &aii, DoubleVect &ajj) const override
double flux_face(const DoubleTab &, int, const Symetrie &, int) const override
void coeffs_face(int, int, const Symetrie &, DoubleVect &aii, DoubleVect &ajj) const override
double secmem_faces_interne(int) const override
void coeffs_face(int, int, const Dirichlet_paroi_defilante &, DoubleVect &aii, DoubleVect &ajj) const override
void coeffs_face(int, int, const Dirichlet_paroi_fixe &, DoubleVect &aii, DoubleVect &ajj) const override
void coeffs_face(int, int, const Symetrie &, double &aii, double &ajj) const override
void secmem_face(int, int, int, const Echange_externe_impose &, int, DoubleVect &) const override
void secmem_face(int, const Neumann_paroi &, int, DoubleVect &) const override
void secmem_face(int, const Neumann_paroi_adiabatique &, int, DoubleVect &) const override
int calculer_flux_faces_periodique() const override
double secmem_face(int, const Echange_global_impose &, int) const override
void flux_face(const DoubleTab &, int, const Neumann_paroi &, int, DoubleVect &flux) const override
void coeffs_face(int, int, const Dirichlet_paroi_defilante &, double &aii, double &ajj) const override
void flux_face(const DoubleTab &, int, const Neumann_paroi_adiabatique &, int, DoubleVect &flux) const override
int calculer_flux_faces_echange_global_impose() const override
void secmem_faces_interne(int, DoubleVect &) const override
void secmem_face(int, const Echange_global_impose &, int, DoubleVect &) const override
void coeffs_face(int, int, int, int, const Echange_externe_impose &, DoubleVect &aii, DoubleVect &ajj) const override
double flux_face(const DoubleTab &, int, const Dirichlet_paroi_defilante &, int) const override
double secmem_face(int, const Periodique &, int) const override
void secmem_face(int, const Dirichlet_paroi_fixe &, int, DoubleVect &) const override
double secmem_face(int, int, int, const Echange_externe_impose &, int) const override
void coeffs_face(int, int, const Dirichlet_paroi_fixe &, double &aii, double &ajj) const override
int calculer_flux_faces_echange_externe_impose() const override
double flux_face(const DoubleTab &, int, const Dirichlet_entree_fluide &, int) const override
void coeffs_face(int, int, const Echange_global_impose &, DoubleVect &aii, DoubleVect &ajj) const override
double secmem_face(int, const Neumann_paroi &, int) const override
void coeffs_face(int, int, int, int, const Echange_externe_impose &, double &aii, double &ajj) const override
int calculer_flux_faces_paroi_adiabatique() const override
void flux_face(const DoubleTab &, int, const Symetrie &, int, DoubleVect &flux) const override
double secmem_face(int, const Dirichlet_paroi_defilante &, int) const override
void secmem_face(int, const Periodique &, int, DoubleVect &) const override
void secmem_face(int, const Symetrie &, int, DoubleVect &) const override
void secmem_face(int, const Dirichlet_paroi_defilante &, int, DoubleVect &) const override
void flux_face(const DoubleTab &, int, const Echange_global_impose &, int, DoubleVect &flux) const override
void flux_face(const DoubleTab &, int, const Dirichlet_paroi_fixe &, int, DoubleVect &flux) const override
void coeffs_face(int, int, const Echange_global_impose &, double &aii, double &ajj) const override
double flux_face(const DoubleTab &, int, const Neumann_paroi &, int) const override
double flux_face(const DoubleTab &, int, const Neumann_paroi_adiabatique &, int) const override
double qcentre(const double, const int, const int, const int, const int, const int, const DoubleTab &) const
void coeffs_face(int, int, const Neumann_paroi &, double &aii, double &ajj) const override
double secmem_face(int, const Neumann_paroi_adiabatique &, int) const override
int calculer_flux_faces_paroi_fixe() const override
double secmem_face(int, const Symetrie &, int) const override
Classe Neumann_paroi_adiabatique This boundary condition corresponds to an adiabatic wall in a.
Classe Neumann_paroi This boundary condition corresponds to an imposed flux for the.
Neumann_sortie_libre This class represents an open boundary without imposed velocity.
double val_ext(int i) const override
Returns the value of the i-th component of the field imposed on the exterior of the boundary.
class Periodique This class represents a periodic boundary condition.
Definition Periodique.h:31
Symetrie On symmetry faces, the following properties hold:
Definition Symetrie.h:37
_SIZE_ size_array() const
_SIZE_ size() const
Definition TRUSTVect.tpp:45