-
Notifications
You must be signed in to change notification settings - Fork 29
Fixes for 1D examples #553
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
Merged
Merged
Changes from 3 commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
8f59cf3
1D-hydrogen example
bendudson 12fc888
neutral_parallel_diffusion: Floor collision frequency
bendudson 26f5254
braginskii_collisions: Fix bug with ion_neutral switch
bendudson e04a139
examples 1D-neon and 1D-neon-source
bendudson 812451c
braginskii_collisions: Add unit test of ion_neutral switch
bendudson bb8f101
Formatting
bendudson 44e652e
neutral_parallel_diffusion: Add unit tests
bendudson File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -18,7 +18,9 @@ | |
|
|
||
| #include "../include/braginskii_collisions.hxx" | ||
| #include "../include/component.hxx" | ||
| #include "../include/guarded_options.hxx" | ||
| #include "../include/hermes_utils.hxx" | ||
| #include "../include/permissions.hxx" | ||
|
|
||
| BraginskiiCollisions::BraginskiiCollisions(const std::string& name, Options& alloptions, | ||
| Solver*) | ||
|
|
@@ -370,7 +372,7 @@ void BraginskiiCollisions::transform_impl(GuardedOptions& state) { | |
| BoutReal const coulomb_log = | ||
| 29.91 | ||
| - log((Z1 * Z2 * (AA1 + AA2)) / (AA1 * Tlim2 + AA2 * Tlim1) | ||
| * sqrt(Nlim1 * SQ(Z1) / Tlim1 + Nlim2 * SQ(Z2) / Tlim2)); | ||
| * sqrt((Nlim1 * SQ(Z1) / Tlim1) + (Nlim2 * SQ(Z2) / Tlim2))); | ||
|
|
||
| // Calculate v_a^2, v_b^2 | ||
| const BoutReal v1sq = 2 * Tlim1 * SI::qe / mass1; | ||
|
|
@@ -390,6 +392,10 @@ void BraginskiiCollisions::transform_impl(GuardedOptions& state) { | |
| } else { | ||
| // species1 charged, species2 neutral | ||
|
|
||
| if (!ion_neutral) { | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks for spotting this. It could explain the difference we saw in the ReMKiT1D benchmark when adding neutrals! |
||
| continue; | ||
| } | ||
|
|
||
| // Scattering of charged species 1 | ||
| // Neutral density | ||
| Field3D const Nn = GET_NOBOUNDARY(Field3D, species2["density"]); | ||
|
|
||
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
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.
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.
I am hoping this change is just style preference and C++ doesn't do something bizarre to make these brackets necessary?
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.
That is clang-tidy - it likes to make it obvious that
*has precedence before+🤷