air drag

Discussions about the technical aspects of graphics development, including NewGRF tools and utilities.

Moderator: Graphics Moderators

Post Reply
Eddi
Tycoon
Tycoon
Posts: 8289
Joined: 17 Jan 2007 00:14

air drag

Post by Eddi »

The current specs allow setting an air drag coefficient for "realistic acceleration", the game uses this coefficient for the front vehicle with the formula:

Code: Select all

air_drag * (1 + 3/20 * number of wagons)
the second part of that formula is supposed to simulate the drag caused by the gap between wagons.

however, this is insufficent, because
1) high speed train sets are modeled in a way so the gap between wagons is minimized to reduce overall air drag
2) "dummy" articulated parts used in some NewGRFs (no, not only mine! :) ) should not be counted in this formula


so i propose a new property/callback for additional air drag for wagons
- value between 0 and 1 [scaled to 0..255]
- default value (for "legacy" vehicles) 3/20 [38]

the value of this property/callback is evaluated on change of consist, summed up over all vehicles, and cached in the front vehicle, the formula for calculation of air drag will be:

Code: Select all

air_drag * (1 + cached_additional_drag)
michael blunck
Tycoon
Tycoon
Posts: 5954
Joined: 27 Apr 2005 07:09
Contact:

Re: air drag

Post by michael blunck »

Eddi wrote: [...] the second part of that formula is supposed to simulate the drag caused by the gap between wagons.
Is that OTTD-only? I don´t remember seeing this formula in TTDPatch.

Nevertheless, I doubt something like your proposal would be needed, simply because you don´t need to "simulate" that inter-wagon gap explicitly, neither for old-style coaches nor for freight wagons, simply because of their low velocity? In comparison to modern trains with much higher speed (-> c2 * v²)?

Moreover, an easy workaround to the problem of trains not reaching their max speed would be to set prop20 (air drag coefficient) somewhat lower, this would do no harm since it won´t allow an engine to run with more than its max speed (or faster than the freight wagon speed limit, etc).

regards
Michael
Image
Eddi
Tycoon
Tycoon
Posts: 8289
Joined: 17 Jan 2007 00:14

Re: air drag

Post by Eddi »

michael blunck wrote:
Eddi wrote: [...] the second part of that formula is supposed to simulate the drag caused by the gap between wagons.
Is that OTTD-only? I don´t remember seeing this formula in TTDPatch.
I don't know, the "realistic acceleration" code is rather old, but i don't think it was ported over from TTDPatch in a 1:1 fashion.
Moreover, an easy workaround to the problem of trains not reaching their max speed would be to set prop20 (air drag coefficient) somewhat lower, this would do no harm since it won´t allow an engine to run with more than its max speed (or faster than the freight wagon speed limit, etc).
yes, that's what i did, but this hack is rather awkward, and it's not "exact" for varying train lengths.
michael blunck
Tycoon
Tycoon
Posts: 5954
Joined: 27 Apr 2005 07:09
Contact:

Re: air drag

Post by michael blunck »

Eddi wrote:
mb wrote: Is that OTTD-only? I don´t remember seeing this formula in TTDPatch.
I don't know, the "realistic acceleration" code is rather old, but i don't think it was ported over from TTDPatch in a 1:1 fashion.
So, how about getting better rid of it? :cool:

Technically, something like this makes indeed sense, because for total air drag, we have

- hull resistance (pressure and suction)
- frictional resistance (side walls, roof, passages, undercarriage)
- flow resistance (ventilation and cooling; to a much smaller degree than those other two)

But to model it in a proper way for TTD´s trains might be tricky, since

- hull resistance mainly depends on the cross section area, slightly modified by an empirical value depending on the shape/design of the vehicle (ranging from 0.8 for a straight cross section like a coach, to 0.22 for a Shinkansen type). Intentionally, this is done by TTDPatch´s prop20, leaving it to the newGRF coder.

- frictional resistance is totally empirical, depending not only on passages, but also on the way doors and windows are inserted into the vehicle´s hull, on pantographs and other roof equipment, and most importantly, on bogeys and other undercarriage equipment. I remember data from ICE development, where frictional resistance from the undercarriage contributed 75% of the total air drag, which could be halved by a better cladding of bogeys alone.

I.e., for some of its components, there´s indeed a dependency with number of vehicles, but finding correct values for these components would strongly depend on the particular design. So, IMO, it would be better to only have one parameter defined by the newGRF at all, rather than introducing another one?

regards
Michael
Image
Eddi
Tycoon
Tycoon
Posts: 8289
Joined: 17 Jan 2007 00:14

Re: air drag

Post by Eddi »

michael blunck wrote:I.e., for some of its components, there´s indeed a dependency with number of vehicles, but finding correct values for these components would strongly depend on the particular design. So, IMO, it would be better to only have one parameter defined by the newGRF at all, rather than introducing another one?
the main point is that there's a difference between whether a vehicle runs at the front or not. it does not make sense to try to model that with one property.
michael blunck
Tycoon
Tycoon
Posts: 5954
Joined: 27 Apr 2005 07:09
Contact:

Re: air drag

Post by michael blunck »

Eddi wrote: the main point is that there's a difference between whether a vehicle runs at the front or not. it does not make sense to try to model that with one property.
Why not? At least, there´s always only one consist. And the problem with different handling of airdrag for locomotives or heads consisting of one part, or being composed of a number of parts (by CB 1D) seems only having been introduced by that specific formula you showed above, right?

For me, this seems to meddle with symptoms.

regards
Michael
Image
Post Reply

Return to “NewGRF Technical Discussions”

Who is online

Users browsing this forum: No registered users and 10 guests