资源简介
本程序用Weno对激波管进行计算,得到温度、速度、压力等曲线,捕捉激波准确,和解析解吻合较好。
代码片段和文件信息
% Roe‘s Flux Function
%*****************************************************************************
function F=solver(rhoLrhoRvLvRpLpR)
%uL(3) uR(3) ! Input (conservative variables rho*[1 v E])
%roe(3) ! Output (numerical flux across L and R states)
%rhoL rhoR vL vR pL pR % Primitive variables.
%aL aR HL HR % Speeds of sound.
%RTrhovHa % Roe-averages
%drhodudPdV(3)
%ws(3)Da R(33)
%Constants.
gamma = 1.4;
%First compute the Roe Averages **************************
RT = sqrt(rhoR/rhoL);
rho = RT*rhoL;
v = (vL+RT*vR)/(1+RT);
H = (HL+RT*HR)/(1+RT);
a = sqrt( (gamma-1)*(H-0.5*v*v) );
%Differences in primitive variables.
drho = rhoR - rhoL;
du = vR - vL;
dP = pR - pL;
%Wave strength (Characteristic Variables).
dV =[ 0.5*(dP-rho*a*du)/(a*a); -( dP/(a*a) - drho ); half*(dP+rho*a*du)/(a*a)];
%Absolute values of the wave speeds (Eigenvalues)
ws(1) = abs(v-a);
ws(2) = abs(v );
ws(3) = abs(v+
- 上一篇:HOG方向梯度直方图matlab源程序
- 下一篇:超声波摇头避障小车mixly代码
评论
共有 条评论