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

Increment form for implicit RK added and tested #566

Open
wants to merge 18 commits into
base: main
Choose a base branch
from

Conversation

atb1995
Copy link
Collaborator

@atb1995 atb1995 commented Oct 24, 2024

Non-increment form for Implicit RK does not yet exist. This is likely required for running implicit RK with compressible Euler equations, so this capability has been added (as in explicit rk)

@atb1995 atb1995 self-assigned this Oct 24, 2024
@atb1995 atb1995 requested a review from tommbendall October 24, 2024 10:03
@atb1995 atb1995 linked an issue Oct 24, 2024 that may be closed by this pull request
@tommbendall tommbendall added the enhancement Involves adding a new capability label Oct 27, 2024
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.

A few suggested changes, but otherwise the tests convince me that the formulae are probably correct

@@ -56,6 +57,7 @@ class ImplicitRungeKutta(TimeDiscretisation):
# ---------------------------------------------------------------------------
Copy link
Contributor

Choose a reason for hiding this comment

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

Is it worth us making the predictor and increment forms clear in the docstrings?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I've made it a bit more clear, describing what we are solving for

else:
raise NotImplementedError(
'Runge-Kutta formulation is not implemented'
)

def lhs(self):
Copy link
Contributor

Choose a reason for hiding this comment

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

Do you know we don't set up the lhs and rhs variables? If these are inherited from the base TimeDiscretisation class, are they wrong? They don't appear to be used anywhere either. I wonder if we should either:

  • use them
  • set their values to be None
  • remove them and stop them being an @abstractproperty

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I have removed lhs & rhs and stopped them being an abstract property

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Instead they are now just a property

Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks for making this change. @jshipton are you happy with this?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I have now removed all lhs & rhs. Each time discretisation just has a res (residual).

gusto/time_discretisation/implicit_runge_kutta.py Outdated Show resolved Hide resolved
gusto/time_discretisation/implicit_runge_kutta.py Outdated Show resolved Hide resolved
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.

Two minor suggestions from me. I'm happy but think it would also be helpful for @jshipton have a look

gusto/time_discretisation/implicit_runge_kutta.py Outdated Show resolved Hide resolved
gusto/time_discretisation/implicit_runge_kutta.py Outdated Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Involves adding a new capability
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Non-increment form for implicit runge-kutta
2 participants