201 lines
6.6 KiB
C#
201 lines
6.6 KiB
C#
|
using NG_Tools;
|
|||
|
using System;
|
|||
|
using System.Collections.Generic;
|
|||
|
using System.Linq;
|
|||
|
using System.Text;
|
|||
|
using System.Web;
|
|||
|
using System.Web.UI;
|
|||
|
using System.Web.UI.WebControls;
|
|||
|
|
|||
|
namespace NGTools.Pages.A_FLowCal
|
|||
|
{
|
|||
|
public partial class orifice : System.Web.UI.Page
|
|||
|
{
|
|||
|
|
|||
|
protected void Page_Load(object sender, EventArgs e)
|
|||
|
{
|
|||
|
//if (Request.QueryString["action"] == "Cal")
|
|||
|
//{
|
|||
|
// string[] tempPar = Request["Par"].Split(',');
|
|||
|
|
|||
|
// Flowcal(tempPar);
|
|||
|
|
|||
|
|
|||
|
//}
|
|||
|
}
|
|||
|
|
|||
|
private void Flowcal(string[] par)
|
|||
|
{
|
|||
|
|
|||
|
double[] ngCom = new double[21];
|
|||
|
double[] tempPar = new double[110];
|
|||
|
for (int i = 0; i < par.Length; i++)
|
|||
|
{
|
|||
|
if (i != 11)
|
|||
|
{
|
|||
|
tempPar[i] = double.Parse(par[i]);
|
|||
|
}
|
|||
|
else
|
|||
|
{
|
|||
|
for (int j = 0; j < 21; j++)
|
|||
|
{
|
|||
|
ngCom[j] = double.Parse(par[11].Split('_')[j]) / 100;
|
|||
|
}
|
|||
|
}
|
|||
|
}
|
|||
|
FlowCal NGFLOW = new FlowCal();
|
|||
|
NG_Cal.FlowParStruct flPar = new NG_Cal.FlowParStruct();
|
|||
|
NG_Cal.GasPropsSTRUCT gasPar = new NG_Cal.GasPropsSTRUCT();
|
|||
|
gasPar.adMixture = ngCom;
|
|||
|
|
|||
|
UnitConvert MyConvert = new UnitConvert();
|
|||
|
|
|||
|
|
|||
|
flPar.dMeterType = (int)tempPar[0]; //流量计类别
|
|||
|
flPar.dCoreType = (int)tempPar[1]; //节流装置类型
|
|||
|
flPar.dFlowCalbz = (int)tempPar[2]; //流量计算标准
|
|||
|
flPar.dZcalbz = (int)tempPar[3]; //压缩因子计算标准
|
|||
|
flPar.dCbtj = (int)tempPar[4]; //'计量参比条件
|
|||
|
flPar.dPb_M = tempPar[5]; //计量参比条件压力
|
|||
|
flPar.dTb_M = tempPar[6]; //计量参比条件温度
|
|||
|
flPar.dPb_E = tempPar[7]; //燃烧参比条件压力
|
|||
|
flPar.dTb_E = tempPar[8]; //燃烧参比条件温度
|
|||
|
flPar.dPatmUnit = (int)tempPar[10]; //当地大气压单位
|
|||
|
flPar.dPatm = MyConvert.Converter("yl", tempPar[9], flPar.dPatmUnit, 0, 4); ; //当地大气压
|
|||
|
flPar.dNG_Compents = gasPar.adMixture; //天然气组分
|
|||
|
flPar.dPtmode = (int)tempPar[12]; //取压方式
|
|||
|
flPar.dPipeType = (int)tempPar[13]; //管道类型
|
|||
|
flPar.dPipeD = tempPar[14]; //管道内径
|
|||
|
flPar.dLenUnit = (int)tempPar[15]; //长度单位
|
|||
|
flPar.dPipeDtemp = tempPar[16]; //管道内径参考温度
|
|||
|
flPar.dPileDtempUint = (int)tempPar[17]; //温度单位
|
|||
|
flPar.dPipeMaterial = (int)tempPar[18]; //管道材料
|
|||
|
flPar.dOrificeD = tempPar[19]; //孔板孔径
|
|||
|
flPar.dOrificeUnit = (int)tempPar[20]; //长度单位
|
|||
|
flPar.dOrificeDtemp = tempPar[21]; //孔板内径参考温度
|
|||
|
flPar.dOrificeDtempUnit = (int)tempPar[22]; //温度单位
|
|||
|
flPar.dOrificeMaterial = (int)tempPar[23]; //孔板材料
|
|||
|
flPar.dOrificeSharpness = (int)tempPar[24]; //锐利度系数计算方法
|
|||
|
flPar.dOrificeRk = tempPar[25]; //孔板入口圆弧半径
|
|||
|
flPar.dOrificeRkLenUint = (int)tempPar[26]; //长度单位
|
|||
|
flPar.dPfUnit = (int)tempPar[28]; //压力单位
|
|||
|
flPar.dPf = MyConvert.Converter("yl", tempPar[27], flPar.dPfUnit, 0, 4); //输入压力
|
|||
|
flPar.dPfType = (int)tempPar[29]; //压力类型
|
|||
|
flPar.dTfUnit = (int)tempPar[31]; //温度单位
|
|||
|
flPar.dTf = MyConvert.Converter("wd", tempPar[30], flPar.dTfUnit, 1, 4); //输入温度
|
|||
|
flPar.dDpUnit = (int)tempPar[33]; //压力单位
|
|||
|
flPar.dDp = MyConvert.Converter("yl", tempPar[32], flPar.dDpUnit, 0, 4); //输入压力; //输入差压
|
|||
|
flPar.dVFlowUnit = (int)tempPar[34]; //体积流量单位
|
|||
|
flPar.dMFlowUnit = (int)tempPar[35]; //质量流量单位
|
|||
|
flPar.dEFlowUnit = (int)tempPar[36]; //能量流量单位
|
|||
|
|
|||
|
//将压力换算为绝压
|
|||
|
if (flPar.dPfType == 0)
|
|||
|
{
|
|||
|
flPar.dPf = flPar.dPf + flPar.dPatm;
|
|||
|
}
|
|||
|
|
|||
|
gasPar.dCbtj = flPar.dCbtj;
|
|||
|
gasPar.dPf = flPar.dPf;
|
|||
|
gasPar.dTf = flPar.dTf;
|
|||
|
|
|||
|
switch (gasPar.dCbtj)
|
|||
|
{
|
|||
|
case 2:
|
|||
|
gasPar.dPb = 101325;
|
|||
|
gasPar.dTb = 273.15;
|
|||
|
break;
|
|||
|
case 1:
|
|||
|
gasPar.dPb = 101325;
|
|||
|
gasPar.dTb = 288.15;
|
|||
|
break;
|
|||
|
case 0:
|
|||
|
gasPar.dPb = 101325;
|
|||
|
gasPar.dTb = 293.15;
|
|||
|
break;
|
|||
|
}
|
|||
|
|
|||
|
NG_Tools.NG_Cal NG_Cal = new NG_Cal();
|
|||
|
NG_Cal.Crit(ref gasPar, 0.0);
|
|||
|
|
|||
|
NGFLOW.OFlowCal(ref gasPar, ref flPar);
|
|||
|
|
|||
|
|
|||
|
tempPar[45] = flPar.dCd;
|
|||
|
tempPar[46] = flPar.dE;
|
|||
|
tempPar[47] = flPar.dFG;
|
|||
|
tempPar[48] = flPar.dFT;
|
|||
|
tempPar[49] = flPar.dDViscosity;
|
|||
|
tempPar[50] = flPar.dDExpCoefficient;
|
|||
|
tempPar[51] = flPar.dRnPipe;
|
|||
|
tempPar[52] = flPar.dBk;
|
|||
|
tempPar[53] = flPar.dRoughNessPipe;
|
|||
|
tempPar[54] = flPar.dCdCorrect;
|
|||
|
tempPar[55] = 0;
|
|||
|
tempPar[56] = flPar.dVFlowb * 86400;
|
|||
|
tempPar[57] = flPar.dVFlowf * 3600;
|
|||
|
tempPar[58] = flPar.dMFlowb;
|
|||
|
tempPar[59] = flPar.dEFlowb;
|
|||
|
tempPar[60] = flPar.dVelocityFlow;
|
|||
|
tempPar[61] = flPar.dPressLost;
|
|||
|
tempPar[62] = flPar.dBeta;
|
|||
|
|
|||
|
tempPar[63] = gasPar.dMrx;
|
|||
|
tempPar[64] = gasPar.dZb;
|
|||
|
tempPar[65] = gasPar.dZf;
|
|||
|
tempPar[66] = gasPar.dFpv;
|
|||
|
tempPar[67] = gasPar.dDb;
|
|||
|
tempPar[68] = gasPar.dDf;
|
|||
|
tempPar[69] = gasPar.dRhob;
|
|||
|
tempPar[70] = gasPar.dRhof;
|
|||
|
tempPar[71] = gasPar.dRD_Ideal;
|
|||
|
tempPar[72] = gasPar.dRD_Real;
|
|||
|
tempPar[73] = gasPar.dHo;
|
|||
|
tempPar[74] = gasPar.dH;
|
|||
|
tempPar[75] = gasPar.dS;
|
|||
|
tempPar[76] = gasPar.dCpi;
|
|||
|
tempPar[77] = gasPar.dCp;
|
|||
|
tempPar[78] = gasPar.dCv;
|
|||
|
tempPar[79] = gasPar.dk;
|
|||
|
tempPar[80] = gasPar.dKappa;
|
|||
|
tempPar[81] = gasPar.dSOS;
|
|||
|
tempPar[82] = gasPar.dCstar;
|
|||
|
tempPar[83] = gasPar.dHhvMol;
|
|||
|
tempPar[84] = gasPar.dLhvMol;
|
|||
|
tempPar[85] = gasPar.dHhvv;
|
|||
|
tempPar[86] = gasPar.dLhvv;
|
|||
|
tempPar[87] = gasPar.dHhvm;
|
|||
|
tempPar[88] = gasPar.dLhvm;
|
|||
|
tempPar[89] = gasPar.dZb11062;
|
|||
|
tempPar[90] = gasPar.dRhob11062;
|
|||
|
tempPar[91] = gasPar.dRhof11062;
|
|||
|
tempPar[92] = gasPar.dRD_Ideal11062;
|
|||
|
tempPar[93] = gasPar.dRD_Real11062;
|
|||
|
tempPar[94] = gasPar.dWobbeIndex;
|
|||
|
tempPar[95] = gasPar.Pc;
|
|||
|
tempPar[96] = gasPar.TC;
|
|||
|
tempPar[97] = gasPar.Bzsx;
|
|||
|
tempPar[98] = gasPar.Bzxx;
|
|||
|
tempPar[99] = gasPar.TotalC;
|
|||
|
tempPar[100] = gasPar.C2;
|
|||
|
tempPar[101] = gasPar.C2j;
|
|||
|
tempPar[102] = gasPar.C3j;
|
|||
|
tempPar[103] = gasPar.C4j;
|
|||
|
tempPar[104] = gasPar.C5j;
|
|||
|
tempPar[105] = gasPar.C6j;
|
|||
|
tempPar[106] = gasPar.C3C4;
|
|||
|
|
|||
|
StringBuilder Json = new StringBuilder();
|
|||
|
Json.Append("[");
|
|||
|
for (int i = 0; i < tempPar.Length; i++)
|
|||
|
{
|
|||
|
Json.Append(tempPar[i].ToString() + ",");
|
|||
|
}
|
|||
|
string json = (Json.Replace(",", "", Json.Length - 1, 1).Append("]")).ToString();
|
|||
|
|
|||
|
Response.Write(json);
|
|||
|
Response.End();
|
|||
|
}
|
|||
|
|
|||
|
}
|
|||
|
}
|