At the time of writing an MPACT model's mesh to a disk, we know nearly everything needed to generate the input file. To save the user some trouble, and prevent potential errors and poor choices of parameters, we should simply write the input file for them. I propose the following structure:
CASEID
Simply make the CASEID the name of the mesh file prior to the extension. For example: my_model.xdmf -> CASEID my_model
MATERIAL
If the model uses physically based materials, we should be able to write the material ID, type, density, temperature, and isotopic number densities, fully specifying the MATERIAL block. This eliminates potential user error in which the materials in the input file and XDMF file do not match.
GEOM
The geom block is always just um2_core followed by the output file name of the mesh.
XSEC
For advanced meshing or CMFD grid generation, UM2 needs access to MPACT cross sections. Hence, we can simply fill this block with the XS lib and the full path to the library's location.
OPTION
If a model is 2D, we can immediately set 2 of the 6 boundary conditions. Additionally, we can set a target ray spacing based upon the average mean chord length of the mesh cells in the model. Values which cannot be determined at time of writing the file should be formatted in a manner that raises errors if the model is run in MPACT. For instance, don't assume we want 16 azimuthal angles or an angular quadrature type.
At the time of writing an MPACT model's mesh to a disk, we know nearly everything needed to generate the input file. To save the user some trouble, and prevent potential errors and poor choices of parameters, we should simply write the input file for them. I propose the following structure:
my_model.xdmf -> CASEID my_model
um2_core
followed by the output file name of the mesh.