Example #1
0
                    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')
                # os.system('mcnp5'+ ' n=' + inp)
                os.system('mpirun -r ssh -np ' + str(int(node * ppn)) +
                          ' /home/daiye/bin/mcnp5.mpi n=' + inp)
                if os.path.isfile(inp + 'o'):
                    print('MCNP5 run finished!')
                    results['keff'] = mtr.readKeff(inp + 'o')['keff']
Example #2
0
                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',
                                            'surface')
                    perpross.changeMcnpLine(mcnpinp, coreincrement, '16',
                                            'surface')
                    perpross.changeMcnpLine(mcnpinp, coreincrement, '17',
                                            'surface')
                    perpross.changeMcnpLine(mcnpinp, coreincrement, '18',
                                            'surface')