Skip to content

Commit 79e9c38

Browse files
committed
Add emergency dump valve
1 parent 1edb2e5 commit 79e9c38

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

Source/Documentation/Manual/physics.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2904,6 +2904,7 @@ MaxAuxilaryChargingRate and EmergencyResChargingRate.
29042904
.. index::
29052905
single: BrakePipeVolume
29062906
single: ORTSEmergencyValveActuationRate
2907+
single: ORTSEmergencyDumpValveRate
29072908
single: ORTSMainResPipeAuxResCharging
29082909
single: ORTSMainResChargingRate
29092910
single: ORTSEngineBrakeReleaseRate
@@ -2932,6 +2933,8 @@ MaxAuxilaryChargingRate and EmergencyResChargingRate.
29322933
brake actuation of the triple valve. If the pressure in the brake pipe
29332934
decreases at a higher rate than specified, the triple valve will switch to
29342935
emergency mode.
2936+
- ``Wagon(ORTSEmergencyDumpValveRate)``-- Rate at which BP is locally discharged
2937+
at every wagon during an emergency brake application.
29352938
- ``Wagon(ORTSMainResPipeAuxResCharging`` -- Boolean value that indicates,
29362939
for twin pipe systems, if the main reservoir pipe is used for charging the auxiliary
29372940
reservoirs. If set to false, the main reservoir pipe will not be used

Source/Orts.Simulation/Simulation/RollingStocks/SubSystems/Brakes/MSTS/AirSinglePipe.cs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ public class AirSinglePipe : MSTSBrakeSystem
5151
protected float MaxAuxilaryChargingRatePSIpS = 1.684f;
5252
protected float BrakeInsensitivityPSIpS = 0;
5353
protected float EmergencyValveActuationRatePSIpS = 0;
54+
protected float EmergencyDumpValveRatePSIpS = 0;
5455
protected float EmergResChargingRatePSIpS = 1.684f;
5556
protected float EmergAuxVolumeRatio = 1.4f;
5657
protected string DebugType = string.Empty;
@@ -116,6 +117,7 @@ public override void InitializeFromCopy(BrakeSystem copy)
116117
MaxAuxilaryChargingRatePSIpS = thiscopy.MaxAuxilaryChargingRatePSIpS;
117118
BrakeInsensitivityPSIpS = thiscopy.BrakeInsensitivityPSIpS;
118119
EmergencyValveActuationRatePSIpS = thiscopy.EmergencyValveActuationRatePSIpS;
120+
EmergencyDumpValveRatePSIpS = thiscopy.EmergencyDumpValveRatePSIpS;
119121
EmergResChargingRatePSIpS = thiscopy.EmergResChargingRatePSIpS;
120122
EmergAuxVolumeRatio = thiscopy.EmergAuxVolumeRatio;
121123
TwoPipes = thiscopy.TwoPipes;
@@ -232,6 +234,7 @@ public override void Parse(string lowercasetoken, STFReader stf)
232234
case "wagon(brakepipevolume": BrakePipeVolumeM3 = Me3.FromFt3(stf.ReadFloatBlock(STFReader.UNITS.VolumeDefaultFT3, null)); break;
233235
case "wagon(ortsbrakeinsensitivity": BrakeInsensitivityPSIpS = stf.ReadFloatBlock(STFReader.UNITS.PressureRateDefaultPSIpS, null); break;
234236
case "wagon(ortsemergencyvalveactuationrate": EmergencyValveActuationRatePSIpS = stf.ReadFloatBlock(STFReader.UNITS.PressureRateDefaultPSIpS, 15f); break;
237+
case "wagon(ortsemergencydumpvalverate": EmergencyDumpValveRatePSIpS = stf.ReadFloatBlock(STFReader.UNITS.PressureRateDefaultPSIpS, 15f); break;
235238
case "wagon(ortsmainrespipeauxrescharging": MRPAuxResCharging = this is AirTwinPipe && stf.ReadBoolBlock(true); break;
236239
}
237240
}
@@ -307,7 +310,10 @@ public override void Initialize(bool handbrakeOn, float maxPressurePSI, float fu
307310
AutoCylPressurePSI = immediateRelease ? 0 : Math.Min((maxPressurePSI - BrakeLine1PressurePSI) * AuxCylVolumeRatio, MaxCylPressurePSI);
308311
AuxResPressurePSI = Math.Max(TwoPipes ? maxPressurePSI : maxPressurePSI - AutoCylPressurePSI / AuxCylVolumeRatio, BrakeLine1PressurePSI);
309312
if ((Car as MSTSWagon).EmergencyReservoirPresent)
313+
{
310314
EmergResPressurePSI = Math.Max(AuxResPressurePSI, maxPressurePSI);
315+
if (EmergencyValveActuationRatePSIpS == 0) EmergencyValveActuationRatePSIpS = 15;
316+
}
311317
TripleValveState = AutoCylPressurePSI < 1 ? ValveState.Release : ValveState.Lap;
312318
HoldingValve = ValveState.Release;
313319
HandbrakePercent = handbrakeOn & (Car as MSTSWagon).HandBrakePresent ? 100 : 0;
@@ -440,6 +446,12 @@ public override void Update(float elapsedClockSeconds)
440446
EmergResPressurePSI -= dp;
441447
AuxResPressurePSI += dp * EmergAuxVolumeRatio;
442448
}
449+
if (EmergencyDumpValveRatePSIpS > 0)
450+
{
451+
BrakeLine1PressurePSI -= elapsedClockSeconds * EmergencyDumpValveRatePSIpS;
452+
if (BrakeLine1PressurePSI < 0)
453+
BrakeLine1PressurePSI = 0;
454+
}
443455
}
444456
}
445457

0 commit comments

Comments
 (0)