-
-
Notifications
You must be signed in to change notification settings - Fork 385
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Atmospheric flight fix #4946
Atmospheric flight fix #4946
Conversation
Cool. FYI: "fix" commits aught to be squashed into the correct commit, as we (usually) don't want to track bug fixes in the PR itself. Looks like there are some clang format issues still. (see wiki dev section on how to run clang-format script) @fluffyfreak looks like appveyor is working again? I hadn't noticed until now. |
Ok, I should read the dev wiki parts. Can somebody explain, how to |
https://pioneerwiki.com/wiki/Using_git_and_GitHub#Fixing.2FUpdating_your_pull_request If you need further help, come by IRC (you need to register a nick with nickserv to speak) |
…s code from CalcAtmosphericDrag
Does this address #4847 ? |
Wait, this does NOT square the local velocity and take its x, y, z components, right? Shouldn't we separate x, y, z first and square each axis individually? |
But the operator *, overloaded for vector3d simply multiplies each component of the facteurs. const vector3d lv2(localVel * localVel); lv2 contains squares of localVel coordinates. |
Oh, that's okay then. I was thinking in scalar values in my head, dumb me.... |
I'll have to double-check both the original calculation and this one - the way it was originally done, the drag calculation was also responsible for about half of the lift (up to a certain point), which might be the reason the current one doesn't look entirely correct. I'll review this when I get some time over the next few days (I promise!), but if this calculation brings us closer to correct behavior I think it'll be good for merge. |
I also found a possible bug with Planet::GetAtmosphericState. // surface gravity = -G*M/planet radius^2
m_surfaceGravity_g = -G * sbody->GetMass() / (sbody->GetRadius() * sbody->GetRadius()); which gives positive laps rate in GetAtmospheric state: const double lapseRate_L = -m_surfaceGravity_g / specificHeatCp; // negative deg/m I propose to make "g" value positive and make a few corrections of sign in Planet class. Is it worth to open an issue and pull request, or I can place the commits in this branch, because I think of computing Mach number, using the atmosphere temperature, which will affect Atmospheric drag? |
If it's a bug in master related to atmosphere-stuff/similar code, I'm fine with adding commits to this PR. |
What was the result? The long discussion, the consensus about that laps rate troposhere model, being used, takes positive g and LR is negative itself, big diff at pull request, which cleans up the code and insulted author deleted the branch? Or language barrier prevented me from uderstanding. |
I wasn't involved with it back then, but my take on it now is that there was reluctance to just flip the signs and call it good. I wouldn't read too much into everything else, including the branch being deleted. At least, that's not why I was pointing out that PR, only for the discussion about the formulas used. I think if you have a solution and are willing to back it up and discuss it then it would be a good contribution to make. |
In accordance with the "Chesterton's fence"-analogy[*], I'm fine with changes as If you guys understand the code, go for it (I haven't looked at it myself). [*] From G.K. Chesterton, The Thing (1929):
|
@starling13: Nothing shows? |
@Web-eWorks, if you found correction of drag force suitable to merging, decide if it's worth to make also atmospheric parameters fix, discussed above before merging. |
Left a few comments and requests for change - I'd appreciate the atmospheric density changes being added to this PR as (I presume) they're small enough to not be a burden while reviewing! |
I made dedicated clang-format commit on Planet.cpp file because it leaves the main atmosphere computations correction commit clear and atomic. |
That's the way we prefer things, thank you! Left one change request, but then I think this PR will be good for merge! |
…osphere force if density at the altitude is near zero.
…e altitude due to the signs mess.
Fix the error in calculation of drag force basis components.
Leads to reduction of the overall drag on significant angles of attack, as can be seen from the first look.