GasFlowMeter/User/NG/Therm.h

74 lines
1.7 KiB
C
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/*************************************************************************
* 文件: therm.h
* 描述: Therm类的头文件
**************************************************************************/
#ifndef _THERM_H
#define _THERM_H
#include "NGCal.h"
#include "Detail.h"
// Therm类
typedef struct Therm {
// 成员数据
double dT; // 当前温度,单位开尔文(K)
double dP; // 当前压力,单位帕斯卡(Pa)
double dD; // 摩尔密度单位mol/dm3
double dRho; // 质量密度单位kg/m3
double dPdD; // P对D的偏导数
double dPdT; // P对T的偏导数
double dSi; // 理想气体比熵单位kJ/kg.K
double dTold; // 之前使用的温度
double dMrxold; // 之前使用的混合物摩尔质量
// 方法指针
double (*CpiMolar)(struct Therm*, NGParSTRUCT*);
void (*Run)(struct Therm*, NGParSTRUCT*, Detail*);
double (*Ho)(struct Therm*, NGParSTRUCT*);
double (*So)(struct Therm*, NGParSTRUCT*);
void (*CprCvrHS)(struct Therm*, NGParSTRUCT*, Detail*);
double (*H)(struct Therm*, NGParSTRUCT*, Detail*);
double (*S)(struct Therm*, NGParSTRUCT*, Detail*);
void (*HS_Mode)(struct Therm*, NGParSTRUCT*, Detail*, double, double, int);
} Therm;
// Therm类的构造函数和析构函数
Therm* Therm_construct(void);
void Therm_destruct(Therm* obj);
// Therm类使用的其他数据
// 使用 extern 声明变量
extern int GK_points;
extern double GK_root[5];
extern double GK_weight[5];
extern double ThermConstants[21][11];
// 热化学卡路里到焦耳的转换常数: 1 cal(IT) = 4.1840 J
extern double CalTH ;
// 系数索引的枚举
enum CoefficientList {
coefA = 0,
coefB,
coefC,
coefD,
coefE,
coefF,
coefG,
coefH,
coefI,
coefJ,
coefK
};
#endif