|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?注册
x
本帖最后由 xuwenhua625 于 2016-6-19 11:28 编辑
楼主算多个机翼的受力,用DEFINE_EXECUTE_AT_END 和 Compute_Force_And_Moment 宏 求合力
但是如果同时求多个 机翼的受力Compute_Force_And_Moment (domain, tf1, x1_cg, f1_glob, m1_glob,1);
Compute_Force_And_Moment (domain, tf2, x2_cg, f2_glob, m2_glob,1);
Compute_Force_And_Moment (domain, tf3, x3_cg, f3_glob, m3_glob,1);
Compute_Force_And_Moment (domain, tf4, x4_cg, f4_glob, m4_glob,1);
就会出现 fl1450s.exe received fatal signal (ACCESS_VIOLATION) 的错误
只保留上面一个,注释掉其他几个就没有问题 ,请问这是什么原因,如何解决?
DEFINE_EXECUTE_AT_END(Force_and_Power)
{
real f1_glob[ND_ND],m1_glob[ND_ND],x1_cg[ND_ND];
real f2_glob[ND_ND],m2_glob[ND_ND],x2_cg[ND_ND];
real f3_glob[ND_ND],m3_glob[ND_ND],x3_cg[ND_ND];
real f4_glob[ND_ND],m4_glob[ND_ND],x4_cg[ND_ND];
real f5_glob[ND_ND],m5_glob[ND_ND],x5_cg[ND_ND];
real f6_glob[ND_ND],m6_glob[ND_ND],x6_cg[ND_ND];
real f1,f3,f5;
Domain *domain= Get_Domain (1);
Thread *tf1 = Lookup_Thread (domain, 58);
//Thread *tf2 = Lookup_Thread (domain, 59);
//Thread *tf3 = Lookup_Thread (domain, 60);
//Thread *tf4 = Lookup_Thread (domain, 61);
Thread *tf5 = Lookup_Thread (domain, 62);
//Thread *tf6 = Lookup_Thread (domain, 63);
//----------------------------------------------------------------------------------------
if(N_TIME>2){
x1_cg[0]=x1_cg[1]=0.000;
x2_cg[0]=x2_cg[1]=0.000;
x3_cg[0]=x3_cg[1]=0.000;
x4_cg[0]=x4_cg[1]=0.000;
x5_cg[0]=x5_cg[1]=0.000;
x6_cg[0]=x6_cg[1]=0.000;
Compute_Force_And_Moment (domain, tf1, x1_cg, f1_glob, m1_glob,1);
//Compute_Force_And_Moment (domain, tf2, x2_cg, f2_glob, m2_glob,1);
//Compute_Force_And_Moment (domain, tf3, x3_cg, f3_glob, m3_glob,1);
//Compute_Force_And_Moment (domain, tf4, x4_cg, f4_glob, m4_glob,1);
Compute_Force_And_Moment (domain, tf5, x5_cg, f5_glob, m5_glob,1);
//Compute_Force_And_Moment (domain, tf6, x6_cg, f6_glob, m6_glob,1);
f1=f1_glob[0]+f5_glob[0]; //+f3_glob[0]+f4_glob[0]+f5_glob[0]+f6_glob[0];
f3=f1_glob[1]+f5_glob[1]; //+f3_glob[1]+f4_glob[1]+f5_glob[1]+f6_glob[1];
f5=m1_glob[2]+m5_glob[2]; //+m3_glob[2]+m4_glob[2]+m5_glob[2]+m6_glob[2];
fpo=fopen("Power_All.dat", "a+");
fprintf(fpo,"%8.5f %12.5f %12.5f\n",CURRENT_TIME*w/(2*PI),f1*U,f5*w);
fclose(fpo);}
// non-dimension disposal
f1 = f1/(rou*Nt*Nt*8*Radius*Radius*Radius*L);
f3 = f3/(rou*Nt*Nt*8*Radius*Radius*Radius*L);
f5 = f5/(rou*Nt*Nt*16*Radius*Radius*Radius*Radius*L);
fpc=fopen("Force_All.dat", "a+");
fprintf(fpc,"%8.5f %12.8f %12.8f %12.8f\n",CURRENT_TIME*w/(2*PI),f1,f3,f5);
fclose(fpc);
// test
fpc1=fopen("force_1.dat", "a+");
fprintf(fpc1,"%8.5f %10.5f %10.5f %10.5f\n",CURRENT_TIME*w/(2*PI),f1_glob[0],f1_glob[1],m1_glob[2]);
fclose(fpc1);
//----------------------------------------------------------------------------------------
}
|
-
-
|