#include <iostream>
#include <fstream>
#include <math.h>
using namespace std;
int main()
{
double Hf;
double D[3] = {10,20,30};
double Qm[12] = { 36.80130687
,21.02931821
,52.57329552
,68.34528418
,73.60261373
,42.05863642
,105.146591
,136.6905684
,110.4039206
,63.08795463
,157.7198866
,205.0358525 };
double Ch = 130;
double l = 1.5;
double P_loss;
double m = 1.157;
std::ofstream out("Hf.dat");
if (!out)
{
// 打开文件失败
std::cerr << "Error opening file!" << std::endl;
return 1;
}
out << "Hf(m)" << " " << "D(mm)" << " " << "Qm(M3/H)" << " " << "Ch" <<" " <<"P_loss(pa)" << std::endl;
for (int i=0;i<3;i++)
{
for (int j =0;j<12;j++)
{
double Temp1 = 1 / (pow(D[i], 4.871));
double Temp3 = Qm[j] / m;
double Temp2 = pow((Temp3/ Ch), 1.852);
Hf = 1.13 * 1000000000 * Temp1 * Temp2;
P_loss = m * 9.8 * Hf;
out << Hf << " " << D[i] << " " << Temp3 << " " << Ch << " " << P_loss << std::endl;
Temp1 = 0;
Temp2 = 0;
}
};
out.close();
return 0;
};
计算管道沿程压损
于 2023-05-12 16:26:16 首次发布