Skip to content
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

cherab interface: Calculate heat fluxes to walls #308

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

bendudson
Copy link
Contributor

xbout.wall.AxisymmetricWall represents an axisymmetric wall

xbout.wall.read_geqdsk reads a GEQDSK file, returning an AxisymmetricWall

xbout.cherab.triangulate.TriangularData.wall_flux takes an AxisymmetricWall and calculates heat fluxes to each element.

So to calculate heat fluxes:

wall = xbout.wall.read_geqdsk("geqdsk")

ds = ds.bout.with_cherab_grid()

da = -bd['Rd+_ex'].isel(t=1, zeta=0)

da[:2,:] = 0.0
da[-2:,:] = 0.0

data = da.bout.as_cherab_data()

result = data.wall_flux(cat_wall, pixel_samples=1000)

`xbout.wall.AxisymmetricWall` represents an axisymmetric wall

`xbout.wall.read_geqdsk` reads a GEQDSK file, returning an AxisymmetricWall

`xbout.cherab.triangulate.TriangularData.wall_flux`
takes an AxisymmetricWall and calculates heat fluxes to each element.

So to calculate heat fluxes:

```
wall = xbout.wall.read_geqdsk("geqdsk")

ds = ds.bout.with_cherab_grid()

da = -bd['Rd+_ex'].isel(t=1, zeta=0)

da[:2,:] = 0.0
da[-2:,:] = 0.0

data = da.bout.as_cherab_data()

result = data.wall_flux(cat_wall, pixel_samples=1000)
```
@pep8speaks
Copy link

pep8speaks commented Dec 11, 2024

Hello @bendudson! Thanks for updating this PR. We checked the lines you've touched for PEP 8 issues, and found:

Line 209:89: E501 line too long (106 > 88 characters)

Comment last updated at 2024-12-11 06:37:51 UTC

"""
return np.stack((self.Rs, self.Zs), axis=-1)

def plot(self, linestyle="k-", ax=None):
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FYI I think plotting the wall onto the plasma is analogous to plotting features like coastlines using cartopy onto the earth.

There might be useful inspiration from how cartopy interacts with matplotlib, especially if you want to set up presets for a small number of possible wall shapes (there are only so many tokamaks in the world).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants