Aerodynamics in SFS

Horus Lupercal

Primarch - Warmaster
Professor
Swingin' on a Star
Deja Vu
Biker Mice from Mars
ET phone home
Floater
Copycat
Registered
#51
Yeah, that mostly happens because fairings don't do their job (they are meant to protect from drag the equipments inside), and separators are bugged too: they induce drag even if they weren't triggered.
Oooor you're trying to re-launch a landed dropship from a saved game with a 200t pod made of structural parts...
 

Altaïr

Space Stig, Master of gravity
Staff member
Head Moderator
Team Kolibri
Modder
TEAM HAWK
Atlas
Deja Vu
Under Pressure
Forum Legend
#53
Oooor you're trying to re-launch a landed dropship from a saved game with a 200t pod made of structural parts...
True, but at least a structure that generates drag is somewhat expectable.
 

Horus Lupercal

Primarch - Warmaster
Professor
Swingin' on a Star
Deja Vu
Biker Mice from Mars
ET phone home
Floater
Copycat
Registered
#54
Expected, but after about 30 seconds of burn with the Valkyrie I'd hit the dizzying speed of 60m/s with a TWR of at least 1.2, maybe 1.4. It was a quick turn around(touch down, fuel, load and go) and I didn't do the maths
 

Altaïr

Space Stig, Master of gravity
Staff member
Head Moderator
Team Kolibri
Modder
TEAM HAWK
Atlas
Deja Vu
Under Pressure
Forum Legend
#56
I finally measured effective surfaces for all pieces, and I tried to summarize my findings in a sheet as clearly as possible. Here it is:
https://docs.google.com/spreadsheets/d/1010FfVr77E2I9gpNUgGKXX35A69AafIvFp7W4Jsiw-4/edit?usp=sharing

In a few words, drag generated by a piece is proportional to its effective surface. The greater it is, the more drag will be generated.
I also put a comment column to explain when a piece has a special behaviour. But expect this to be like french grammar: exception is the rule!

In particular, some pieces have their drag application point off centered. Those pieces tend to make your rocket flip, even if your design is symmetric. Here is an example:
Screenshot_20190125-144750_Spaceflight Simulator.jpg
That build is unstable and tends to lean to the right. That's because of the wheels, their drag application center is on the right (no matter how you rotate and place them!).
But if I modify it that way:
Screenshot_20190125-144659_Spaceflight Simulator.jpg
Now the rocket is perfectly stable! o_Oo_Oo_O
Such pieces have been labeled as "generates instability" in the chart. This is what it means.

I'll make a second message soon to explain things more in detail, but feel free to ask anything if that's not clear, I'll try to answer the best I can :p
 
#57
I finally measured effective surfaces for all pieces, and I tried to summarize my findings in a sheet as clearly as possible. Here it is:
https://docs.google.com/spreadsheets/d/1010FfVr77E2I9gpNUgGKXX35A69AafIvFp7W4Jsiw-4/edit?usp=sharing

In a few words, drag generated by a piece is proportional to its effective surface. The greater it is, the more drag will be generated.
I also put a comment column to explain when a piece has a special behaviour. But expect this to be like french grammar: exception is the rule!

In particular, some pieces have their drag application point off centered. Those pieces tend to make your rocket flip, even if your design is symmetric. Here is an example:
View attachment 13486
That build is unstable and tends to lean to the right. That's because of the wheels, their drag application center is on the right (no matter how you rotate and place them!).
But if I modify it that way:
View attachment 13487
Now the rocket is perfectly stable! o_Oo_Oo_O
Such pieces have been labeled as "generates instability" in the chart. This is what it means.

I'll make a second message soon to explain things more in detail, but feel free to ask anything if that's not clear, I'll try to answer the best I can :p
Wow, this is incredible. Thanks for doing this! I'm sure we could generate a few challenges around aerodynamics and use this table for designing our rockets.

I'd love to hear more about your test strategy again at some point, too.
 

Horus Lupercal

Primarch - Warmaster
Professor
Swingin' on a Star
Deja Vu
Biker Mice from Mars
ET phone home
Floater
Copycat
Registered
#58
Some of those results are crazy. A covered Titan is less aero efficient than the flat top of the biggest fuel tank and the biggest structural piece. Who'd have thunk it.
 

Altaïr

Space Stig, Master of gravity
Staff member
Head Moderator
Team Kolibri
Modder
TEAM HAWK
Atlas
Deja Vu
Under Pressure
Forum Legend
#59
Wow, this is incredible. Thanks for doing this! I'm sure we could generate a few challenges around aerodynamics and use this table for designing our rockets.

I'd love to hear more about your test strategy again at some point, too.
Yeah, probably. It surely can be used to make an optimal rocket for Venus.

My test strategy uses specific atmosphere parameters. Here they are:
Screenshot_20190215-111023_QuickEdit.jpg
The density is 0.00046, and because curve = 0, it's constant, it doesn't decrease with altitude as it should.
Then I build my rockets and fly them in that atmosphere, with no gravity/infinite fuel enabled. Because of that, the only forces that apply are thrust and drag. So when the ship reaches a limit speed, it means that thrust and drag are equal:
T = 1/2 × density × S × v^2

I know everything but S, so I can calculate it:
S = 2×T/(density × v^2)

Now let's go for practice:
Screenshot_20190215-110234_Spaceflight Simulator.jpg
For example that ship has a limit speed of 1000 m/s. The formula gives me its effective surface: S=5.
Note that the structures doesn't generate drag in this case. This is because they are directly attached to a fuel tank above them, so they are shielded. If I flew the same design without the structural parts, I would get the same result.

Now let's try with a fuel tank:
Screenshot_20190215-110543_Spaceflight Simulator.jpg
Now my limit speed is 620 m/s, so the whole effective surface is 13. Because the previous rocket had a surface of 5, it means that the fuel tank added 8.

Now let's try with a nose cone:
Screenshot_20190215-110940_Spaceflight Simulator.jpg
The limit speed is now 924 m/s, so S = 5.85.
Again, 5 is coming from the original design, so the cone has an effective surface of 0.85, and shields the fuel tank below it.

That's more or less how I did all my tests. The hardest part was for parts that make the rocket unstable. I had to try to place them differently, to add RCS on one side to balance off centered drag, or adding lots of capsules to have enough torque to compensate.

For information, here is one of the most aerodynamic rocket I found:
Screenshot_20190215-113526_Spaceflight Simulator.jpg
Its effective surface is only 3.82. 1.4 come from the cone, 2.4 from the engine. And 0.02 from numerical imprecision :)
 

Altaïr

Space Stig, Master of gravity
Staff member
Head Moderator
Team Kolibri
Modder
TEAM HAWK
Atlas
Deja Vu
Under Pressure
Forum Legend
#60
Some of those results are crazy. A covered Titan is less aero efficient than the flat top of the biggest fuel tank and the biggest structural piece. Who'd have thunk it.
Yeah, those big engines generate a huge drag. The Hawk and the Broadsword are way better for that.
But the problem is also about the fuel tanks: To be logic, the 12 width fuel tanks should have an effective surface of 24 to be consistant.
 

Horus Lupercal

Primarch - Warmaster
Professor
Swingin' on a Star
Deja Vu
Biker Mice from Mars
ET phone home
Floater
Copycat
Registered
#61
Yeah, those big engines generate a huge drag. The Hawk and the Broadsword are way better for that.
But the problem is also about the fuel tanks: To be logic, the 12 width fuel tanks should have an effective surface of 24 to be consistant.
And its also nuts that the system ignores 'shielded' structural parts, but not the shielded engine. Have you tried exposing parts of parts? As in, a following 8x1 structural part is shielded completely, but if you exposed half of it to the airflow, would the system allocate half the drag or all drag value?
 

Altaïr

Space Stig, Master of gravity
Staff member
Head Moderator
Team Kolibri
Modder
TEAM HAWK
Atlas
Deja Vu
Under Pressure
Forum Legend
#66
And its also nuts that the system ignores 'shielded' structural parts, but not the shielded engine. Have you tried exposing parts of parts? As in, a following 8x1 structural part is shielded completely, but if you exposed half of it to the airflow, would the system allocate half the drag or all drag value?
Actually I'm not that shocked that the engines generate drag. In real life the bottom of a rocket also generates drag, because the zone below is a low pressure zone that tends to exert a suction force on the launcher.
If they generated no drag, it would be very easy to make insanely aerodynamic rockets. But it sure needs to be balanced.

When a piece is partly shielded, the effective surface is reduced indeed, but in a weird way. From what I understood, each bit covered reduces the effective surface by 2 units. This gives a logical result in most cases, but not always.

Let's take that example:
Screenshot_20190215-133917_Spaceflight Simulator.jpg
The small fuel tanks (4w) has a surface of 8, the other one of 12. In both cases, the cone reduces the surface exposed by 8, and adds its own surface (0.85). So the build on the left has a surface of 0.85, the one on the right has 4.85.
Note that the game ignores the shape due to adaptative parts.

This works also with bigger parts:
Screenshot_20190215-134507_Spaceflight Simulator.jpg
You could expect that the fuel tank on the left is only partly covered. But as its effective surface is 8, the nose cone still provides a -8 bonus and manages to cancel completely the drag it would generate. So the build on the left has an effective surface if 0.85.
If you look at the builds on the right, this doesn't work anymore though. That fuel tank has a surface of 16. So when covered by a small nose cone, it still has a surface of 8.85 (8 remaining from the fuel tank, 0.85 added by the nose cone).
Covering it by a large small cone provides a -12 bonus, so its surface is 5.4 (4 remaining + 1.4 from the nose cone).

On another hand, if you cover it like this:
Screenshot_20190215-135248_Spaceflight Simulator.jpg
Now the 2 nose cones manage to cancel completely the surface of the tank.

Because of this small fuel tank anomaly, the way you assemble a booster can change things:
Screenshot_20190215-140839_Spaceflight Simulator.jpg
I used colors so that you can easily see how I placed the different fuel tanks. The small fuel tank (orange) has a surface of 16 while the other ones have a surface of 8.
The build on the left is more resistive because the nose cone is placed on the small fuel tank, reducing its surface from 16 to 8. On the right, it covers the medium fuel tank that only has 8, so it manages to cancel it completely.
The medium fuel tank covers the small one, but because of its width (8 bits), it can provide a -16 bonus, so it manages to hide completely the small fuel tank below.
In a word, don't put the small fuel tank on the top. This is something really important to take into account if you want an aerodynamic rocket!

Here is another example:
Screenshot_20190215-135529_Spaceflight Simulator.jpg
The build on the left has 2 2×1 structs (8 surface units together), the one on the right has a 4×1 struct (16 surface units - that part is bugged, it has twice more surface as expected).
On the left, the structural parts are completely shielded, so the global surface is 0.85.
But on the right, as the effective surface can only be reduced from 16 to 8, this build has a surface of 8.85, despite the structural part being fully covered.

Additionally, some parts cannot be shielded by placing something above them (I warned you there were lots of exceptions didn't I?).
This is especially the case for separators (the side separator is ok though), and for some utilities parts like wheels and RCS.

I told you, aerodynamics in this game is more complicated than french grammar, perhaps even as much complicated as welsh o_O
 
#69
Hello guys and girls!

I did a few tests and I finally figured out how aerodynamics work in that game. :D

If you've already had a look at the planet data, you surely noticed that section:
View attachment 12050
This is where the atmospheric data is described. Here is what it means:
- height: that one is clear, that's the height of the atmosphere limit, in meters.
- density: air density at ground level
- curve: a coefficient that tells how fast density decreases with altitude. A greater coefficient means that density decreases faster.

The density formula used by SFS is:
rho(h) = density × exp(-curve × h/height)
With h being height, and rho(h) density at the corresponding height.

That may be useful for modders that want to design a new planet with its own atmosphere.

You can also use this to test if your rocket is aerodynamic or not (highly recommended if you want to come back from Venus :p).
Here is how to proceed:
First, open the Earth.txt file in planet data, and change the atmosphere data like this:
View attachment 12051
Changing height is not that important, but what really is is setting the curve parameter to 0. This will make density remain always the same; It will neither increase, nor decrease with altitude.

Then, open SFS, and activate the "no gravity" and "infinite fuel" cheats.
Go into the build menu, and build the rocket you want to test. Before launching it, take note about its thrust:
View attachment 12052
In this example, I have a single Hawk, so my thrust is 115 tons.

Then, when you're on the launchpad, exit and then resume the game! This is because drag is brok. erm... disabled by default. This allows to enable drag, so that you can test.

Then turn on the engine, and lift-off! Now your rocket only experiences drag, as gravity is disabled, and its mass won't vary because of infinite fuel.
Your rocket will first accelerate, but it will quickly reach a limit speed:
View attachment 12053
When speed doesn't vary anymore, it means that drag is exactly compensating for thrust. Note that limit speed, and now you can calculate a coefficient that will tell you how aerodynamic your rocket is:

Aerodynamism = (speed^2)/thrust

The higher the result, the more aerodynamic your rocket is!

That's still messy, and I apologize for that, but I just figured this out and I still want to experiment, but I wanted to share this so that anyone can do his own tests :p
Greetings from the future :D Did you make any progress? I was trying to wrote some simple code using matlab to design proper rockets that suits for my low orbit launches, but i didnt get aerodynamics involved to calculations, because i have no idea about it. However, i did some experiments and found a gravitational acceleration function with the variable of altitude. Actually, a few function. Each one works better for a spesific altitude range. About aerodynamics, according to my experiments, negative acceleration due to air resistance graph with respect to time looks like gaussian distribution but upside down.
 
#70
Greetings from the future :D Did you make any progress? I was trying to wrote some simple code using matlab to design proper rockets that suits my low orbit launches, but i didnt get aerodynamics involved to calculations, because i have no idea about it. However, i did some experiments and found a gravitational acceleration function with the variable of altitude. Actually, a few function. Each one works better for a specific altitude range. About aerodynamics, according to my experiments, negative acceleration due to air resistance graph with respect to time looks like gaussian distribution but upside down.
By the way, the program i wrote works well enough for me. At first, i enter required parameter. Lets say i have a 100 ton satelite and want to make it orbit at 40km altitude. I enter these weight and altitude values, then program enters the loop. In this loop, program simulates different rockets until it finds a proper rocket that capable of carrying this satelite with 100 ton weight to the altitude of 40km. Behind scene is a little bit more complex than this, but this is the main idea of how program works.
 

Catalyst_Kh

TEAM HAWK
Atlas
Fly me to the Moon
Under Pressure
Registered
#71
What would be calculated rocket's mass to bring 100t to 40 km orbit?

If we put 100t payload to that rocket, what would be all starting mass at launchpad with this payload?
 

Altaïr

Space Stig, Master of gravity
Staff member
Head Moderator
Team Kolibri
Modder
TEAM HAWK
Atlas
Deja Vu
Under Pressure
Forum Legend
#72
Greetings from the future :D Did you make any progress?
Hello,

It's been so long, I didn't think somebody would be interested in that huge pile of sh... of maths :p

To be honest most of all this is not valid anymore, that was for SFS 1.4, and drag has been completely reworked for 1.5. The stuff in the first post is still valid though. But it's still hard to calculate drag in a real situation, it depends a lot on the rocket and on its angle of incidence (its orientation relative to the air flow).


However, i did some experiments and found a gravitational acceleration function with the variable of altitude. Actually, a few function. Each one works better for a spesific altitude range.
If it's just that, I can help you. For gravity, you can use the following formula:
g = g0 / (1 + alt/R)², where:
- g0 is the altitude at ground level (9.8 m/s²)
- alt: your altitude
- R: the Earth radius (R = 315000 meters)

Be careful though, this is not enough, you have to take into account the centripetal acceleration. It's oriented upwards and is opposed to gravity. It's:
a = Vh²/(R + alt)
With Vh: your horizontal speed.

You will notice that you've reached orbital velocity when a and g cancel out.

About aerodynamics, according to my experiments, negative acceleration due to air resistance graph with respect to time looks like gaussian distribution but upside down.
It's not exactly a gaussian distribution, but it quite looks like it yes. Drag is null at lift off (because no speed), then it reaches a peak (the well known Max Q), then it decreases and reaches 0 again (because no atmosphere in space).

Anyway, that's an unusual approach, that must be interesting :)
 
#73
What would be calculated rocket's mass to bring 100t to 40 km orbit?

If we put 100t payload to that rocket, what would be all starting mass at launchpad with this payload?
its a 2 stage rocket. Program starts calculations with stage 2. Stage 2 starts at altitude of 30km and the goal is to orbit payload to a specific altitude. Calculations done in many loops. It starts like this: payload is 100t, initial fuel tank weight is 5t, initial titan engine amount is 1. So, the weight of stage 2 rocket inculing payload is 117t (100t payload, 5t fuel tank, 12t titan engine). Progam simulates these conditions to find out whether this rocket achieves to orbit or not. If not, returns to the beginning of the loop and increases fuel tank weigt 5t and this situation continues until it achieves orbit. If it cant achieve, at some point, T/W ratio will be 1 and it means rocket cant launch. Then program stops to increase tank weight. Instead, increases amount of titan engine 1 and simulation starts with 5t again and so on. This is the loop that designs a proper stage 2 rocket. When the stage 2 rocket is found, our new payload weight is payload weight+stage 2 rocket weight. Now stage 1 loop starts with our new payload weight and it does almost the same calculations to find out a proper stage 1 rocket. When the calculations done, program shows me tank weight and amount of booster for stage 1 and stage 2 separately. I hope i explained with an understandable English :D im not native
 
#74
It's been so long, I didn't think somebody would be interested in that huge pile of sh... of maths :p
then you're right :D exceptions don't break rules

Be careful though, this is not enough, you have to take into account the centripetal acceleration. It's oriented upwards and is opposed to gravity. It's:
a = Vh²/(R + alt)
With Vh: your horizontal speed.
To avoid unexpected things like centripetal acceleration, i flight stage 1 rocket only vertically. When stage 1 rocket runs out of fuel, i detach it from stage 2 rocket. Then i rotate stage 2 rocket to make it go horizontally. After reaching altitude of 30km, stage 2 ignition starts.

If it's just that, I can help you. For gravity, you can use the following formula:
g = g0 / (1 + alt/R)², where:
- g0 is the altitude at ground level (9.8 m/s²)
- alt: your altitude
- R: the Earth radius (R = 315000 meters)
i was about to start a new launch test to find better gravity funcion :D thank you