Looky1173 / launchpad-bugs-migration2

0 stars 0 forks source link

[BUG n°1987643] Steam engine: superheat temperature in F #2575

Open Looky1173 opened 1 year ago

Looky1173 commented 1 year ago

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

Property Value
Reported by Wesley Johnson (trackcreworts)
Date reported Thu, 25 Aug 2022 11:16:49 GMT

File: MSTSSteamLocomotive.cs

However ORTS has some degree F around, It keeps the superheat temperature in degree F, and this one calculation seems to multiply by degree F, without converting to degree K. I cannot see how this could be valid.

In ORTS code:

// Calculate superheat steam reference temperature based upon heating area of superheater // SuperTemp = (SuperHeatArea x HeatTransmissionCoeff (MeanGasTemp - MeanSteamTemp)) / (SteamQuantity MeanSpecificSteamHeat) // Formula has been simplified as follows: SuperTemp = (SuperHeatArea x FlueTempK x SFactor) / SteamQuantity // SFactor is a "loose reprentation" = (HeatTransmissionCoeff / MeanSpecificSteamHeat) - Av figure calculate by comparing a number of "known" units for superheat. SuperheatRefTempF = (Me2.ToFt2(SuperheatAreaM2) C.ToF(C.FromK(MaxFlueTempK)) SuperheatKFactor) / pS.TopH(TheoreticalMaxSteamOutputLBpS); SuperheatTempRatio = SuperheatRefTempF / SuperheatTempLbpHtoDegF[pS.TopH(TheoreticalMaxSteamOutputLBpS)]; // calculate a ratio figure for known value against reference curve.

In my code (which is easier to follow and has the comments): I have changed my superheat temperatures to entirely degree K.

// SuperheatKFactor = (HeatTransmissionCoeff / MeanSpecificSteamHeat) - Av figure calculate by comparing a number of "known" units for superheat.

ifdef KELVIN_SUPERHEAT

// flue_temp = 775K = 492C = 917F // boiler_temp = 110C = 383K = 230F
float superheat_K_kelvin; // Factor used to calculate superheat temperature - guesstimate

else

float SuperheatKFactor; // Factor used to calculate superheat temperature - guesstimate

endif

float superheater_MSTS_factor = 1.0f; // MSTS parameter // Currently 2 values respected: 0.0 for no superheat (default), > 1.0 for typical superheat // SuperheaterFactor

void verify_and_correct() { if( num_cylinders == 0 ) num_cylinders = 2;

// SuperheatKFactor = (HeatTransmissionCoeff / MeanSpecificSteamHeat) - Av figure calculate by comparing a number of "known" units for superheat.

ifdef KELVIN_SUPERHEAT

// flue_temp = 775K = 492C = 917F // boiler_temp = 110C = 383K = 230F
superheat_K_kelvin = 27.3f; // degree K based

else

SuperheatKFactor = 11.7f; // ORTS

endif

safety_valve_high_trip = boiler_pressure_max + safety_valve_high_margin;
safety_valve_low_reset = boiler_pressure_max - safety_valve_low_margin;

..... }

// Calculate superheat steam reference temperature based upon heating area of superheater / SuperTemp = (SuperHeatArea x HeatTransmissionCoeff (MeanGasTemp - MeanSteamTemp)) / (SteamQuantity MeanSpecificSteamHeat) // Formula has been simplified as follows: SuperTemp = (SuperHeatArea x flue_temperature x SFactor) / SteamQuantity // SFactor is a "loose representation" = (HeatTransmissionCoeff / MeanSpecificSteamHeat) - Av figure calculate by comparing a number of "known" units for superheat.

ifdef KELVIN_SUPERHEAT

// FIXME: use better formula, (flue_temperature_max - steam_temp), // Assume steam_temp approx 110 degree C. or so, depending on boiler pressure superheat_ref_temperature = superheat_area (flue_temperature_max - C_to_K(110)) * superheat_K_kelvin / pS.TopH(boiler_steam_output_max);

else

// ORTS: Has multiply by degree F, this is not normal. // This is after translations to degree K, kg, joule, meter. // flue_temperture_max is now in degree K. // ORTS equation: // model->superheat_ref_temperature = ((superheat_area K_to_F(flue_temperature_max) SuperheatKFactor) / pS.TopH((model->boiler_steam_output_max))); // ORTS // Fixed: Multiply by degree K. superheat_ref_temperature = superheat_area flue_temperature_max SuperheatKFactor / boiler_steam_output_max;

endif

// calculate a ratio figure for known value against reference curve. superheat_temperature_ratio = superheat_ref_temperature / SuperheatTemp(boiler_steam_output_max);

Looky1173 commented 1 year ago

Imported from https://bugs.launchpad.net/or/+bug/1987643/comments/1

Property Value
Posted by Wesley Johnson (trackcreworts)
Date posted Thu, 25 Aug 2022 11:43:06 GMT

Offending line: SuperheatRefTempF = (Me2.ToFt2(SuperheatAreaM2) C.ToF(C.FromK(MaxFlueTempK)) SuperheatKFactor) / pS.TopH(TheoreticalMaxSteamOutputLBpS);

It may be that ORTS code should be (moving two paren): SuperheatRefTempF = (Me2.ToFt2(SuperheatAreaM2) C.ToF(C.FromK( MaxFlueTempK SuperheatKFactor )) ) / pS.TopH(TheoreticalMaxSteamOutputLBpS);

If I could figure out what that SuperheatKFactor had for units, it would help. But it still leaves you with the rest of the equation being a ratio upon a temp in degree F, which cannot be valid. You need degree K to multiply ratios like that. That conversion to degree F involves adding some constants, so it does not act like a const multiply.

So my best guess is that it should be (moving conversion to F around entire result): SuperheatRefTempF = C.ToF(C.FromK( (Me2.ToFt2(SuperheatAreaM2) MaxFlueTempK SuperheatKFactor) / pS.TopH(TheoreticalMaxSteamOutputLBpS) ));