package com.ng.ngtools.modules;

public class NG_Cal
{
	public static final int NORMAL = 9000;
	public static final int NG_Cal_INITIALIZED = 9001;
	public static final int MEMORY_ALLOCATION_ERROR = 9002;
	public static final int GENERAL_CALCULATION_FAILURE = 9003;
	public static final int MAX_NUM_OF_ITERATIONS_EXCEEDED = 9004;
	public static final int NEGATIVE_DENSITY_DERIVATIVE = 9005;
	public static final int MAX_DENSITY_IN_BRAKET_EXCEEDED = 9006;
	/* number of components */
	public static final int NUMBEROFCOMPONENTS = 21;
	/* maximum number of tries within search routines */
	public static final int MAX_NUM_OF_ITERATIONS = 100;
	/* default tolerance limits */
	public static final double P_CHG_TOL = 0.001; // 0.001 Pa
	public static final double T_CHG_TOL = 0.001; // 0.001 of a Kelvin
										   /* maximum allowable P & T */
	public static final double P_MAX = 1.379e8; // maximum pressure (Pa) ~= 20,000 psi
	public static final double P_MIN = 0.0; // maximum pressure = 0
	public static final double T_MAX = 473.15; // maximum temperature (K) ~= 392 F
	public static final double T_MIN = 143.0; // maximum temperature (K) ~= -200 F
									   /* universal gas constant, in two configurations */
	public static final double RGASKJ = 8.314510e-3; // in kJ mol^-1 K^-1
	public static final double RGAS = 8.314510; // in J mol^-1 K^-1
	public Therm ptTherm;
	public Detail ptDetail;

	//public struct SqgyParStruct   //输气工艺相关参数
	//{
	//    public int dCalName; //计算项目
	//    public int dPipleD; //管道内径mm
	//    public int dPipleDw; //管道内径外径mm
	//    public int dPipleBh; //管道壁厚 mm
	//    public double dPipleTotalLength; //管道总长度 km
	//    public double dPiplePointLength; //管道任意点长度 km
	//    public double dPstart; //起点压力终点压力MPa
	//    public double dPend; //终点压力MPa
	//    public double dFlow; //输气能力
	//    public double dRd;//相对密度
	//    public double dZf;//压缩因子
	//    public double[] dNG_Compents;//天然气组分

	//    public double dPavg;//管道平均压力
	//    public double dPavgPoint;//管道任意点的平均压力


	//}

	public static  void main(String[] args){
		 System.out.println("ngtools");
	}


	/* FUNCTION PROTOTYPES */
	/* prototypes for initialization */
	// int NG_Cal_Init(void) ; /* initialize library */
	// int NG_Cal_UnInit(void) ; /* un-initialize library */
	//*** function prototype for basic VOS calculation */
	//*/
	// double SOS(ref AGA10.GasPropsSTRUCT ) ;
	//*** function prototype for a C* calculation */
	//*/
	// double Crit(ref AGA10.GasPropsSTRUCT , double) ;

	/**************************************************************************

	* Function : NG_Cal_Init()
	* Arguments : void
	* Returns : int
	* Purpose : Initializes library; creates required objects
	* Revisions :
	**************************************************************************/

	public final int NG_Cal_Init()
	{
		//create object for calculating density
		if (null == (ptDetail = new Detail()))
		{
			return MEMORY_ALLOCATION_ERROR;
		}

		//create object for calculating thermodynamic properties
		if (null == (ptTherm = new Therm()))
		{
			return MEMORY_ALLOCATION_ERROR;
		}

		return NG_Cal_INITIALIZED;

	} // NG_Cal_Init

	/**************************************************************************

	* Function : NG_Cal_UnInit()
	* Arguments : void
	* Returns : int
	* Purpose : Un-initializes library; deletes objects
	* Revisions :
	**************************************************************************/

	public final int NG_Cal_UnInit()
	{
		// delete the objects (if they exist)
		ptDetail = null;
		ptTherm = null;
		return 0;

	} // NG_Cal_UnInit

	/**************************************************************************
	* Function : SOS()
	* Arguments : Pointers to external AGA10 data struct
	* Returns : double
	* Purpose : calculates speed of sound and other parameters
	* Revisions :
	**************************************************************************/

	public final double SOS(com.ng.ngtools.tangible.RefObject<GasPropsSTRUCT> ptAGA10)
	{
		// check if library is ready; initialize if necessary
		if (null == ptDetail || null == ptTherm)
		{
			NG_Cal_UnInit();
			NG_Cal_Init();

		}

		switch (ptAGA10.argValue.dCbtj)
		{
			case 2:
				ptAGA10.argValue.dPb = 101325;
				ptAGA10.argValue.dTb = 273.15;
				break;
			case 1:
				ptAGA10.argValue.dPb = 101325;
				ptAGA10.argValue.dTb = 288.15;
				break;
			case 0:
				ptAGA10.argValue.dPb = 101325;
				ptAGA10.argValue.dTb = 293.15;
				break;
		}


		//Call function to calculate densities and thermodynamic properties
		com.ng.ngtools.tangible.RefObject<com.ng.ngtools.modules.Detail> tempRef_ptDetail = new com.ng.ngtools.tangible.RefObject<com.ng.ngtools.modules.Detail>(ptDetail);
		ptTherm.Run(ptAGA10, tempRef_ptDetail);
	ptDetail = tempRef_ptDetail.argValue;

		//the basic sound speed calculation doesn't calculate C*; initialize to zero
		ptAGA10.argValue.dCstar = 0.0;

		//return the speed of sound to caller

		return ptAGA10.argValue.dSOS;

	} // VOS()

	/**************************************************************************

	* Function : Crit()
	* Arguments : Pointers to external AGA10 data struct, Detail and Therm
	*  objects and a double precision float (gas velocity in plenum)
	* Returns : double
	* Purpose : calculates C*
	* Revisions :
	**************************************************************************/

	public  final double Crit(com.ng.ngtools.tangible.RefObject<GasPropsSTRUCT> ptAGA10, double dPlenumVelocity)
	{
		//variables local to function
		double DH, DDH, S, H;
		double tolerance = 1.0;
		double R, P, T, Z;

		int i;

		//check objects for readiness; try to initialize if not
		if (null == ptDetail || null == ptTherm)
		{
			NG_Cal_UnInit();

			if (NG_Cal_INITIALIZED != NG_Cal_Init())
			{

				ptAGA10.argValue.lStatus = MEMORY_ALLOCATION_ERROR;
				return 0.0;

			}
		}
		switch (ptAGA10.argValue.dCbtj)
		{
			case 2:
				ptAGA10.argValue.dPb = 101325;
				ptAGA10.argValue.dTb = 273.15;
				break;
			case 1:
				ptAGA10.argValue.dPb = 101325;
				ptAGA10.argValue.dTb = 288.15;
				break;
			case 0:
				ptAGA10.argValue.dPb = 101325;
				ptAGA10.argValue.dTb = 293.15;
				break;


		}
		//begin by calculating densities and thermodynamic properties
		com.ng.ngtools.tangible.RefObject<com.ng.ngtools.modules.Detail> tempRef_ptDetail = new com.ng.ngtools.tangible.RefObject<com.ng.ngtools.modules.Detail>(ptDetail);
		ptTherm.Run(ptAGA10, tempRef_ptDetail);
	ptDetail = tempRef_ptDetail.argValue;

		//DH is enthalpy change from plenum to throat; this is our initial guess

		DH = (ptAGA10.argValue.dSOS * ptAGA10.argValue.dSOS - dPlenumVelocity * dPlenumVelocity) / 2.0;

		//trap plenum conditions before we alter the data stucture's contents
		S = ptAGA10.argValue.dS;
		H = ptAGA10.argValue.dH;
		R = ptAGA10.argValue.dRhof;
		P = ptAGA10.argValue.dPf;
		Z = ptAGA10.argValue.dZf;
		T = ptAGA10.argValue.dTf;

		//initialize delta of DH to an arbitrary value outside of

		//convergence tolerance
		DDH = 10.0;

		//Via simple repetition, search for a pressure, temperature and sound speed

		//at a nozzle throat which provide constant enthalpy, given the entropy known
		//at the plenum. Abort if loop executes more than 100 times without convergence.
		for (i = 1; i < MAX_NUM_OF_ITERATIONS; i++)
		{
			// calculate P and T to satisfy H and S
			com.ng.ngtools.tangible.RefObject<com.ng.ngtools.modules.Detail> tempRef_ptDetail2 = new com.ng.ngtools.tangible.RefObject<com.ng.ngtools.modules.Detail>(ptDetail);
			ptTherm.HS_Mode(ptAGA10, tempRef_ptDetail2, H - DH, S, true);
		ptDetail = tempRef_ptDetail2.argValue;

			//calculate new thermo, including SOS
			com.ng.ngtools.tangible.RefObject<com.ng.ngtools.modules.Detail> tempRef_ptDetail3 = new com.ng.ngtools.tangible.RefObject<com.ng.ngtools.modules.Detail>(ptDetail);
			ptTherm.Run(ptAGA10, tempRef_ptDetail3);
		ptDetail = tempRef_ptDetail3.argValue;

			//hold DH for tolerance check

			DDH = DH;

			// recalculate DH

			DH = (ptAGA10.argValue.dSOS * ptAGA10.argValue.dSOS - dPlenumVelocity * dPlenumVelocity) / 2.0;

			// end loop if tolerance reached

			if (Math.abs(DDH - DH) < tolerance)
			{
				break;
			}
		}

		//C* is the real gas critical flow constant (not to be confused with Cperf or CRi)
		ptAGA10.argValue.dCstar = (ptAGA10.argValue.dRhof * ptAGA10.argValue.dSOS) / Math.sqrt(R * P * Z);

		//put the original plenum pressure and temperature back

		ptAGA10.argValue.dPf = P;
		ptAGA10.argValue.dTf = T;

		//restore fluid props to plenum conditions
		com.ng.ngtools.tangible.RefObject<com.ng.ngtools.modules.Detail> tempRef_ptDetail4 = new com.ng.ngtools.tangible.RefObject<com.ng.ngtools.modules.Detail>(ptDetail);
		ptTherm.Run(ptAGA10, tempRef_ptDetail4);
	ptDetail = tempRef_ptDetail4.argValue;

		GB11062 ptGB11062 = new GB11062();

		ptGB11062.Run(ptAGA10);

		//return the critical flow function to caller
		return ptAGA10.argValue.dCstar;

	} // Crit()

	/**************************************************************************

  * Function : Crit()
  * Arguments : Pointers to external AGA10 data struct, Detail and Therm
  *  objects and a double precision float (gas velocity in plenum)
  * Returns : double
  * Purpose : calculates C*
  * Revisions :
  **************************************************************************/

	public final double Zcal(com.ng.ngtools.tangible.RefObject<GasPropsSTRUCT> ptAGA10, double dPlenumVelocity)
	{
		//variables local to function



		//check objects for readiness; try to initialize if not
		if (null == ptDetail || null == ptTherm)
		{
			NG_Cal_UnInit();

			if (NG_Cal_INITIALIZED != NG_Cal_Init())
			{
				ptAGA10.argValue.lStatus = MEMORY_ALLOCATION_ERROR;
				return 0.0;
			}
		}
		switch (ptAGA10.argValue.dCbtj)
		{
			case 0:
				ptAGA10.argValue.dPb = 101325;
				ptAGA10.argValue.dTb = 293.15;
				break;
			case 1:
				ptAGA10.argValue.dPb = 101325;
				ptAGA10.argValue.dTb = 288.15;
				break;
			case 2:
				ptAGA10.argValue.dPb = 101325;
				ptAGA10.argValue.dTb = 273.15;
				break;




		}
		//begin by calculating densities and thermodynamic properties
		com.ng.ngtools.tangible.RefObject<com.ng.ngtools.modules.Detail> tempRef_ptDetail = new com.ng.ngtools.tangible.RefObject<com.ng.ngtools.modules.Detail>(ptDetail);
		ptTherm.Run(ptAGA10, tempRef_ptDetail);
	ptDetail = tempRef_ptDetail.argValue;


		GB11062 ptGB11062 = new GB11062();

		ptGB11062.Run(ptAGA10);

		//return the critical flow function to caller
		return ptAGA10.argValue.dZf;

	} // Z()

	/**************************************************************************
	* Function : Cperf()
	* Arguments : pointer to external AGA10 data struct
	* Returns : double
	* Purpose : calculates isentropic perfect gas critical flow function
	* Revisions :
	**************************************************************************/

	private double Cperf(com.ng.ngtools.tangible.RefObject<GasPropsSTRUCT> ptAGA10)
	{

		double k, root, exponent;

		k = ptAGA10.argValue.dKappa;
		root = 2.0 / (k + 1.0);
		exponent = (k + 1.0) / (k - 1.0);

		// isentropic perfect gas critical flow function C*i
		return (Math.sqrt(k * Math.pow(root, exponent)));

	} // Cperf

	 /**************************************************************************
	 * Function : CRi()
	 * Arguments : pointer to external AGA10 data struct
	 * Returns : double
	 * Purpose : calculates isentropic real gas critical flow function CRi
	 * Revisions :
	 **************************************************************************/

	private double CRi(com.ng.ngtools.tangible.RefObject<GasPropsSTRUCT> ptAGA10)
	{
		return (Cperf(ptAGA10) / Math.sqrt(ptAGA10.argValue.dZf));
	} // CRi()

	/* enumerations for tracking gas components */
	private enum gascomp
	{
		XiC1(0),
		XiN2(1),
		XiCO2(2),
		XiC2(3),
		XiC3(4),
		XiH2O(5),
		XiH2S(6),
		XiH2(7),
		XiCO(8),
		XiO2(9),
		XiIC4(10),
		XiNC4(11),
		XiIC5(12),
		XiNC5(13),
		XiNC6(14),
		XiNC7(15),
		XiNC8(16),
		XiNC9(17),
		XiNC10(18),
		XiHe(19),
		XiAr(20);

		public static final int SIZE = Integer.SIZE;
		private static java.util.HashMap<Integer, gascomp> mappings;
		private final int intValue;
		gascomp(int value)
		{
			intValue = value;
			getMappings().put(value, this);
		}

		private static java.util.HashMap<Integer, gascomp> getMappings()
		{
			if (mappings == null)
			{
				synchronized (gascomp.class)
				{
					if (mappings == null)
					{
						mappings = new java.util.HashMap<Integer, gascomp>();
					}
				}
			}
			return mappings;
		}

		public static gascomp forValue(int value)
		{
			return getMappings().get(value);
		}

		public int getValue()
		{
			return intValue;
		}
	}

	/* the main data structure used by this library */
//C# TO JAVA CONVERTER WARNING: Java does not allow user-defined value types. The behavior of this class will differ from the original:
//ORIGINAL LINE: public struct GasPropsSTRUCT
	public final static class GasPropsSTRUCT
	{ // corresponds to the control group in meter classes

		public int lStatus; // calculation status 计算状态
		public boolean bForceUpdate; //执行全部计算的标志 signal to perform full calculation
		public double[] adMixture; //气体摩尔组成 Composition in mole fraction
		public double[] adMixtureV; //气体体积组成 Composition in mole fraction
		public double[] adMixtureD; //气体质量组成 Composition in mole fraction
		public int dCbtj; //参比条件 101325 0,15,20
		public double dPb; //参比压力 Contract base Pressure (Pa)
		public double dTb; // 参比温度Contract base temperature (K)
		public double dPf; //绝对压力 Absolute Pressure (Pa)
		public double dTf; //工况温度 Flowing temperature (K)
							// basic output from AGA 8 Detail method
		public double dMrx; //分子量 mixture molar mass
		public double dZb; // 标况压缩因子compressibility at contract base condition
		public double dZf; // 工况压缩因子compressibility at flowing condition
		public double dFpv; //超压缩系数 supercompressibility
		public double dDb; // 标况摩尔密度molar density at contract base conditions (moles/dm3)
		public double dDf; //工况摩尔密度 molar density at flowing conditions (moles/dm3)
		public double dRhob; // 标况质量密度mass density at contract base conditions (kg/m3)
		public double dRhof; //工况质量密度 mass density at flowing conditions (kg/m3)
		public double dRD_Ideal; // 理想气体的相对密度ideal gas relative density
		public double dRD_Real; // 真实气体的相对密度real gas relative density
								 // additional output
		public double dHo; //理想气体的比焓 ideal gas specific enthalpy
		public double dH; //真实气体的焓 real gas specific enthalpy (J/kg)
		public double dS; // 真实气体的熵real gas specific entropy (J/kg-mol.K)
		public double dCpi; //理想气体定压热容 ideal gas constant pressure heat capacity (J/kg-mol.K)
		public double dCp; // 定压热容real gas constant pressure heat capacity (J/kg-mol.K)
		public double dCv; //定容积热容 real gas constant volume heat capacity (J/kg-mol.K)
		public double dk; // 比热比ratio of specific heats
		public double dKappa; //等熵指数 isentropic exponent, denoted with Greek letter kappa
		public double dSOS; // 声速speed of sound (m/s)
		public double dCstar; //临界流函数 critical flow factor C*

		// 11062 输出

		public double dHhvMol; //摩尔高位发热量
		public double dLhvMol; //摩尔低位发热量
		public double dHhvv; //体积高位发热量
		public double dLhvv; //体积低位发热量
		public double dHhvm; //质量高位发热量
		public double dLhvm; //质量地位发热量

		public double dZb11062; //标况压缩因子
		public double dRhob11062; // 标况质量密度mass density at contract base conditions (kg/m3)
		public double dRhof11062; //工况质量密度 mass density at flowing conditions (kg/m3)
		public double dRD_Ideal11062; // 理想气体的相对密度ideal gas relative density
		public double dRD_Real11062; // 真实气体的相对密度real gas relative density
		public double dWobbeIndex; // 真实气体的沃泊指数


		public double Pc; //  '临界压力
		public double TC; /// '临界温度
		public double Bzsx; //  '爆炸上限
		public double Bzxx; //  '爆炸下限
		public double TotalC; //  '总炭含量 (kg/m3)
		public double C2; // 'C2组分含量 (kg/m3)
		public double C2j; // 'C2以上组分含量 (kg/m3)
		public double C3j; // 'C3以上组分含量 (kg/m3)
		public double C4j; // 'C4以上组分含量 (kg/m3)
		public double C5j; //  'C5以上组分含量 (kg/m3)
		public double C6j; //  'C6以上组分含量 (kg/m3)
		public double C3C4; //   'C3C4组分含量 (kg/m3)


		public GasPropsSTRUCT clone()
		{
			GasPropsSTRUCT varCopy = new GasPropsSTRUCT();

			varCopy.lStatus = this.lStatus;
			varCopy.bForceUpdate = this.bForceUpdate;
			varCopy.adMixture = this.adMixture;
			varCopy.adMixtureV = this.adMixtureV;
			varCopy.adMixtureD = this.adMixtureD;
			varCopy.dCbtj = this.dCbtj;
			varCopy.dPb = this.dPb;
			varCopy.dTb = this.dTb;
			varCopy.dPf = this.dPf;
			varCopy.dTf = this.dTf;
			varCopy.dMrx = this.dMrx;
			varCopy.dZb = this.dZb;
			varCopy.dZf = this.dZf;
			varCopy.dFpv = this.dFpv;
			varCopy.dDb = this.dDb;
			varCopy.dDf = this.dDf;
			varCopy.dRhob = this.dRhob;
			varCopy.dRhof = this.dRhof;
			varCopy.dRD_Ideal = this.dRD_Ideal;
			varCopy.dRD_Real = this.dRD_Real;
			varCopy.dHo = this.dHo;
			varCopy.dH = this.dH;
			varCopy.dS = this.dS;
			varCopy.dCpi = this.dCpi;
			varCopy.dCp = this.dCp;
			varCopy.dCv = this.dCv;
			varCopy.dk = this.dk;
			varCopy.dKappa = this.dKappa;
			varCopy.dSOS = this.dSOS;
			varCopy.dCstar = this.dCstar;
			varCopy.dHhvMol = this.dHhvMol;
			varCopy.dLhvMol = this.dLhvMol;
			varCopy.dHhvv = this.dHhvv;
			varCopy.dLhvv = this.dLhvv;
			varCopy.dHhvm = this.dHhvm;
			varCopy.dLhvm = this.dLhvm;
			varCopy.dZb11062 = this.dZb11062;
			varCopy.dRhob11062 = this.dRhob11062;
			varCopy.dRhof11062 = this.dRhof11062;
			varCopy.dRD_Ideal11062 = this.dRD_Ideal11062;
			varCopy.dRD_Real11062 = this.dRD_Real11062;
			varCopy.dWobbeIndex = this.dWobbeIndex;
			varCopy.Pc = this.Pc;
			varCopy.TC = this.TC;
			varCopy.Bzsx = this.Bzsx;
			varCopy.Bzxx = this.Bzxx;
			varCopy.TotalC = this.TotalC;
			varCopy.C2 = this.C2;
			varCopy.C2j = this.C2j;
			varCopy.C3j = this.C3j;
			varCopy.C4j = this.C4j;
			varCopy.C5j = this.C5j;
			varCopy.C6j = this.C6j;
			varCopy.C3C4 = this.C3C4;

			return varCopy;
		}
	}

//C# TO JAVA CONVERTER WARNING: Java does not allow user-defined value types. The behavior of this class will differ from the original:
//ORIGINAL LINE: public struct FlowParStruct
	public final static class FlowParStruct //流量相关参数
	{
		//流量计算输入参数信息
		public int dFlowCalbz; //流量计算标准
		public int dZcalbz; //压缩因子计算标准
		public int dCbtj; //计量参比条件压力
		public double dPb_M; //计量参比条件压力
		public double dTb_M; //计量参比条件温度
		public double dPb_E; //燃烧参比条件压力
		public double dTb_E; //燃烧参比条件温度
		public double dPatm; //当地大气压
		public int dPatmUnit; //当地大气压单位
		public double[] dNG_Compents; //天然气组分

		public int dMeterType; // 流量计类别
		public int dCoreType; //节流装置类型
		public int dPtmode; //取压方式
		public int dPipeType; // 管道类型
		public double dPipeD; //管道内径
		public int dLenUnit; //长度单位
		public double dPipeDtemp; //管道内径参考温度
		public int dPileDtempUint; //温度单位
		public double dPipeMaterial; //管道材料

		public double dOrificeD; //孔板孔径
		public int dOrificeUnit; //长度单位
		public double dOrificeDtemp; //孔板内径参考温度
		public int dOrificeDtempUnit; //温度单位
		public double dOrificeMaterial; //孔板材料
		public int dOrificeSharpness; //锐利度系数计算方法
		public double dOrificeRk; //孔板入口圆弧半径
		public int dOrificeRkLenUint; //长度单位
		public double dPf; //输入压力
		public int dPfUnit; //压力单位
		public int dPfType; //压力类型
		public double dTf; //输入温度
		public int dTfUnit; //温度单位
		public double dDp; //输入差压
		public int dDpUnit; //压力单位
		public int dVFlowUnit; //体积流量单位
		public int dMFlowUnit; //'NG_Par(33) = ComboBox15.SelectedIndex  '质量流量单位
		public int dEFlowUnit; //'NG_Par(34) = ComboBox16.SelectedIndex  '能量流量单位
		public double dCd; //流出系数
		public double dCdCalMethod; //流出系数计算方法   0 检定证书  0回归公式
		public double dMeterFactor; //仪表系数
		public double dPulseNum; //脉冲数

		public double dVFlowMax; //'NG_par(39)＝’最大体积流量
		public double dVFlowMin; //'NG_par(40)＝’最小体积流量
		public double dVFlowCon; //'NG_par(41)＝’常用流量
		public double dPfRangeMin; //'NG_par(42)＝’压力量程
		public double dPfRangeMax; //'NG_par(42)＝’压力量程
		public double dDpRangeMin; //'NG_par(43)＝’差压量程
		public double dDpRangeMax; //'NG_par(43)＝’差压量程
		public double dTfRangeMin; //'NG_par(44)＝’温度计量程
		public double dTfRangeMax; //'NG_par(44)＝’温度计量程

		public double dVGsc;// 管束车水容积


		//流量计算输出参数
		public double dE; //'求渐近速度系数 E
		public double dFG; //'求相对密度系数 FG
		public double dFT; //'求流动温度系数 'FT
		public double dDViscosity; //'求动力粘度 dlnd
		public double dDExpCoefficient; //'求可膨胀系数
		public double dRnPipe; //'管道雷诺数
		public double dBk; //'孔板锐利度系数Bk
		public double dRoughNessPipe; //'管道粗糙度系数 Gme
		public double dCdCorrect; //'修正后的流出系数
		public double dCdNozell; //'喷嘴的流出系数
		public double dVFlowb; //'标况体积流量 m³、s
		public double dVFlowf; //'工况体积流量
		public double dMFlowb; //'标况质量流量
		public double dEFlowb; //'标况能量流量
		public double dVelocityFlow; //'管道内天然气流速
		public double dPressLost; //'压力损失
		public double dBeta; //'直径比
		public double dKappa; //'等熵指数

		public double dVCNG; //'CNG体积



		public FlowParStruct clone()
		{
			FlowParStruct varCopy = new FlowParStruct();

			varCopy.dFlowCalbz = this.dFlowCalbz;
			varCopy.dZcalbz = this.dZcalbz;
			varCopy.dCbtj = this.dCbtj;
			varCopy.dPb_M = this.dPb_M;
			varCopy.dTb_M = this.dTb_M;
			varCopy.dPb_E = this.dPb_E;
			varCopy.dTb_E = this.dTb_E;
			varCopy.dPatm = this.dPatm;
			varCopy.dPatmUnit = this.dPatmUnit;
			varCopy.dNG_Compents = this.dNG_Compents;
			varCopy.dMeterType = this.dMeterType;
			varCopy.dCoreType = this.dCoreType;
			varCopy.dPtmode = this.dPtmode;
			varCopy.dPipeType = this.dPipeType;
			varCopy.dPipeD = this.dPipeD;
			varCopy.dLenUnit = this.dLenUnit;
			varCopy.dPipeDtemp = this.dPipeDtemp;
			varCopy.dPileDtempUint = this.dPileDtempUint;
			varCopy.dPipeMaterial = this.dPipeMaterial;
			varCopy.dOrificeD = this.dOrificeD;
			varCopy.dOrificeUnit = this.dOrificeUnit;
			varCopy.dOrificeDtemp = this.dOrificeDtemp;
			varCopy.dOrificeDtempUnit = this.dOrificeDtempUnit;
			varCopy.dOrificeMaterial = this.dOrificeMaterial;
			varCopy.dOrificeSharpness = this.dOrificeSharpness;
			varCopy.dOrificeRk = this.dOrificeRk;
			varCopy.dOrificeRkLenUint = this.dOrificeRkLenUint;
			varCopy.dPf = this.dPf;
			varCopy.dPfUnit = this.dPfUnit;
			varCopy.dPfType = this.dPfType;
			varCopy.dTf = this.dTf;
			varCopy.dTfUnit = this.dTfUnit;
			varCopy.dDp = this.dDp;
			varCopy.dDpUnit = this.dDpUnit;
			varCopy.dVFlowUnit = this.dVFlowUnit;
			varCopy.dMFlowUnit = this.dMFlowUnit;
			varCopy.dEFlowUnit = this.dEFlowUnit;
			varCopy.dCd = this.dCd;
			varCopy.dCdCalMethod = this.dCdCalMethod;
			varCopy.dMeterFactor = this.dMeterFactor;
			varCopy.dPulseNum = this.dPulseNum;
			varCopy.dVFlowMax = this.dVFlowMax;
			varCopy.dVFlowMin = this.dVFlowMin;
			varCopy.dVFlowCon = this.dVFlowCon;
			varCopy.dPfRangeMin = this.dPfRangeMin;
			varCopy.dPfRangeMax = this.dPfRangeMax;
			varCopy.dDpRangeMin = this.dDpRangeMin;
			varCopy.dDpRangeMax = this.dDpRangeMax;
			varCopy.dTfRangeMin = this.dTfRangeMin;
			varCopy.dTfRangeMax = this.dTfRangeMax;
			varCopy.dVGsc = this.dVGsc;

			varCopy.dE = this.dE;
			varCopy.dFG = this.dFG;
			varCopy.dFT = this.dFT;
			varCopy.dDViscosity = this.dDViscosity;
			varCopy.dDExpCoefficient = this.dDExpCoefficient;
			varCopy.dRnPipe = this.dRnPipe;
			varCopy.dBk = this.dBk;
			varCopy.dRoughNessPipe = this.dRoughNessPipe;
			varCopy.dCdCorrect = this.dCdCorrect;
			varCopy.dCdNozell = this.dCdNozell;
			varCopy.dVFlowb = this.dVFlowb;
			varCopy.dVFlowf = this.dVFlowf;
			varCopy.dMFlowb = this.dMFlowb;
			varCopy.dEFlowb = this.dEFlowb;
			varCopy.dVelocityFlow = this.dVelocityFlow;
			varCopy.dPressLost = this.dPressLost;
			varCopy.dBeta = this.dBeta;
			varCopy.dKappa = this.dKappa;
			varCopy.dVCNG = this.dVCNG;


			return varCopy;
		}
	}
}