Skip to content

[#1328] Added wind environment modules#1329

Open
carlo98 wants to merge 1 commit intoAVSLab:developfrom
carlo98:feature/wind_env_modules
Open

[#1328] Added wind environment modules#1329
carlo98 wants to merge 1 commit intoAVSLab:developfrom
carlo98:feature/wind_env_modules

Conversation

@carlo98
Copy link
Contributor

@carlo98 carlo98 commented Mar 12, 2026

Description

Implements the wind environment module infrastructure requested in issue #1328.

Two modules are introduced:

WindBase — abstract base class that handles all shared operations for atmospheric wind models:

  • Reads one spacecraft state (scStateInMsg) and one planet SPICE ephemeris (planetPosInMsg) per instance.
  • Computes r_BP_N = r_BN_N - r_PN_N at every time step, handling simulations where the planet is not at the inertial origin.
  • Derives planetOmega_N automatically from J20002Pfix and J20002Pfix_dot when SPICE provides orientation derivatives; falls back to a subclass-supplied value when the derivative is zero.
  • Maintains an epochDateTime structure for time-dependent empirical models, populated from the optional epochInMsg or via the customSetEpochFromVariable() method.
  • Writes a single windOutMsg per update.

CorotatingAtmosphereWindModel computes

v_wind_N = planetOmega_N x r_BP_N

Defaults to Earth's sidereal rotation rate about the inertial Z-axis (OMEGA_EARTH). The rotation rate can be overridden via setPlanetOmega_N() or automatically from SPICE DCM derivatives managed by WindBase.

Verification

Unit tests added in _UnitTest/test_corotatingAtmosphereWindModel.py:

  • Parametrised correctness test: v_wind_N = omega x r_BP_N for all combinations of zero/non-zero planet position and manual/default rotation rate.
  • Default omega equals OMEGA_EARTH.
  • setPlanetOmega_N / getPlanetOmega_N.
  • Reset() raises when planetPosInMsg is not linked.
  • Reset() raises when scStateInMsg is not linked.
  • planetOmega_N is derived from J20002Pfix_dot when non-zero.
  • planetOmega_N derived from DCM combined with non-zero planet position.
  • Connecting epochInMsg does not break Reset() or the wind output.
  • windOutMsg is zeroed when input messages are linked but not yet written.

Documentation

  • windBase.rst added.
  • corotatingAtmosphereWindModel.rst added.
  • Release snippet: docs/source/Support/ReleaseNotes/1328-windBase_corotatingAtmosphereWindModel.rst.
  • Reviewers should verify equation formatting renders correctly in the built docs and that all cross-references resolve.

Future work

  • Additional wind models can be implemented as WindBase subclasses, reusing all shared infrastructure.
  • Drag Dynamic Effectors should be updated to consume this message.

@carlo98 carlo98 requested a review from a team as a code owner March 12, 2026 21:48
@carlo98
Copy link
Contributor Author

carlo98 commented Mar 12, 2026

@juan-g-bonilla @schaubh
New module, I cannot add reviewers.

@carlo98
Copy link
Contributor Author

carlo98 commented Mar 12, 2026

wind_modules This is the idea

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant