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

use correct beta_u in shallow water linear solvers #544

Merged
merged 5 commits into from
Dec 17, 2024

Conversation

jshipton
Copy link
Contributor

@jshipton jshipton commented Aug 19, 2024

Sorry @Witt-D I didn't notice this in your PR.

@jshipton jshipton requested a review from Witt-D August 19, 2024 18:40
Copy link
Contributor

@tommbendall tommbendall left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This puts things in line with the rest of the code ... but the awkward thought I've had is that maybe we don't want the beta values to be constant at all?

In theory we could update dt, but if we did then we would want the beta values to be updated too. At the moment they won't be, so do we actually want:

beta = self.dt*Constant(tau)

instead of

beta_ = self.dt*tau
beta = Constant(beta_)

@tommbendall tommbendall added the tidying Involves tidying up code label Aug 21, 2024
@tommbendall tommbendall added the optimisation Involves optimising performance of code label Dec 14, 2024
beta_u = dt*self.tau_values.get("u", self.alpha)
beta_t = dt*self.tau_values.get("theta", self.alpha)
beta_r = dt*self.tau_values.get("rho", self.alpha)
beta_u_cp = Constant(beta_u * cp)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we remove this variable and just have beta_u*cp in the code below?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should've known I couldn't get away with being lazy!

Copy link
Contributor

@tommbendall tommbendall left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@tommbendall tommbendall merged commit aa850ae into main Dec 17, 2024
4 checks passed
@tommbendall tommbendall deleted the fix_const_beta_u branch December 17, 2024 11:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
optimisation Involves optimising performance of code tidying Involves tidying up code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants