Repository navigation
Incorporates relative humidity to atmospheric conditions - #2834
Conversation
|
Could you point at some of the sources you used to derive the humidity variation with altitude? |
|
I've derived the 6% from these and another analysis from japanese meteorologists which I will post here as soon as i find the pdf. pdf Any help in literature would help tremendously. |
| /** | ||
| * Calculate the relative humidity at any altitude. | ||
| * Assumes relative humidity drops at a rate of 0,06/km | ||
| * Assumes there is no more humidity after 16,5 km |
There was a problem hiding this comment.
Where does this come from, can you please add a source in the docstring?
There was a problem hiding this comment.
I've added the papers I used but when i was searching for the modeling of RH I couldn't find it's modelling wrt altitude. I am hoping someone more knowledgeable about the subject can give a more concrete and correct model.
There was a problem hiding this comment.
Hm, if it's not based on anything, we should simple return humidity1 and add a TODO to make it dependent on the altitude. There's no point in inventing numbers 🙂.
There was a problem hiding this comment.
@gdilbaz if you have time, could you clarify this? Once that's done, we can do a full code review and merge it.
| assertTrue(options.isISAAtmosphere()); | ||
| assertEquals(288.15, options.getLaunchTemperature(), EPSILON); | ||
| assertEquals(101325, options.getLaunchPressure(), EPSILON); | ||
| //assertEquals(0, options.getLaunchHumidity(), EPSILON); |
There was a problem hiding this comment.
Does this not work? Why is it commented out?
There was a problem hiding this comment.
Don't exactly remember but seems to be working fine. Probably just a temporary fix until the I came around to tests.
There was a problem hiding this comment.
You only test cases with relative humidity equal to 0. Can you please also add test cases that test different humidity levels, and that test the different calculations, e.g. vapor pressure....
|
Great work @gdilbaz, thanks! I've added some comments. I still need to test it thoroughly though. We are currently in the process of releasing the 24.12 release. Once that's done, we can look into merging your PR. |
|
@gdilbaz did you find time to take a look at my remarks? |
|
No pressure! Just making sure you got the message. |
removed "import java.security.PublicKey;"
removed"import info.openrocket.core.rocketcomponent.*;"
Fixed typo
Will return R if humidity is 0
| /** | ||
| * Calculate the relative humidity at any altitude. | ||
| * Assumes relative humidity drops at a rate of 0,06/km | ||
| * Assumes there is no more humidity after 16,5 km |
There was a problem hiding this comment.
@gdilbaz if you have time, could you clarify this? Once that's done, we can do a full code review and merge it.
|
Hello, I'm willing to implement his paper since I couldn't find any other papers that are this useful. But it'll be locked into the region I've mentioned which may lead us to exclude simulating it outside the region concerning me with the usefulnes of the implementation. I'd appreciate any guidance and further literature to review. Thanks! Here is the link to the paper: https://journals.ametsoc.org/view/journals/clim/27/19/jcli-d-14-00255.1.pdf |
Thanks for the reply! The paper you linked could be a start, but it's not very generic. I would be inclined to just use a constant RH throughout the flight. So, you can replace the content of |
|
Thanks a lot for your contribution @gdilbaz, we appreciate it! |
This PR adresses #2713 incorporating the relative humudity to gas constant calculations. Also adding option to specify it simulation options.
When modeling the behaviour of RH as the altitude increased i opted to model it linearly decreasing by 6% per kilometer. I did this due to the lack of literature tackling the problem. The literature I've found was inconsistent but mentioned rates between 4-8%. Because the program doesn't currently take humidity to consideration and the relatively small effect it'd have I think this model is fine four our purposes. Any help is really appreciated in this part.
Method:

Clausius-Clapeyron equation was used to determine the saturation vapor pressure
Then due definition :



Relative Humidity
Mixing ratio (Epsilon being the ratio of molar masses)
Specific Humidity
Subtituting e into the mixing ratio we get:

We also know

Finally after some algebra:
