# loop for nacl for ii in np.arange(startmolnacl, endmolnacl, stepmolnacl): matdict[nacl] = ii # loop for ucl for jj in np.arange(100 - ii, endmolucl, stepmolucl): if jj > startmolucl: continue ## set initials results['kCR'] = 0 # CR of kcode mode results['fCR'] = 0 # CR of fixed mode results['kescape'] = 0 # escape of kcode mode results['fescape'] = 0 # escape of fixed mode matdict[ucl3] = jj matdict[thcl4] = 100 - ii - jj mat = Material('mat1', matdict, 900) # print(uf4.getActomicMass()) # print(thf4.getActomicMass()) density = mat.getDensity() print(density) # print(mat.toMcnpCard().strip()) line = mat.toMcnpCard().strip() mh.modifyinp(inp, 'm1', 'm1 ' + line, 'data') line = mh.readContent(inp, '4') print(line) # print(line.strip().split()[2]) newline = line.replace(line.strip().split()[2], '-{:.4f}'.format(density)) print(newline) mh.modifyinp(inp, '4', newline) changeMode(inp, mode='kcode')
results = {} for coreincrement in range(0, endCoreSize, coreSizeStep): for reflectorincrement in range(0, endreflectorThickness, thicknessStep): for ii in np.arange(startmolnacl, endmolnacl, stepmolnacl): compounddic = matproc.setCompoundDict(compounddic, 'nacl', ii) # loop for pucl for jj in np.arange(startmolchloridefuel, endmolchloridefuel, stepmolchloridefuel): # if jj > startmolchloridefuel: # continue compounddic = matproc.setCompoundDict( compounddic, chloridefuelname, jj) compounddic = matproc.setCompoundDict( compounddic, 'thcl4', 100 - ii - jj) mat = Material('mat1', compounddic, 900) perpross.copyInitalMcnpinp(initalMcnpinp, mcnpinp) perpross.deleteNonMcnpCard(mcnpinp) perpross.changeMode(mcnpinp, 'kcode', True) perpross.cleanupFolder(mcnpinp) perpross.modfiyMaterial(mcnpinp, '4', mat.getDensity(), 'm1', 'm1 ' + mat.toMcnpCard()) perpross.changeMcnpLine(mcnpinp, coreincrement, '2', 'surface') perpross.changeMcnpLine(mcnpinp, coreincrement, '13', 'surface') perpross.changeMcnpLine(mcnpinp, coreincrement, '14', 'surface') perpross.changeMcnpLine(mcnpinp, coreincrement, '15',