-
Notifications
You must be signed in to change notification settings - Fork 13
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
mcpl2openmc #56
Comments
Hi Perry, cheers |
Great Erik @ebknudsen - an mcpl2openmc tool would certainly be enough to induce a new release all by itself :-) For Perry @yrrepy in the meantime - if you (as you told me in your email) plan to produce some sort of code yourself, I strongly suggest you make your code capable of reading MCPL files directly, rather than relying on an intermediate ASCII representation. It should be essentially trivial: https://mctools.github.io/mcpl/usage_c/#reading-mcpl-files Feel free to ask follow up questions here if it gives your problems or if you have other issues. I add @marquezj and @dddijulio here as well, since they might also have experience working with MCPL+OpenMC. Cheers, |
I was in fact looking in to the matter of having OpenMC read/write mcpl directly which should not be significantly more difficult than a standalone mcpl2openmc and vice versa, but adoption would likely take longer than in the lean and mean mcpl-organization. |
Absolutely, we are extremely lean ;-) (and mean...) |
@norberto-schmidt has a solution for this. Not as elegant as something from @tkittel, but it works. |
@tkittel ; Cheerio! |
Hi eveyone, The solution that I founded to transform an OpenMC surface source file into MCPL format is the next:
I know it is not the best solution, but at least it worked for my Master's Thesis. Unfortaunly my OpenMC branch is not well commented, so please @yrrepy let me kindly know if you have any problem with the codes and if they work for you! With kind regards, Norbert |
Hi all! 👋 I just learned about MCPL this week and would love to see OpenMC support in one form or another! I'm curious to hear everyone's thoughts on whether it makes more sense to have functionality in OpenMC for reading/writing MCPL files (using the |
Hi guys, so as it were, I just got the MCPL to OpenMC surface.source.h5 working yesterday. It comes from an original MCNP6.2 wssa. As Thomas suggested I worked directly from the MCPL format rather than from a ASCII text output, I was hoping this would save in RAM, but it doesn't, it just saves the to text conversion step and having that giant file. Paul, I might drop in on the OpenMC Discourse tomorrow and we can chat. Cheerio, |
Hi guys,
Great to hear that there is already a pipeline.
On my hand I managed to put together half a c++-prototype to do the
mcpl/openmc coupling before I had to attend to other things. I hope to be
able to finish that in a week or two.
Although the use of that somewhat limited now :-). But I do like to finish
what I started. Perhaps it could be easily integrated into OpenMC if that
is of interest.
cheers
Erik
…On Thu, Apr 28, 2022 at 4:43 PM yrrepy ***@***.***> wrote:
Hi guys,
so as it were, I just got the MCPL to OpenMC surface.source.h5 working
yesterday. It comes from an original MCNP6.2 wssa.
It's a fairly compact Python script that I ended up using, inspired by
your suggestions on the OpenMC forums, Paul.
Really, it was so simple, I'm not sure extra functionality is really
needed elsewhere. (And this is from a non programmer, with not great
scripting skills).
That said I do like the ease and tidiness of MCPL, so it would seem to be
a natural fit to have it within MCPL.
As Thomas suggested I worked directly from the MCPL format rather than
from a ASCII text output, I was hoping this would save in RAM, but it
doesn't, it just saves the to text conversion step and having that giant
file.
(I have an 8 GB WSSA, all told it required about 50-60GB of RAM to process
it)
Paul, I might drop in on the OpenMC Discourse tomorrow and we can chat.
Cheerio,
Perry
—
Reply to this email directly, view it on GitHub
<#56 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAGQ7FERIWPJCZXQZVCIHILVHKPZPANCNFSM5PYBMULQ>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Hi everyone, Great to see so much activity here! I think both avenues of approach are useful: A proper integration of mcpl-reading/producing code into OpenMC itself could indeed be the most convenient way, skipping intermediate file formats. However, creating such code can be tricky and it might take years before it will be adopted into a project like OpenMC. On the other hand, two standalone cmdline scripts a'la what we do for MCNP's ssw files could be immediately useful. So I would suggest that, to the extent people are interested in contributing, those of you interested pursue the avenue of getting the direct mcpl-using code directly into OpenMC - then time will tell when and if it will one day become a superior alternative. In the meantime, I would be very happy to help guide some people creating some polished command-line tools for openmc integrated into the MCPL release itself. For that to happen, I would ideally ask those of you to volunteer to contribute to that to also "hang around" afterwards and help me answer support requests when someone asks for help or submit bug reports concerning that code. After all, I can't be an expert in all the MC codes, and we have done something similar for our McStas/MCNP/PHITS/etc. support and it seems to be working so far :-) Let me know what you think. Cheers, |
@tkittel or others -- I was just looking at the Python |
Hi there, |
@ebknudsen sounds good, feel free to reach out! |
@paulromano yes, the mcpl python module is read-only (because of lack of time). However, while that is certainly something that should one day be improved upon, I think that any built-in support for reading mcpl files from OpenMC should in any case be using the C-module, to avoid any overhead. @yrrepy when you say that you get 50GB of overhead for reading an 8GB file, I assume you are not talking about overhead from mcpl? If you read a few particles at a time then there should be very little memory usage from mcpl (it does not need to read the entire file in memory). @ebknudsen sounds good! Yes, native openmc (c++) code using the mcpl C code should certainly be the most efficient (and hopefully also the most convenient). A bit of advice: From my past experiences, one of the most tricky parts of these converters is mapping the particle codes with good coverage and fallback strategies. In particular, it might be worthwhile to check carefully that Ions/nuclei codes are dealt with correctly. |
Hi there, |
@paulromano Btw. I imagine I could spend 5 min at the next OpenMC "gathering" to show this code. |
Yes, that would be great! |
Hi all,
|
Hi @yrrepy, your script looks nice! I have just two comments regarding the conversion from MCPL to OpenMC:
|
Just wanted to note here that openmc-dev/openmc#2116 was recently merged 🎉 Thanks to @ebknudsen for making it happen. Perhaps it makes sense to close this issue here now? |
Indeed, huge thanks to @ebknudsen for this nice work + @paulromano for shepherding it into OpenMC :-) I will keep this issue open a bit longer, to remind myself that we need the new functionality mentioned on the MCPL website as well (perhaps after the next OpenMC release). |
It would be great if mcpl had the functionality to directly produce an OpenMC surface_source.h5 file.
https://docs.openmc.org/en/stable/io_formats/source.html?highlight=surface_source.h5
Much like mcpl2ssw and mcpl2phits.
Cheers,
Perry
The text was updated successfully, but these errors were encountered: