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

Add to the docs a better explanation about max_change and min_change of the TimeStepWizard #3244

Closed
iuryt opened this issue Aug 30, 2023 · 2 comments · Fixed by #3245
Closed

Comments

@iuryt
Copy link
Collaborator

iuryt commented Aug 30, 2023

Hi,

I have been confused about what the max_change and min_change means.
I understand from the documentation that this is to avoid the time step to change too quickly, but how is it used?

Is it in time units? e.g., taking the default max_change of 1.1, that means that for dated simulation it will change the time step at max in 1.1 seconds?

Is it a multiplication? e.g., new_time_step = 1.1*time_step ?

I think we can try to be more clear about that in the docs.

@glwagner
Copy link
Member

It's the latter: max_change is the maximum relative change of the time step and is therefore non-dimensional. Thus the new time step satisfies the criteria

new_dt <= max_change * old_dt

It's implemented here:

# Put the kibosh on if needed
new_Δt = min(wizard.max_change * old_Δt, new_Δt)
new_Δt = max(wizard.min_change * old_Δt, new_Δt)
new_Δt = clamp(new_Δt, wizard.min_Δt, wizard.max_Δt)

Improving the docs is always a good idea!

@glwagner glwagner added the documentation 📜 The sacred scrolls label Aug 30, 2023
@iuryt
Copy link
Collaborator Author

iuryt commented Aug 31, 2023

I add that to the docs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants