[#1325] Added relative velocity atmo and density correction in facetDragDynEff#1326
Closed
carlo98 wants to merge 1 commit intoAVSLab:developfrom
Closed
[#1325] Added relative velocity atmo and density correction in facetDragDynEff#1326carlo98 wants to merge 1 commit intoAVSLab:developfrom
carlo98 wants to merge 1 commit intoAVSLab:developfrom
Conversation
Contributor
Author
|
This may create problems with PR 1289. Should probably wait for it to be merged? |
Contributor
|
@leahkiner , does this PR impact any of your ongoing work? |
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 and optional multiplicative density correction to
facetDragDynamicEffector, bringing it to feature parity withdragDynamicEffector.Key implementation details reviewers should be aware of:
Default behavior is unchanged: Both new features are opt-in. Existing users keep the current inertial-velocity, uncorrected-density 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 per-facet 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 viasetPlanetOmega_N.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 facet drag setups.
Resetguard: IfuseAtmosphereRelativeVelocityis enabled but the hub position state is unavailable,Reset()emits aBSK_ERRORimmediately.Near-zero relative velocity handling: If the relative velocity magnitude falls below threshold, the module returns zero drag force and torque instead of normalizing a near-zero vector.
Density correction state: When
densityCorrectionStateNameis set, the effective density is scaled asrho_eff = rho_in * (1 + delta), wheredeltais a scalar state read from the dynamic state manager (e.g. driven byMeanRevertingNoiseStateEffector). Getter and setter methods are provided so the state name is accessible from Python.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 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.
Added a test confirming drag force is unchanged when no density correction state is configured.
Documentation
Updated
facetDragDynamicEffector.rstwith a new Density Correction State section including the scaling equation, default behavior, and a Python usage example.Updated
facetDragDynamicEffector.rstwith a new Atmosphere Relative Velocity section including the formulation, Earth default, non-Earth configuration note, and a Python usage example.Future work
planetOmega_Nautomatically from Spice kernels.dragDynamicEffector.