Hello,
this is not directly related to OpenMC, but I was hoping this community might provide reasonable opinions on this. If it’s off-topic, I’d be happy to hear where to move the discussion.
Question: Is there anything like code-independant input file format for calculation codes?
Rationale
In my experience so far, almost every nuclear code had different input syntax - e.g. compare OpenMC, Serpent and Helios. I don’t like writing input files by hand, as it feels tedious, repetitive and very error-prone, especially with older codes.
Several times I have seen different scripts like convert_codeX_to_codeY.py or load_latticeCodeX_to_diffusionCodeYlibrary.py . This seems to be more DRY approach, but requires many conversion scripts.
Ideas
Defining something like “input database”, e.g. by JSON/YAML/TOML/XML configs and then having some script that load and validate it and provide API like
assembly = FuelAssembly("my_fa.yaml")
assembly.to_openmc()
assembly.to_serpent()
assembly.to_mcnp()
assembly.to_openmoc()
would be great. Do you know if anything like this exists so far? I don’t want to re-invent the wheel, I’m pretty sure someone has thought about this already.
Or even better, would there by code-agnostic input file format? E.g. one input that would work for multiple codes?
Research
I prompted some AI chat about it and it mentioned
- DAGMC - mentioned to be great for geometry portability, but it does not describe materials etc.
- OpenMC’s Model class - one would just have to implement
Model.to_codeX() - ARMI (Advanced Reactor Modeling Interface) -I’ve never used it - does anyone have experience?
My idea
I was wondering if creating blueprints using OpenMC Python API and Pydantic models could be reasonable. It would be great for validation of user input and automatically exporting JSONSchema, which can be later used for IDE support. Downside of this would be still the tedious Model.to_codeX() approach. Has anyone done something similar already?
Thanks for any opinions on this.