#ifndef FLOWCAL_H
#define FLOWCAL_H
#include "NGCal.h"
typedef struct FlowParSTRUCT {


	int dCbtj;
	double dPb_M;
	double dTb_M;
	double dPb_E;
	double dTb_E;
	double dPatm;
	double dNG_Compents[21];

	int dMeterType;
	int dCoreType;
	int dPtmode;
	int dPipeType;
	double dPipeD;
	int dPipeMaterial;

	double dOrificeD;
	int dOrificeMaterial;

	double dPf;
	int dPfType;
	double dTf;
	double dDp;

	double dMeterFactor;
	double dPulseNum;



	double dE;
	double dFG;
	double dFT;
	double dDViscosity;
	double dDExpCoefficient;
	double dRnPipe;
	double dBk;
	double dRoughNessPipe;
	double dCd;
	double dCdCorrect;
	double dCdNozell;
	double dVFlowb;
	double dVFlowf;
	double dMFlowb;
	double dEFlowb;
	double dVelocityFlow;
	double dPressLost;
	double dBeta;
	double dKappa;
	double dFpv;
} FlowParSTRUCT;

double CaiLiaoPzxs(int tempCaiLiao);

double calculateK(int dPipeType);

double calculateRoughnessFactor(double D_pipe, double K, double C);

void thermalExpansionCorrection(double dOrificeMaterial, double dOrificeD,
								double dPipeMaterial, double dPipeD,
								double dTf, double correctedValues[3]);

double calculateE(double beta);

double calculateFG(double dRD_Real);

double calculateFT(double dTb_M, double dTf);

double calculateEpsilon(double dPf, double dDp, double beta, double dKappa);

double calculateKappa(double dZf);

double calculateReD(double Qf, double D, double rho, double mu);

double calculateCd(double beta, double ReD, double D_mm, int ptMode);


double Dlndjs(double tempP_jy, double tempT);

void OFlowCal(FlowParSTRUCT *ptFlowPar, NGParSTRUCT *ptNGPar);

void NGFlowCal(void);

#endif

