Skip to content

Commit

Permalink
Merged
Browse files Browse the repository at this point in the history
  • Loading branch information
DominicDirkx committed Sep 16, 2022
2 parents de4bce7 + 864bb6b commit ab155dc
Show file tree
Hide file tree
Showing 252 changed files with 19,005 additions and 7,577 deletions.
2 changes: 1 addition & 1 deletion .bumpversion.cfg
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[bumpversion]
current_version = 2.10.6.dev13
current_version = 2.10.6.dev40
commit = True
tag = True
parse = (?P<major>\d+)\.(?P<minor>\d+)\.(?P<patch>\d+)(\.(?P<release>[a-z]+)(?P<dev>\d+))?
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@ int main( )
std::shared_ptr< IntegratorSettings< double > > integratorSettings =
std::make_shared< RungeKuttaVariableStepSizeSettingsScalarTolerances< double > >
( rungeKuttaVariableStepSize, double( initialEphemerisTime ), 40.0,
RungeKuttaCoefficients::CoefficientSets::rungeKuttaFehlberg78,
rungeKuttaFehlberg78,
0.00001, 1.0E2, 1.0E-13, 1.0E-13);

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ int main( )
std::shared_ptr< IntegratorSettings< double > > integratorSettings =
std::make_shared< RungeKuttaVariableStepSizeSettingsScalarTolerances< double > >(
double( initialEphemerisTime ), 40.0,
RungeKuttaCoefficients::CoefficientSets::rungeKuttaFehlberg78,
rungeKuttaFehlberg78,
40.0, 40.0, 1.0, 1.0 );

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ int main( )
std::shared_ptr< IntegratorSettings< double > > integratorSettings =
std::make_shared< RungeKuttaVariableStepSizeSettingsScalarTolerances< double > >(
rungeKuttaVariableStepSize, double( initialEphemerisTime ), 30.0,
RungeKuttaCoefficients::CoefficientSets::rungeKuttaFehlberg78,
CoefficientSets::rungeKuttaFehlberg78,
15.0, 15.0, 1.0, 1.0 );

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ int main( )
{
// Reference trajectory
integratorSettings = std::make_shared< RungeKuttaVariableStepSizeSettingsScalarTolerances< > >(
simulationStartEpoch, 100.0, RungeKuttaCoefficients::rungeKuttaFehlberg78, 1.0e-5, 1.0e5,
simulationStartEpoch, 100.0, rungeKuttaFehlberg78, 1.0e-5, 1.0e5,
integrationReferenceTolerance, integrationReferenceTolerance );
}
else
Expand All @@ -230,7 +230,7 @@ int main( )
if ( integratorType == 0 )
{
integratorSettings = std::make_shared< RungeKuttaVariableStepSizeSettingsScalarTolerances< > >(
simulationStartEpoch, 100.0, RungeKuttaCoefficients::rungeKuttaFehlberg56, 1.0e-5, 1.0e5,
simulationStartEpoch, 100.0, rungeKuttaFehlberg56, 1.0e-5, 1.0e5,
integrationRelativeTolerance, integrationAbsoluteTolerance );
}
else if ( integratorType == 1 )
Expand Down
53 changes: 11 additions & 42 deletions include/tudat/astro/aerodynamics/aerodynamicGuidance.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,72 +11,41 @@
#define TUDAT_ENTRYGUIDANCE_H

#include "tudat/astro/reference_frames/aerodynamicAngleCalculator.h"
#include "tudat/basics/deprecationWarnings.h"

namespace tudat
{

namespace aerodynamics
{

//! Base class in which the aerodynamic angles (angle of attack, sideslip and bank angle) are computed. A derived class
//! implementing a specific guidance law is to be implemented by the user.
/*!
* Functionality is no longer supported, interfaces are retained to print error messages with referral to website for people using old code.
*/
class AerodynamicGuidance
{
public:

//! Constructor.
AerodynamicGuidance( ):
currentAngleOfAttack_( TUDAT_NAN ), currentAngleOfSideslip_( TUDAT_NAN ), currentBankAngle_( TUDAT_NAN ){ }
AerodynamicGuidance( )
{
utilities::printDeprecationError(
"tudatpy.numerical_simulation.propagation.AerodynamicGuidance",
"https://docs.tudat.space/en/stable/_src_user_guide/state_propagation/environment_setup/thrust_refactor/thrust_refactor.html#aerodynamic-guidance" );

}

//! Destructor
virtual ~AerodynamicGuidance( ){ }

//! Pure virtual function to update the guidance to the current time and state
/*!
* Pure virtual function to update the guidance to the current time and state
* \param currentTime Time to which the guidance object is to be updated.
*/
virtual void updateGuidance( const double currentTime ) = 0;

//! Function to retrieve the current angle of attack, as set by last call to updateGuidance function
/*!
* Function to retrieve the current angle of attack, as set by last call to updateGuidance function
* \return Current angle of attack, as set by last call to updateGuidance function
*/
double getCurrentAngleOfAttack( )
{
return currentAngleOfAttack_;
}

//! Function to retrieve the current angle of sideslip, as set by last call to updateGuidance function
/*!
* Function to retrieve the current angle of sideslip, as set by last call to updateGuidance function
* \return Current angle of sideslip, as set by last call to updateGuidance function
*/
double getCurrentAngleOfSideslip( )
{
return currentAngleOfSideslip_;
}

//! Function to retrieve the current bank angle, as set by last call to updateGuidance function
/*!
* Function to retrieve the current bank angle, as set by last call to updateGuidance function
* \return Current bank angle, as set by last call to updateGuidance function
*/
double getCurrentBankAngle( )
{
return currentBankAngle_;
}

protected:

//! Current angle of attack, as set by last call to updateGuidance function
double currentAngleOfAttack_;

//! Current angle of sideslip, as set by last call to updateGuidance function
double currentAngleOfSideslip_;

//! Current bank angle, as set by last call to updateGuidance function
double currentBankAngle_;

};
Expand Down
24 changes: 18 additions & 6 deletions include/tudat/astro/aerodynamics/flightConditions.h
Original file line number Diff line number Diff line change
Expand Up @@ -169,11 +169,11 @@ class FlightConditions
* to NaN, indicating the need to recompute all quantities for the next time computation.
* \param currentTime
*/
virtual void resetCurrentTime( const double currentTime = TUDAT_NAN )
virtual void resetCurrentTime( )
{
currentTime_ = currentTime;
currentTime_ = TUDAT_NAN;
isScalarFlightConditionComputed_ = allScalarFlightConditionsUncomputed;
aerodynamicAngleCalculator_->resetCurrentTime( currentTime_ );
aerodynamicAngleCalculator_->resetCurrentTime( );
}

//! Function to return current central body-fixed state of vehicle.
Expand Down Expand Up @@ -466,6 +466,12 @@ class AtmosphericFlightConditions: public FlightConditions
*/
std::vector< double > getAerodynamicCoefficientIndependentVariables( )
{
if( aerodynamicCoefficientInterface_ == nullptr )
{
throw std::runtime_error(
"Error when getting aerodynamic coefficient independent variables, no coefficient interface is defined" );
}

if( aerodynamicCoefficientIndependentVariables_.size( ) !=
aerodynamicCoefficientInterface_->getNumberOfIndependentVariables( ) )
{
Expand All @@ -483,6 +489,12 @@ class AtmosphericFlightConditions: public FlightConditions
*/
std::map< std::string, std::vector< double > > getControlSurfaceAerodynamicCoefficientIndependentVariables( )
{
if( aerodynamicCoefficientInterface_ == nullptr )
{
throw std::runtime_error(
"Error when getting control surface aerodynamic coefficient independent variables, no coefficient interface is defined" );
}

if( controlSurfaceAerodynamicCoefficientIndependentVariables_.size( ) !=
aerodynamicCoefficientInterface_->getNumberOfControlSurfaces( ) )
{
Expand All @@ -498,12 +510,12 @@ class AtmosphericFlightConditions: public FlightConditions
* to NaN, indicating the need to recompute all quantities for the next time computation.
* \param currentTime
*/
void resetCurrentTime( const double currentTime = TUDAT_NAN )
void resetCurrentTime( )
{
currentTime_ = currentTime;
currentTime_ = TUDAT_NAN;

isScalarFlightConditionComputed_ = allScalarFlightConditionsUncomputed;
aerodynamicAngleCalculator_->resetCurrentTime( currentTime_ );
aerodynamicAngleCalculator_->resetCurrentTime( );
aerodynamicCoefficientIndependentVariables_.clear( );
controlSurfaceAerodynamicCoefficientIndependentVariables_.clear( );
}
Expand Down
99 changes: 33 additions & 66 deletions include/tudat/astro/aerodynamics/nrlmsise00Atmosphere.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@
#include "tudat/astro/basic_astro/physicalConstants.h"
#include "tudat/astro/aerodynamics/atmosphereModel.h"
#include "tudat/astro/aerodynamics/aerodynamics.h"
#include "tudat/astro/aerodynamics/nrlmsise00InputFunctions.h"
#include "tudat/math/basic/mathematicalConstants.h"
#include "tudat/io/solarActivityData.h"

extern "C"
{
Expand Down Expand Up @@ -104,70 +106,6 @@ struct GasComponentProperties
double molarMassAtomicOxygen;
};

//! Struct for Solar Activity data.
/*!
*
*/
struct NRLMSISE00Input
{
//! Input for computation of NRLMSISE00 atmospheric conditions at current time and position.
/*!
* Input for computation of NRLMSISE00 atmospheric conditions at current time and position. The computation of
* this struct may be reperformed every time step, to reflect the changes in atmospheric condition.
* \param year Current year
* \param dayOfTheYear Day in the current year
* \param secondOfTheDay Number of seconds into the current day.
* \param localSolarTime Local solar time at the computation position
* \param f107 Current daily F10.7 flux for previous day
* \param f107a 81 day average of F10.7 flux (centered on current dayOfTheYear).
* \param apDaily Current daily magnetic index
* \param apVector Current magnetic index data vector: \sa ap_array
* \param switches List of NRLMSISE-specific flags: \sa nrlmsise_flags
*/
NRLMSISE00Input(
int year = 0, int dayOfTheYear = 0, double secondOfTheDay = 0.0,
double localSolarTime = 0.0, double f107 = 0.0, double f107a = 0.0,
double apDaily = 0.0,
std::vector< double > apVector = std::vector< double>( 7, 0.0 ),
std::vector< int > switches = std::vector< int >( ) )
: year( year ), dayOfTheYear( dayOfTheYear ), secondOfTheDay( secondOfTheDay) ,
localSolarTime( localSolarTime ), f107( f107 ), f107a( f107a ),
apDaily( apDaily ), apVector( apVector ), switches( switches )
{
if( switches.empty( ) )
{
this->switches = std::vector< int >( 24, 1 );
this->switches[ 0 ] = 0;
}
}

//! Current year
int year;

//! Day in the current year
int dayOfTheYear;

//! Number of seconds into the current day.
double secondOfTheDay;\

//! Local solar time at the computation position
double localSolarTime;

//! Current daily F10.7 flux for previous day
double f107;

//! 81 day average of F10.7 flux (centered on current dayOfTheYear).
double f107a;

//! Current daily magnetic index
double apDaily;

//! Current magnetic index data vector: \sa ap_array
std::vector< double > apVector;

//! List of NRLMSISE-specific flags: \sa nrlmsise_flag
std::vector< int > switches;
};

//! NRLMSISE-00 atmosphere model class.
/*!
Expand Down Expand Up @@ -207,6 +145,23 @@ class NRLMSISE00Atmosphere : public AtmosphereModel
useIdealGasLaw_ = useIdealGasLaw;
}

NRLMSISE00Atmosphere( const tudat::input_output::solar_activity::SolarActivityDataMap solarActivityData,
const bool useIdealGasLaw = true )
{
nrlmsise00InputFunction_ = std::bind( &tudat::aerodynamics::nrlmsiseInputFunction,
std::placeholders::_1, std::placeholders::_2, std::placeholders::_3, std::placeholders::_4,
solarActivityData, false, TUDAT_NAN );
solarActivityContainer_ = std::make_shared< input_output::solar_activity::SolarActivityContainer >(
solarActivityData );

resetHashKey( );
molarGasConstant_ = tudat::physical_constants::MOLAR_GAS_CONSTANT;
specificHeatRatio_ = 1.4;
GasComponentProperties gasProperties;
gasComponentProperties_ = gasProperties; // Default gas properties
useIdealGasLaw_ = useIdealGasLaw;
}

//! Constructor
/*!
* Constructor that sets the gas component properties and specific heat ratio.
Expand All @@ -216,12 +171,17 @@ class NRLMSISE00Atmosphere : public AtmosphereModel
* the molecule collision diameters and the molar mass.
* \param useIdealGasLaw Boolean denoting whether the ideal gas law is to be used.
*/
NRLMSISE00Atmosphere( const NRLMSISE00InputFunction nrlmsise00InputFunction,
NRLMSISE00Atmosphere(const tudat::input_output::solar_activity::SolarActivityDataMap solarActivityData,
const double specificHeatRatio,
const GasComponentProperties gasProperties,
const bool useIdealGasLaw = true)
: nrlmsise00InputFunction_(nrlmsise00InputFunction)
{
nrlmsise00InputFunction_ = std::bind( &tudat::aerodynamics::nrlmsiseInputFunction,
std::placeholders::_1, std::placeholders::_2, std::placeholders::_3, std::placeholders::_4,
solarActivityData, false, TUDAT_NAN );
solarActivityContainer_ = std::make_shared< input_output::solar_activity::SolarActivityContainer >(
solarActivityData );

resetHashKey( );
molarGasConstant_ = tudat::physical_constants::MOLAR_GAS_CONSTANT;
specificHeatRatio_ = specificHeatRatio;
Expand Down Expand Up @@ -418,6 +378,11 @@ class NRLMSISE00Atmosphere : public AtmosphereModel
hashKey_ = 0;
}

std::shared_ptr< input_output::solar_activity::SolarActivityContainer > getSolarActivityContainer( )
{
return solarActivityContainer_;
}

//! Function to get Input data to NRLMSISE00 atmosphere model
/*!
* Function to get input data to NRLMSISE00 atmosphere model
Expand Down Expand Up @@ -589,6 +554,8 @@ class NRLMSISE00Atmosphere : public AtmosphereModel

//! Input data to NRLMSISE00 atmosphere model
NRLMSISE00Input inputData_;

std::shared_ptr< input_output::solar_activity::SolarActivityContainer > solarActivityContainer_;
};

} // namespace aerodynamics
Expand Down
Loading

0 comments on commit ab155dc

Please sign in to comment.