-
Notifications
You must be signed in to change notification settings - Fork 11
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
Moist thermal sw #390
Moist thermal sw #390
Conversation
…ud isn't accumulating
…racers and blows up
…egative vapour/rain
…lePhysics class so that it works with a time-varying saturation curve. Also adding the option for convective feedback to the ReversiblePhysics class.
… fraction of the moist species is converted. Take absolute value in theta initial condition.
…illations between moist species.
…step oscillations) with a fraction that can be time-varying
…g the initial conditions to a file
…of 0.02, fix bug so that beta2 is 1
…s an argument to ReversibleAdjustment, use beta1 as variable name for proportion in InstantRain (in line with ReversibleAdjustment), assign to b in evaluate.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for opening this! Very exciting to have this on main.
In terms of which examples to have, I think it would be lovely to have just a moist_thermal_williamson_5.py
to ensure that we have the moist-thermal combination tested somewhere
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Generally looks really good, thanks so much for adding this!
gusto/physics.py
Outdated
dependent on a prognostic field. | ||
time_varying_saturation (bool, optional): set this to True if the | ||
saturation curve is changing in time. Defaults to False. | ||
L (float, optional): The air expansion factor multiplied by the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we call this L_v
instead of L
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I think that makes more sense.
L (float, optional): The air expansion factor multiplied by the | ||
latent heat due to phase change divided by the specific heat | ||
capacity. For the atmosphere we take L to be 10, following A.2 | ||
in Zerroukat and Allen (2015). Defaults to None but must be |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just to check, should this be (2015) or (2020) as the comment above is their paper from (2020)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be 2015 - thanks!
Defaults to None, in which case the timestep dt is used. | ||
parameters (:class:`Configuration`, optional): parameters containing | ||
the values of constants. Defaults to None, in which case the | ||
parameters are obtained from the equation. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is very nicely commented, thanks!
water_t_T = total[-1] | ||
|
||
assert abs(water_t_0 - water_t_T) / water_t_0 < 1e-12, \ | ||
f'Total amount of water should be conserved by {process}' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Test looks really good! My only question is if we should called it test_sw_saturation_adjustment.py
instead? (And also rename test_condensation.py
as test_saturation_adjustment.py
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I think that's a better name. I've changed the name of both tests.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Brilliant, thanks Nell!
This PR adds the capability for the moist thermal shallow water equations. It:
SWSaturationAdjustment
, to do condensation and evaporation between two moist species in the shallow water equations. This class takessaturation_curve
as an argument, and where the water vapour exceeds the saturation curve a specified fraction of the excess vapour is converted to cloud. Conversely, in a sub-saturated atmosphere where cloud is present, a specified fraction of the cloud will evaporate. Ifthermal_feedback
is true then these processes affect the buoyancy equation - evaporation should cause an increase in buoyancy and condensation a decrease.SWSaturationAdjustment
which tests both the evaporation and condensation ability by running two different scenarios.moist_thermal_williamson5
example to theshallow_water
directory. This is based on test 2 in Zerroukat and Allen (2015), which is a version of test 5 from Williamson et al (flow over a mountain) with additional thermodynamic variables.gamma
parameter inInstantRain
tobeta1
to make clearer the distinction between convective feedback (beta1
) and thermal feedback (beta2
). Adds agamma_r
parameter toInstantRain
to allow the conversion of a specified fraction of vapour above the saturation threshold to rain.