-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathAirMassEstimator.h
98 lines (83 loc) · 2.57 KB
/
AirMassEstimator.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
#ifndef AIRMASSESTIMATOR_H
#define AIRMASSESTIMATOR_H
#define DISCHARGE_COEFFICIENT_TABLE_ROWS 20
#define DISCHARGE_COEFFICIENT_TABLE_COLS 20
#define VOLUMETRIC_EFFICIENCY_TABLE_ROWS 20
#define VOLUMETRIC_EFFICIENCY_TABLE_COLS 20
class DataArray;
class AirMassEstimator
{
public:
AirMassEstimator(
double dischargeCoefficientTable[DISCHARGE_COEFFICIENT_TABLE_ROWS][DISCHARGE_COEFFICIENT_TABLE_COLS],
double volumetricEfficiencyTable[VOLUMETRIC_EFFICIENCY_TABLE_ROWS][VOLUMETRIC_EFFICIENCY_TABLE_COLS],
double specificGasConstantAir,
double specificHeatRatio,
double airIntakeManifoldVolume,
double cylinderDisplacement,
double intakeDiameter,
double intakeValveThickness,
const DataArray* timeData,
const DataArray* manifoldAirPressureData,
const DataArray* angularVelocityData,
const DataArray* reynoldsNumberData,
const DataArray* throttleAngleData,
const DataArray* inletPressureData,
const DataArray* inletTemperatureData
);
~AirMassEstimator();
double estimateAirMass();
private:
// Single Value Parameters
double m_previousAirMass;
double m_previousXAdjustment;
double m_specificGasConstantAir;
double m_specificHeatRatio;
double m_intakeAirManifoldVolume;
double m_cylinderDisplacement;
double m_intakeDiameter;
double m_intakeRadius;
double m_intakeValveThickness;
// Tabular Parameters
double m_dischargeCoefficientTable[DISCHARGE_COEFFICIENT_TABLE_ROWS][DISCHARGE_COEFFICIENT_TABLE_COLS];
double m_volumetricEfficiencyTable[VOLUMETRIC_EFFICIENCY_TABLE_ROWS][VOLUMETRIC_EFFICIENCY_TABLE_COLS];
// Computation Functions
double computeXAdjustment(
double manifoldAirPressure,
double angularVelocity
) const;
double computeSSAdjustment();
double computeSSCompressibleInletAirMassFlowRate(
double reynoldsNumber,
double throttleAngle,
double inletPressure,
double inletTemperature,
double manifoldAirPressure
) const;
double computeOpenArea(
double throttleAngle
) const;
double computeFlowFunction(
double inletPressure,
double manifoldAirPressure
) const;
// Lookup Functions
double lookupVolumetricEfficiency(
double manifoldAirPressure,
double angularVelocity
) const;
double lookupDischargeCoefficient(
double reynoldsNumber
) const;
// Raw Data Inputs
const DataArray* m_timeData;
const DataArray* m_manifoldAirPressureData;
const DataArray* m_angularVelocityData;
const DataArray* m_reynoldsNumberData;
const DataArray* m_throttleAngleData;
const DataArray* m_inletPressureData;
const DataArray* m_inletTemperatureData;
// Computed Data
DataArray* m_airMassFlowRateData;
};
#endif