- Joined
- Jul 7, 2012
- Messages
- 1,519
- Reaction score
- 1,542
- Points
- 128
- Location
- Monte Hermoso - Argentina
- Website
- github.com
- Preferred Pronouns
- he/him
I have translated your Lua tables into C++ structures, like this:You must be using the wrong engine specification table. You need to use the one for the reciprocating engine (the one in my code). If you tried guessing numbers and putting them into the gas turbine table that's the only way this would happen.
C++:
struct EngineSpec{
double r = 5.20; //compression ratio
int rc = 1; //cut-off ratio, 1 for Otto cycle, >1 for Diesel
double displacement = 6.82e-3; //engine displacement in cubic meters
int max_rpm = 2050; //maximum engine speed (rpm)
int min_rpm = 750; //idle engine speed (rpm)
int n_stroke = 4; //2 if 2-stroke, 4 if 4-stroke
double HV = 43e6; //lower heating value of fuel (J/kg) (~43 MJ/kg for typical liquid fuels)
double AF = 14.6; //air fuel ratio (mass air/mass fuel) (stochiometric ~14.6:1 for typical liquid fuels)
};
EngineSpec engine_spec;
struct GasTurbine_EngineSpec{
int rp = 20; //pressure ratio
int max_rpm = 3600; //maximum engine speed (rpm)
int min_rpm = 1000; //idle engine speed (rpm)
double max_air_flow = 69.4; //mass air flow at max rpm
double HV = 43e6; //lower heating value of fuel (J/kg) (~43 MJ/kg for typical liquid fuels)
double AF = 77.1; //air fuel ratio (mass air/mass fuel) (stochiometric ~14.6:1 for typical liquid fuels)
};
GasTurbine_EngineSpec gas_turbine_engine_spec;