Skip to content

Commit 308959f

Browse files
committed
Add emergency dump valve
1 parent b79cb2d commit 308959f

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
@@ -2944,6 +2944,7 @@ MaxAuxilaryChargingRate and EmergencyResChargingRate.
29442944
.. index::
29452945
single: BrakePipeVolume
29462946
single: ORTSEmergencyValveActuationRate
2947+
single: ORTSEmergencyDumpValveRate
29472948
single: ORTSMainResPipeAuxResCharging
29482949
single: ORTSMainResChargingRate
29492950
single: ORTSEngineBrakeReleaseRate
@@ -2972,6 +2973,8 @@ MaxAuxilaryChargingRate and EmergencyResChargingRate.
29722973
brake actuation of the triple valve. If the pressure in the brake pipe
29732974
decreases at a higher rate than specified, the triple valve will switch to
29742975
emergency mode.
2976+
- ``Wagon(ORTSEmergencyDumpValveRate)``-- Rate at which BP is locally discharged
2977+
at every wagon during an emergency brake application.
29752978
- ``Wagon(ORTSMainResPipeAuxResCharging`` -- Boolean value that indicates,
29762979
for twin pipe systems, if the main reservoir pipe is used for charging the auxiliary
29772980
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.07f;
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, 0.07f); 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
CylPressurePSI = 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)