diff --git a/fng_dose/neutron/generate_settings.py b/fng_dose/neutron/generate_settings.py index 50df4b3b..c8abd821 100644 --- a/fng_dose/neutron/generate_settings.py +++ b/fng_dose/neutron/generate_settings.py @@ -5,32 +5,41 @@ import openmc import openmc.stats +# Take discrete values and create intervals that cover [-1, 1] cos_theta = np.array([ 1.00000, 0.98481, 0.93969, 0.86603, 0.76604, 0.64279, 0.50000, 0.34202, 0.17365, 0.00000, -0.17365, -0.34202, -0.50000, -0.64279, -0.76604, -0.86603, -0.93969, -0.98481, -1.00000 ]) +cos_theta = np.concatenate([[1.], cos_theta[:-1] + 0.5*np.diff(cos_theta), [-1.]]) +# Weight relative intensity by width of corresponding cos_theta intervals relative_intensity = np.array([ 1.05459, 1.05374, 1.05124, 1.04715, 1.04162, 1.03484, 1.02701, 1.01842, 1.00932, 1.00000, 0.99075, 0.98184, 0.97354, 0.96609, 0.95969, 0.95452, 0.95073, 0.94842, 0.94764 ]) +relative_intensity *= np.diff(-cos_theta) yield_data = np.loadtxt('yields.txt') yields = [] -for i in range(cos_theta.size): +for i in range(relative_intensity.size): yields.append( openmc.stats.Tabular(1e6*yield_data[:, 2*i], yield_data[:, 2*i+1]) ) sources = [] -for i in range(cos_theta.size): - mu_dist = openmc.stats.Discrete([cos_theta[i]], [1.0]) +for i, (mu_high, mu_low) in enumerate(zip(cos_theta[:-1], cos_theta[1:])): + mu_dist = openmc.stats.Uniform(mu_low, mu_high) phi_dist = openmc.stats.Uniform(0., 2*pi) - angle_dist = openmc.stats.PolarAzimuthal(mu_dist, phi_dist) + angle_dist = openmc.stats.PolarAzimuthal( + mu_dist, + phi_dist, + reference_uvw=(0.0, 1.0, 0.0), + ) energy_dist = yields[i] + # Create sources so that strengths add up to 1 source = openmc.Source( angle=angle_dist, energy=energy_dist, @@ -38,7 +47,6 @@ ) sources.append(source) - settings = openmc.Settings() settings.run_mode = 'fixed source' settings.particles = 10_000 diff --git a/fng_dose/neutron/settings.xml b/fng_dose/neutron/settings.xml index d7c16890..9f995e4f 100644 --- a/fng_dose/neutron/settings.xml +++ b/fng_dose/neutron/settings.xml @@ -3,209 +3,171 @@ fixed source 10000 100 - - - - 1.0 1.0 - + + + 14316700.0 14359900.0 14398300.0 14433400.0 14465800.0 14496200.0 14524900.0 14552200.0 14578300.0 14603400.0 14627600.0 14651000.0 14673700.0 14695700.0 14717100.0 14738000.0 14758400.0 14778400.0 14797900.0 14817000.0 14835800.0 14854300.0 14872400.0 14890200.0 14907700.0 14925000.0 14942000.0 14958800.0 14975300.0 14991700.0 15007800.0 15023700.0 15039500.0 15055000.0 15070400.0 15085600.0 15100700.0 15115600.0 15130400.0 15145000.0 15159500.0 15173800.0 15188000.0 15202100.0 0.00042 0.00072 0.00184 0.00278 0.00485 0.00671 0.00966 0.0124 0.01593 0.01926 0.02283 0.02625 0.02912 0.0319 0.03406 0.03615 0.03707 0.03798 0.03792 0.03786 0.03708 0.0363 0.03523 0.03417 0.0328 0.03143 0.03039 0.02934 0.02793 0.0265 0.02542 0.02434 0.02319 0.02203 0.02112 0.02019 0.01951 0.01883 0.01805 0.01727 0.01669 0.01609 0.0155 0.01489 - - - - 0.98481 1.0 - + + + 14312700.0 14355200.0 14393100.0 14427600.0 14459600.0 14489500.0 14517800.0 14544700.0 14570500.0 14595200.0 14619000.0 14642100.0 14664400.0 14686100.0 14707200.0 14727800.0 14748000.0 14767600.0 14786900.0 14805700.0 14824200.0 14842400.0 14860300.0 14877900.0 14895100.0 14912200.0 14928900.0 14945500.0 14961800.0 14977900.0 14993800.0 15009500.0 15025000.0 15040400.0 15055500.0 15070500.0 15085400.0 15100100.0 15114600.0 15129100.0 15143300.0 15157500.0 15171500.0 15185400.0 0.00042 0.00072 0.00184 0.00278 0.00485 0.00671 0.00966 0.0124 0.01594 0.01926 0.02283 0.02626 0.02913 0.0319 0.03406 0.03615 0.03708 0.03798 0.03793 0.03786 0.03708 0.0363 0.03523 0.03417 0.03279 0.03143 0.03039 0.02934 0.02792 0.0265 0.02542 0.02434 0.02318 0.02203 0.02111 0.02019 0.01951 0.01883 0.01805 0.01727 0.01668 0.01609 0.01549 0.01489 - - - - 0.93969 1.0 - + + + 14300700.0 14341400.0 14377500.0 14410500.0 14441100.0 14469700.0 14496700.0 14522500.0 14547100.0 14570800.0 14593600.0 14615600.0 14637000.0 14657700.0 14678000.0 14697700.0 14716900.0 14735700.0 14754200.0 14772200.0 14789900.0 14807300.0 14824400.0 14841200.0 14857800.0 14874100.0 14890200.0 14906000.0 14921600.0 14937000.0 14952300.0 14967300.0 14982200.0 14996900.0 15011400.0 15025800.0 15040000.0 15054100.0 15068000.0 15081800.0 15095500.0 15109100.0 15122500.0 15135800.0 0.00042 0.00072 0.00185 0.00278 0.00485 0.00672 0.00967 0.01241 0.01595 0.01927 0.02285 0.02627 0.02914 0.03192 0.03407 0.03616 0.03709 0.03799 0.03793 0.03787 0.03709 0.03631 0.03523 0.03416 0.03279 0.03142 0.03038 0.02934 0.02792 0.02649 0.02541 0.02433 0.02317 0.02202 0.0211 0.02018 0.0195 0.01881 0.01804 0.01726 0.01667 0.01607 0.01548 0.01488 - - - - 0.86603 1.0 - + + + 14281100.0 14318700.0 14352100.0 14382600.0 14410900.0 14437400.0 14462400.0 14486300.0 14509000.0 14530900.0 14552100.0 14572500.0 14592300.0 14611500.0 14630300.0 14648500.0 14666400.0 14683800.0 14700900.0 14717600.0 14734100.0 14750200.0 14766100.0 14781700.0 14797000.0 14812100.0 14827000.0 14841700.0 14856200.0 14870500.0 14884700.0 14898600.0 14912400.0 14926100.0 14939600.0 14952900.0 14966100.0 14979200.0 14992200.0 15005000.0 15017700.0 15030300.0 15042800.0 15055200.0 0.00043 0.00072 0.00185 0.00279 0.00486 0.00673 0.00969 0.01243 0.01597 0.0193 0.02287 0.0263 0.02917 0.03194 0.0341 0.03618 0.03711 0.03801 0.03795 0.03788 0.03709 0.03631 0.03523 0.03416 0.03279 0.03142 0.03037 0.02932 0.02791 0.02647 0.0254 0.02431 0.02316 0.022 0.02108 0.02016 0.01948 0.01879 0.01802 0.01724 0.01665 0.01605 0.01546 0.01486 - - - - 0.76604 1.0 - + + + 14254600.0 14288000.0 14317800.0 14344900.0 14370100.0 14393700.0 14416000.0 14437200.0 14457500.0 14477100.0 14495900.0 14514200.0 14531800.0 14549000.0 14565700.0 14582100.0 14598000.0 14613600.0 14628900.0 14643900.0 14658600.0 14673000.0 14687200.0 14701200.0 14714900.0 14728500.0 14741800.0 14755000.0 14768000.0 14780800.0 14793400.0 14806000.0 14818300.0 14830600.0 14842700.0 14854600.0 14866500.0 14878200.0 14889800.0 14901400.0 14912800.0 14924100.0 14935300.0 14946400.0 0.00043 0.00073 0.00186 0.0028 0.00488 0.00675 0.00971 0.01245 0.016 0.01933 0.02291 0.02633 0.0292 0.03198 0.03413 0.03621 0.03713 0.03803 0.03796 0.03789 0.0371 0.03631 0.03523 0.03416 0.03278 0.03141 0.03036 0.02931 0.02789 0.02646 0.02538 0.02429 0.02313 0.02198 0.02106 0.02014 0.01945 0.01877 0.01799 0.01721 0.01662 0.01603 0.01543 0.01483 - - - - 0.64279 1.0 - + + + 14222000.0 14250300.0 14275500.0 14298500.0 14319900.0 14339900.0 14358900.0 14377000.0 14394300.0 14411000.0 14427000.0 14442600.0 14457700.0 14472300.0 14486600.0 14500600.0 14514200.0 14527500.0 14540600.0 14553400.0 14566000.0 14578400.0 14590600.0 14602500.0 14614300.0 14625900.0 14637400.0 14648700.0 14659800.0 14670900.0 14681700.0 14692500.0 14703100.0 14713600.0 14724000.0 14734300.0 14744500.0 14754600.0 14764600.0 14774600.0 14784400.0 14794100.0 14803800.0 14813400.0 0.00043 0.00073 0.00186 0.00281 0.00489 0.00676 0.00973 0.01248 0.01603 0.01937 0.02295 0.02637 0.02925 0.03202 0.03417 0.03625 0.03716 0.03805 0.03798 0.03791 0.03711 0.03632 0.03523 0.03415 0.03277 0.0314 0.03035 0.02929 0.02787 0.02643 0.02535 0.02427 0.02311 0.02195 0.02103 0.02011 0.01942 0.01874 0.01796 0.01718 0.01659 0.01599 0.0154 0.0148 - - - - 0.5 1.0 - + + + 14184300.0 14206700.0 14226700.0 14245000.0 14262000.0 14277900.0 14293100.0 14307500.0 14321400.0 14334700.0 14347600.0 14360100.0 14372200.0 14384000.0 14395500.0 14406700.0 14417700.0 14428500.0 14439000.0 14449400.0 14459500.0 14469500.0 14479400.0 14489100.0 14498600.0 14508000.0 14517300.0 14526500.0 14535600.0 14544500.0 14553400.0 14562100.0 14570800.0 14579300.0 14587800.0 14596200.0 14604500.0 14612700.0 14620900.0 14629000.0 14637000.0 14645000.0 14652900.0 14660700.0 0.00043 0.00073 0.00187 0.00282 0.00491 0.00679 0.00976 0.01252 0.01607 0.01941 0.023 0.02642 0.0293 0.03207 0.03421 0.03629 0.0372 0.03808 0.03801 0.03792 0.03712 0.03632 0.03523 0.03415 0.03276 0.03138 0.03033 0.02927 0.02784 0.02641 0.02532 0.02424 0.02307 0.02192 0.021 0.02007 0.01939 0.0187 0.01792 0.01714 0.01655 0.01595 0.01536 0.01476 - - - - 0.34202 1.0 - + + + 14142700.0 14158600.0 14172900.0 14185900.0 14198200.0 14209700.0 14220600.0 14231100.0 14241100.0 14250800.0 14260200.0 14269300.0 14278200.0 14286900.0 14295300.0 14303600.0 14311700.0 14319600.0 14327400.0 14335100.0 14342600.0 14350100.0 14357400.0 14364600.0 14371700.0 14378700.0 14385700.0 14392500.0 14399300.0 14406000.0 14412600.0 14419200.0 14425700.0 14432100.0 14438500.0 14444800.0 14451100.0 14457300.0 14463500.0 14469600.0 14475700.0 14481700.0 14487700.0 14493600.0 0.00043 0.00074 0.00188 0.00283 0.00493 0.00681 0.0098 0.01255 0.01612 0.01946 0.02305 0.02648 0.02935 0.03212 0.03426 0.03633 0.03724 0.03812 0.03803 0.03794 0.03713 0.03633 0.03523 0.03414 0.03275 0.03137 0.03031 0.02925 0.02782 0.02638 0.02529 0.0242 0.02304 0.02188 0.02096 0.02003 0.01935 0.01866 0.01788 0.0171 0.01651 0.01591 0.01531 0.01471 - - - - 0.17365 1.0 - + + + 14098500.0 14107500.0 14115700.0 14123300.0 14130500.0 14137300.0 14143800.0 14150000.0 14156100.0 14162000.0 14167700.0 14173300.0 14178700.0 14184100.0 14189300.0 14194500.0 14199500.0 14204500.0 14209400.0 14214300.0 14219100.0 14223800.0 14228500.0 14233100.0 14237600.0 14242200.0 14246600.0 14251100.0 14255500.0 14259800.0 14264100.0 14268400.0 14272700.0 14276900.0 14281100.0 14285300.0 14289400.0 14293500.0 14297600.0 14301600.0 14305700.0 14309700.0 14313700.0 14317600.0 0.00044 0.00074 0.00189 0.00284 0.00495 0.00684 0.00983 0.0126 0.01617 0.01951 0.02311 0.02654 0.02941 0.03218 0.03432 0.03638 0.03728 0.03815 0.03806 0.03796 0.03715 0.03633 0.03523 0.03414 0.03274 0.03135 0.03029 0.02922 0.02779 0.02635 0.02526 0.02417 0.023 0.02184 0.02092 0.01999 0.0193 0.01861 0.01783 0.01705 0.01646 0.01586 0.01527 0.01467 - - - - 0.0 1.0 - + + + 14053100.0 14055000.0 14057000.0 14059000.0 14061000.0 14063000.0 14065000.0 14067000.0 14068900.0 14070900.0 14072900.0 14074900.0 14076900.0 14078900.0 14080800.0 14082800.0 14084800.0 14086800.0 14088800.0 14090800.0 14092700.0 14094700.0 14096700.0 14098700.0 14100700.0 14102700.0 14104600.0 14106600.0 14108600.0 14110600.0 14112600.0 14114600.0 14116500.0 14118500.0 14120500.0 14122500.0 14124500.0 14126500.0 14128500.0 14130400.0 14132400.0 14134400.0 14136400.0 14138400.0 0.00044 0.00074 0.0019 0.00286 0.00497 0.00687 0.00987 0.01264 0.01622 0.01957 0.02317 0.0266 0.02947 0.03224 0.03437 0.03643 0.03732 0.03819 0.03809 0.03798 0.03716 0.03634 0.03523 0.03413 0.03273 0.03133 0.03026 0.0292 0.02776 0.02631 0.02522 0.02413 0.02296 0.0218 0.02088 0.01995 0.01926 0.01857 0.01779 0.01701 0.01641 0.01582 0.01522 0.01462 - - - - -0.17365 1.0 - + + + 14007800.0 14002800.0 13998600.0 13995000.0 13991900.0 13989100.0 13986600.0 13984300.0 13982300.0 13980400.0 13978700.0 13977200.0 13975700.0 13974400.0 13973200.0 13972000.0 13971000.0 13970000.0 13969100.0 13968300.0 13967500.0 13966800.0 13966200.0 13965600.0 13965000.0 13964500.0 13964100.0 13963700.0 13963300.0 13962900.0 13962600.0 13962400.0 13962100.0 13961900.0 13961700.0 13961600.0 13961500.0 13961400.0 13961300.0 13961300.0 13961300.0 13961300.0 13961300.0 13961300.0 0.00044 0.00075 0.00191 0.00287 0.00499 0.00689 0.0099 0.01268 0.01627 0.01963 0.02323 0.02666 0.02953 0.0323 0.03443 0.03648 0.03737 0.03823 0.03812 0.03801 0.03717 0.03635 0.03523 0.03412 0.03271 0.03131 0.03024 0.02917 0.02773 0.02628 0.02519 0.02409 0.02292 0.02176 0.02083 0.0199 0.01921 0.01852 0.01774 0.01696 0.01637 0.01577 0.01517 0.01457 - - - - -0.34202 1.0 - + + + 13964000.0 13952300.0 13942200.0 13933200.0 13925200.0 13917800.0 13911000.0 13904700.0 13898800.0 13893300.0 13888000.0 13883100.0 13878400.0 13873900.0 13869600.0 13865500.0 13861500.0 13857700.0 13854100.0 13850600.0 13847200.0 13843900.0 13840800.0 13837700.0 13834800.0 13831900.0 13829100.0 13826400.0 13823800.0 13821300.0 13818800.0 13816400.0 13814000.0 13811700.0 13809500.0 13807400.0 13805200.0 13803200.0 13801200.0 13799200.0 13797300.0 13795400.0 13793600.0 13791800.0 0.00044 0.00075 0.00192 0.00288 0.00501 0.00692 0.00994 0.01272 0.01632 0.01968 0.02329 0.02672 0.02959 0.03235 0.03448 0.03653 0.03741 0.03826 0.03815 0.03803 0.03719 0.03635 0.03523 0.03412 0.0327 0.0313 0.03022 0.02914 0.0277 0.02625 0.02515 0.02406 0.02288 0.02172 0.02079 0.01986 0.01917 0.01848 0.0177 0.01691 0.01632 0.01572 0.01512 0.01452 - - - - -0.5 1.0 - + + + 13923100.0 13905000.0 13889400.0 13875500.0 13862900.0 13851300.0 13840500.0 13830400.0 13820900.0 13812000.0 13803500.0 13795400.0 13787600.0 13780200.0 13773100.0 13766200.0 13759600.0 13753200.0 13747000.0 13741000.0 13735200.0 13729600.0 13724100.0 13718800.0 13713600.0 13708600.0 13703700.0 13698900.0 13694200.0 13689600.0 13685100.0 13680800.0 13676500.0 13672300.0 13668200.0 13664200.0 13660200.0 13656400.0 13652600.0 13648900.0 13645200.0 13641600.0 13638100.0 13634700.0 0.00045 0.00076 0.00193 0.0029 0.00503 0.00695 0.00997 0.01276 0.01636 0.01973 0.02334 0.02678 0.02965 0.03241 0.03453 0.03658 0.03745 0.03829 0.03817 0.03804 0.0372 0.03636 0.03523 0.03411 0.03269 0.03128 0.0302 0.02912 0.02767 0.02622 0.02512 0.02402 0.02285 0.02168 0.02075 0.01982 0.01913 0.01844 0.01765 0.01687 0.01628 0.01568 0.01508 0.01448 - - - - -0.64279 1.0 - + + + 13886200.0 13862500.0 13841900.0 13823500.0 13806800.0 13791400.0 13777000.0 13763600.0 13750900.0 13738900.0 13727500.0 13716600.0 13706100.0 13696100.0 13686400.0 13677100.0 13668100.0 13659400.0 13651000.0 13642800.0 13634800.0 13627100.0 13619600.0 13612200.0 13605100.0 13598100.0 13591300.0 13584600.0 13578100.0 13571700.0 13565500.0 13559400.0 13553400.0 13547500.0 13541700.0 13536100.0 13530500.0 13525000.0 13519700.0 13514400.0 13509200.0 13504100.0 13499100.0 13494100.0 0.00045 0.00076 0.00194 0.00291 0.00505 0.00697 0.01 0.0128 0.01641 0.01978 0.02339 0.02683 0.0297 0.03246 0.03458 0.03662 0.03748 0.03832 0.0382 0.03806 0.03721 0.03636 0.03523 0.0341 0.03268 0.03127 0.03018 0.0291 0.02765 0.02619 0.02509 0.02399 0.02281 0.02165 0.02072 0.01978 0.01909 0.0184 0.01761 0.01683 0.01624 0.01564 0.01504 0.01444 - - - - -0.76604 1.0 - + + + 13854400.0 13825900.0 13801000.0 13778800.0 13758600.0 13739900.0 13722500.0 13706200.0 13690800.0 13676100.0 13662200.0 13648900.0 13636100.0 13623900.0 13612100.0 13600700.0 13589600.0 13579000.0 13568600.0 13558500.0 13548800.0 13539200.0 13530000.0 13520900.0 13512100.0 13503500.0 13495000.0 13486800.0 13478700.0 13470800.0 13463000.0 13455500.0 13448000.0 13440700.0 13433500.0 13426400.0 13419500.0 13412700.0 13406000.0 13399400.0 13392900.0 13386500.0 13380200.0 13374000.0 0.00045 0.00076 0.00194 0.00292 0.00507 0.00699 0.01003 0.01283 0.01644 0.01982 0.02343 0.02688 0.02974 0.0325 0.03462 0.03666 0.03752 0.03835 0.03822 0.03808 0.03722 0.03637 0.03523 0.0341 0.03267 0.03125 0.03017 0.02908 0.02763 0.02617 0.02507 0.02396 0.02279 0.02162 0.02069 0.01975 0.01906 0.01836 0.01758 0.0168 0.0162 0.0156 0.015 0.0144 - - - - -0.86603 1.0 - + + + 13828700.0 13796300.0 13768000.0 13742700.0 13719600.0 13698300.0 13678400.0 13659800.0 13642200.0 13625500.0 13609500.0 13594300.0 13579700.0 13565600.0 13552100.0 13539000.0 13526300.0 13514100.0 13502200.0 13490600.0 13479300.0 13468400.0 13457700.0 13447300.0 13437100.0 13427200.0 13417400.0 13407900.0 13398600.0 13389500.0 13380500.0 13371700.0 13363100.0 13354700.0 13346400.0 13338200.0 13330200.0 13322300.0 13314500.0 13306800.0 13299300.0 13291900.0 13284600.0 13277400.0 0.00045 0.00076 0.00195 0.00292 0.00508 0.00701 0.01005 0.01286 0.01647 0.01985 0.02347 0.02691 0.02978 0.03254 0.03465 0.03669 0.03754 0.03837 0.03823 0.03809 0.03723 0.03637 0.03523 0.03409 0.03266 0.03124 0.03015 0.02906 0.02761 0.02615 0.02504 0.02394 0.02276 0.02159 0.02066 0.01973 0.01903 0.01834 0.01755 0.01677 0.01617 0.01557 0.01498 0.01437 - - - - -0.93969 1.0 - + + + 13809800.0 13774500.0 13743700.0 13716100.0 13690900.0 13667700.0 13646000.0 13625700.0 13606500.0 13588200.0 13570800.0 13554200.0 13538200.0 13522800.0 13508000.0 13493700.0 13479900.0 13466400.0 13453400.0 13440700.0 13428400.0 13416400.0 13404700.0 13393300.0 13382100.0 13371200.0 13360600.0 13350100.0 13339900.0 13329900.0 13320100.0 13310400.0 13300900.0 13291600.0 13282500.0 13273500.0 13264700.0 13256000.0 13247500.0 13239100.0 13230800.0 13222600.0 13214600.0 13206700.0 0.00045 0.00077 0.00195 0.00293 0.00509 0.00702 0.01007 0.01287 0.01649 0.01987 0.02349 0.02694 0.02981 0.03256 0.03467 0.03671 0.03756 0.03839 0.03825 0.0381 0.03723 0.03637 0.03523 0.03409 0.03266 0.03124 0.03014 0.02905 0.0276 0.02614 0.02503 0.02392 0.02275 0.02158 0.02065 0.01971 0.01901 0.01832 0.01753 0.01675 0.01615 0.01555 0.01496 0.01435 - - - - -0.98481 1.0 - + + + 13798200.0 13761100.0 13728800.0 13699800.0 13673400.0 13649000.0 13626300.0 13604900.0 13584700.0 13565500.0 13547200.0 13529700.0 13512900.0 13496700.0 13481100.0 13466000.0 13451500.0 13437300.0 13423600.0 13410300.0 13397300.0 13384700.0 13372400.0 13360300.0 13348600.0 13337100.0 13325900.0 13314900.0 13304100.0 13293500.0 13283200.0 13273000.0 13263000.0 13253200.0 13243600.0 13234100.0 13224800.0 13215600.0 13206600.0 13197700.0 13189000.0 13180400.0 13171900.0 13163500.0 0.00045 0.00077 0.00195 0.00293 0.00509 0.00703 0.01008 0.01289 0.01651 0.01989 0.02351 0.02696 0.02982 0.03258 0.03469 0.03672 0.03757 0.0384 0.03825 0.0381 0.03724 0.03638 0.03522 0.03409 0.03265 0.03123 0.03014 0.02904 0.02759 0.02613 0.02502 0.02391 0.02274 0.02157 0.02063 0.0197 0.019 0.01831 0.01752 0.01674 0.01614 0.01554 0.01494 0.01434 - - - - -1.0 1.0 - + + +