Skip to content
Open
Show file tree
Hide file tree
Changes from 21 commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
c1a0cce
Add basic integrated test for sheath-boundary-simple
ZedThree Jun 11, 2025
3f0fdaf
Add unit test for sheath-boundary-simple
ZedThree Jun 12, 2025
31c5480
Fix sheath-boundary-simple when `phi` isn't set but required
ZedThree Jun 12, 2025
d8aa3fe
Delete some unused code
ZedThree Jun 12, 2025
655ce43
Use enum for sheath boundary condition
ZedThree Jun 9, 2025
a534d0d
Clang-tidy fixes to sheath boundaries
ZedThree Jun 9, 2025
226973a
Add more cases to sheath boundary simple integrated test
ZedThree Jun 13, 2025
541bbc6
Add tests for sheath boundary diagnostic quantities
ZedThree Jun 25, 2025
73a396f
Move sheath `phi` calculation out into helper function
ZedThree Jun 25, 2025
a39e161
Consolidate loops in `calculate_phi`
ZedThree Jun 25, 2025
cf92d21
Consolidate electron sheath boundary loops
ZedThree Jun 25, 2025
53dd502
Fix minor bug in calculation of cross-sectional area
ZedThree Jun 25, 2025
71a7001
Pull out repeated calculation of geometric coefficients
ZedThree Jun 25, 2025
8a3e7a6
Make more local variables `const`
ZedThree Jun 25, 2025
86f9098
Consolidate ion sheath boundary loops
ZedThree Jun 25, 2025
0515131
Apply clang-format
ZedThree Jun 25, 2025
7b9e28b
Simplify setting sheath diagnostics a little
ZedThree Jun 25, 2025
16e2240
Use `BoutOutputs` instead of `collect` in test
ZedThree Jun 25, 2025
0d36c2f
Minor refactoring of sheath test case
ZedThree Jun 25, 2025
6bd97e2
Tests: Fix mirror simple sheath case
ZedThree Jul 18, 2025
083c0f0
Add integrated test for `sheath_boundary`
ZedThree Jul 18, 2025
a890f9f
Add helper function and class for looping over Y-boundaries
ZedThree Jul 18, 2025
223d720
Merge branch 'master' into sheath-boundary-testing
ZedThree Aug 8, 2025
ae5e8a8
Fix bug from typo in `sheath-boundary-insulating`
ZedThree Aug 8, 2025
34099d5
Add integrated golden answer test for `sheath-boundary-insulating`
ZedThree Aug 8, 2025
74c1b62
Merge branch 'master' into sheath-boundary-testing
ZedThree Dec 4, 2025
1cfa567
Remove duplicated static function
ZedThree Dec 4, 2025
e066b24
Fix missing `break` in `switch` statement
ZedThree Dec 4, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,8 @@ if(HERMES_TESTS)

hermes_add_integrated_test(1D-fluid)
hermes_add_integrated_test(1D-recycling)
hermes_add_integrated_test(1D-sheath-simple)
hermes_add_integrated_test(1D-sheath)
hermes_add_integrated_test(diffusion)
hermes_add_integrated_test(evolve_density)
hermes_add_integrated_test(neutral_mixed)
Expand Down
10 changes: 5 additions & 5 deletions docs/sphinx/boundary_conditions.rst
Original file line number Diff line number Diff line change
Expand Up @@ -93,17 +93,17 @@ First, density, temperature and pressure are extrapolated into the target bounda
The extrapolation method for each can be user set, e.g. `density_boundary_mode`. At the moment,
the available modes are:

- 0: LimitFree
- ``limit_free``
An exponential extrapolation for decreasing quantities and a Neumann boundary for increasing
quantities. It is inconsistent between increasing and decreasing values and is not recommended
unless you have a reason to use it - it's legacy behaviour.

- 1: ExponentialFree
An exponential extrapolation. It is more consistent than LimitFree and has the advantage of
- ``exponential_free``
An exponential extrapolation. It is more consistent than ``limit_free`` and has the advantage of
inherently preventing negative values at the target. This is the default and is recommended for most cases.
It is defined as :math:`guard = (last)^2 / previous`

- 2: LinearFree
- ``linear_free``
A linear extrapolation. It can lead to negative values at the target. However, it is the most
consistent (the linear extrapolation is what second order differencing reduces to at the wall) and has been shown to
reduce "zigzags" or "squiggles" near the target which are common in cell centered codes. Use only
Expand Down Expand Up @@ -620,4 +620,4 @@ Note that if you have the density controller enabled, it will work to counteract
function = 0.01
source = Pe:source
source_time_dependent = true
source_prefactor = Pe:source_prefactor
source_prefactor = Pe:source_prefactor
16 changes: 11 additions & 5 deletions include/sheath_boundary_simple.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@

#include "component.hxx"

#include <bout/bout_enum_class.hxx>

BOUT_ENUM_CLASS(SheathLimitMode, limit_free, exponential_free, linear_free);

/// Boundary condition at the wall in Y
///
/// This is a collective component, because it couples all charged species
Expand All @@ -27,7 +31,8 @@ struct SheathBoundarySimple : public Component {
/// - secondary_electron_coef Effective secondary electron emission coefficient
/// - sin_alpha Sine of the angle between magnetic field line and wall surface (0 to 1)
/// - always_set_phi Always set phi field? Default is to only modify if already set
SheathBoundarySimple(std::string name, Options &options, Solver *);
SheathBoundarySimple(const std::string& name, Options& options,
[[maybe_unused]] Solver* solver);

///
/// # Inputs
Expand Down Expand Up @@ -90,20 +95,21 @@ private:
Field3D wall_potential; ///< Voltage of the wall. Normalised units.

Field3D hflux_e; // Electron heat flux through sheath
Field3D phi; // Phi at sheath
Field3D ion_sum; // Sum of ion current at sheath
Field3D phi; // Phi at sheath

bool diagnose; // Save diagnostic variables?
Options diagnostics; // Options object to store diagnostic fields like a dict

bool no_flow; ///< No flow speed, only remove energy

BoutReal density_boundary_mode, pressure_boundary_mode, temperature_boundary_mode; ///< BC mode: 0=LimitFree, 1=ExponentialFree, 2=LinearFree
SheathLimitMode density_boundary_mode; ///< BC for density
SheathLimitMode pressure_boundary_mode; ///< BC for pressure
SheathLimitMode temperature_boundary_mode; ///< BC for temperature
};

namespace {
RegisterComponent<SheathBoundarySimple>
registercomponentsheathboundarysimple("sheath_boundary_simple");
}

#endif // SHEATH_BOUNDARY_SIMPLE_H
#endif // SHEATH_BOUNDARY_SIMPLE_H
Loading