Damper manual is used by AI, not manual
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Open Rails |
New
|
Undecided
|
Unassigned |
Bug Description
In every comment, the DamperFactorManual is said to be for manual damper control.
At the point of use, it is used by the AI, and not the manual damper control.
The test is reversed, or something more complicated,
File: MSTSSteamLocomo
float DamperFactorManual = 1.0f; // factor to control draft through fire when locomotive is running in Manual mode
DamperFactorManual = TheoreticalMaxS
// ORTS ERROR: or at least this is terribly confusing given the previous comments.
// Damper - to determine smoke color
float SmokeColorDamper = 0.0f;
if (FiringIsManual)
{
}
else
{
}
Note: my code is replacing the ORTS damper controls with something entirely new, with more control,
and more refined simulation. Not entirely ready yet, as I have these details to figure out.
My code:
// ---- Damper Model
// factor to control draft through fire when locomotive is running in Manual mode
float damper_
// DamperFactorManual lb/meter/sec
float fire_draft_
float exhaust_
// ---- Damper in engine unit
// Damper
byte damper_control; // 0..255
float draft_air; // 1.0 = air to burn 1kg
float DamperBurnEffect; // Effect of the Damper control
// Draft caused by fire. Do not ever let it be 0.
draft_air = model->
// Draft caused by exhaust steam.
draft_air += model->
// Damper - need to be calculated in AI fireman case too, to determine smoke color
if (absSpeedMpS < 1.0f) // locomotive is stationary then damper will have no effect
{
// This is not necessary.
DamperBurnE
}
else
{
// Damper value for manual firing - related to damper setting and increased speed
DamperBurnE
}
draft_air *= damper_control * (1.0/255);
// Manual fireman
// Test to see if blower has been manually activated.
if( blower_control > 0 )
{
fire_
blower_
BlowerBurnEffect = model->
draft_air += model->
}
// AI fireman
draft_air = fire_mass; // perfect damper control ?? FIXME
// The draft_air is measured as the amount of fire that can be supported, so it is measured the same as fire mass.
float fire_supported = fire_mass;
float fire_mass_unburned = 0;
float excess_air = 0;
draft_air += (fire_mass * 0.01f) + 0.1; // damper leakage, and so draft_air is never 0.
if( draft_air > fire_mass ) {
// Excess air
excess_air = draft_air - fire_mass;
// Excess air cools the fire, the boiler, and the superheater.
// The amount of air that would be ideal for the fire is same value as fire_mass.
// All the draft_air going through the firebox has to be heated too.
float excess_air_frac = fire_mass / draft_air;
float source_temp = C_to_K(
superheater_
// specific heat of air = 1.006 kj/kg K
// specific heat of water = 4.22 kj/kg K at 300 K
float draft_heat_loss = excess_air * (boiler_
boiler_
boiler_heat -= draft_heat_loss * tick_secs; // Reduce boiler Heat to reflect heat lost by excess air.
}else{
// Insufficient air
// Can only support draft_air amount of fire.
fire_supported = draft_air;
fire_
}
fire_burn_rate_inst *= fire_supported / model->
I have not yet tied the draft_air and fire_mass_unburned to the smoke, as that requires
rewriting the smoke generation for my graphics files and environment.
I missed putting this in the bug report.
From my code:
// verify_and_correct model
// max steam vrs max speed factor_ manual = boiler_ steam_output_ max / MPH60; // a factor for damper control that will vary with speed.
damper_
blower_ steam_usage_ factor = (0.04f * 2.20462f / 255) * boiler_ steam_output_ max / boiler_ pressure_ max; // kg/sec/ psi/control_ step
// draft_air multipliers, guess work for now multiplier = (fire_mass_ideal * 0.2f) / grate_burn_ rate_max; // background burn rate draft_multiplie r = (fire_mass_ideal * 0.85f) / boiler_ steam_output_ max; draft_multiplie r = (fire_mass_ideal * 0.4f / 255) / (blower_ steam_usage_ factor * boiler_ pressure_ max); // control 0..255
// natural draft can support 20% of full burn
fire_draft_
// exhaust, by itself, supplies air for 85% of full burn
exhaust_
// blower can support 40% of full burn
blower_
note:
I expect at full steam, the firebox will suffer from excess air.
I expect that because the stack and flues will be designed for efficient operation at a
nomimal steam usage less than the maximum.
The fireman will be expected to close the dampers somewhat.