Bug fixes for SF>90 configurations #102
Open
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.
Bugs have been found in setting the core boundary conditions for the snowflake geometries SF105, SF135 and SF165. This PR fixes those bugs, and all snowflake geometries have been validated.
Bug description
Several variables control the cells over which the core boundary condition is applied: isixcore (set in bbb/geometry.m), and the initial and final poloidal cells for the core BC loop (set in bbb/boundary.m).
For SF105, SF135 and SF165 geometries, these variables were being set incorrectly. For example, in this SF135 case, the cells where

com.isixcore == 1were the black cells below:This meant the core BCs were being applied on a few cells on the inner wall boundary instead of the core.
Fix
Straightforward changes to the definitions of each of these variables, which depend on the geometry being simulated.
Validation
Case files used in validation are here: https://github.com/Plasdom/uedge_snowflake_benchmarking
We assume the snowflake geometries SF15, SF45 and SF75 are being handled correctly. In this case, we can generate pairs of artificial equilibria for the corresponding SF>90 geometry and compare simulation results. To illustrate: the SF165 is topologically the same as the SF15 mirrored in the R-axis, and so on, and therefore the UEDGE solution should be the same in both cases after the mirroring is accounted for. To minimise the effects of toroidal geometry we increase the major radius to 10^4m.
After the fix is applied, we get good agreement between SF<90 and SF>90 cases. Here are the electron densities for converged UEDGE simulations, where the settings are the same in each toplogical pair. These simulations use a heat flux core BC, and we solve for te, ti, ni, ng, up, and phi.
