The operation of the brakes is a reasonably complex field in its own right, when thinking about railway operations. I have spent a bit of time trying to understand it, enough for me to set up braking for some of my projects. I have reproduced some of the data that I have managed to find and extract from various sources on this
brake page. Using it has hopefully allowed me to configure brake systems on cars as realistically as possible. Whilst it is written for NSWGR operation most of the principles will be similar to other systems. The main differences will be the system operating pressures.
I believe that, before we can confidently determine whether the braking code in OR has a bug(s) in it or not, we need to complete the following two activities:
i) Configure a train with realistic prototypical information in the ENG and WAG files
ii) determine some realistic expectations that we can then test the code and the rolling stock created in i) above against.
In regard to the first point above, even default trains in MSTS appear to be very poorly configured as far as brake operations are concerned, for example take the consist "gp38.con", which is two GP38 with 35 mixed freight cars attached. To demonstrate my point, run this consist in OR and open the Brake Information HUD.
A couple of points to note from the HUD:
i) The locomotives have 70 psi pressures in their brake cylinders, whereas the cars have 50 psi (ie different values of BrakeCylinderPressureForMaxBrakeBrakeForce( 70 ) )
ii) Wagons 5 & 6 don't show up correctly, so perhaps there is a problem in their respective WAG file.
Then looking at the respective ENG and WAG files for the stock in the consist.
i) As suggested in the post earlier, the locomotive Main Reservoir volume seems low and the Compressor charging rate needs checking.
ii) In addition, the locomotives and wagons seem to have auxiliary brake reservoirs of around 7 - 10 cu ft. Typically I believe that the auxiliary reservoir on a wagon should be in the order of 1 - 2 cu ft. See here for an example
specification.
So, when compared with the locomotive main reservoir volume of 8 cu ft, I think that the train air supply in the main reservoir will be very quickly exhausted, if it is trying to fill 35 x 7 cu ft reservoirs. The other factor that is not necessarily clear, is the size of the brake cylinder, and how much air is being used to apply it and release it, as this will be the actual air used by the system in each application/release cycle.
Typically for the brake system in this consist, a drop of 1 psi in the brake pipe will increase the pressure in the brake cylinder by 2.5 psi, and similarly in reverse, a 1psi increase in the brake pipe will decrease the pressure in the brake cylinder by 2.5psi.
Thus the system operates between the following limits:
i) Full brake release (BP = 90psi, BC = 0 psi)
ii) Full brake application (BP = 70psi, BC = 50 psi)
Typically the brake operation is influenced by various pressures, and volumes within the system. Thus it is possible that incorrectly specified reservoirs may be using too much air, and exceeding the ability of the main reservoir and compressor to supply the air in a timely fashion. For example, if the BP air pressure has dropped to 80 psi (which means that the BC = 25psi), and the main air reservoir volume has been exhausted, then the brakes will need to be recharged by the compressor. This may may take a reasonable period of time depending upon the compressor specifications. In this event, you will see the main reservoir pressure slowly increasing, and in turn the BP, and as a result the BC slowly decreasing.
Remembering that excessively rapid brake operations will eventually discharge the air in the system, and result in "faulty" operation of the brakes. Over the years a number of trains have runaway when descending steep gradients as a result of poor driving, and exhausted air supplies.
So the question now becomes, is it the OR code or the poor specification in the MSTS ENG and WAG files, or train operation that is causing some of the issues being seen? As suggested the only way to determine this is to have a test configuration with the correct values in it, and then test the OR code against it.
To assist in identifying these sorts of issues, I would like to see the main reservoir and wagon reservoirs included in the Brake HUD.