Added floors to several components. #530
Open
malamast wants to merge 3 commits into
Open
Conversation
…ming Nan when the snes solver increases the timestep aggressively. ion_viscosity was causing problems.
bendudson
reviewed
Mar 25, 2026
| const Field3D q_fl = eta_limit_alpha * P; // Flux limit | ||
|
|
||
| eta = eta / (1. + abs(q_cl / q_fl)); | ||
| eta = eta / (1. + (q_cl / q_fl)); |
Collaborator
There was a problem hiding this comment.
Suggested change
| eta = eta / (1. + (q_cl / q_fl)); | |
| eta = eta / (1. + softFloor(q_cl, 1e-15) / softFloor(q_fl, 1e-15)); |
Collaborator
There was a problem hiding this comment.
Suggesting for consistency with braginskii_electron_viscosity https://github.com/boutproject/hermes-3/pull/530/changes#diff-cc095e4b1787493c5dede9586f4f3017e3105f8724c6fad6b3637574e64773ccR73
bendudson
reviewed
Mar 25, 2026
|
|
||
| const Field3D Natom = get<Field3D>(atom1["density"]); | ||
| const Field3D Nion = get<Field3D>(ion1["density"]); | ||
| const Field3D Natom = softFloor(get<Field3D>(atom1["density"]), 0.0); |
Collaborator
There was a problem hiding this comment.
I think this might cause problems: softFloor doesn't work if the floor is set to zero.
Collaborator
|
I am breaking up #451 into separate PRs and would like to put the floor changes into this branch if that's OK. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
-That is to protect some variables from becoming Nan when the SNES solver increases the timestep aggressively.
-ion_viscosity was causing problems.
-In the hydrogen_charge_exchange I changed the loop to include boundaries because later we take log(Teff) and if the boundaries of Teff become negative we could potentially have a problem? not sure about that.
-In the sheath_boundary_simple we had two return statements in that function so I removed the first one. In that way, the check can take effect.
-I removed the density2 variable in braginskii_friction because it was not used.
-In the electron_viscosity i included even more floors (compared to the ion_viscosity) because this component was causing also many problems with snes.
-Added a isfinite check of the time derivatives in vorticity and relax_potential components as we do with the rest of the components.