-
Notifications
You must be signed in to change notification settings - Fork 21
Add some basic tests for sheath_boundary_simple and refactor
#368
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
base: master
Are you sure you want to change the base?
Conversation
`phi` must be calculated in field-aligned coordinates, and transformed to unaligned
Lower-y loop used wrong cell face
Possibly faster, certainly cleaner
Didn't flip noflow BCs at same time, so was not exactly symmetric
45f3c45 to
083c0f0
Compare
| flipped_upstream = base_downstream | ||
| flipped_upstream["Ve"] = -flipped_upstream["Ve"] | ||
| flipped_upstream["Vi"] = -flipped_upstream["Vi"] | ||
| flipped_upstream["Si_sheath"] = -flipped_upstream["Si_sheath"] | ||
|
|
||
| expected = { | ||
| "upstream": flipped_upstream, | ||
| "downstream": base_upstream, | ||
| } |
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 solved the issue with switching which end had the sheath BC not being symmetric -- I needed to also switch the noflow BC to the other end. Now that I fixed that, it is exactly symmetric.
I just want to double check that the particle source Si_sheath should also flip sign -- is it a flux in the y-direction, rather than a scalar quantity? And should we expect that the flux is in the opposite sense to the velocities? (Particles moving into the boundary require a flux in the opposite direction to remove them and avoid a build up of density?)
I just wanted to let you know that that is essentially what I did for sheath_parallel: I think the plan is to only keep the parallel version, so too much refactoring is probably not worth it :-/ |
Yes, this way is very similar, although it's a complete free function, so doesn't rely on changes in BOUT++. I think a sensible plan is to get this in, and then look at refactoring it into BOUT++, and probably using regions like your version. We should very much try to avoid globals though.
I'm currently merging the different sheath boundary implementations into one, so I will also pull out your parallel version and merge it all together. This PR is laying the groundwork for that. |
* master: (54 commits) Silence some compiler warnings. Increase the test tolerance to work around compiler differences (seen with -O0 vs. -O2 and gcc@12+). fixed_velocity: Add description of mesh array to manual Typo in assert message. fixed_velocity: Read velocity from mesh Extend test input densities, temperatures outside clipped ranges. ADAS CX tests. Use common input ranges for all reaction regression tests. Rename test base class for ADAS izn/rec. Move AmjuelCXTest::generate_state() up to a parent class, so it can reused for ADAS. Rejig ReactionTest::sources_regression_test to check species data stored in (sub-)sections, including collision freqencies. evolve_pressure: Initialize flow_ylow if diagnose but no velocity Add H isotope CX tests. Move generate_data() for ADAS, Amjuel izn and rec tests into a separate class. Consistent naming of reaction regression data files. ADAS ionisation, recombination reaction regression tests. Correct a mistake in the docs Makefile that meant the doxygen target wasn't declared as .PHONY. Tidy up ReactionTest::generate_state(). Revert "Rename doxygen Makefile target to avoid clash with docs subdirectory name." Add missing header. ...
|
I've added a similar test for the insulating BC, along with a bug fix |
density_boundary_mode = limit_freein the input fileyboundaries