Skip to content

Commit bca3491

Browse files
committed
Fixed an issue with the branch cuts not being consistent between BOUT and INGRID for Single Null topology.
1 parent d235648 commit bca3491

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

src/boutdata/gridue_to_bout_converter/gridue_to_bout.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -769,6 +769,13 @@ def Convert_grids(gridue_file: str, output_filename: str, plotting: bool = False
769769
jyseps1_2 = g["ix_cut3"]
770770
jyseps2_2 = g["ix_cut4"] - 1
771771

772+
#jyseps2_1 should always be smaller that jyseps1_2. Only inconsistency found here is for SN.
773+
if jyseps1_2 < jyseps2_1:
774+
jyseps1_2 = jyseps2_1
775+
ny_inner = jyseps2_1
776+
#For Single Null (SN) cases, Ingrid sets this values to be different, but BOUT++ expects them to be the same.
777+
print ("WARNING: Adjusting jyseps1_2 to be equal to jyseps2_1 for consistency with BOUT++ expectations. This is expected for Single Null cases.")
778+
772779
# Calculate metric tensor
773780
grd.update(calcMetric(grd, bpsign, verbose, ignore_checks))
774781

@@ -930,6 +937,13 @@ def getMeshTopology(g, nx, ny):
930937
ny_inner = g["ix_inner"]
931938
jyseps1_2 = g["ix_cut3"]
932939
jyseps2_2 = g["ix_cut4"] - 1
940+
941+
#jyseps2_1 should always be smaller that jyseps1_2. Only inconsistency found here is for SN.
942+
if jyseps1_2 < jyseps2_1:
943+
jyseps1_2 = jyseps2_1
944+
ny_inner = jyseps2_1
945+
#For Single Null (SN) cases, Ingrid sets this values to be different, but BOUT++ expects them to be the same.
946+
print ("WARNING: Adjusting jyseps1_2 to be equal to jyseps2_1 for consistency with BOUT++ expectations. This is expected for Single Null cases.")
933947

934948
if (jyseps1_1 < 0 and jyseps2_2 >= ny - 1):
935949
return "CFL"

0 commit comments

Comments
 (0)