Steam engine: superheat temperature in F

Bug #1987643 reported by Wesley Johnson
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Open Rails
New
Undecided
Unassigned

Bug Description

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);

Revision history for this message
Wesley Johnson (trackcreworts) wrote :

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) ));

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.