-
Notifications
You must be signed in to change notification settings - Fork 9
Feature/plasdom/updownsymmetry #37
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
Conversation
…' into feature/plasdom/updownsymmetry
…' into feature/plasdom/updownsymmetry
bryan-garcia
left a comment
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.
Looks great
| 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) |
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.
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
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.