Latest JSBSim changes.
This commit is contained in:
parent
fbccfab5ff
commit
26c6f3f407
3 changed files with 26 additions and 12 deletions
|
@ -1,7 +1,8 @@
|
||||||
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||||
|
|
||||||
Module: FGPiston.cpp
|
Module: FGPiston.cpp
|
||||||
Author: Jon S. Berndt
|
Author: Jon S. Berndt, JSBSim framework
|
||||||
|
Dave Luff, Piston engine model
|
||||||
Date started: 09/12/2000
|
Date started: 09/12/2000
|
||||||
Purpose: This module models a Piston engine
|
Purpose: This module models a Piston engine
|
||||||
|
|
||||||
|
@ -85,6 +86,7 @@ FGPiston::FGPiston(FGFDMExec* exec, FGConfigFile* Eng_cfg) : FGEngine(exec),
|
||||||
crank_counter = 0;
|
crank_counter = 0;
|
||||||
EngineNumber = 0;
|
EngineNumber = 0;
|
||||||
OilTemp_degK = 298;
|
OilTemp_degK = 298;
|
||||||
|
ManifoldPressure_inHg = Atmosphere->GetPressure() * 0.014138; // psf to in Hg
|
||||||
|
|
||||||
dt = State->Getdt();
|
dt = State->Getdt();
|
||||||
|
|
||||||
|
@ -285,8 +287,12 @@ void FGPiston::doEngineStartup(void)
|
||||||
|
|
||||||
void FGPiston::doManifoldPressure(void)
|
void FGPiston::doManifoldPressure(void)
|
||||||
{
|
{
|
||||||
ManifoldPressure_inHg = MinManifoldPressure_inHg +
|
if (Running || Cranking) {
|
||||||
(Throttle * (MaxManifoldPressure_inHg - MinManifoldPressure_inHg));
|
ManifoldPressure_inHg = MinManifoldPressure_inHg +
|
||||||
|
(Throttle * (MaxManifoldPressure_inHg - MinManifoldPressure_inHg));
|
||||||
|
} else {
|
||||||
|
ManifoldPressure_inHg = Atmosphere->GetPressure() * 0.014138; // psf to in Hg
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||||
|
@ -390,11 +396,19 @@ void FGPiston::doEnginePower(void)
|
||||||
|
|
||||||
void FGPiston::doEGT(void)
|
void FGPiston::doEGT(void)
|
||||||
{
|
{
|
||||||
|
double delta_T_exhaust = 0.0;
|
||||||
|
double heat_capacity_exhaust;
|
||||||
|
double enthalpy_exhaust;
|
||||||
|
|
||||||
combustion_efficiency = Lookup_Combustion_Efficiency->GetValue(equivalence_ratio);
|
combustion_efficiency = Lookup_Combustion_Efficiency->GetValue(equivalence_ratio);
|
||||||
double enthalpy_exhaust = m_dot_fuel * calorific_value_fuel *
|
enthalpy_exhaust = m_dot_fuel * calorific_value_fuel * combustion_efficiency * 0.33;
|
||||||
combustion_efficiency * 0.33;
|
heat_capacity_exhaust = (Cp_air * m_dot_air) + (Cp_fuel * m_dot_fuel);
|
||||||
double heat_capacity_exhaust = (Cp_air * m_dot_air) + (Cp_fuel * m_dot_fuel);
|
|
||||||
double delta_T_exhaust = enthalpy_exhaust / heat_capacity_exhaust;
|
if (heat_capacity_exhaust >= 0.0000001)
|
||||||
|
delta_T_exhaust = enthalpy_exhaust / heat_capacity_exhaust;
|
||||||
|
else
|
||||||
|
delta_T_exhaust = 0.0;
|
||||||
|
|
||||||
ExhaustGasTemp_degK = T_amb + delta_T_exhaust;
|
ExhaustGasTemp_degK = T_amb + delta_T_exhaust;
|
||||||
ExhaustGasTemp_degK *= 0.444 + ((0.544 - 0.444) * Percentage_Power / 100.0);
|
ExhaustGasTemp_degK *= 0.444 + ((0.544 - 0.444) * Percentage_Power / 100.0);
|
||||||
}
|
}
|
||||||
|
|
|
@ -147,8 +147,8 @@ double FGPropeller::Calculate(double PowerAvailable)
|
||||||
if (P_Factor > 0.0001) {
|
if (P_Factor > 0.0001) {
|
||||||
alpha = fdmex->GetTranslation()->Getalpha();
|
alpha = fdmex->GetTranslation()->Getalpha();
|
||||||
beta = fdmex->GetTranslation()->Getbeta();
|
beta = fdmex->GetTranslation()->Getbeta();
|
||||||
SetActingLocationY( GetLocationY() + P_Factor*alpha*fabs(Sense)/Sense);
|
SetActingLocationY( GetLocationY() + P_Factor*alpha*Sense);
|
||||||
SetActingLocationZ( GetLocationZ() + P_Factor*beta*fabs(Sense)/Sense);
|
SetActingLocationZ( GetLocationZ() + P_Factor*beta*Sense);
|
||||||
} else if (P_Factor < 0.000) {
|
} else if (P_Factor < 0.000) {
|
||||||
cerr << "P-Factor value in config file must be greater than zero" << endl;
|
cerr << "P-Factor value in config file must be greater than zero" << endl;
|
||||||
}
|
}
|
||||||
|
@ -161,7 +161,7 @@ double FGPropeller::Calculate(double PowerAvailable)
|
||||||
// natural axis of the engine. The transform takes place in the base class
|
// natural axis of the engine. The transform takes place in the base class
|
||||||
// FGForce::GetBodyForces() function.
|
// FGForce::GetBodyForces() function.
|
||||||
|
|
||||||
vH(eX) = Ixx*omega*fabs(Sense)/Sense;
|
vH(eX) = Ixx*omega*Sense;
|
||||||
vH(eY) = 0.0;
|
vH(eY) = 0.0;
|
||||||
vH(eZ) = 0.0;
|
vH(eZ) = 0.0;
|
||||||
|
|
||||||
|
@ -208,7 +208,7 @@ double FGPropeller::GetPowerRequired(void)
|
||||||
|
|
||||||
PowerRequired = cPReq*RPS*RPS*RPS*Diameter*Diameter*Diameter*Diameter
|
PowerRequired = cPReq*RPS*RPS*RPS*Diameter*Diameter*Diameter*Diameter
|
||||||
*Diameter*rho;
|
*Diameter*rho;
|
||||||
vTorque(eX) = PowerRequired / ((RPM/60)*2.0*M_PI);
|
vTorque(eX) = -Sense*PowerRequired / (RPS*2.0*M_PI);
|
||||||
|
|
||||||
return PowerRequired;
|
return PowerRequired;
|
||||||
}
|
}
|
||||||
|
|
|
@ -317,7 +317,7 @@ bool FGPropulsion::Load(FGConfigFile* AC_cfg)
|
||||||
if (thrType == "FG_PROPELLER" && P_Factor > 0.001) {
|
if (thrType == "FG_PROPELLER" && P_Factor > 0.001) {
|
||||||
((FGPropeller*)Thrusters[numThrusters])->SetPFactor(P_Factor);
|
((FGPropeller*)Thrusters[numThrusters])->SetPFactor(P_Factor);
|
||||||
if (debug_lvl > 0) cout << " P-Factor: " << P_Factor << endl;
|
if (debug_lvl > 0) cout << " P-Factor: " << P_Factor << endl;
|
||||||
((FGPropeller*)Thrusters[numThrusters])->SetSense(Sense);
|
((FGPropeller*)Thrusters[numThrusters])->SetSense(fabs(Sense)/Sense);
|
||||||
if (debug_lvl > 0) cout << " Sense: " << Sense << endl;
|
if (debug_lvl > 0) cout << " Sense: " << Sense << endl;
|
||||||
}
|
}
|
||||||
Thrusters[numThrusters]->SetdeltaT(dt*rate);
|
Thrusters[numThrusters]->SetdeltaT(dt*rate);
|
||||||
|
|
Loading…
Add table
Reference in a new issue