| 查看: 483 | 回复: 2 | ||
zhaoyubosd铜虫 (小有名气)
|
[求助]
求助C++编程,不胜感激
|
|
运行C++程序,显示运行成功,里面有这样一句话,请问是什么意思?The thread 0x2cb0 has exited with code 0 (0x0).如何解决。还有,黑色运行界面上为什么没有运行结果,请各位大神指教。附上程序代码。 #include <iostream> #include <fstream> #include <iomanip> #include <cmath> #include <string> using namespace std; void fibermodel (double X[], int n0, double U[], int n1, double V[], int n2, double P[], int n3, double R[],int n4, double r, double l, double mu, double dp, double den, double converge, int n, double &dX); int main () { //Hollow fiber double X[301],t[301], U[301], V[301], Pressure[301], R[301]; double r, l, T,Rm, mu, dp, den, dX,converge,cp; double ResultP[51][51],ResultU[51][51],ResultV[51][51],ResultR[51][51]; int n,m,IncrementT,IncrementX; string OutputFileName; //Information about the software cout << "HOLLOW FIBER MEMBRANE SIMULATION SOFTWARE Version 1.0" << "\n" << "developed by Dr. Lianfa Song, College of Engineering, Texas Tech University" << "\n" << "APRIL 2015" << "\n" << "\n" << "\n"; // Open input file and read parameter values ifstream input_file("numeric.txt" ; input_file >> r >> l >> T >> Rm >> mu >> dp >> den >> converge >> n >> m >> IncrementX >> IncrementT >> cp >> OutputFileName; cout << "The Name of Output File = " << OutputFileName << "\n" << "\n"; // Start calculation // Call fibermodel int j,i; t[0]=0.0; for (j=1;j<=m;j++) {t[j]=t[j-1]+T/m;} for (j=0;j<=m;j++) { if (j=0) { for(i=0;i<=n;i++) { R=Rm;} } fibermodel (X, 301, U, 301, V, 301, Pressure, 301, R, 301, r, l, mu, dp, den, converge, n, dX); if (j%6==0) { for(i=0;i<=n;i=i+6) { ResultP[j]=Pressure;ResultU[j]=U;ResultV[j]=V;ResultR[j]=R;} } for(i=0;i<=n;i++) { R=R+cp*V*T/m;} } //Output results // Open output file ofstream output_file(OutputFileName); output_file << "CONDITIONS" << "\n" ; output_file << fixed; output_file.precision(0); output_file << setw(13) << "Space-Step=" << setw(13) << n << "\n"; output_file << scientific; output_file.precision(4); output_file << setw(13) << "InnerRadius=" << setw(13) << r << "\n"; output_file << setw(13) << "FiberLength=" << setw(13) << l << "\n"; output_file << setw(13) << "MemResisten=" << setw(13) << Rm << "\n"; output_file << setw(13) << "WaterViscos=" << setw(13) << mu << "\n"; output_file << setw(13) << " Pressure=" << setw(13) << dp << "\n"; output_file << setw(13) << "ConvergeCre=" << setw(13) << converge << "\n" << "\n"; output_file << fixed << "RESULTS1" << "\n"; //P的分布情况 output_file << fixed << "Pressure" << "\n"; output_file << scientific; output_file.precision(3); output_file<< "X"; for (int j=0; j<=m; j=j+IncrementT) {output_file<< setw(13) << "t="<< t[j] << setw(13);} output_file<< endl; for (int i=0; i<=n; i=i+IncrementX) { output_file<< X ; for (int j=0; j<=n; j=j+IncrementT) { output_file<< setw(13) << ResultP[j] << setw(13); } output_file<< endl; } output_file<< endl; //u的分布情况 output_file << fixed << "u" << "\n"; output_file << scientific; output_file.precision(3); output_file<< "X"; for (int j=0; j<=m; j=j+IncrementT) {output_file<< setw(13) << "t="<< t[j] << setw(13);} output_file<< endl; for (int i=0; i<=n; i=i+IncrementX) { output_file<< X ; for (int j=0; j<=n; j=j+IncrementT) { output_file<< setw(13) << ResultU[j] << setw(13); } output_file<< endl; } output_file<< endl; //v的分布情况 output_file << fixed << "v" << "\n"; output_file << scientific; output_file.precision(3); output_file<< "X"; for (int j=0; j<=m; j=j+IncrementT) {output_file<< setw(13) << "t="<< t[j] << setw(13);} output_file<< endl; for (int i=0; i<=n; i=i+IncrementX) { output_file<< X ; for (int j=0; j<=n; j=j+IncrementT) { output_file<< setw(13) << ResultV[j] << setw(13); } output_file<< endl; } output_file<< endl; //R的分布情况 output_file << fixed << "R" << "\n"; output_file << scientific; output_file.precision(3); output_file<< "X"; for (int j=0; j<=m; j=j+IncrementT) {output_file<< setw(13) << "t="<< t[j] << setw(13);} output_file<< endl; for (int i=0; i<=n; i=i+IncrementX) { output_file<< X ; for (int j=0; j<=n; j=j+IncrementT) { output_file<< setw(13) << ResultR[j] << setw(13); } output_file<< endl; } output_file<< endl; system("PAUSE" ;return 0; } // fibermodel defination void fibermodel (double X[], int n0, double U[], int n1, double V[], int n2, double P[], int n3,double R[], int n4, double r, double l, double mu, double dp, double den, double converge, int n, double &dX) { //Preparation double UP, LP, K, pi = 3.1415926; K=dX; dX = l/double(n); X[0]=0.0; for (int i=1; i<=n; i++) {X=X[i-1]+dX;} //Start Calculation int iter=0; UP=dp; LP=0.0; // loop: iter = iter +1; P[n] = 0.5*(UP+LP); U[n] =0.0; for (int i=n; i>=1; i--) { V = P/R; U[i-1] =U+2.0*dX*V/r; P[i-1]=P+8.0*mu*U[i-1]*dX/(r*r)+K*3.0*den*U[i-1]*V*dX/r; if (P[i-1] > dp) {UP=P[n]; goto loop;} } if (abs((P[0]-dp)/dp) > converge) {LP=P[n]; goto loop;} V[0] = dp/R[0]; return; } |
» 猜你喜欢
博士读完未来一定会好吗
已经有28人回复
博士申请都是内定的吗?
已经有4人回复
之前让一硕士生水了7个发明专利,现在这7个获批发明专利的维护费可从哪儿支出哈?
已经有3人回复
到新单位后,换了新的研究方向,没有团队,持续积累2区以上论文,能申请到面上吗
已经有12人回复
投稿精细化工
已经有4人回复
高职单位投计算机相关的北核或SCI四区期刊推荐,求支招!
已经有4人回复
导师想让我从独立一作变成了共一第一
已经有9人回复
读博
已经有4人回复
JMPT 期刊投稿流程
已经有4人回复
心脉受损
已经有5人回复
zzy滴号
金虫 (小有名气)
- 应助: 18 (小学生)
- 金币: 5449.9
- 散金: 367
- 红花: 1
- 帖子: 282
- 在线: 895.6小时
- 虫号: 1540568
- 注册: 2011-12-17
- 性别: GG
- 专业: 理论和计算化学

2楼2015-10-21 22:58:08
3楼2015-10-22 09:14:39












;
回复此楼