From 88912e1b71a3440b02fea54d78904b927ec5d7d8 Mon Sep 17 00:00:00 2001 From: Artur Glavic Date: Fri, 14 Feb 2020 10:08:43 +0100 Subject: [PATCH] Add python script to merge input files and comment out SM for standard MCNP --- e2-estia.i | 6 +++--- merge_model.py | 16 ++++++++++++++++ 2 files changed, 19 insertions(+), 3 deletions(-) create mode 100644 merge_model.py diff --git a/e2-estia.i b/e2-estia.i index f53fea5..5bd1a72 100644 --- a/e2-estia.i +++ b/e2-estia.i @@ -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 diff --git a/merge_model.py b/merge_model.py new file mode 100644 index 0000000..8cd5997 --- /dev/null +++ b/merge_model.py @@ -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()