-
Notifications
You must be signed in to change notification settings - Fork 11
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
extra tests ideas #34
Comments
testing the plotting routines ideas check that plots result in file such as png files check the axis ranges are correct |
Hi Jonathan, for the first point, would I be right in thinking that you're interested in testing that TokamakSource is generating RZ coordinates correctly? |
That would be very nice, something that checks triangulation and elongation are correctly handled. What do you think @RemDelaporteMathurin ? |
So I think there are several things here and maybe we need seperated issues to make it clearer. The openmc-plasma-source/openmc_plasma_source/tokamak_source.py Lines 198 to 215 in 3de9d21
One way to test this is to 1) test the method
|
Thanks @RemDelaporteMathurin and @shimwell, that's what I assumed the issue was about. I've managed to get such a test working, though with a few caveats:
The first point is difficult to solve, as the plasma boundary is quite a complex shape to work with, but I might be able to constrain the test further with a bit more work. The second point should be quite easy to incorporate into my solution, as I'll just need to add a few more examples of tokamak geometries. Once I've done this I'll make a pull request. |
Thanks for this. I guess that works but doesn't test the triangularity. Perhaps we can focus on testing So to create that inverse function, "simply" inverse the relations I gave above:
|
I've tried looking at an inverse function, but I believe it can only ever be approximate as the a-alpha to RZ relations aren't bijective (at least according to "Tokamak D-T neutron source models for different plasma physics confinement modes", Fausser et al.). I believe I have an approximate solution working, but it'll take some further testing to make sure it's robust. |
It isn't bijective as is but if you constraint a to be positive than each R, Z couple corresponds to one unique (a, alpha) point doesn't it? |
I believe so, but the inversion may need to be performed numerically rather than analytically. |
Ah maybe. Well even an approximate is better than what we have currently I suppose :-) |
Test that point coordinates are generated within the ranges expected.
This is tricky for random samples as the results change
Allow for a wide tolerance to account for random distributions
Perhaps fixing the seed in openmc could help, openmc has a
settings.seed
value that defaults to 1The text was updated successfully, but these errors were encountered: