21 STATE LeftSoundSpeed,RightSoundSpeed,
23 LeftNormalSpeed, RightNormalSpeed,
24 LeftEnthalpy,RightEnthalpy,
25 LeftPress, RightPress;
27 this->
ComputeInitialData(solL,normal,LeftSoundSpeed,LeftSpeed,LeftNormalSpeed,LeftEnthalpy,LeftPress);
28 this->
ComputeInitialData(solR,normal,RightSoundSpeed,RightSpeed,RightNormalSpeed,RightEnthalpy,RightPress);
30 const STATE NumericalSoundSpeed =
NumSoundSpeed(LeftSoundSpeed,RightSoundSpeed);
31 const STATE LeftNumMach = LeftNormalSpeed/NumericalSoundSpeed;
32 const STATE RightNumMach = RightNormalSpeed/NumericalSoundSpeed;
35 const STATE FaceMach = this->
FaceMachNumber(LeftNumMach,RightNumMach);
36 const STATE
MassFlux = this->
MassFlux(NumericalSoundSpeed,solL[0], solR[0], FaceMach);
38 const STATE uL = solL[1]/solL[0];
39 const STATE vL = solL[2]/solL[0];
40 const STATE wL = solL[3]/solL[0];
42 const STATE uR = solR[1]/solR[0];
43 const STATE vR = solR[2]/solR[0];
44 const STATE wR = solR[3]/solR[0];
46 F[0] = ((STATE)0.5)*(MassFlux* ((STATE)(2.)));
47 F[1] = ((STATE)0.5)*MassFlux* (uL+uR) -((STATE)0.5)*
fabs(MassFlux)* (uR-uL) + FacePressure*normal[0];
48 F[2] = 0.5*MassFlux* (vL+vR) -0.5*
fabs(MassFlux)* (vR-vL) + FacePressure*((STATE)normal[1]);
49 F[3] = 0.5*MassFlux* (wL+wR) -0.5*
fabs(MassFlux)* (wR-wL) + FacePressure*normal[2];
50 F[4] = 0.5*MassFlux* (LeftEnthalpy+RightEnthalpy) -0.5*
fabs(MassFlux)* (RightEnthalpy-LeftEnthalpy) + 0.;
55 STATE &
Speed, STATE &NormalSpeed, STATE &
Enthalpy, STATE &press){
58 Speed = this->
Speed(sol,normal,NormalSpeed);
59 Enthalpy = this->
Enthalpy(soundSpeed,Speed);
63 const STATE rho = sol[0];
65 PZError <<
"TPZEulerEquation(::cSpeed Too small or negative density\n";
69 const STATE c =
sqrt(this->
fGamma * press/ sol[0]);
74 if(
fabs(sol[0]) < 1.e-6){
75 PZError <<
"TPZEulerEquation::Pressure - Negative or too small density" 76 << sol[0] << std::endl;
82 const STATE rho_velocity2 = ( sol[1]*sol[1] + sol[2]*sol[2] + sol[3]*sol[3] )/sol[0];
83 press = ((this->
fGamma-1.)*( sol[4] - 0.5 * rho_velocity2 ));
86 STATE temp = (this->
fGamma-1.)*sol[4];
87 PZError <<
"TPZEulerEquation::Pressure Negative pressure: " << press <<
" (gama-1)*E = " << temp << std::endl;
94 const STATE rho = sol[0];
95 const STATE rhoU = sol[1];
96 const STATE rhoV = sol[2];
97 const STATE rhoW = sol[3];
98 const STATE u = rhoU/rho;
99 const STATE v = rhoV/rho;
100 const STATE w = rhoW/rho;
101 const STATE speed =
sqrt(u*u+v*v+w*w);
102 NormalSpeed = u*normal[0]+v*normal[1]+w*normal[2];
107 const STATE enthalpy = soundSpeed*soundSpeed/(this->
fGamma-1.)+0.5*speed*speed;
113 if(Ml >= 1.) Pplus = 1.;
114 else if(Ml <= -1.) Pplus = 0.;
116 Pplus = 0.25*(Ml+1.)*(Ml+1.)*(2.-Ml)+this->
fAlpha*Ml*(Ml*Ml-1.)*(Ml*Ml-1.);
120 if(Mr >= 1.) Pminus = 0.;
121 else if(Mr <= -1.) Pminus = 1.;
123 Pminus = 0.25*(Mr-1.)*(Mr-1.)*(2.+Mr)-this->
fAlpha*Mr*(Mr*Mr-1.)*(Mr*Mr-1.);
126 const STATE pFace = pL*Pplus+pR*Pminus;
133 if(Ml >= 1.) Mplus = Ml;
134 else if(Ml <= -1.) Mplus = 0.;
136 Mplus = 0.25*(Ml+1.)*(Ml+1.)+this->
fBeta*(Ml*Ml-1.)*(Ml*Ml-1.);
140 if(Mr >= 1.) Mminus = 0.;
141 else if(Mr <= -1.) Mminus = Mr;
143 Mminus = -0.25*(Mr-1.)*(Mr-1.)-this->
fBeta*(Mr*Mr-1.)*(Mr*Mr-1.);
146 const STATE faceMach = Mplus+Mminus;
152 return sqrt(LeftSoundSpeed*RightSoundSpeed);
156 STATE min = 0., max = 0.;
157 if(FaceMach > 0.) max = FaceMach;
158 if(FaceMach < 0.) min = FaceMach;
160 const STATE
m = NumericalSoundSpeed*(rhoL*max+rhoR*min);
expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ fabs
STATE fAlpha
Method constants.
TPZAUSMFlux(STATE gamma)
Constructor with Gamma value.
STATE Speed(TPZVec< STATE > &sol, TPZVec< REAL > &normal, STATE &NormalSpeed)
Returns speed.
void ComputeInitialData(TPZVec< STATE > &sol, TPZVec< REAL > &normal, STATE &soundSpeed, STATE &Speed, STATE &NormalSpeed, STATE &Enthalpy, STATE &press)
Auxiliar method only.
STATE Enthalpy(STATE soundSpeed, STATE speed)
Returns enthalpy.
STATE FacePressure(STATE pL, STATE pR, STATE Ml, STATE Mr)
Returns pressure in the face.
#define DebugStop()
Returns a message to user put a breakpoint in.
STATE MassFlux(STATE NumericalSoundSpeed, STATE rhoL, STATE rhoR, STATE FaceMach)
Returns the mass flux.
expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ sqrt
Contains the TPZAUSMFlux class.
long double gamma(unsigned int n)
Evaluate the factorial of a integer.
void ComputeFlux(TPZVec< STATE > &solL, TPZVec< STATE > &solR, TPZVec< REAL > &normal, TPZVec< STATE > &F)
Computes numerical flux.
STATE SoundSpeed(TPZVec< STATE > &sol, STATE press)
Returns sound speed.
STATE NumSoundSpeed(STATE LeftSoundSpeed, STATE RightSoundSpeed)
Computes the numerical sound speed at the face.
STATE FaceMachNumber(STATE Ml, STATE Mr)
Returns mach number in the face.
STATE fGamma
Ratio between specific heat is constant and the specific heat the constant volume of a polytropic gas...
clarg::argString m("-m", "input matrix file name (text format)", "matrix.txt")
STATE Pressure(TPZVec< STATE > &sol)
Returns pressure values.
Implements the numerical flux for AUSM problem. (Jorge?)
#define PZError
Defines the output device to error messages and the DebugStop() function.