Closed emaartensson closed 1 year ago
If anyone want to create a positive Z plasma source, this is how I did it:
indexes = np.where(source.RZ[1] > 0)[0]
source.sources = list(np.array(source.sources)[indexes])
source.RZ = (list(np.array(source.RZ[0][indexes])),
list(np.array(source.RZ[1])[indexes]))
source.neutron_source_density =\
list(np.array(source.neutron_source_density)[indexes])
Oops sorry I seem to have missed this! Yes deleting point afterwards should work!
Is this functionality useful enough to others to merit a PR, I guess the source currently only works for models centered at z=0 which is a bit inconvenient
I'm not sure if this should have a PR.
@emaartensson 's solution seems easy enough. Do you need to call list
?
Also the problem here is not that the source isn't centered on z=0 but rather that we want to remove all the z<0 points
ok then I think we can close this issue, feel free to reopen if needed
Hi both, thanks for your message. I'm not sure how useful it is for other people, I only did it because my model is up-down symmetrical and I wanted to improve convergence.
@RemDelaporteMathurin, I tried to not create a list again but openmc didn't like source.sources not being a list for some reason.
I only did the RZ and neutron_source_density as well so I could plot it:
If you want a PR then I could try and add to the class, but completely up to you.
Hello,
I'm trying to create an openmc model where I only model one half of the tokamak since my model is completely up/down symmetrical. Any ideas how I should accomplish this in TokamakSource()? I'm happy to create the entire source and then remove the source-points above or below the Z=0-plane but unsure how to remove points when I create the source like below. I can iterate over the my_source.sources and get the space-variable. Could I just delete the data points I don't want from the list?
Maybe it would be useful to have a Z-delimiter option in the input arguments, similar to the angles-argument.