Tudat/Astrodynamics/Aerodynamics/UnitTests/unitTestNRLMSISE00Atmosphere.cpp
//! Perform NRLMSISE-00 test 21 - Test input function
// Corresponds to NRLMSISE test 1 but space weather file is used to set solar activity data.
// No adjustment values in space weather file are used.
Perform NRLMSISE-00 test 21 - Test input function
Corresponds to NRLMSISE test 1 but space weather file is used to set solar activity data.
No adjustment values in space weather file are used.
Perform NRLMSISE - 00 test 21 - Test input function Corresponds to NRLMSISE test 1 but space weather file is used to set solar activity data . No adjustment values in space weather file are used .
BOOST_AUTO_TEST_CASE( test_nrlmise_InputFunction_no_adjustment )
{
    double julianDate = tudat::basic_astrodynamics::convertCalendarDateToJulianDay< double >( 2030, 6, 21, 8, 3, 20.0 );
    double time = tudat::basic_astrodynamics::convertJulianDayToSecondsSinceEpoch(
                    julianDate , tudat::basic_astrodynamics::JULIAN_DAY_ON_J2000) ;
    double altitude     = 400.0E3       ; 
    double longitude    = -70.0 * PI / 180.0  ;
    double latitude     = 60.0 * PI / 180.0  ;
    std::string cppPath( __FILE__ );
    std::string folder = cppPath.substr( 0, cppPath.find_last_of("/\\")+1);
    std::string spaceWeatherFilePath = folder + "swAtmosTestNoAdjust.txt";
    tudat::input_output::solar_activity::SolarActivityDataMap solarActivityData =
            tudat::input_output::solar_activity::readSolarActivityData(spaceWeatherFilePath) ;
    std::function< tudat::aerodynamics::NRLMSISE00Input (double,double,double,double) > inputFunction =
            std::bind( &tudat::aerodynamics::nrlmsiseInputFunction, std::placeholders::_1, std::placeholders::_2,
                      std::placeholders::_3, std::placeholders::_4, solarActivityData , true , 16.0 );
    tudat::aerodynamics::NRLMSISE00Atmosphere atmosphereModel( inputFunction );
    std::vector<double> verificationData = { 6.665176904952E+05, 1.138805559752E+08, 1.998210925573E+07,
            4.022763585713E+05, 3.557464994516E+03, 4.074713532757E-15,
            3.475312399717E+04, 4.095913268293E+06, 2.667273209336E+04,
            1.250539943561E+03, 1.241416130019E+03 };
    double computedDensity = atmosphereModel.getDensity( altitude , longitude, latitude , time ) ;
    BOOST_CHECK_CLOSE_FRACTION(verificationData[5]*1000 , computedDensity , 1E-11);
}
BOOST_AUTO_TEST_CASE ( test_nrlmise_InputFunction_no_adjustment ) { double julianDate = tudat :: basic_astrodynamics :: convertCalendarDateToJulianDay < double > ( 2030 , 6 , 21 , 8 , 3 , 20.0 ) ; double time = tudat :: basic_astrodynamics :: convertJulianDayToSecondsSinceEpoch ( julianDate , tudat :: basic_astrodynamics :: JULIAN_DAY_ON_J2000 ) ; double altitude = 400.0E3 ; double longitude = -70.0 * PI / 180.0 ; double latitude = 60.0 * PI / 180.0 ; std :: string cppPath ( __FILE__ ) ; std :: string folder = cppPath . substr ( 0 , cppPath . find_last_of ( " \\ " ) + 1 ) ; std :: string spaceWeatherFilePath = folder + " " ; tudat :: input_output :: solar_activity :: SolarActivityDataMap solarActivityData = tudat :: input_output :: solar_activity :: readSolarActivityData ( spaceWeatherFilePath ) ; std :: function < tudat :: aerodynamics :: NRLMSISE00Input ( double , double , double , double ) > inputFunction = std :: bind ( & tudat :: aerodynamics :: nrlmsiseInputFunction , std :: placeholders :: _1 , std :: placeholders :: _2 , std :: placeholders :: _3 , std :: placeholders :: _4 , solarActivityData , true , 16.0 ) ; tudat :: aerodynamics :: NRLMSISE00Atmosphere atmosphereModel ( inputFunction ) ; std :: vector < double > verificationData = { 6.665176904952E+05 , 1.138805559752E+08 , 1.998210925573E+07 , 4.022763585713E+05 , 3.557464994516E+03 , 4.074713532757E-15 , 3.475312399717E+04 , 4.095913268293E+06 , 2.667273209336E+04 , 1.250539943561E+03 , 1.241416130019E+03 } ; double computedDensity = atmosphereModel . getDensity ( altitude , longitude , latitude , time ) ; BOOST_CHECK_CLOSE_FRACTION ( verificationData [ 5 ] * 1000 , computedDensity , 1E-11 ) ; }
Perform NRLMSISE-00 test 21 - Test input function
Corresponds to NRLMSISE test 1 but space weather file is used to set solar activity data.
Perform NRLMSISE - 00 test 21 - Test input function Corresponds to NRLMSISE test 1 but space weather file is used to set solar activity data .
//    NRLMSISE00Input gen_data(2030, 172, 29000.0, 16.0, 150.0, 150.0, 4.0); // DD-MM-YY = 21-06-2030 , Hrs-Min-Sec = 8-3-20 // std::vector< double > gen_input = { 400.0, -70.0, 60.0, 0.0 }; // km // find space weather file // Create atmosphere model using NRLMISE00 input function // Local solar time is set to 16.0 to correspond with testing data! // Create Pointer to NRLMSISE model // Verification data