Returns the HLL numerical flux for MHD equations. The scheme uses four cells to estimate the flux at the interface. Cell2 and Cell3 are the first neighbours on the left and right sides. Cell1 and Cell4 are the second neighbours on the left and right sides.
24 real rhoL=0., rhoR=0.;
26 real preL=0., preR=0.;
33 dx = Cell2.
size(AxisNo);
34 real r, Limit, LeftSlope = 0., RightSlope = 0.;
47 r = RightSlope/LeftSlope;
49 LeftAverage.setValue(i, Cell2.
average(i) + 0.5*Limit*LeftSlope);
53 LeftAverage.setValue(i, Cell2.
average(i));
61 r = RightSlope/LeftSlope;
63 RightAverage.setValue(i, Cell3.
average(i) - 0.5*Limit*LeftSlope);
67 RightAverage.setValue(i, Cell3.
average(i));
76 rhoL = LeftAverage.value(1);
77 rhoR = RightAverage.value(1);
80 for (
int i=1;i<=3;i++)
82 VL.setValue( i, LeftAverage.value(i+1));
83 VR.setValue( i, RightAverage.value(i+1));
84 BL.setValue( i, LeftAverage.value(i+6));
85 BR.setValue( i, RightAverage.value(i+6));
89 eL = LeftAverage.value(5);
90 eR = RightAverage.value(5);
93 preL = (
Gamma -1.)*(eL - 0.5*(VL*VL)/rhoL - 0.5*(BL*BL));
94 preR = (
Gamma -1.)*(eR - 0.5*(VR*VR)/rhoR - 0.5*(BR*BR));
98 bkL =
power2(BL.value(AxisNo))/rhoL;
99 bkR =
power2(BR.value(AxisNo))/rhoR;
101 aL =
Gamma*preL/rhoL;
102 aR =
Gamma*preR/rhoR;
108 cfL = sqrt(0.5*(aL + bL + sqrt(
power2(aL + bL) - 4.0*aL*bkL)));
109 cfR = sqrt(0.5*(aR + bR + sqrt(
power2(aR + bR) - 4.0*aR*bkR)));
112 SL =
Min(
Min(VL.value(AxisNo)/rhoL - cfL, VR.value(AxisNo)/rhoR - cfR),0.0);
113 SR =
Max(
Max(VL.value(AxisNo)/rhoL + cfL, VR.value(AxisNo)/rhoR + cfR),0.0);
118 FL =
FluxX(LeftAverage);
119 FR =
FluxX(RightAverage);
120 }
else if(AxisNo ==2){
122 FL =
FluxY(LeftAverage);
123 FR =
FluxY(RightAverage);
126 FL =
FluxZ(LeftAverage);
127 FR =
FluxZ(RightAverage);
135 Result.setValue(i, (SR*FL.value(i) - SL*FR.value(i) + SR*SL*(RightAverage.value(i) - LeftAverage.value(i)))/(SR-SL));
#define power2(x)
Definition: Carmen.h:70
real EigenvalueZ
Definition: Parameters.cpp:160
Vector FluxY(const Vector &Avg)
Returns the physical flux of MHD equations in Y direction.
Definition: PhysicalFluxMHD.cpp:58
int QuantityNb
Definition: Parameters.cpp:171
Standard class for every vector in Carmen.
Definition: Vector.h:29
Vector ArtificialViscosity(const Vector &Cell1, const Vector &Cell2, real dx, int AxisNo)
Returns the artificial diffusion source terms in the cell UserCell.
Definition: ArtificialViscosity.cpp:11
#define Min(x, y)
Definition: Carmen.h:62
real Gamma
Definition: Parameters.cpp:109
Vector Limiter(const Vector u, const Vector v)
Returns the value of the slope limiter between the slopes u and v.
Definition: Limiter.cpp:56
bool Diffusivity
Definition: Parameters.cpp:121
Vector FluxX(const Vector &Avg)
Returns the physical flux of MHD equations in X direction.
Definition: PhysicalFluxMHD.cpp:8
real size(const int AxisNo) const
Returns the cell size in the direction AxisNo.
Definition: Cell.h:1095
void fluxCorrection(Vector &Flux, const Vector &AvgL, const Vector &AvgR, int AxisNo)
This function apply the divergence-free correction to the numerical flux.
Definition: FluxCorrection.cpp:9
real average(const int QuantityNo) const
Returns the component no. QuantityNo of the cell-average value.
Definition: Cell.h:1128
Vector FluxZ(const Vector &Avg)
Returns the physical flux of MHD equations in Z direction.
Definition: PhysicalFluxMHD.cpp:106
#define Abs(x)
Definition: Carmen.h:78
real EigenvalueY
Definition: Parameters.cpp:159
real EigenvalueX
Definition: Parameters.cpp:158
#define Max(x, y)
Definition: Carmen.h:54
#define real
Definition: PreProcessor.h:31