Merged
Conversation
…' into feature/plasdom/updownsymmetry
…' into feature/plasdom/updownsymmetry
bryan-garcia
approved these changes
Aug 27, 2025
Comment on lines
+1523
to
+1539
| def ApplyUpDownSymmetry(self) -> None: | ||
| if self.settings["grid_settings"]["up_down_symmetry"]: | ||
| if self.CurrentTopology.config == "LSN": | ||
| del self.CurrentTopology.patches["C1"] | ||
| del self.CurrentTopology.patches["C2"] | ||
| del self.CurrentTopology.patches["D1"] | ||
| del self.CurrentTopology.patches["D2"] | ||
| elif self.CurrentTopology.config in ["SF15", "SF75"]: | ||
| del self.CurrentTopology.patches["C1"] | ||
| del self.CurrentTopology.patches["C2"] | ||
| del self.CurrentTopology.patches["C3"] | ||
| del self.CurrentTopology.patches["D1"] | ||
| del self.CurrentTopology.patches["D2"] | ||
| del self.CurrentTopology.patches["D3"] | ||
| else: | ||
| #TODO: Implement up/down symmetry for other geometries | ||
| raise Exception("Up/down symmetry not yet implemented for config " + self.CurrentTopology.config) |
Collaborator
There was a problem hiding this comment.
If we ever do a proper refactor of ingrid, we can probably have each topology state which patches to delete. Could help keep things tidy and trickle in future changes
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Description of changes
This PR adds an up_down_symmetry option to INGRID. This enables grids to be generated which are symmetric about the midplane, and can be used with the
com.isudsymoption in UEDGE.As an example, we start with this UDN configuration:



Changing the INGRID input file settings from
to
allows INGRID to generate a half-domain configuration, with ghost cells added to the upper patches where they meet the midplane:
A key part of this process is an added module to INGRID,
udsym_tools.py, which takes the magnetic equilibrium, chops off the upper half of the domain and extends psi from the lower half by matching field lines on the outer/inner side.Important note: when using this option, the INGRID input file should be configured as if the equilibrium contained just a single divertor. So for a UDN geometry, the upper x-point should be ignored and the INGRID input file should specify one x-point, i.e.
How was this tested?
Locally on some example files.
Relevant issues
Checklist
I have added/updated tests relevant to this PR.I have updated any baselines required for the test suite.