diff --git a/include/tudat/astro/electromagnetism/luminosityModel.h b/include/tudat/astro/electromagnetism/luminosityModel.h index a19a2736b8..c55cb6cfd6 100644 --- a/include/tudat/astro/electromagnetism/luminosityModel.h +++ b/include/tudat/astro/electromagnetism/luminosityModel.h @@ -25,6 +25,8 @@ namespace tudat namespace electromagnetism { +double computeLuminosityFromIrradiance( const double irradiance, const double distance ); + /*! * Class modeling the luminosity, or emitted electromagnetic power, of a radiation source. * @@ -81,56 +83,36 @@ class ConstantLuminosityModel : public LuminosityModel double luminosity_; }; - -/*! - * Class modeling luminosity of a radiation source based on the irradiance at a given distance. - * - * This luminosity is useful to model variations in the Sun luminosity based on the solar irradiance measured - * at Earth distance. - * - * The source is assumed to be isotropic such that the irradiance given would be found at any position with the - * same distance from the source. - */ -class IrradianceBasedLuminosityModel : public LuminosityModel +class VariableLuminosityModel : public LuminosityModel { public: /*! * Constructor. * - * @param irradianceAtDistanceFunction Function returning the irradiance [W/m²] at a given time - * @param distance Distance from the source at which the irradiance was evaluated/measured - */ - explicit IrradianceBasedLuminosityModel( - const std::function& irradianceAtDistanceFunction, - double distance) - : irradianceAtDistanceFunction_(irradianceAtDistanceFunction), distance_(distance) {} - - /*! - * Constructor. - * - * @param irradianceAtDistance Irradiance at the given distance [W/m²] - * @param distance Distance from the source at which the irradiance was evaluated/measured + * @param luminosity Constant luminosity of the source [W] */ - explicit IrradianceBasedLuminosityModel( - double irradianceAtDistance, - double distance) - : IrradianceBasedLuminosityModel([=] (double) { return irradianceAtDistance; }, distance) {} + explicit VariableLuminosityModel( const std::function< double( const double ) > luminosityFunction ) : + luminosityFunction_( luminosityFunction ), luminosity_( TUDAT_NAN ) {} - double getLuminosity() const override; + double getLuminosity() const override + { + return luminosity_; + } private: - void updateMembers_(double currentTime) override; - //! Function returning the irradiance [W/m²] at a given time - std::function irradianceAtDistanceFunction_; + virtual void updateMembers_(const double currentTime) override + { + luminosity_ = luminosityFunction_( currentTime ); + } - //! Irradiance from the last evaluation of irradianceAtDistanceFunction_ [W/m²] - double irradianceAtDistance_{}; + //! Constant luminosity of the source [W] + const std::function< double( const double ) > luminosityFunction_; - //! Distance from the source at which the irradiance was evaluated/measured - double distance_; + double luminosity_; }; + } // tudat } // electromagnetism diff --git a/include/tudat/astro/electromagnetism/surfacePropertyDistribution.h b/include/tudat/astro/electromagnetism/surfacePropertyDistribution.h index a2942192be..d08141bd0f 100644 --- a/include/tudat/astro/electromagnetism/surfacePropertyDistribution.h +++ b/include/tudat/astro/electromagnetism/surfacePropertyDistribution.h @@ -219,8 +219,26 @@ class SecondDegreeZonalPeriodicSurfacePropertyDistribution : public SurfacePrope const double angularFrequency; }; -} // tudat +class CustomSurfacePropertyDistribution : public SurfacePropertyDistribution +{ +public: + CustomSurfacePropertyDistribution( + const std::function< double( const double, const double, const double ) > customFunction ): + customFunction_( customFunction ){ } + + double getValue(double latitude, double longitude) + { + return customFunction_( latitude, longitude, currentTime_ ); + } + + bool isTimeInvariant( ){ return false; } + +private: + std::function< double( const double, const double, const double ) > customFunction_; +}; + } // electromagnetism +} // tudat #endif //TUDAT_SURFACEPROPERTYDISTRIBUTION_H diff --git a/include/tudat/simulation/environment_setup/createRadiationSourceModel.h b/include/tudat/simulation/environment_setup/createRadiationSourceModel.h index 46bf373b3d..42fd03d918 100644 --- a/include/tudat/simulation/environment_setup/createRadiationSourceModel.h +++ b/include/tudat/simulation/environment_setup/createRadiationSourceModel.h @@ -66,7 +66,7 @@ class RadiationSourceModelSettings enum class LuminosityModelType { constant_radiant_power, - irradiance_based_radiant_power + time_variable_isotropic_radiant_power }; /*! @@ -117,40 +117,26 @@ class ConstantLuminosityModelSettings : public LuminosityModelSettings double luminosity_; }; -/*! - * Settings for an irradiance-based luminosity model. - * - * @see IrradianceBasedLuminosityModel - */ -class IrradianceBasedLuminosityModelSettings : public LuminosityModelSettings +class TimeVariableLuminosityModelSettings : public LuminosityModelSettings { public: /*! * Constructor. * - * @param irradianceAtDistanceFunction Function returning the irradiance at a given time [W/m²] - * @param distance Distance from the source at which the irradiance was evaluated/measured + * @param luminosity Constant luminosity of the source [W] */ - explicit IrradianceBasedLuminosityModelSettings( - const std::function& irradianceAtDistanceFunction, - const double distance) : - LuminosityModelSettings(LuminosityModelType::irradiance_based_radiant_power), - irradianceAtDistanceFunction_(irradianceAtDistanceFunction), - distance_(distance) {} - - const std::function& getIrradianceAtDistanceFunction() const - { - return irradianceAtDistanceFunction_; - } + explicit TimeVariableLuminosityModelSettings( + const std::function< double( const double ) > luminosityFunction) : + LuminosityModelSettings(LuminosityModelType::time_variable_isotropic_radiant_power), + luminosityFunction_(luminosityFunction) {} - double getDistance() const + std::function< double( const double ) > getLuminosityFuntion() const { - return distance_; + return luminosityFunction_; } private: - std::function irradianceAtDistanceFunction_; - double distance_; + std::function< double( const double ) > luminosityFunction_; }; /*! @@ -200,9 +186,24 @@ inline std::shared_ptr inline std::shared_ptr irradianceBasedLuminosityModelSettings(double irradianceAtDistance, double distance) { - return std::make_shared< IrradianceBasedLuminosityModelSettings >( - [=] (double) { return irradianceAtDistance; }, - distance); + return std::make_shared< ConstantLuminosityModelSettings >( + electromagnetism::computeLuminosityFromIrradiance( irradianceAtDistance, distance ) ); +} + +inline std::shared_ptr +timeVariableLuminosityModelSettings(const std::function< double( const double ) > luminosityFunction ) +{ + return std::make_shared< TimeVariableLuminosityModelSettings >(luminosityFunction); +} + + +inline std::shared_ptr +timeVariableIrradianceBasedLuminosityModelSettings(const std::function< double( const double ) > irradianceAtDistanceFunction, double distance) +{ + return std::make_shared< TimeVariableLuminosityModelSettings >( + [=](const double time){ return electromagnetism::computeLuminosityFromIrradiance( + irradianceAtDistanceFunction( time ), distance ); } + ); } /*! @@ -540,7 +541,7 @@ inline std::shared_ptr */ inline std::shared_ptr albedoPanelRadiosityModelSettings( - SecondDegreeZonalPeriodicSurfacePropertyDistributionModel albedoModel, + KnockeTypeSurfacePropertyDistributionModel albedoModel, const std::string& originalSourceName) { return std::make_shared< AlbedoPanelRadiosityModelSettings >( @@ -586,7 +587,7 @@ inline std::shared_ptr */ inline std::shared_ptr delayedThermalPanelRadiosityModelSettings( - SecondDegreeZonalPeriodicSurfacePropertyDistributionModel emissivityModel, + KnockeTypeSurfacePropertyDistributionModel emissivityModel, const std::string& originalSourceName) { return std::make_shared< DelayedThermalPanelRadiosityModelSettings >( diff --git a/include/tudat/simulation/environment_setup/createSurfacePropertyDistribution.h b/include/tudat/simulation/environment_setup/createSurfacePropertyDistribution.h index 83e09aa26e..b22e713ffc 100644 --- a/include/tudat/simulation/environment_setup/createSurfacePropertyDistribution.h +++ b/include/tudat/simulation/environment_setup/createSurfacePropertyDistribution.h @@ -28,7 +28,8 @@ enum class SurfacePropertyDistributionType { constant, spherical_harmonics, - second_degree_zonal_periodic + second_degree_zonal_periodic, + custom_surface_distribution }; /*! @@ -138,7 +139,7 @@ class SphericalHarmonicsSurfacePropertyDistributionSettings : public SurfaceProp Eigen::MatrixXd sineCoefficients_; }; -enum class SecondDegreeZonalPeriodicSurfacePropertyDistributionModel +enum class KnockeTypeSurfacePropertyDistributionModel { custom, albedo_knocke, /**< Knocke Earth albedo model: Knocke, Philip et al. "Earth radiation pressure effects on satellites." Astrodynamics Conference. American Institute of Aeronautics and Astronautics, 1988. */ @@ -174,7 +175,7 @@ class SecondDegreeZonalPeriodicSurfacePropertyDistributionSettings : public Surf const double referenceEpoch, const double period) : SurfacePropertyDistributionSettings(SurfacePropertyDistributionType::second_degree_zonal_periodic), - model_(SecondDegreeZonalPeriodicSurfacePropertyDistributionModel::custom), + model_(KnockeTypeSurfacePropertyDistributionModel::custom), a0(a0), c0(c0), c1(c1), @@ -189,7 +190,7 @@ class SecondDegreeZonalPeriodicSurfacePropertyDistributionSettings : public Surf * @param model Model to be used */ explicit SecondDegreeZonalPeriodicSurfacePropertyDistributionSettings( - SecondDegreeZonalPeriodicSurfacePropertyDistributionModel model); + KnockeTypeSurfacePropertyDistributionModel model); double getA0() const { @@ -227,7 +228,7 @@ class SecondDegreeZonalPeriodicSurfacePropertyDistributionSettings : public Surf } private: - SecondDegreeZonalPeriodicSurfacePropertyDistributionModel model_; + KnockeTypeSurfacePropertyDistributionModel model_; double a0; double c0; @@ -238,6 +239,24 @@ class SecondDegreeZonalPeriodicSurfacePropertyDistributionSettings : public Surf double period; }; + +class CustomSurfacePropertyDistributionSettings : public SurfacePropertyDistributionSettings +{ +public: + explicit CustomSurfacePropertyDistributionSettings( + const std::function< double( const double, const double, const double ) > customFunction ) : + SurfacePropertyDistributionSettings(SurfacePropertyDistributionType::custom_surface_distribution), + customFunction_( customFunction ){ } + + std::function< double( const double, const double, const double ) > getCustomFunction( ) + { + return customFunction_; + } + +private: + std::function< double( const double, const double, const double ) > customFunction_; + +}; /*! * Create settings for constant surface property distribution. * @@ -287,7 +306,7 @@ inline std::shared_ptr */ inline std::shared_ptr secondDegreeZonalPeriodicSurfacePropertyDistributionSettings( - SecondDegreeZonalPeriodicSurfacePropertyDistributionModel model) + KnockeTypeSurfacePropertyDistributionModel model) { return std::make_shared< SecondDegreeZonalPeriodicSurfacePropertyDistributionSettings >(model); } @@ -307,6 +326,12 @@ manualSecondDegreeZonalPeriodicSurfacePropertyDistributionSettings( ); } +inline std::shared_ptr +customSurfacePropertyDistributionSettings( + const std::function< double( const double, const double, const double ) > customFunction ) +{ + return std::make_shared< CustomSurfacePropertyDistributionSettings >(customFunction); +} /*! * Create surface property distribution from its settings. diff --git a/src/astro/electromagnetism/luminosityModel.cpp b/src/astro/electromagnetism/luminosityModel.cpp index e5e8b0ef5f..4cc46a2e9e 100644 --- a/src/astro/electromagnetism/luminosityModel.cpp +++ b/src/astro/electromagnetism/luminosityModel.cpp @@ -21,6 +21,11 @@ namespace tudat namespace electromagnetism { +double computeLuminosityFromIrradiance( const double irradiance, const double distance ) +{ + return 4.0 * mathematical_constants::PI * distance * distance * irradiance; +} + void LuminosityModel::updateMembers(double currentTime) { if(currentTime_ != currentTime) @@ -30,18 +35,5 @@ void LuminosityModel::updateMembers(double currentTime) } } -double IrradianceBasedLuminosityModel::getLuminosity() const -{ - // The source is assumed to be isotropic - auto sphereArea = 4 * mathematical_constants::PI * distance_ * distance_; - auto luminosity = irradianceAtDistance_ * sphereArea; - return luminosity; -} - -void IrradianceBasedLuminosityModel::updateMembers_(const double currentTime) -{ - // Evaluate only once per timestep since irradiance function could be expensive to evaluate - irradianceAtDistance_ = irradianceAtDistanceFunction_(currentTime); -} } // tudat } // electromagnetism diff --git a/src/simulation/environment_setup/createRadiationSourceModel.cpp b/src/simulation/environment_setup/createRadiationSourceModel.cpp index 379fd8350e..5a7ef10a6a 100644 --- a/src/simulation/environment_setup/createRadiationSourceModel.cpp +++ b/src/simulation/environment_setup/createRadiationSourceModel.cpp @@ -55,19 +55,18 @@ std::shared_ptr createLuminosityModel( ); break; } - case LuminosityModelType::irradiance_based_radiant_power: + case LuminosityModelType::time_variable_isotropic_radiant_power : { - auto irradianceBasedLuminosityModelSettings = - std::dynamic_pointer_cast< IrradianceBasedLuminosityModelSettings >(modelSettings); - if(irradianceBasedLuminosityModelSettings == nullptr) + auto variableLuminosityModelSettings = + std::dynamic_pointer_cast< TimeVariableLuminosityModelSettings >(modelSettings); + if(variableLuminosityModelSettings == nullptr) { throw std::runtime_error( - "Error, expected irradiance-based luminosity model for body " + body ); + "Error, expected time-variable luminosity model for body " + body ); } - luminosityModel = std::make_shared( - irradianceBasedLuminosityModelSettings->getIrradianceAtDistanceFunction(), - irradianceBasedLuminosityModelSettings->getDistance() + luminosityModel = std::make_shared( + variableLuminosityModelSettings->getLuminosityFuntion( ) ); break; } diff --git a/src/simulation/environment_setup/createSurfacePropertyDistribution.cpp b/src/simulation/environment_setup/createSurfacePropertyDistribution.cpp index c37346a69e..1b85b6760c 100644 --- a/src/simulation/environment_setup/createSurfacePropertyDistribution.cpp +++ b/src/simulation/environment_setup/createSurfacePropertyDistribution.cpp @@ -32,45 +32,45 @@ SphericalHarmonicsSurfacePropertyDistributionSettings::SphericalHarmonicsSurface // Original coefficients: https://github.com/DominikStiller/tudelft-hpb-project/blob/main/analysis/files/DLAM-1.txt // Initializer lists generated in https://github.com/DominikStiller/tudelft-hpb-project/blob/0a73ae8d03022852ff89874fbebf1eb7c58ea8e9/analysis/lunar_models.ipynb - cosineCoefficients_ = Eigen::MatrixXd { - {+1.9467246e-01, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00}, - {+3.7619635e-03, -3.6562523e-02, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00}, - {+2.6013759e-02, -2.3342472e-02, -1.5511737e-03, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00}, - {+1.0791359e-02, +1.2984099e-02, -5.1947501e-04, +8.3037838e-04, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00}, - {+1.5490099e-03, +2.4150199e-03, -4.5980599e-04, -5.8965344e-05, +1.0396812e-04, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00}, - {-4.7391417e-03, +9.7388352e-04, -6.6144592e-04, +3.6299540e-05, +3.9759108e-06, +2.2706280e-06, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00}, - {+2.1741056e-03, +1.9854158e-03, +3.6293963e-05, -2.7638060e-05, -4.6429902e-06, -3.8219121e-06, +3.8641269e-07, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00}, - {-2.6214758e-03, +9.6586546e-04, -7.8726437e-05, +3.5085491e-05, +3.0497316e-06, -4.0231517e-08, -5.2535643e-08, -1.3545976e-08, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00}, - {-7.2392123e-03, -3.6002321e-05, -1.5504282e-04, -4.2175334e-06, +2.0927038e-06, -2.1213522e-07, +5.7936412e-08, -2.8380071e-09, +1.0183988e-09, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00}, - {-4.6530150e-03, +7.7363813e-04, +5.8165535e-05, -2.2643899e-05, -3.9981338e-07, -2.2805609e-08, -2.1918927e-08, +4.0524183e-09, +5.7278542e-10, +1.0169170e-10, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00}, - {-1.5925583e-02, -1.4417769e-05, +5.8118004e-05, -1.0071993e-06, +3.8769952e-07, -1.2667752e-08, +8.7088087e-09, +1.0255584e-09, +3.5006160e-10, +3.1475729e-11, +2.3275218e-12, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00}, - {-3.7225793e-03, -4.1507339e-04, -6.3009829e-05, -2.5513158e-06, +1.5175304e-07, -5.7092276e-08, +1.9616945e-09, +3.1055117e-10, +3.6901893e-11, +5.4058712e-12, +6.7325209e-14, +8.2735779e-14, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00}, - {-7.7462959e-03, +6.8495466e-04, +1.4207584e-04, -1.0655919e-06, -3.4816920e-07, +5.7062063e-09, +5.0926848e-11, +9.6192077e-11, +6.7701005e-12, +2.1793964e-13, -1.3931937e-13, -6.8635425e-14, -1.5758214e-14, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00}, - {-3.3546880e-03, -1.3212219e-04, +4.5390329e-05, -2.6017423e-07, +7.6728373e-08, +3.4665610e-08, -7.9035553e-10, +1.7610549e-11, -3.1363309e-13, -4.7416380e-13, +5.5748058e-14, -1.3900740e-14, -1.8879465e-15, -1.0161655e-16, +0.0000000e+00, +0.0000000e+00}, - {-3.6441110e-04, -9.7545225e-05, +1.5509838e-05, +4.0179933e-06, +1.6956168e-07, +1.7457361e-09, +7.2904379e-10, +2.9305495e-11, +1.3563638e-13, -3.3491741e-13, +4.1828106e-14, +4.4231192e-15, -2.2486444e-17, -2.6053296e-17, +1.6362147e-18, +0.0000000e+00}, - {-5.2703131e-04, -1.6753741e-04, -2.3173518e-06, +1.9601325e-06, +1.3155985e-07, +8.7049262e-11, -1.5396847e-10, +3.0639418e-11, +3.3787168e-12, +1.8243357e-15, +5.1578908e-15, +6.2635779e-16, +7.1664911e-17, +4.9580752e-17, -6.7885954e-19, +1.5503219e-19} - }; + cosineCoefficients_ = Eigen::MatrixXd::Zero( 16, 16 ); + cosineCoefficients_ << + +1.9467246e-01, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00, + +3.7619635e-03, -3.6562523e-02, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00, + +2.6013759e-02, -2.3342472e-02, -1.5511737e-03, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00, + +1.0791359e-02, +1.2984099e-02, -5.1947501e-04, +8.3037838e-04, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00, + +1.5490099e-03, +2.4150199e-03, -4.5980599e-04, -5.8965344e-05, +1.0396812e-04, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00, + -4.7391417e-03, +9.7388352e-04, -6.6144592e-04, +3.6299540e-05, +3.9759108e-06, +2.2706280e-06, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00, + +2.1741056e-03, +1.9854158e-03, +3.6293963e-05, -2.7638060e-05, -4.6429902e-06, -3.8219121e-06, +3.8641269e-07, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00, + -2.6214758e-03, +9.6586546e-04, -7.8726437e-05, +3.5085491e-05, +3.0497316e-06, -4.0231517e-08, -5.2535643e-08, -1.3545976e-08, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00, + -7.2392123e-03, -3.6002321e-05, -1.5504282e-04, -4.2175334e-06, +2.0927038e-06, -2.1213522e-07, +5.7936412e-08, -2.8380071e-09, +1.0183988e-09, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00, + -4.6530150e-03, +7.7363813e-04, +5.8165535e-05, -2.2643899e-05, -3.9981338e-07, -2.2805609e-08, -2.1918927e-08, +4.0524183e-09, +5.7278542e-10, +1.0169170e-10, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00, + -1.5925583e-02, -1.4417769e-05, +5.8118004e-05, -1.0071993e-06, +3.8769952e-07, -1.2667752e-08, +8.7088087e-09, +1.0255584e-09, +3.5006160e-10, +3.1475729e-11, +2.3275218e-12, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00, + -3.7225793e-03, -4.1507339e-04, -6.3009829e-05, -2.5513158e-06, +1.5175304e-07, -5.7092276e-08, +1.9616945e-09, +3.1055117e-10, +3.6901893e-11, +5.4058712e-12, +6.7325209e-14, +8.2735779e-14, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00, + -7.7462959e-03, +6.8495466e-04, +1.4207584e-04, -1.0655919e-06, -3.4816920e-07, +5.7062063e-09, +5.0926848e-11, +9.6192077e-11, +6.7701005e-12, +2.1793964e-13, -1.3931937e-13, -6.8635425e-14, -1.5758214e-14, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00, + -3.3546880e-03, -1.3212219e-04, +4.5390329e-05, -2.6017423e-07, +7.6728373e-08, +3.4665610e-08, -7.9035553e-10, +1.7610549e-11, -3.1363309e-13, -4.7416380e-13, +5.5748058e-14, -1.3900740e-14, -1.8879465e-15, -1.0161655e-16, +0.0000000e+00, +0.0000000e+00, + -3.6441110e-04, -9.7545225e-05, +1.5509838e-05, +4.0179933e-06, +1.6956168e-07, +1.7457361e-09, +7.2904379e-10, +2.9305495e-11, +1.3563638e-13, -3.3491741e-13, +4.1828106e-14, +4.4231192e-15, -2.2486444e-17, -2.6053296e-17, +1.6362147e-18, +0.0000000e+00, + -5.2703131e-04, -1.6753741e-04, -2.3173518e-06, +1.9601325e-06, +1.3155985e-07, +8.7049262e-11, -1.5396847e-10, +3.0639418e-11, +3.3787168e-12, +1.8243357e-15, +5.1578908e-15, +6.2635779e-16, +7.1664911e-17, +4.9580752e-17, -6.7885954e-19, +1.5503219e-19; // DLAM-1 was derived for 750 nm, for which the lunar albedo is 1.3x higher than for the average solar wavelength (Vasavada 2012) cosineCoefficients_ /= 1.3; - sineCoefficients_ = Eigen::MatrixXd { - {+0.0000000e+00, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00}, - {+0.0000000e+00, +5.6001365e-03, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00}, - {+0.0000000e+00, +8.1157719e-03, +3.8666951e-03, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00}, - {+0.0000000e+00, +4.4228069e-03, +8.4562088e-04, +5.6399842e-04, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00}, - {+0.0000000e+00, +4.0835265e-04, +1.3355072e-04, -3.6099797e-04, +2.3202309e-05, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00}, - {+0.0000000e+00, -1.3456091e-03, +3.1660688e-04, -8.7896463e-06, -1.2393980e-05, -7.7072017e-06, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00}, - {+0.0000000e+00, -1.4544906e-03, -4.4995953e-04, -2.6311244e-05, -1.8718417e-06, -2.2078777e-06, +1.8563273e-07, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00}, - {+0.0000000e+00, +1.8339524e-04, -1.8110928e-04, +5.0219647e-06, +8.2965753e-06, -3.7900317e-07, -3.4385676e-08, +4.9054745e-08, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00}, - {+0.0000000e+00, +2.0406948e-04, -1.3913689e-05, -8.4511225e-06, +3.1466922e-07, +4.9911698e-07, -1.8092486e-08, +5.8710168e-09, -1.5713514e-10, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00}, - {+0.0000000e+00, +4.6701200e-04, +6.9847140e-05, -4.0525490e-06, -7.9218511e-07, -1.9313979e-07, +3.4069650e-08, -1.4011289e-09, -1.3832559e-10, +1.3236655e-10, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00}, - {+0.0000000e+00, -5.4143689e-04, -1.1630132e-05, -6.4835704e-06, +2.2378128e-07, +4.3471159e-08, -9.0300331e-09, +5.7498839e-10, -1.0203755e-10, +1.8234256e-13, +7.5191487e-12, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00}, - {+0.0000000e+00, -8.4160025e-04, -5.5066150e-05, +3.4092571e-07, +1.8967153e-07, +1.0107761e-08, -2.0706063e-09, +5.8926272e-10, -5.1348358e-12, -1.8695112e-12, +1.8852480e-13, +1.1409691e-13, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00}, - {+0.0000000e+00, -5.6343034e-04, -4.4633814e-05, -3.3261046e-07, +2.0043823e-07, -1.4608797e-08, +1.9354670e-11, +3.4474363e-10, +2.3030528e-11, +1.1705956e-12, +1.2995393e-13, +6.8129780e-14, +1.5142770e-14, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00}, - {+0.0000000e+00, +9.0551537e-05, +2.2609028e-07, +1.4402096e-07, -6.4197295e-09, -8.3422668e-09, -1.1672606e-09, -1.9050421e-10, +1.9903467e-11, -1.2764944e-12, +1.4391851e-14, +3.2500778e-15, +7.7976884e-16, +3.1218531e-17, +0.0000000e+00, +0.0000000e+00}, - {+0.0000000e+00, -1.0450677e-04, +6.4306586e-06, +2.1110565e-06, -1.5533490e-07, +1.4467997e-08, -6.1351496e-10, -2.9127184e-12, +6.4443237e-12, +6.0953923e-13, +4.1457548e-14, +1.2466192e-15, -8.6235475e-18, -5.0954031e-17, -1.3625581e-17, +0.0000000e+00}, - {+0.0000000e+00, +8.1385640e-05, -2.2953268e-05, +1.1112276e-06, +7.8452563e-10, -3.3764876e-09, -9.4043359e-10, -6.7121496e-12, -1.1717653e-12, +4.9851680e-14, +2.5320711e-15, -9.5636359e-16, +6.2521874e-17, -1.8821820e-17, +4.7202048e-19, +2.5665136e-19} - }; + sineCoefficients_ = Eigen::MatrixXd::Zero( 16, 16 ); + sineCoefficients_ << + +0.0000000e+00, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00, + +0.0000000e+00, +5.6001365e-03, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00, + +0.0000000e+00, +8.1157719e-03, +3.8666951e-03, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00, + +0.0000000e+00, +4.4228069e-03, +8.4562088e-04, +5.6399842e-04, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00, + +0.0000000e+00, +4.0835265e-04, +1.3355072e-04, -3.6099797e-04, +2.3202309e-05, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00, + +0.0000000e+00, -1.3456091e-03, +3.1660688e-04, -8.7896463e-06, -1.2393980e-05, -7.7072017e-06, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00, + +0.0000000e+00, -1.4544906e-03, -4.4995953e-04, -2.6311244e-05, -1.8718417e-06, -2.2078777e-06, +1.8563273e-07, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00, + +0.0000000e+00, +1.8339524e-04, -1.8110928e-04, +5.0219647e-06, +8.2965753e-06, -3.7900317e-07, -3.4385676e-08, +4.9054745e-08, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00, + +0.0000000e+00, +2.0406948e-04, -1.3913689e-05, -8.4511225e-06, +3.1466922e-07, +4.9911698e-07, -1.8092486e-08, +5.8710168e-09, -1.5713514e-10, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00, + +0.0000000e+00, +4.6701200e-04, +6.9847140e-05, -4.0525490e-06, -7.9218511e-07, -1.9313979e-07, +3.4069650e-08, -1.4011289e-09, -1.3832559e-10, +1.3236655e-10, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00, + +0.0000000e+00, -5.4143689e-04, -1.1630132e-05, -6.4835704e-06, +2.2378128e-07, +4.3471159e-08, -9.0300331e-09, +5.7498839e-10, -1.0203755e-10, +1.8234256e-13, +7.5191487e-12, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00, + +0.0000000e+00, -8.4160025e-04, -5.5066150e-05, +3.4092571e-07, +1.8967153e-07, +1.0107761e-08, -2.0706063e-09, +5.8926272e-10, -5.1348358e-12, -1.8695112e-12, +1.8852480e-13, +1.1409691e-13, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00, + +0.0000000e+00, -5.6343034e-04, -4.4633814e-05, -3.3261046e-07, +2.0043823e-07, -1.4608797e-08, +1.9354670e-11, +3.4474363e-10, +2.3030528e-11, +1.1705956e-12, +1.2995393e-13, +6.8129780e-14, +1.5142770e-14, +0.0000000e+00, +0.0000000e+00, +0.0000000e+00, + +0.0000000e+00, +9.0551537e-05, +2.2609028e-07, +1.4402096e-07, -6.4197295e-09, -8.3422668e-09, -1.1672606e-09, -1.9050421e-10, +1.9903467e-11, -1.2764944e-12, +1.4391851e-14, +3.2500778e-15, +7.7976884e-16, +3.1218531e-17, +0.0000000e+00, +0.0000000e+00, + +0.0000000e+00, -1.0450677e-04, +6.4306586e-06, +2.1110565e-06, -1.5533490e-07, +1.4467997e-08, -6.1351496e-10, -2.9127184e-12, +6.4443237e-12, +6.0953923e-13, +4.1457548e-14, +1.2466192e-15, -8.6235475e-18, -5.0954031e-17, -1.3625581e-17, +0.0000000e+00, + +0.0000000e+00, +8.1385640e-05, -2.2953268e-05, +1.1112276e-06, +7.8452563e-10, -3.3764876e-09, -9.4043359e-10, -6.7121496e-12, -1.1717653e-12, +4.9851680e-14, +2.5320711e-15, -9.5636359e-16, +6.2521874e-17, -1.8821820e-17, +4.7202048e-19, +2.5665136e-19; sineCoefficients_ /= 1.3; break; @@ -81,14 +81,14 @@ SphericalHarmonicsSurfacePropertyDistributionSettings::SphericalHarmonicsSurface } SecondDegreeZonalPeriodicSurfacePropertyDistributionSettings::SecondDegreeZonalPeriodicSurfacePropertyDistributionSettings( - SecondDegreeZonalPeriodicSurfacePropertyDistributionModel model) : + KnockeTypeSurfacePropertyDistributionModel model) : SecondDegreeZonalPeriodicSurfacePropertyDistributionSettings(TUDAT_NAN, TUDAT_NAN, TUDAT_NAN, TUDAT_NAN, TUDAT_NAN, TUDAT_NAN, TUDAT_NAN) { model_ = model; switch(model) { - case SecondDegreeZonalPeriodicSurfacePropertyDistributionModel::albedo_knocke: + case KnockeTypeSurfacePropertyDistributionModel::albedo_knocke: { // Knocke Earth albedo model: Knocke, Philip et al. "Earth radiation pressure effects on satellites." Astrodynamics Conference. American Institute of Aeronautics and Astronautics, 1988. a0 = 0.34; @@ -101,7 +101,7 @@ SecondDegreeZonalPeriodicSurfacePropertyDistributionSettings::SecondDegreeZonalP break; } - case SecondDegreeZonalPeriodicSurfacePropertyDistributionModel::emissivity_knocke: + case KnockeTypeSurfacePropertyDistributionModel::emissivity_knocke: { // Knocke Earth emissivity model: Knocke, Philip et al. "Earth radiation pressure effects on satellites." Astrodynamics Conference. American Institute of Aeronautics and Astronautics, 1988. a0 = 0.68; @@ -178,6 +178,20 @@ std::shared_ptr createSurfaceProp secondDegreeZonalPeriodicSurfacePropertyDistributionSettings->getPeriod()); break; } + case SurfacePropertyDistributionType::custom_surface_distribution: + { + auto customSurfacePropertyDistributionSettings = + std::dynamic_pointer_cast(distributionSettings); + if(customSurfacePropertyDistributionSettings == nullptr) + { + throw std::runtime_error( + "Error, expected custom surface property distribution for body " + body ); + } + + surfacePropertyDistribution = std::make_shared< CustomSurfacePropertyDistribution >( + customSurfacePropertyDistributionSettings->getCustomFunction( ) ); + break; + } default: throw std::runtime_error( "Error, do not recognize surface property distribution settings for " + body ); } diff --git a/src/simulation/environment_setup/defaultBodies.cpp b/src/simulation/environment_setup/defaultBodies.cpp index d1de1b3a56..f6311830bb 100644 --- a/src/simulation/environment_setup/defaultBodies.cpp +++ b/src/simulation/environment_setup/defaultBodies.cpp @@ -49,8 +49,8 @@ std::shared_ptr getKnockeEarthRadiationPressureSet { // Model from Knocke (1988) return extendedRadiationSourceModelSettings({ - albedoPanelRadiosityModelSettings(SecondDegreeZonalPeriodicSurfacePropertyDistributionModel::albedo_knocke, "Sun"), - delayedThermalPanelRadiosityModelSettings(SecondDegreeZonalPeriodicSurfacePropertyDistributionModel::emissivity_knocke, "Sun") + albedoPanelRadiosityModelSettings(KnockeTypeSurfacePropertyDistributionModel::albedo_knocke, "Sun"), + delayedThermalPanelRadiosityModelSettings(KnockeTypeSurfacePropertyDistributionModel::emissivity_knocke, "Sun") }, {6, 12}); } //! Function to create default settings for a body's radiation source model. @@ -73,8 +73,8 @@ std::shared_ptr getDefaultRadiationSourceModelSett // // Model from Knocke (1988) // radiationSourceModelSettings = // extendedRadiationSourceModelSettings({ -// albedoPanelRadiosityModelSettings(SecondDegreeZonalPeriodicSurfacePropertyDistributionModel::albedo_knocke, "Sun"), -// delayedThermalPanelRadiosityModelSettings(SecondDegreeZonalPeriodicSurfacePropertyDistributionModel::emissivity_knocke, "Sun") +// albedoPanelRadiosityModelSettings(KnockeTypeSurfacePropertyDistributionModel::albedo_knocke, "Sun"), +// delayedThermalPanelRadiosityModelSettings(KnockeTypeSurfacePropertyDistributionModel::emissivity_knocke, "Sun") // }, {6, 12}); // } diff --git a/tests/src/astro/electromagnetism/unitTestLuminosityModel.cpp b/tests/src/astro/electromagnetism/unitTestLuminosityModel.cpp index f0501933d7..ba7608cbda 100644 --- a/tests/src/astro/electromagnetism/unitTestLuminosityModel.cpp +++ b/tests/src/astro/electromagnetism/unitTestLuminosityModel.cpp @@ -41,7 +41,7 @@ BOOST_AUTO_TEST_CASE( testIrradianceBasedLuminosityModel ) { const auto expectedLuminosity = celestial_body_constants::SUN_LUMINOSITY; - IrradianceBasedLuminosityModel luminosityModel(1360.8, physical_constants::ASTRONOMICAL_UNIT); + ConstantLuminosityModel luminosityModel( computeLuminosityFromIrradiance( 1360.8, physical_constants::ASTRONOMICAL_UNIT ) ); luminosityModel.updateMembers(TUDAT_NAN); const auto actualLuminosity = luminosityModel.getLuminosity(); diff --git a/tests/src/astro/electromagnetism/unitTestRadiationPressureAcceleration.cpp b/tests/src/astro/electromagnetism/unitTestRadiationPressureAcceleration.cpp index 9dfed1910e..c8f63f0c85 100644 --- a/tests/src/astro/electromagnetism/unitTestRadiationPressureAcceleration.cpp +++ b/tests/src/astro/electromagnetism/unitTestRadiationPressureAcceleration.cpp @@ -57,8 +57,7 @@ BOOST_AUTO_TEST_CASE( testRadiationPressureAcceleration_Unity ) const auto expectedAcceleration = Eigen::Vector3d::UnitX(); // Set distance to speed of light to cancel to unity radiation pressure - auto luminosityModel = std::make_shared( - [](double) { return physical_constants::SPEED_OF_LIGHT; }, 1); + auto luminosityModel = std::make_shared(computeLuminosityFromIrradiance( 1.0, 1.0 )); auto sourceModel = std::make_shared(luminosityModel); auto targetModel = std::make_shared(1, 1); IsotropicPointSourceRadiationPressureAcceleration accelerationModel( @@ -87,8 +86,8 @@ BOOST_AUTO_TEST_CASE( testRadiationPressureAcceleration_GOCE ) const Eigen::Vector3d expectedAcceleration = Eigen::Vector3d(1, 1, 0).normalized() * 5.2e-9; const double expectedReceivedFraction = 1.0; - auto luminosityModel = std::make_shared( - [](double) { return 1371; }, physical_constants::ASTRONOMICAL_UNIT); + auto luminosityModel = std::make_shared( + computeLuminosityFromIrradiance( 1371.0, physical_constants::ASTRONOMICAL_UNIT ) ); auto sourceModel = std::make_shared(luminosityModel); auto targetModel = std::make_shared(1, 1.2); IsotropicPointSourceRadiationPressureAcceleration accelerationModel( @@ -248,7 +247,8 @@ BOOST_AUTO_TEST_CASE( testRadiationPressureAcceleration_IsotropicPointSource_Can const Eigen::Vector3d sourcePosition = -149598000.0e3 * Eigen::Vector3d::UnitX(); auto sourceModel = std::make_shared( - std::make_shared(1367.0, physical_constants::ASTRONOMICAL_UNIT)); + std::make_shared( + computeLuminosityFromIrradiance( 1367.0, physical_constants::ASTRONOMICAL_UNIT ) )); const auto targetModel = std::make_shared(5, 1.2); auto sourceToTargetOccultationModel = std::make_shared( @@ -292,8 +292,8 @@ BOOST_AUTO_TEST_CASE( testRadiationPressureAcceleration_IsotropicPointSource_Can BOOST_AUTO_TEST_CASE( testRadiationPressureAcceleration_IsotropicPointSource_PaneledTarget_Basic ) { // Set distance to speed of light to cancel to unity radiation pressure - auto luminosityModel = std::make_shared( - [](double) { return physical_constants::SPEED_OF_LIGHT; }, 1); + auto luminosityModel = std::make_shared( + computeLuminosityFromIrradiance( physical_constants::SPEED_OF_LIGHT, 1.0 ) ); auto sourceModel = std::make_shared(luminosityModel); std::vector< std::shared_ptr< system_models::VehicleExteriorPanel > > panels{ std::make_shared< system_models::VehicleExteriorPanel >(1, -Eigen::Vector3d::UnitX(), @@ -974,8 +974,8 @@ BOOST_AUTO_TEST_CASE( testRadiationPressureAcceleration_IsotropicPointSource_Pan BOOST_AUTO_TEST_CASE( testRadiationPressureAcceleration_StaticallyPaneledSource_PaneledTarget_Basic ) { // Set distance to speed of light to cancel to unity radiation pressure - auto luminosityModel = std::make_shared( - [](double) { return physical_constants::SPEED_OF_LIGHT; }, 1); + auto luminosityModel = std::make_shared( + computeLuminosityFromIrradiance( physical_constants::SPEED_OF_LIGHT, 1.0 ) ); auto originalSourceModel = std::make_shared(luminosityModel); const std::map>& originalSourceModels { @@ -1230,8 +1230,8 @@ BOOST_AUTO_TEST_CASE( testRadiationPressureAcceleration_DynamicallyPaneledSource const auto targetModel = createRadiationPressureTargetModel(targetModelSettings, "Vehicle", bodies); const auto sourceModelSettings = extendedRadiationSourceModelSettings({ - albedoPanelRadiosityModelSettings(SecondDegreeZonalPeriodicSurfacePropertyDistributionModel::albedo_knocke, "Sun"), - delayedThermalPanelRadiosityModelSettings(SecondDegreeZonalPeriodicSurfacePropertyDistributionModel::emissivity_knocke, "Sun") + albedoPanelRadiosityModelSettings(KnockeTypeSurfacePropertyDistributionModel::albedo_knocke, "Sun"), + delayedThermalPanelRadiosityModelSettings(KnockeTypeSurfacePropertyDistributionModel::emissivity_knocke, "Sun") }, {6, 12}); const auto sourceModel = std::dynamic_pointer_cast(createRadiationSourceModel(sourceModelSettings, globalFrameOrigin, bodies)); diff --git a/tests/src/astro/electromagnetism/unitTestRadiationSourceModel.cpp b/tests/src/astro/electromagnetism/unitTestRadiationSourceModel.cpp index 899b38408c..02d190891c 100644 --- a/tests/src/astro/electromagnetism/unitTestRadiationSourceModel.cpp +++ b/tests/src/astro/electromagnetism/unitTestRadiationSourceModel.cpp @@ -53,8 +53,8 @@ BOOST_AUTO_TEST_CASE( testIsotropicPointRadiationSourceModel ) auto targetPosition = Eigen::Vector3d(physical_constants::ASTRONOMICAL_UNIT, 0, 0); - auto luminosityModel = std::make_shared( - [=](double) { return expectedIrradiance; }, physical_constants::ASTRONOMICAL_UNIT); + auto luminosityModel = std::make_shared( + computeLuminosityFromIrradiance( expectedIrradiance, physical_constants::ASTRONOMICAL_UNIT ) ); auto radiationSourceModel = std::make_shared(luminosityModel); radiationSourceModel->updateMembers(TUDAT_NAN); @@ -158,7 +158,8 @@ BOOST_AUTO_TEST_CASE( testStaticallyPaneledRadiationSourceModel_Albedo ) // Original source such that at source, original source irradiance = 1 and original source to source = (-1, 0, 0) const std::map>& originalSourceModels { {"OrigSource", std::make_shared( - std::make_shared(1, 1))}}; + std::make_shared(computeLuminosityFromIrradiance( 1.0, 1.0 )))}}; + const std::map>& originalSourceBodyShapeModels { {"OrigSource", nullptr}}; const std::map>& originalSourcePositionFunctions { @@ -202,7 +203,7 @@ BOOST_AUTO_TEST_CASE( testStaticallyPaneledRadiationSourceModel_Albedo ) // Original source such that at source, original source irradiance = 1 and original source to source = (-1, 0, 0) const std::map>& originalSourceModels { {"OrigSource", std::make_shared( - std::make_shared(1, 1))}}; + std::make_shared(computeLuminosityFromIrradiance( 1.0, 1.0 )))}}; const std::map>& originalSourceBodyShapeModels { {"OrigSource", nullptr}}; const std::map>& originalSourcePositionFunctions { @@ -278,7 +279,7 @@ BOOST_AUTO_TEST_CASE( testStaticallyPaneledRadiationSourceModel_Albedo ) // Original source such that at source, original source irradiance = 1 and original source to source = (0, 0, -1) const std::map>& originalSourceModels { {"OrigSource", std::make_shared( - std::make_shared(1, 1))}}; + std::make_shared(computeLuminosityFromIrradiance( 1.0, 1.0 )))}}; const std::map>& originalSourceBodyShapeModels { {"OrigSource", nullptr}}; const std::map>& originalSourcePositionFunctions { diff --git a/tests/src/simulation/unitTestEnvironmentModelSetup.cpp b/tests/src/simulation/unitTestEnvironmentModelSetup.cpp index 44209c440c..2bf0e5231f 100644 --- a/tests/src/simulation/unitTestEnvironmentModelSetup.cpp +++ b/tests/src/simulation/unitTestEnvironmentModelSetup.cpp @@ -1657,7 +1657,7 @@ BOOST_AUTO_TEST_CASE( test_surfacePropertyDistributionSetup_SecondDegreeZonalPer spice_interface::loadStandardSpiceKernels(); auto surfacePropertyDistributionSettings = secondDegreeZonalPeriodicSurfacePropertyDistributionSettings( - SecondDegreeZonalPeriodicSurfacePropertyDistributionModel::albedo_knocke); + KnockeTypeSurfacePropertyDistributionModel::albedo_knocke); auto surfacePropertyDistribution = std::dynamic_pointer_cast( createSurfacePropertyDistribution(surfacePropertyDistributionSettings, "")); @@ -1679,7 +1679,7 @@ BOOST_AUTO_TEST_CASE( test_surfacePropertyDistributionSetup_SecondDegreeZonalPer spice_interface::loadStandardSpiceKernels(); auto surfacePropertyDistributionSettings = secondDegreeZonalPeriodicSurfacePropertyDistributionSettings( - SecondDegreeZonalPeriodicSurfacePropertyDistributionModel::emissivity_knocke); + KnockeTypeSurfacePropertyDistributionModel::emissivity_knocke); auto surfacePropertyDistribution = std::dynamic_pointer_cast( createSurfacePropertyDistribution(surfacePropertyDistributionSettings, ""));