@@ -159,6 +159,7 @@ protected float VacResPressureAdjPSIA()
159
159
( Car as MSTSWagon ) . HandBrakePresent ? string . Format ( "{0:F0}%" , HandbrakePercent ) : string . Empty ,
160
160
FrontBrakeHoseConnected ? "I" : "T" ,
161
161
string . Format ( "A{0} B{1}" , AngleCockAOpen ? "+" : "-" , AngleCockBOpen ? "+" : "-" ) ,
162
+ BleedOffValveOpen ? Simulator . Catalog . GetString ( "Open" ) : string . Empty ,
162
163
} ;
163
164
}
164
165
else
@@ -177,6 +178,7 @@ protected float VacResPressureAdjPSIA()
177
178
HandbrakePercent > 0 ? string . Format ( "{0:F0}%" , HandbrakePercent ) : string . Empty ,
178
179
FrontBrakeHoseConnected ? "I" : "T" ,
179
180
string . Format ( "A{0} B{1}" , AngleCockAOpen ? "+" : "-" , AngleCockBOpen ? "+" : "-" ) ,
181
+ BleedOffValveOpen ? Simulator . Catalog . GetString ( "Open" ) : string . Empty ,
180
182
} ;
181
183
}
182
184
}
@@ -323,14 +325,16 @@ public override void Update(float elapsedClockSeconds)
323
325
324
326
LocomotiveSteamBrakeFitted = true ;
325
327
326
- // Steam brake operation is impacted by boiler pressure, a drop in boile rpressure will reduce the force applied
328
+ // Steam brake operation is impacted by boiler pressure, a drop in boiler pressure will reduce the force applied
327
329
SteamBrakeCompensation = lead . BoilerPressurePSI / lead . MaxBoilerPressurePSI ;
328
330
329
331
float SteamBrakeDesiredFraction ;
330
- float MaximumVacuumPressureValue = Vac . ToPress ( lead . TrainBrakeController . MaxPressurePSI ) ; // As model uses air pressure this equates to minimum vacuum pressure
331
- float MinimumVacuumPressureValue = Vac . ToPress ( 0 ) ; // As model uses air pressure this equates to maximum vacuum pressure
332
+
333
+ float MaximumVacuumPressureValue = OneAtmospherePSI - lead . TrainBrakeController . MaxPressurePSI ; // As model uses air pressure this equates to minimum air pressure
334
+ float MinimumVacuumPressureValue = OneAtmospherePSI ; // As model uses air pressure this equates to maximum air pressure
332
335
float EngineBrakePipeFraction = ( lead . BrakeSystem . BrakeLine3PressurePSI - MaximumVacuumPressureValue ) / ( MinimumVacuumPressureValue - MaximumVacuumPressureValue ) ;
333
336
EngineBrakePipeFraction = MathHelper . Clamp ( EngineBrakePipeFraction , 0.0f , 1.0f ) ; // Keep fraction within bounds
337
+
334
338
float TrainBrakePipeFraction = ( lead . BrakeSystem . BrakeLine1PressurePSI - MaximumVacuumPressureValue ) / ( MinimumVacuumPressureValue - MaximumVacuumPressureValue ) ;
335
339
TrainBrakePipeFraction = MathHelper . Clamp ( TrainBrakePipeFraction , 0.0f , 1.0f ) ; // Keep fraction within bounds
336
340
@@ -343,7 +347,9 @@ public override void Update(float elapsedClockSeconds)
343
347
if ( SteamBrakingCurrentFraction < SteamBrakeDesiredFraction ) // Brake application, increase steam brake pressure to max value as appropriate
344
348
{
345
349
346
- SteamBrakingCurrentFraction += elapsedClockSeconds * lead . EngineBrakeController . ApplyRatePSIpS / conversionFactor ;
350
+ var diff = elapsedClockSeconds * lead . EngineBrakeController . ApplyRatePSIpS / conversionFactor ;
351
+
352
+ SteamBrakingCurrentFraction += diff ;
347
353
if ( SteamBrakingCurrentFraction > 1.0f )
348
354
{
349
355
SteamBrakingCurrentFraction = 1.0f ;
@@ -352,7 +358,10 @@ public override void Update(float elapsedClockSeconds)
352
358
}
353
359
else if ( SteamBrakingCurrentFraction > SteamBrakeDesiredFraction ) // Brake release, decrease steam brake pressure to min value as appropriate
354
360
{
355
- SteamBrakingCurrentFraction -= elapsedClockSeconds * lead . EngineBrakeController . ReleaseRatePSIpS / conversionFactor ;
361
+
362
+ var diff = elapsedClockSeconds * lead . EngineBrakeController . ReleaseRatePSIpS / conversionFactor ;
363
+
364
+ SteamBrakingCurrentFraction -= diff ;
356
365
357
366
if ( SteamBrakingCurrentFraction < 0 )
358
367
{
@@ -374,6 +383,7 @@ public override void Update(float elapsedClockSeconds)
374
383
float equivalentBrakeLine3PressurePSI = equivalentEngineBrakePipeFraction * ( MinimumVacuumPressureValue - MaximumVacuumPressureValue ) + MaximumVacuumPressureValue ;
375
384
376
385
lead . BrakeSystem . BrakeLine3PressurePSI = equivalentBrakeLine3PressurePSI ; // If engine brake on, then don't allow engine brake pressure to drop when reducing train brake pressure
386
+
377
387
EngineBrakePipeFraction = SteamBrakingCurrentFraction ;
378
388
Car . PreviousSteamBrakeCylinderPressurePSI = 0 ; // set to zero so that this loop is not executed again until train brake is activated
379
389
}
@@ -473,7 +483,18 @@ public override void Update(float elapsedClockSeconds)
473
483
}
474
484
else
475
485
{
476
- if ( BrakeLine1PressurePSI < VacResPressurePSIA )
486
+
487
+ if ( BleedOffValveOpen )
488
+ {
489
+ // the following reduces the brake cylinder and vacuum reservoir to 0inHg if the bleed valve is operated
490
+ float dp = elapsedClockSeconds * MaxApplicationRatePSIpS ;
491
+
492
+ VacResPressurePSIA = Math . Min ( VacResPressurePSIA + dp , OneAtmospherePSI ) ;
493
+
494
+ CylPressurePSIA = Math . Min ( CylPressurePSIA + dp , OneAtmospherePSI ) ;
495
+
496
+ }
497
+ else if ( BrakeLine1PressurePSI < VacResPressurePSIA )
477
498
{
478
499
float dp = elapsedClockSeconds * MaxApplicationRatePSIpS * ( NumBrakeCylinders * BrakeCylVolM3 ) / VacResVolM3 ;
479
500
float vr = VacResVolM3 / BrakePipeVolumeM3 ;
0 commit comments