Looky1173 / launchpad-bugs-migration2

0 stars 0 forks source link

[BUG n°1987635] Steam engine: Radiation steam usage #2574

Open Looky1173 opened 1 year ago

Looky1173 commented 1 year ago

Imported from https://bugs.launchpad.net/bugs/1987635

Property Value
Reported by Wesley Johnson (trackcreworts)
Date reported Thu, 25 Aug 2022 10:31:03 GMT
Tags steamlocomotive

I have been writing a Linux, C++ train simulator, using ORTS code and data intially and for formats for loading MSTS files. The simulator itself not a copy of ORTS. I am crediting ORTS often in the code, but am also researchng documents and replacing many of the tables, as I am using Kg/meter/joule entirely.

As I go over the code I have been finding what look like errors in the ORTS code. I shall report these in separate bug reports.

In all the steam loss calculations, it has not be commented on why the heat loss is the ( boiler_steam_heat - boiler_water_heat ) everywhere. Some places it is proper to retain the water heat, but others it is not. This is less clear for things like the blower, as to why the water heat is retained. The blower condenses its output water and injects it back into the tender, or something like that ??? This needs to be documented in the code for each steam device.

File: MSTSSteamLocomotive.cs

Radiation steam loss: If the steam is condensed back into water the heat in the water would be retained. Therefore the loss would be proportional to ( boiler_steam_heat - water_heat ) as ORTS has it. However, there should NOT be any boiler mass lost then. The steam mass is condensed into water mass. I am not sure if this is actually steam usage (TotalSteamUsageLBpS).

// From ORTS: // Basic steam radiation losses RadiationSteamLossLBpS = pS.FrompM((absSpeedMpS == 0.0f) ? 3.04f : // lb/min at rest 5.29f); // lb/min moving BoilerMassLB -= elapsedClockSeconds RadiationSteamLossLBpS; BoilerHeatBTU -= elapsedClockSeconds RadiationSteamLossLBpS (BoilerSteamHeatBTUpLB - BoilerWaterHeatBTUpLB); TotalSteamUsageLBpS += RadiationSteamLossLBpS; BoilerHeatOutBTUpS += RadiationSteamLossLBpS (BoilerSteamHeatBTUpLB - BoilerWaterHeatBTUpLB);

// From my code (which has the comments I am trying to share)

// The radiation condenses the steam back into water, so the water heat is not lost. float radiation_heat_loss = radiation_steam_loss (boiler_steam_heat - boiler_water_heat); steam_usage_total += radiation_steam_loss; boiler_output_heat_rate += radiation_heat_loss; // boiler_mass -= radiation_steam_loss tick_secs; // boiler mass should be unaffected by recondensation boiler_heat -= radiation_heat_loss * tick_secs;

Safety valve loss: The steam is lost from the boiler entirely. It is not condensed back to water, so the heat loss should be the entire steam heat enthapy.

// From ORTS SafetyValveUsageLBpS = SafetyValveUsage1LBpS + SafetyValveUsage2LBpS + SafetyValveUsage3LBpS + SafetyValveUsage4LBpS; // Sum all the safety valve discharge rates together BoilerMassLB -= elapsedClockSeconds SafetyValveUsageLBpS; BoilerHeatBTU -= elapsedClockSeconds SafetyValveUsageLBpS (BoilerSteamHeatBTUpLB - BoilerWaterHeatBTUpLB); // Heat loss due to safety valve TotalSteamUsageLBpS += SafetyValveUsageLBpS; BoilerHeatOutBTUpS += SafetyValveUsageLBpS (BoilerSteamHeatBTUpLB - BoilerWaterHeatBTUpLB); // Heat loss due to safety valve

// From my code

// Rate of steam loss through all safety valves. safety_valve_steam_loss = (boiler_pressure + ATMOSPHERE_1) port_accum safety_valve_port_steam_rate;

// Heat loss due to safety valve

if 0

// ORTS: this looks wrong float steam_loss_heat_rate = safety_valve_steam_loss * (boiler_steam_heat - boiler_water_heat);

else

// Should lose entire steam heat float steam_loss_heat_rate = safety_valve_steam_loss * boiler_steam_heat; // Heat loss due to safety valve

endif

// Steam loss through safety valves, update boiler. steam_usage_total += safety_valve_steam_loss; boiler_output_heat_rate += steam_loss_heat_rate; boiler_mass -= safety_valve_steam_loss tick_secs; boiler_heat -= steam_loss_heat_rate tick_secs; // Heat loss due to safety valve