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

Nrlmsise update #28

Merged
merged 11 commits into from
Sep 4, 2016
Merged

Nrlmsise update #28

merged 11 commits into from
Sep 4, 2016

Conversation

Reneh107
Copy link
Contributor

@Reneh107 Reneh107 commented May 5, 2016

I updated the NRLMSISE atmosphere model:

Input variables to: meters and radians (instead of km and deg) . This is consistent with the US atmosphere model.

I added the calculation of the speed of sound, mean molar mass and mean free path.
The weighted average collision diameter is also calculated, but not tested. I cannot find data to test this value except for an old thesis of A. Ronse.

I added a data structure called: GasComponentProperties in Atmospheremodel.h
This datastructure includes the molar mass of the components and the collision diameter (which is needed for the calculation of the mean free path). The default constructor, constructs the datastructure with default values that I obtained from the sources that are provided in the comments.

I added tests to the unit test:

  • speed of sound (compare with US76 , should be approx the same)
  • mean molar mass (compare with figure of Regan)
  • mean free path (compare with figure of book)

The sources are provided in the comments.

The specific heat ratio is set to 1.4 and not calculated. This can be implemented easily if data is obtained of the cp of all the gasses. The number densities can directly be used to calculate the specific heat ratio. (Thermodynamics an Engineering Approach, Michael A. Boles)

I added several virtual functions to the Atmospheremodel.h

I know that the code of this pull request is not complete, but I would like some opinions so I can finalize it:

  • Which functions should be virtual in Atmospheremodel.h ? I would say mean molar mass, mean free path and speed of sound. You can set them to NaN by default and only use if they are implemented.
  • The GasComponentProperties data structure. Did I implement this correctly according to the Tudat style? For example, the default constructor filled with values. (I use this so that the NRLMSISE model can be constructed without additional data)

Any other comments on the implementation?

I also have an NRLMSISE input function that uses a solarActivityData data structure and the time in seconds since the J2000 epoch to set all the input values of the NRLMSISE model. I will add this later.

One additional comment: I performed these changes already in an earlier version of Tudat. Therefore, I made a new branch with the newest version of Tudat and merged the specific commits into that branch. As a result, I had to solve some conflicts, so these conflicts can also arise when merging to Tudat.

Reneh107 and others added 6 commits March 21, 2016 16:07
Find Cmake added folders
Add molar gas constant
Added mean free path + speed of sound + molar mass + Gas properties datastructure
Changed altitude input to meters and radians +
Added mean molar mass + speed of sound + mean free path etc.
Added stream output for nrlmsise input data structure
@DominicDirkx
Copy link
Member

Hi Rene,

I've had a look at the code, and I think this will be an excellent (and long overdue) addition to Tudat. I'm not entirely sure about the use of the many new functions in the base class, though (returning NaN, instead of using pure virtual functions). I think it would be better to have default implementations (with some default values for gas constant, ratio of specific heats, etc.) in the derived classes (i.e. StandardAtmosphere).

On a more specific note, I think the getNumberDensities function should return a map (with the specie as key) to be more modular (i.e. applicable to non-terrestrial atmospheres).

I'd be happy to make the modifications, but before I start changing stuff, let's discuss in person this or next week,

Cheers,

Dominic

@DominicDirkx DominicDirkx self-assigned this May 17, 2016
@DominicDirkx
Copy link
Member

Hi René,

To address the questions from your original post:

  • As we discussed, the new functions at present are more suitable for inclusion in derived class only (with the exception of speed of sound, and possible mean free path)
  • For the GasProperties: are the values used as input physical constants? From their naming, it would appear so. Perhaps these values can be hardcoded as constants in a (sub folder/namespace of) the physical_constants code. Alternatively, to generalize the code, you could have a list of map< GasSpecie, std::pair< double, double > >, where the GasSpecie is the type of gas component, and teh pair is the diameter and molar mass

@Reneh107
Copy link
Contributor Author

Reneh107 commented May 17, 2016

As we discussed, I will update the gas properties class with two maps that contain the molar mass and the collision diameter. Enums will be used in a find function to get the molar mass of a specific specie.

I will move the constants to the tudat physical constants section.

I will further add the NRLMSISE input function. Then, the final code checks can be performed and it can be added to Tudat.

@Reneh107
Copy link
Contributor Author

Reneh107 commented Aug 8, 2016

Based on the discussion we had before, I have done the following:

  • I added the NRLMSISE input function and 2 unit tests.
  • I updated the vector size of the number densities, because it was too small..
  • I deleted the functions in the atmosphere model, only the mean free path remains.
  • I made a small update to the mean free path test.

The only thing that remains:

  • Decide how we will implement the gas species information.

I also recommend to make an atmosphere folder and move the atmosphere code over there. But I think it is better to do this after it is merged, because this pull request is far behind the current version.

@DominicDirkx DominicDirkx merged commit a36a767 into Tudat:master Sep 4, 2016
@DominicDirkx
Copy link
Member

I made some minor changes to the code, and added an interface to the SimulationSetup folder. BY using AtmosphereSettings( nrlmsise00 ) with the createBodies interface, the atmosphere model and associated files are automatically loaded/created.

Thanks a lot for all the effort you put into this Rene, this piece of code will go a long way to making Tudat more robust for accurate Earth orbit simulation/data analysis.

@gviavattene gviavattene mentioned this pull request Sep 21, 2017
DominicDirkx added a commit to DominicDirkx/tudat that referenced this pull request Jan 25, 2022
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