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

No complete grid file created with the tokamak example #169

Open
carlito1720 opened this issue Mar 3, 2023 · 3 comments
Open

No complete grid file created with the tokamak example #169

carlito1720 opened this issue Mar 3, 2023 · 3 comments

Comments

@carlito1720
Copy link

Hi. I have been trying to create a grid using the tokamak example provided. I can get the visual representation of the grid but the file created seems to be incomplete as I get the following error

DataFile: None passed as data to write. Ignoring
DataFile: None passed as data to write. Ignoring

I have tried to use the incomplete file in a simulation, and that also comes up with errors

Is there any way of using the tokamak example script to create a usable grid file?

@johnomotani
Copy link
Collaborator

I don't see any errors running that script. Could you post the exact command you ran, and the full output please?

@carlito1720
Copy link
Author

It's not a direct error, the created file just does not contain all the grid points.

The output when running 'python tokamak_example.py' in terminal is:

UserWarning: At least one element of rtol is too small. Setting rtol = np.maximum(rtol, 2.220446049250313e-14).
warn("At least one element of rtol is too small. "
Generating a lower single null

Options

Name | Value

N_norm_prefactor | 1.0 (default)
cap_Bp_ylow_xpoint | False (default)
curvature_smoothing | None (default)
curvature_type | curl(b/B) (default)
finecontour_Nfine | 100 (default)
finecontour_atol | 1e-12 (default)
finecontour_diagnose | False (default)
finecontour_extend_prefactor | 2.0 (default)
finecontour_maxits | 200 (default)
finecontour_overdamping_factor | 0.8 (default)
follow_perpendicular_atol | 1e-08 (default)
follow_perpendicular_rtol | 2e-08 (default)
geometry_rtol | 1e-10 (default)
number_of_processors | 1 (default)
orthogonal | True (default)
poloidal_spacing_delta_psi | None (default)
poloidal_spacing_method | sqrt (default)
poloidalfunction_diagnose | False (default)
psi_interpolation_method | spline (default)
psi_spacing_separatrix_multiplier | 0.5
refine_atol | 2e-08 (default)
refine_methods | ['integrate+newton', 'integrate'] (default)
refine_timeout | 10.0 (default)
refine_width | 1e-05 (default)
sfunc_checktol | 1e-13 (default)
shiftedmetric | True (default)
target_all_poloidal_spacing_length | 0.3
target_inner_lower_poloidal_spacing_length | 0.3 (default)
target_inner_upper_poloidal_spacing_length | 0.3 (default)
target_outer_lower_poloidal_spacing_length | 0.3 (default)
target_outer_upper_poloidal_spacing_length | 0.3 (default)
wall_point_exclude_radius | 0.001 (default)
xpoint_poloidal_spacing_length | 0.05
y_boundary_guards | 2

creating region 0 - inner_lower_divertor(0)
creating region 1 - inner_lower_divertor(1)
creating region 2 - core(0)
creating region 3 - core(1)
creating region 4 - outer_lower_divertor(0)
creating region 5 - outer_lower_divertor(1)
Get RZ valuespendicular: 13
Calculate geometry
Distances inner_lower_divertor(0)
Distances inner_lower_divertor(1)
Distances core(0)ur distances: 11
Distances core(1)ur distances: 11
Distances outer_lower_divertor(0)
Distances outer_lower_divertor(1)
1 inner_lower_divertor(0)nces: 11
Poloidal field is in opposite direction to Grad(theta) -> Bp negative
1 inner_lower_divertor(1)
Poloidal field is in opposite direction to Grad(theta) -> Bp negative
1 core(0)
Poloidal field is in opposite direction to Grad(theta) -> Bp negative
1 core(1)
Poloidal field is in opposite direction to Grad(theta) -> Bp negative
1 outer_lower_divertor(0)
Poloidal field is in opposite direction to Grad(theta) -> Bp negative
1 outer_lower_divertor(1)
Poloidal field is in opposite direction to Grad(theta) -> Bp negative
Calculate zShiftrtor(1) calcHy 10 / 11
Calculate Metricrtor(1)divertor(1)
/Users/carlamiquel-davidson/.local/lib/python3.9/site-packages/hypnotoad/core/mesh.py:1709: RuntimeWarning: invalid value encountered in divide
result.xlow[1:-1, :] = (f.centre[1:, :] - f.centre[:-1, :]) / self.dx.xlow[
/Users/carlamiquel-davidson/.local/lib/python3.9/site-packages/hypnotoad/core/mesh.py:1716: RuntimeWarning: invalid value encountered in divide
result.xlow[0, :] = (f.centre[0, :] - f.xlow[0, :]) / (
/Users/carlamiquel-davidson/.local/lib/python3.9/site-packages/hypnotoad/core/mesh.py:1721: RuntimeWarning: invalid value encountered in divide
result.xlow[-1, :] = (f_outer - f.centre[-1, :]) / self.dx.xlow[-1, :]
/Users/carlamiquel-davidson/.local/lib/python3.9/site-packages/hypnotoad/core/mesh.py:1732: RuntimeWarning: invalid value encountered in divide
result.corners[1:-1, :] = (
/Users/carlamiquel-davidson/.local/lib/python3.9/site-packages/hypnotoad/core/mesh.py:1739: RuntimeWarning: invalid value encountered in divide
result.corners[0, :] = (f.ylow[0, :] - f.corners[0, :]) / (
/Users/carlamiquel-davidson/.local/lib/python3.9/site-packages/hypnotoad/core/mesh.py:1744: RuntimeWarning: invalid value encountered in divide
result.corners[-1, :] = (f_outer - f.ylow[-1, :]) / self.dx.corners[
/Users/carlamiquel-davidson/.local/lib/python3.9/site-packages/hypnotoad/core/mesh.py:1714: RuntimeWarning: invalid value encountered in divide
result.xlow[0, :] = (f.centre[0, :] - f_inner) / self.dx.xlow[0, :]
/Users/carlamiquel-davidson/.local/lib/python3.9/site-packages/hypnotoad/core/mesh.py:1723: RuntimeWarning: invalid value encountered in divide
result.xlow[-1, :] = (f.xlow[-1, :] - f.centre[-1, :]) / (
/Users/carlamiquel-davidson/.local/lib/python3.9/site-packages/hypnotoad/core/mesh.py:1737: RuntimeWarning: invalid value encountered in divide
result.corners[0, :] = (f.ylow[0, :] - f_inner) / self.dx.corners[0, :]
/Users/carlamiquel-davidson/.local/lib/python3.9/site-packages/hypnotoad/core/mesh.py:1748: RuntimeWarning: invalid value encountered in divide
result.corners[-1, :] = (f.corners[-1, :] - f.ylow[-1, :]) / (
DataFile: None passed as data to write. Ignoring
DataFile: None passed as data to write. Ignoring
/Users/carlamiquel-davidson/.local/lib/python3.9/site-packages/hypnotoad/core/multilocationarray.py:116: RuntimeWarning: invalid value encountered in divide
this_result = getattr(ufunc, method)(*this_inputs, **kwargs)
/Users/carlamiquel-davidson/.local/lib/python3.9/site-packages/hypnotoad/core/mesh.py:3596: RuntimeWarning: invalid value encountered in divide
chi.ylow = 2.0 * numpy.pi * self.zShift.ylow / self.ShiftAngle.centre

There is also two plot of the grid that show up with no visible issue.

@johnomotani
Copy link
Collaborator

Ah, OK. I was looking in the wrong place. I see the DataFile: None passed as data to write. Ignoring error in my output now. Not sure where that's coming from...

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

No branches or pull requests

2 participants