DamBreak++ Wave Simulator 0.3
DamBreak++ Simulation Framework
Loading...
Searching...
No Matches
Sfx_TestRoeFlux.h
Go to the documentation of this file.
1
2#pragma once
3
4namespace dbpp
5{
6 // E. McNeil test (didn't test yet)
7// class TestRoeFlux : public BaseNumTreatmemt
8// {
9// public:
10
11double CalculMatriceRoe1D (double FR, double FL, double UR, double UL)
12{
13 double A;
14
15 if (UR =! UL)
16 A = (FR-FL)/(UR-UL);
17 else if (UR == UL)
18 A = 1.; // A vérifier
19
20 return (A);
21}
22
23
25 double *U1, double *U2,
26 double *dU1, double *dU2,
27 int NbSections, double B)
28{
29 //int j;
30
31 /*double UL1, UL2, UR1, UR2;
32 double FL1, FL2, FR1, FR2, FL2C, FR2C;
33 double A1, A2;*/
34
35 // Calculs préalables: évaluation des dU
36 dU1[0] = minmod (U1[1]-U1[0], 0.);
37 dU2[0] = minmod (U2[1]-U2[0], 0.);
38
39 for (auto j = 1; j < NbSections; j++)
40 {
41 dU1[j] = minmod (U1[j+1]-U1[j], U1[j]-U1[j-1]);
42 dU2[j] = minmod (U2[j+1]-U2[j], U2[j]-U2[j-1]);
43 }
44
45 for (auto j = 0; j < NbSections-1; j++)
46 {
47 // Calcul des Fj+1/2
48 // (Fj-1/2 représentant simplement le Fj+1/2 associé à la section précédente)
49 // Calcul basé sur Numerical scheme II de Nujic, 1995
50 // Fj+1/2 = 0.5 * (FR + FL - |Aj+1/2|(UR - UL)
51
52 auto UL1 = U1[j] + 0.5*dU1[j];
53 auto UR1 = U1[j+1] - 0.5*dU1[j+1];
54
55 auto UL2 = U2[j] + 0.5*dU2[j];
56 auto UR2 = U2[j+1] - 0.5*dU2[j+1];
57
58 auto FL1 = UL2;
59 auto FR1 = UR2;
60
61 auto FL2 = EvaluationF2_C_1D (UL1, UL2, B);
62 auto FR2 = EvaluationF2_C_1D (UR1, UR2, B);
63
64 auto FL2C = EvaluationF2_I_1D (UL1, UL2, B);
65 auto FR2C = EvaluationF2_I_1D (UR1, UR2, B);
66
67 //fprintf (FichierDEBUG, "U1[%d]: %lf U2[%d]: %lf\n", j, U1[1], j, U2[j]);
68
69 //fprintf (FichierDEBUG, "FL1[%d]: %lf FL2[%d]: %lf\n", j, FL1, j, FL2);
70 //fprintf (FichierDEBUG, "FR1[%d]: %lf FR2[%d]: %lf\n", j, FR1, j, FR2);
71
72 // Calcul de la matrice de Roe
73 // basé sur Alcrudo et Garcia-Navarro (1993)
74
75 auto A1 = CalculMatriceRoe1D (FR1, FL1, UR1, UL1);
76 auto A2 = CalculMatriceRoe1D (FR2C, FL2C, UR2, UL2);
77
78 F1[j] = 0.5 * (FR1 + FL1 - (A1 * (UR1 - UL1)));
79 F2[j] = 0.5 * (FR2 + FL2 - (A2 * (UR2 - UL2)));
80
81 //fprintf (FichierDEBUG, "FF1[%d]: %lf FF2[%d]: %lf\n\n", j, F1[j], j, F2[j]);
82 }
83}
84
85// };
86} // End of namespace
Definition DamBreakProb.h:15
@ A
Definition dbpp_Enumerations.h:16
double CalculMatriceRoe1D(double FR, double FL, double UR, double UL)
Definition Sfx_TestRoeFlux.h:11
void TraitementTermesFluxConvectionPressionRoe1D(double *F1, double *F2, double *U1, double *U2, double *dU1, double *dU2, int NbSections, double B)
Definition Sfx_TestRoeFlux.h:24