lanl / RAM-SCB

RAM-SCB is a unique code that combines a kinetic model of ring current plasma with a three dimensional force-balanced model of the terrestrial magnetic field to simulate Earth's inner magnetosphere.
Other
13 stars 20 forks source link

Enabled nitrogen as percentage of oxygen runs #74

Closed Pheosics closed 4 years ago

Pheosics commented 4 years ago

These changes allow the user to specify a percentage of oxygen to turn into nitrogen for a given run. This impacts the initialization by turning a given percentage from oxygen to nitrogen, and the flux at the boundary by changing the Young et al. composition percentages. The user specifies the percentage of nitrogen they want by adding

#NITROGEN_PERCENT
20

to the PARAM file (for 20 percent oxygen to nitrogen conversion). Note that unless the user also specifies using nitrogen as a species in the PARAM file the conversion will subtract from the oxygen and the composition ratios will no longer add up to 1.

I've also set up the Makefile so that it correctly copies the NitrogenCrossSections to the input directory when making a run directory.

Pheosics commented 4 years ago

@drsteve When you get a chance can you please inspect this pull request?

Pheosics commented 4 years ago

Unfortunately species dependent boundary files have not been working for awhile, although I don't envision it taking much work to implement them again (maybe one or two hours to implement and make sure it's working). So the percentage conversion from O+ to N+ really only works for the Young et al. model. Technically if you set the composition for each species in the PARAM file, and then specify a conversion to N+, it will apply both.

Time dependent ratios would definitely be best defined by species dependent boundary files (once they are implemented), but you could also fairly easily implement your own equation for composition and place it in ModRamBoundary.f90. If exploring boundary composition is of interest to someone it may be worth implementing an easy way to experiment with different equations that can be parameterized by one or more of the indices RAM tracks (e.g. a user could say that N+ is 15% + 1%*F10.7/10 of O+).

Yeah, percentages vs fractions... I kept going back and forth deciding on which to use when I was implementing it, then I realized that in each instance I used the percentages I was dividing by 100, so to simplify things I just moved the division to the initial declaration but didn't change the variable name or the comments. I'll update the comments and variable name and push a new commit.