[#1317] Added option to use atmosphere relative velocity in dragDynamicEff#1318
Open
carlo98 wants to merge 1 commit intoAVSLab:developfrom
Open
[#1317] Added option to use atmosphere relative velocity in dragDynamicEff#1318carlo98 wants to merge 1 commit intoAVSLab:developfrom
carlo98 wants to merge 1 commit intoAVSLab:developfrom
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Adds optional atmosphere-relative velocity support to
dragDynamicEffector, allowing drag to be computed from spacecraft velocity relative to a rotating planetary atmosphere instead of inertial velocity alone.Key implementation details reviewers should be aware of:
Default behavior is unchanged: The new logic is enabled only when
useAtmosphereRelativeVelocityis set toTrue. Existing users keep the current inertial-velocity behavior by default.Relative-velocity formulation: When enabled, the module computes
v_rel = v_sc - (planetOmega_N x r_sc)before transforming into body coordinates and evaluating drag.Earth default, configurable for other bodies:
planetOmega_Ndefaults to[0, 0, OMEGA_EARTH], so Earth cases work without extra configuration. Non-Earth cases can override this vector from Python.Conditional state dependency: The spacecraft position state is linked only when atmosphere-relative velocity is enabled, so no new mandatory dependency is introduced for existing drag setups.
Resetguard: IfuseAtmosphereRelativeVelocityis enabled but the hub position state is unavailable,Reset()throws aBSK_ERRORimmediately.Near-zero relative velocity handling: If the relative velocity magnitude is below threshold, the module returns zero drag force and torque instead of normalizing a near-zero vector.
Verification
Added a test confirming drag is unchanged when
useAtmosphereRelativeVelocity = False.Added a unit test confirming the computed force matches a reference when
useAtmosphereRelativeVelocity = True.Added a test verifying the position state is only required when atmosphere-relative velocity is enabled.
Added a near-zero-relative-velocity test confirming the drag output remains finite and effectively zero.
Added a reset-guard test confirming initialization fails when atmosphere-relative velocity is enabled without a valid position state.
Documentation
Updated
dragDynamicEffector.rstwith a new section.Added the equation, default Earth behavior, non-Earth configuration note, and a Python usage example.
Future work
Source
planetOmega_Nautomatically from Spice kernels.Extend atmosphere-relative velocity support to non-cannonball drag models.