Add python script to merge input files and comment out SM for standard MCNP

This commit is contained in:
2020-02-14 10:08:43 +01:00
parent f02a633f6f
commit 88912e1b71
2 changed files with 19 additions and 3 deletions

View File

@@ -43,7 +43,7 @@ c 700 s 117.0 -155.00 13.5 3.0
c Estia geometry
read file=geometry/estia_surfaces.i echo
read file=geometry/sm_reflectivity.i echo
c read file=geometry/sm_reflectivity.i echo $ Adds SM reflection, requires patch
read file=geometry/materials.i echo
read file=geometry/materials_monolith.i echo
c
@@ -144,7 +144,7 @@ c read file=tallies/bunker_mesh_np.i echo
c read file=tallies/bunker_mesh_act.i echo
c read file=tallies/full_mesh.i echo
c read file=tallies/full_mesh_p.i echo
read file=tallies/full_mesh_np.i echo
c read file=tallies/full_mesh_np.i echo
c read file=tallies/boundary_meshes.i echo
c read file=tallies/boundary_wall_meshes.i echo
c read file=tallies/selene_source_mesh_p.i echo
@@ -174,7 +174,7 @@ c
c ===============================
c Global Variance Reduction Cards
c ===============================
c Exponential transform in collimators
c Exponential transform in collimators, only works with weight windows
ext:n 0 276r $ in monolith
0 0 0 309r $ ess outside
0 132r 0.25v3 13r $CPC1+2

16
merge_model.py Normal file
View File

@@ -0,0 +1,16 @@
#!/usr/bin/env python
"""
Generate a single input file from Estia model.
"""
maintxt=open('e2-estia.i', 'r').readlines()
outp=open('estia_merged.i', 'w')
for line in maintxt:
if not line.startswith('read'):
outp.write(line)
else:
fname=line.split('=', 1)[1].split()[0]
outp.write(open(fname, 'r').read().strip()+'\n')
outp.close()