📄 compute.h
字号:
/**********************************************************
' File Name : compute.h
' Author : endlessfree
' Last updated : 10.04.2002
' Compiler : Visucal C++ 7.0
' Description : ExhCAD0.0.99.1计算Dll头文件
'***********************************************************
'函数
'**********************************************************
'GetRecordSetup --------- 获取参数数据
'GetRecordInput --------- 获取输入数据
'GetRecordDraw --------- 获取输出数据
'SetRecordSetup --------- 设置参数数据
'SetRecordInput --------- 设置输入数据
'SetRecordDraw --------- 设置输出数据
'FindAirPhysicsCp --------- 查找空气比热
'FindAirPhysicsP --------- 查找空气密度
'FindAirPhysicsR --------- 查找空气导热系数
'FindAirPhysicsU --------- 查找空气运动粘度
'FindAirPhysicsV --------- 查找空气动力粘度
'FindAirPhysicsPr --------- 查找空气普朗特数
'FindFumePhysicsCp --------- 查找烟气比热
'FindFumePhysicsP --------- 查找烟气密度
'FindFumePhysicsR --------- 查找烟气导热系数
'FindFumePhysicsU --------- 查找烟气运动粘度
'FindFumePhysicsV --------- 查找烟气动力粘度
'FindFumePhysicsPr --------- 查找烟气普朗特数
'FindLenModify --------- 查找管长修正系数
'FindRowModify --------- 查找管排修正系数
'TransferHeatQuantity --------- 计算换热量
'FumeOutTemperature --------- 计算烟气出口温度
'TemperatureDifference --------- 计算平均温差
'AirConvectionHeatQuantity
--------- 空气对流换热量
'FumeConvectionHeatQuantity
--------- 烟气对流换热量
'FumeRadiationHeatQuantity
--------- 烟气辐射换热量
'PipeTemperature --------- 管壁温度
'HeaterTotalPipeLen --------- 换热器总管长
'HeaterSinglePipeLen --------- 换热器单管长
'HeaterAirLen --------- 换热器空气管长
'HeaterColNumber --------- 换热器列数
'HeaterRowNumber --------- 换热器排数
'AirResistance --------- 空气阻力损失
'FumeResistance --------- 烟气阻力损失
'ComputeFun --------- 换热器设计计算
***********************************************************/
//常数
#define Precision 10//精度
#define Limit 100000//循环次数
#define PI 3.14 //Pi的值
//'参数设置数据
typedef struct {
double FumeElement[3];//'烟气成分
short CannulationArrange;//'管子排列方式
short CannulationRough;//'管壁粗糙度
short MediumDirection;//'介质流向
double ExperienceConstant[3];// '经验常数
short InsertShape;
short Material;
double InsertSize[2];
double UnitWeight;
///double CollectionBox[3];//'集箱
//double WindPipe[2];//'风管
// double Steel;//'钢板
}ExhCADSetup;
//'输入数据
typedef struct {
double Air[4];//'空气
double Fume[3];//'烟气
double Pipe[5];//'管子
}ExhCADInput;
//'输出数据
typedef struct {
double Heater[3];//'换热器结构参数
double Performer[4];//'换热性能
double Assistance[2];//'阻力损失
double Other[4];//'其他参数
}ExhCADDraw;
//'物性数据
typedef struct {
double t;// '温度
double p;// '密度
double cp;// '比热
double r;// '导热系数
double u;// '运动粘度
double v;// '动力粘度
double pr;// '普朗特数
}Physics;
//'管长修正系数
typedef struct{
double ld;// '管长与管径的比值
double cl;// '修正值
}PipeLen;
//'管排修正系数
typedef struct{
short rn;// ' 管排数
double cn[2];// 'cn(0),错排修正值,(1),顺排修正值
}PipeRow;
//'ExhCAD0.99.0.1数据
typedef struct{
Physics AirPhysics[25];//'空气物性数据
Physics FumePhysics[12];//'烟气物性数据
PipeLen LenModify[14];//'管长修正数据
PipeRow RowModify[10];//'管排修正数据
}ExhCADData;
void __stdcall GetRecordSetup(double &h2o,double &co2,double &n2,
short &arrange,short &rough,short &direction,
double &use,double &lose,double &protect,
short &insertshape,short &material,
double &insertthick,double &insertwide,
double &unitweight,
// double &lengthc,double &width,double &heighth,
//double &lengthw,double &diameterw,double &thicks,
ExhCADSetup &RecordSetup){
h2o=RecordSetup.FumeElement[0];
co2=RecordSetup.FumeElement[1];
n2=RecordSetup.FumeElement[2];
arrange=RecordSetup.CannulationArrange;
rough=RecordSetup.CannulationRough;
direction=RecordSetup.MediumDirection;
use=RecordSetup.ExperienceConstant[0];
lose=RecordSetup.ExperienceConstant[1];
protect=RecordSetup.ExperienceConstant[2];
insertshape=RecordSetup.InsertShape;
material=RecordSetup.Material;
insertthick=RecordSetup.InsertSize[0];
insertwide=RecordSetup.InsertSize[1];
unitweight=RecordSetup.UnitWeight;
//lengthc=RecordSetup.CollectionBox[0];
//width=RecordSetup.CollectionBox[1];
//heighth=RecordSetup.CollectionBox[2];
//lengthw=RecordSetup.WindPipe[0];
//diameterw=RecordSetup.WindPipe[1];
//thicks=RecordSetup.Steel;
}
void __stdcall GetRecordInput(double &inairt,double &outairt,double &airq,double &airv,
double &infumet,double &fumeq,double &fumev,
double &diameterp,double &thickp,
double &hdistance,double &vdistance,double &nroute,
// double &unitweight,
ExhCADInput &RecordInput){
inairt=RecordInput.Air[0];
outairt=RecordInput.Air[1];
airq=RecordInput.Air[2];
airv=RecordInput.Air[3];
infumet=RecordInput.Fume[0];
fumeq=RecordInput.Fume[1];
fumev=RecordInput.Fume[2];
diameterp=RecordInput.Pipe[0];
thickp=RecordInput.Pipe[1];
hdistance=RecordInput.Pipe[2];
vdistance=RecordInput.Pipe[3];
nroute=RecordInput.Pipe[4];
// unitweight=RecordInput.Pipe[5];
}
void __stdcall GetRecordDraw(double &row,double &col,double &lengthh,
double &heatq,double &heats,double &heatc,double &dt,
double &airf,double &fumef,
double &outfumet,double &inwallt,double &outwallt,
double &totalweight,ExhCADDraw &RecordDraw){
row=RecordDraw.Heater[0];
col=RecordDraw.Heater[1];
lengthh=RecordDraw.Heater[2];
heatq=RecordDraw.Performer[0];
heats=RecordDraw.Performer[1];
heatc=RecordDraw.Performer[2];
dt=RecordDraw.Performer[3];
airf=RecordDraw.Assistance[0];
fumef=RecordDraw.Assistance[1];
outfumet=RecordDraw.Other[0];
inwallt=RecordDraw.Other[1];
outwallt=RecordDraw.Other[2];
totalweight=RecordDraw.Other[3];
}
void __stdcall SetRecordSetup(double &h2o,double &co2,double &n2,
short &arrange,short &rough,short &direction,
double &use,double &lose,double &protect,
short &insertshape,short &material,
double &insertthick,double &insertwide,
double &unitweight,
// double &lengthc,double &width,double &heighth,
//double &lengthw,double &diameterw,double &thicks,
ExhCADSetup &RecordSetup){
RecordSetup.FumeElement[0]=h2o;
RecordSetup.FumeElement[1]=co2;
RecordSetup.FumeElement[2]=n2;
RecordSetup.CannulationArrange=arrange;
RecordSetup.CannulationRough=rough;
RecordSetup.MediumDirection=direction;
RecordSetup.ExperienceConstant[0]=use;
RecordSetup.ExperienceConstant[1]=lose;
RecordSetup.ExperienceConstant[2]=protect;
RecordSetup.InsertShape=insertshape;
RecordSetup.Material=material;
RecordSetup.InsertSize[0]=insertthick;
RecordSetup.InsertSize[1]=insertwide;
RecordSetup.UnitWeight=unitweight;
//RecordSetup.CollectionBox[0]=lengthc;
//RecordSetup.CollectionBox[1]=width;
//RecordSetup.CollectionBox[2]=heighth;
//RecordSetup.WindPipe[0]=lengthw;
//RecordSetup.WindPipe[1]=diameterw;
//RecordSetup.Steel=thicks;
}
void __stdcall SetRecordInput(double &inairt,double &outairt,double &airq,double &airv,
double &infumet,double &fumeq,double &fumev,
double &diameterp,double &thickp,
double &hdistance,double &vdistance,double &nroute,
double &unitweight,
ExhCADInput &RecordInput){
RecordInput.Air[0]=inairt;
RecordInput.Air[1]=outairt;
RecordInput.Air[2]=airq;
RecordInput.Air[3]=airv;
RecordInput.Fume[0]=infumet;
RecordInput.Fume[1]=fumeq;
RecordInput.Fume[2]=fumev;
RecordInput.Pipe[0]=diameterp;
RecordInput.Pipe[1]=thickp;
RecordInput.Pipe[2]=hdistance;
RecordInput.Pipe[3]=vdistance;
RecordInput.Pipe[4]=nroute;
//RecordInput.Pipe[5]=unitweight;
}
void __stdcall SetRecordDraw(double &row,double &col,double &lengthh,
double &heatq,double &heats,double &heatc,double &dt,
double &airf,double &fumef,
double &outfumet,double &inwallt,double &outwallt,
double &totalweight,ExhCADDraw &RecordDraw){
RecordDraw.Heater[0]= row;
RecordDraw.Heater[1]=col;
RecordDraw.Heater[2]=lengthh;
RecordDraw.Performer[0]=heatq;
RecordDraw.Performer[1]=heats;
RecordDraw.Performer[2]=heatc;
RecordDraw.Performer[3]=dt;
RecordDraw.Assistance[0]= airf;
RecordDraw.Assistance[1]=fumef;
RecordDraw.Other[0]=outfumet;
RecordDraw.Other[1]=inwallt;
RecordDraw.Other[2]=outwallt;
RecordDraw.Other[3]=totalweight;
}
double __stdcall FindAirPhysicsCp(double &airt,ExhCADData &RecordData){
double p,q,r;
int i;
p=RecordData.AirPhysics[0].t;
q=RecordData.AirPhysics[1].t;
r=0;
for(i=0;i<25;)
if (p==airt){
r=RecordData.AirPhysics[i].cp;
break;
}
else if(airt>p && airt<q) {
r=RecordData.AirPhysics[i-1].cp+
(RecordData.AirPhysics[i].cp-RecordData.AirPhysics[i-1].cp) *
(q-p)/(airt-p);
break;
}
else {
p=q;
i++;
q=RecordData.AirPhysics[i].t;
}
return r;
}
double __stdcall FindAirPhysicsP(double &airt,ExhCADData &RecordData){
double p,q,r;
int i;
p=RecordData.AirPhysics[0].t;
q=RecordData.AirPhysics[1].t;
for(i=0;i<25;)
if (p==airt){
r=RecordData.AirPhysics[i].p;
break;
}
else if(airt>p && airt<q) {
r=RecordData.AirPhysics[i-1].p+
(RecordData.AirPhysics[i].p-RecordData.AirPhysics[i-1].p) *
(q-p)/
(airt-p);
break;
}
else {
p=q;
i++;
q=RecordData.AirPhysics[i].t;
}
return r;
}
double __stdcall FindAirPhysicsR(double &airt,ExhCADData &RecordData){
double p,q,r;
int i;
p=RecordData.AirPhysics[0].t;
q=RecordData.AirPhysics[1].t;
for(i=0;i<25;)
if (p==airt){
r=RecordData.AirPhysics[i].p;
break;
}
else if(airt>p && airt<q) {
r=RecordData.AirPhysics[i-1].r+
(RecordData.AirPhysics[i].r-RecordData.AirPhysics[i-1].r) *
(q-p)/
(airt-p);
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -