Skip to content
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

Radiation pressure models #184

Conversation

DominikStiller
Copy link

@DominikStiller DominikStiller commented Sep 25, 2023

This PR introduces a new set of radiation pressure models. Before, only solar radiation was supported. Now, planetary radiation (albedo, thermal, ...) can be considered, and the paneled spacecraft model has more features. The classes are designed to be extended.

The primary models added here are (all tudat::electromagnetism):

  • RadiationPressureAcceleration: a single acceleration for all types of sources and targets, as opposed to multiple before
  • RadiationSourceModel: an environment model describing how a body emits radiation (point or extended/paneled)
  • RadiationPressureTargetModel: an environment model describing how a body is accelerated by radiation (cannonball or paneled)

These classes have many sub- and related classes, all of which are unit tested. There were small discrepancies in the validation, which may or may not indicate issues with the implementation.

The models were implemented for this paper, which contains a description of the core equations. Related analysis code is available in this repositoy.

PR for Documentation: tudat-team/tudat-space#122

To do after merging:

  • Create tudatpy interface
  • Extract docstrings to multidoc
  • Remove code for old radiation pressure models (marked with // RP-OLD)
  • Possibly deprecate the old interface (keep both for a while), or adjust the new models to the old one
  • Adapt estimation of cannonball parameters

Following recommendations from https://eigen.tuxfamily.org/dox/TopicPitfalls.html, section "C++11 and the auto keyword"
@DominicDirkx
Copy link
Member

Thanks for developing al this, it's going to make a very important addition to Tudat!

I'm compiling your code, and am running into the following error in a unit test compilation:

/home/dominic/Tudat/tudat-bundle/tudat-bundle/tudat/tests/src/astro/electromagnetism/unitTestSourcePanelRadiosityModel.cpp:94:54: error: no matching function for call to ‘tudat::electromagnetism::AlbedoSourcePanelRadiosityModel::updateOriginalSourceProperties(int, const NegativeReturnType)’
   94 |         radiosityModel.updateOriginalSourceProperties(1, -Eigen::Vector3d::UnitX());

The updateOriginalSourceProperties function that is being called has the following function signature, which indeed does not match the one above.

 void updateOriginalSourceProperties(
            double originalSourceUnoccultedIrradiance,
            double originalSourceOccultedIrradiance,
            const Eigen::Vector3d& originalSourceToPanelDirection)

I'm assuming that, in these tests, originalSourceUnoccultedIrradiance and originalSourceOccultedIrradiance should be set to be equal to one another (e.g. no effect of occultation). Can you confirm this interpretation?

@DominicDirkx
Copy link
Member

Hi Dominik,

I'm getting a couple of compiler errors, and after fixing them (all in unit tests where there were probably recent changes in interfaces) and afterwards a whole bunch of unit tests failures, typically with:

std::runtime_error: Error when retrieving body Sun from SystemOfBodies, no such body exists

Which would seem to indicate that somewhere in the code, the Sun is required (even though no radiation pressure is used). I'll see if I can find out more. Could you try to compile and run all unit tests on your side, and see if you have an idea how to correct the failures (if you get them as well?)

Dominic

@DominicDirkx
Copy link
Member

DominicDirkx commented Sep 28, 2023

Update: I've traced the issue to this:


else if( bodyName == "Earth" )
    {
        // Model from Knocke (1988)
        radiationSourceModelSettings =
                extendedRadiationSourceModelSettings({
                    albedoPanelRadiosityModelSettings(SecondDegreeZonalPeriodicSurfacePropertyDistributionModel::albedo_knocke, "Sun"),
                    delayedThermalPanelRadiosityModelSettings(SecondDegreeZonalPeriodicSurfacePropertyDistributionModel::emissivity_knocke, "Sun")
                }, {6, 12});
    }

default Earth setting, which requires the Sun to be created if a default Earth is created. I don't think this is a good requirement, and I've commented this out for now.

With the following modifications:

b813a7b

I can compile the code, and all unit tests pass successfully

…n_pressure_modeling

# Conflicts:
#	include/tudat/astro/basic_astro/accelerationModelTypes.h
#	src/astro/electromagnetism/CMakeLists.txt
#	tests/src/astro/electromagnetism/CMakeLists.txt
@DominikStiller
Copy link
Author

Thanks for catching those failed unit tests, I should have checked them before committing. I've integrated your improvements into my branch and they should pass now.

Regarding the default Earth model, I've commented out those lines now. A default source for Earth worked before, but I refactored the dependency on the original source (inherent sources are now natively supported without workaround!), which broke the default.

@DominicDirkx
Copy link
Member

Awesome, thanks! I can confirm that the unit tests are all passing now :)

@DominicDirkx
Copy link
Member

Hi Dominik, I've finally gone through all of your code (there's a lot of it!) and there's only one modification that I plan to make before merging it, which concerns the definition of the panels or a target. There's two things I would like to modify:

  • Use a single 'Panel' type for different types of models, in particular radiation pressure and aerodynamics. There would be a single 'PanelSettings' class, which would have properties defining the settings for interaction with radiation, flow (and possibly other properties)
  • Extend the options on the orientation of a panel to:
  • Tracking a body (now implemented)
  • Constant (now implemented)
  • Custom function (now implemented)
  • Fixed to a reference frame of a vehicle 'part' (antenna, solar panel, etc.) This is not yet implemented, but will be important for linking this to Spice kernels that have time-variable vehicle part orientation

If you have reasons to think that these modifications would not be a good idea, let me know :)

@DominikStiller
Copy link
Author

I think unifying target panels for aerodynamic and radiation pressure into a single geometric model makes a lot of sense, and the dynamic panel orientation will be very useful. So no concerns from my side!

@DominicDirkx
Copy link
Member

I think I'm done with the extensions to your code, and it can be merged! Before I do, if you want to have a look at what I added/changed:

#187

Again, many thanks for developing this code. It addresses what I think is the main limitation in Tudat's dynamical modelling framework. Excellent work!

@DominicDirkx DominicDirkx merged commit 78ba37b into tudat-team:develop Nov 1, 2023
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.

2 participants