全文预览

附录c 二维斜激波刚壁反射 (c)

上传者:蓝天 |  格式:doc  |  页数:21 |  大小:0KB

文档介绍
ble Uf[Jx+2][Jy+2][4],double Ff[Jx+2][Jy+2][4],double dy,double dt) { int i,j,k; double r,nu,q; r=dt/dy; nu=3.0*r*(1-3.0*r); //nu=2.0; for(i=0;i<=Jx+1;i++) for(j=1;j<=Jy;j++) { q=fabs(fabs(U[i][j+1][0]-U[i][j][0])-fabs(U[i][j][0]-U[i][j-1][0])) /(fabs(U[i][j+1][0]-U[i][j][0])+fabs(U[i][j][0]-U[i][j-1][0])+1e-100); for(k=0;k<4;k++) Ff[i][j][k]=U[i][j][k]+0.5*nu*q*(U[i][j+1][k]-2*U[i][j][k]+U[i][j-1][k]);// 人工黏性项} for(i=0;i<=Jx+1;i++) for(k=0;k<4;k++) for(j=1;j<=Jy;j++)U[i][j][k]=Ff[i][j][k]; for(i=0;i<=Jx+1;i++) for(j=0;j<=Jy+1;j++) U2F(U[i][j],Ff[i][j]); for(i=0;i<=Jx+1;i++) for(j=0;j<=Jy;j++) for(k=0;k<4;k++) Uf[i][j][k]=0.5*(U[i][j+1][k]+U[i][j][k])-0.5*r*(Ff[i][j+1][k]-Ff[i][j][k]); //U(n+1/2)(i)(j+1/2) for(i=0;i<=Jx+1;i++) for(j=0;j<=Jy;j++) U2F(Uf[i][j],Ff[i][j]); //F(n+1/2)(i)(j+1/2)

收藏

分享

举报
下载此文档