Skip to content

Commit 8e14b45

Browse files
committed
Correct water consumption rate for wood fired
1 parent 2a3bfc5 commit 8e14b45

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

Source/Orts.Simulation/Simulation/RollingStocks/MSTSSteamLocomotive.cs

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -415,7 +415,7 @@ public float TenderCoalMassKG // Decreased by firing and increased
415415
float Injector1Fraction = 0.0f; // Fraction (0-1) of injector 1 flow from Fireman controller or AI
416416
float Injector2Fraction = 0.0f; // Fraction (0-1) of injector of injector 2 flow from Fireman controller or AI
417417
float SafetyValveStartPSI = 0.1f; // Set safety valve to just over max pressure - allows for safety valve not to operate in AI firing
418-
float InjectorBoilerInputLB = 0.0f; // Input into boiler from injectors
418+
float BoilerWaterInputLB = 0.0f; // Water input into boiler from injectors and pumps
419419
const float WaterDensityAt100DegC1BarKGpM3 = 954.8f;
420420

421421

@@ -2750,7 +2750,7 @@ public override void Update(float elapsedClockSeconds)
27502750

27512751
#region adjust state
27522752
UpdateWaterGauge();
2753-
UpdateInjectors(elapsedClockSeconds);
2753+
UpdateWaterInjection(elapsedClockSeconds);
27542754
UpdateFiring(absSpeedMpS);
27552755
#endregion
27562756

@@ -3812,7 +3812,7 @@ private void UpdateTender(float elapsedClockSeconds)
38123812

38133813
if (HasTenderCoupled) // If a tender is coupled then water is available
38143814
{
3815-
CombinedTenderWaterVolumeUKG -= InjectorBoilerInputLB / WaterLBpUKG; // Adjust water usage in tender
3815+
CombinedTenderWaterVolumeUKG -= BoilerWaterInputLB / WaterLBpUKG; // Adjust water usage in tender
38163816
}
38173817
else // if no tender coupled then check whether a tender is required
38183818
{
@@ -3822,7 +3822,7 @@ private void UpdateTender(float elapsedClockSeconds)
38223822
}
38233823
else // Tender is not required (ie tank locomotive) - therefore water will be carried on the locomotive (and possibly on aux tender)
38243824
{
3825-
CombinedTenderWaterVolumeUKG -= InjectorBoilerInputLB / WaterLBpUKG; // Adjust water usage in tender
3825+
CombinedTenderWaterVolumeUKG -= BoilerWaterInputLB / WaterLBpUKG; // Adjust water usage in tender
38263826
}
38273827
}
38283828

@@ -3831,9 +3831,9 @@ private void UpdateTender(float elapsedClockSeconds)
38313831
CurrentLocoTenderWaterVolumeUKG = (Kg.ToLb(MaxLocoTenderWaterMassKG) / WaterLBpUKG) * TenderWaterPercent; // Adjust water level in locomotive tender
38323832
PrevCombinedTenderWaterVolumeUKG = CombinedTenderWaterVolumeUKG; // Store value for next iteration
38333833
PreviousTenderWaterVolumeUKG = CombinedTenderWaterVolumeUKG; // Store value for next iteration
3834-
WaterConsumptionLbpS = InjectorBoilerInputLB / elapsedClockSeconds; // water consumption
3834+
WaterConsumptionLbpS = BoilerWaterInputLB / elapsedClockSeconds; // water consumption
38353835
WaterConsumptionLbpS = MathHelper.Clamp(WaterConsumptionLbpS, 0, WaterConsumptionLbpS);
3836-
CumulativeWaterConsumptionLbs += InjectorBoilerInputLB;
3836+
CumulativeWaterConsumptionLbs += BoilerWaterInputLB;
38373837
if (CumulativeWaterConsumptionLbs > 0) DbfEvalCumulativeWaterConsumptionLbs = CumulativeWaterConsumptionLbs;//DebriefEval
38383838

38393839
#if DEBUG_AUXTENDER
@@ -7027,8 +7027,9 @@ private void UpdateWaterGauge()
70277027
}
70287028
}
70297029

7030-
private void UpdateInjectors(float elapsedClockSeconds)
7030+
private void UpdateWaterInjection(float elapsedClockSeconds)
70317031
{
7032+
BoilerWaterInputLB = 0; // Used by UpdateTender() later in the cycle
70327033

70337034
if (SteamLocomotiveFeedWaterType == SteamLocomotiveFeedWaterSystemTypes.MotionPump)
70347035
{
@@ -7064,10 +7065,10 @@ private void UpdateInjectors(float elapsedClockSeconds)
70647065
// Loss of boiler heat due to water injection - loss is the diff between steam and ambient temperature (or pressure)
70657066
WaterMotionPumpHeatLossBTU = TotalPumpFlowRateLbpS * (WaterHeatPSItoBTUpLB[BoilerPressurePSI] - WaterHeatPSItoBTUpLB[0]);
70667067

7067-
// calculate Water steam heat based on injector water delivery temp
7068+
// calculate Water steam heat based on pump flow rate
70687069
BoilerMassLB += elapsedClockSeconds * TotalPumpFlowRateLbpS; // Boiler Mass increase by both pumps
70697070
BoilerHeatBTU -= elapsedClockSeconds * WaterMotionPumpHeatLossBTU; // Total loss of boiler heat due to water pump - inject cold water straight from tender
7070-
// InjectorBoilerInputLB += (elapsedClockSeconds * Injector1Fraction * InjectorFlowRateLBpS); // Keep track of water flow into boilers from Injector 1
7071+
BoilerWaterInputLB += (elapsedClockSeconds * TotalPumpFlowRateLbpS); // Keep track of water flow into boilers from Pump
70717072
BoilerHeatOutBTUpS += WaterMotionPumpHeatLossBTU; // Total loss of boiler heat due to water injection - inject steam and water Heat
70727073

70737074
// Update pump lockout timer
@@ -7139,7 +7140,6 @@ private void UpdateInjectors(float elapsedClockSeconds)
71397140
InjectorFlowRateLBpS = 0.0f; // If the tender water is empty, stop flow into boiler
71407141
}
71417142

7142-
InjectorBoilerInputLB = 0; // Used by UpdateTender() later in the cycle
71437143
if (WaterIsExhausted)
71447144
{
71457145
// don't fill boiler with injectors
@@ -7177,7 +7177,7 @@ private void UpdateInjectors(float elapsedClockSeconds)
71777177
// calculate Water steam heat based on injector water delivery temp
71787178
BoilerMassLB += elapsedClockSeconds * Injector1Fraction * InjectorFlowRateLBpS; // Boiler Mass increase by Injector 1
71797179
BoilerHeatBTU -= elapsedClockSeconds * (Inject1WaterHeatLossBTU + Inject1SteamHeatLossBTU); // Total loss of boiler heat due to water injection - inject steam and water Heat
7180-
InjectorBoilerInputLB += (elapsedClockSeconds * Injector1Fraction * InjectorFlowRateLBpS); // Keep track of water flow into boilers from Injector 1
7180+
BoilerWaterInputLB += (elapsedClockSeconds * Injector1Fraction * InjectorFlowRateLBpS); // Keep track of water flow into boilers from Injector 1
71817181
BoilerHeatOutBTUpS += (Inject1WaterHeatLossBTU + Inject1SteamHeatLossBTU); // Total loss of boiler heat due to water injection - inject steam and water Heat
71827182
}
71837183
if (Injector2IsOn)
@@ -7208,7 +7208,7 @@ private void UpdateInjectors(float elapsedClockSeconds)
72087208
// calculate Water steam heat based on injector water delivery temp
72097209
BoilerMassLB += elapsedClockSeconds * Injector2Fraction * InjectorFlowRateLBpS; // Boiler Mass increase by Injector 1
72107210
BoilerHeatBTU -= elapsedClockSeconds * (Inject2WaterHeatLossBTU + Inject2SteamHeatLossBTU); // Total loss of boiler heat due to water injection - inject steam and water Heat
7211-
InjectorBoilerInputLB += (elapsedClockSeconds * Injector2Fraction * InjectorFlowRateLBpS); // Keep track of water flow into boilers from Injector 1
7211+
BoilerWaterInputLB += (elapsedClockSeconds * Injector2Fraction * InjectorFlowRateLBpS); // Keep track of water flow into boilers from Injector 1
72127212
BoilerHeatOutBTUpS += (Inject2WaterHeatLossBTU + Inject2SteamHeatLossBTU); // Total loss of boiler heat due to water injection - inject steam and water Heat
72137213
}
72147214
}

0 commit comments

Comments
 (0)