-
Notifications
You must be signed in to change notification settings - Fork 10
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
Approximate soil energy Jacobian #678
Conversation
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 looks great!! Thank you Kat
test/shared_utilities/implicit_timestepping/energy_hydrology_model.jl
Outdated
Show resolved
Hide resolved
@juliasloan25 thank you for the review! I wont be able to address your comments until next week, but if you have time, let me know if you think these are the main things, or if you see any issues with how we defined J. I think it's all OK because it was just adding terms copying what we do for theta_l, but it would be helpful if you took a close look at that part too. |
778ef22
to
0ffc695
Compare
a88da3d
to
87bcfbe
Compare
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.
These changes all look good!
top = Operators.SetValue(Geometry.WVector.(heat_top_flux_bc)), | ||
bottom = Operators.SetValue(Geometry.WVector.(heat_bottom_flux_bc)), |
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 a note though that this will allocate two surface Fields on every implicit tendency update. It would generally be better to cache these Fields somewhere, or to redefine heat_top_flux_bc
and heat_bottom_flux_bc
to be Fields of WVectors instead of Fields of scalars.
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, Dennis! good catch!
Purpose
Add in our first approximation for the energy equation Jacobian, which only includes d\rho e_int/dT.
This does allow us to take much bigger timesteps, more comparable to our target of 15 minutes, except in the cases where the soil is freezing or the canopy is present. If we make the thermal mass of the canopy larger, we can take bigger steps.
-> need to think about how we handle soil freezing in terms of implicit stepping
-> canopy temp probably does need an implicit solver.
To-do
Content
No Phase change:
With Phase change:
Note the differences in x and y axes. The solution at dt = 10, 100 seconds for the phase change one has lots of oscillations and is not good enough, although the relative error is not terrible