From d579440b02139bb917d4a68be3b0b0c75a74ba18 Mon Sep 17 00:00:00 2001 From: Sam Shaner Date: Sun, 16 Oct 2016 16:19:31 -0400 Subject: [PATCH 01/34] implemented wo for elements and enrichment for U --- examples/xml/pincell/materials.xml | 7 +- src/input_xml.F90 | 2891 +++++++++++++++++++++++----- 2 files changed, 2454 insertions(+), 444 deletions(-) diff --git a/examples/xml/pincell/materials.xml b/examples/xml/pincell/materials.xml index 9f9afa3843..629dd7a6b2 100644 --- a/examples/xml/pincell/materials.xml +++ b/examples/xml/pincell/materials.xml @@ -9,11 +9,8 @@ - - - - - + + diff --git a/src/input_xml.F90 b/src/input_xml.F90 index 18af461a79..1225c91ac2 100644 --- a/src/input_xml.F90 +++ b/src/input_xml.F90 @@ -2126,21 +2126,15 @@ contains integer :: i_library ! index in libraries array integer :: index_nuclide ! index in nuclides integer :: index_sab ! index in sab_tables - real(8) :: val ! value entered for density - real(8) :: temp_dble ! temporary double prec. real logical :: file_exists ! does materials.xml exist? - logical :: sum_density ! density is taken to be sum of nuclide densities character(20) :: name ! name of isotope, e.g. 92235.03c - character(MAX_WORD_LEN) :: units ! units on density character(MAX_LINE_LEN) :: filename ! absolute path to materials.xml character(MAX_LINE_LEN) :: temp_str ! temporary string when reading type(VectorChar) :: names ! temporary list of nuclide names - type(VectorReal) :: densities ! temporary list of nuclide densities type(VectorInt) :: list_iso_lab ! temporary list of isotropic lab scatterers type(Material), pointer :: mat => null() type(Node), pointer :: doc => null() type(Node), pointer :: node_mat => null() - type(Node), pointer :: node_dens => null() type(Node), pointer :: node_nuc => null() type(Node), pointer :: node_ele => null() type(Node), pointer :: node_sab => null() @@ -2207,70 +2201,6 @@ contains material_temps(i) = ERROR_REAL end if - ! ======================================================================= - ! READ AND PARSE TAG - - ! Get pointer to density element - if (check_for_node(node_mat, "density")) then - call get_node_ptr(node_mat, "density", node_dens) - else - call fatal_error("Must specify density element in material " & - // trim(to_str(mat % id))) - end if - - ! Initialize value to zero - val = ZERO - - ! Copy units - call get_node_value(node_dens, "units", units) - - if (units == 'sum') then - ! If the user gave the units as 'sum', then the total density of the - ! material is taken to be the sum of the atom fractions listed on the - ! nuclides - - sum_density = .true. - - else if (units == 'macro') then - if (check_for_node(node_dens, "value")) then - ! Copy value - call get_node_value(node_dens, "value", val) - else - val = ONE - end if - - ! Set density - mat % density = val - - sum_density = .false. - - else - ! Copy value - call get_node_value(node_dens, "value", val) - - ! Check for erroneous density - sum_density = .false. - if (val <= ZERO) then - call fatal_error("Need to specify a positive density on material " & - // trim(to_str(mat % id)) // ".") - end if - - ! Adjust material density based on specified units - select case(to_lower(units)) - case ('g/cc', 'g/cm3') - mat % density = -val - case ('kg/m3') - mat % density = -0.001_8 * val - case ('atom/b-cm') - mat % density = val - case ('atom/cm3', 'atom/cc') - mat % density = 1.0e-24_8 * val - case default - call fatal_error("Unkwown units '" // trim(units) & - // "' specified on material " // trim(to_str(mat % id))) - end select - end if - ! ======================================================================= ! READ AND PARSE TAGS @@ -2308,17 +2238,8 @@ contains call get_node_value(node_nuc, "name", name) name = trim(name) - ! save name and density to list + ! save name to list call names % push_back(name) - - ! Check if no atom/weight percents were specified or if both atom and - ! weight percents were specified - if (units == 'macro') then - call densities % push_back(ONE) - else - call fatal_error("Units can only be macro for macroscopic data " & - // trim(name)) - end if else ! Get pointer list of XML @@ -2356,33 +2277,9 @@ contains call get_node_value(node_nuc, "name", name) name = trim(name) - ! save name and density to list + ! save name to list call names % push_back(name) - ! Check if no atom/weight percents were specified or if both atom and - ! weight percents were specified - if (units == 'macro') then - call densities % push_back(ONE) - else - if (.not. check_for_node(node_nuc, "ao") .and. & - .not. check_for_node(node_nuc, "wo")) then - call fatal_error("No atom or weight percent specified for nuclide " & - // trim(name)) - elseif (check_for_node(node_nuc, "ao") .and. & - check_for_node(node_nuc, "wo")) then - call fatal_error("Cannot specify both atom and weight percents for a & - &nuclide: " // trim(name)) - end if - - ! Copy atom/weight percents - if (check_for_node(node_nuc, "ao")) then - call get_node_value(node_nuc, "ao", temp_dble) - call densities % push_back(temp_dble) - else - call get_node_value(node_nuc, "wo", temp_dble) - call densities % push_back(-temp_dble) - end if - end if end do INDIVIDUAL_NUCLIDES end if @@ -2418,14 +2315,7 @@ contains n_nuc_ele = names % size() ! Expand element into naturally-occurring isotopes - if (check_for_node(node_ele, "ao")) then - call get_node_value(node_ele, "ao", temp_dble) - call expand_natural_element(name, temp_dble, names, & - densities) - else - call fatal_error("The ability to expand a natural element based on & - &weight percentage is not yet supported.") - end if + call expand_natural_element_names(name, names) ! Compute number of new nuclides from the natural element expansion n_nuc_ele = names % size() - n_nuc_ele @@ -2494,7 +2384,6 @@ contains ! Copy name and atom/weight percent mat % names(j) = name - mat % atom_density(j) = densities % data(j) ! Cast integer isotropic lab scattering flag to boolean if (run_CE) then @@ -2507,20 +2396,8 @@ contains end do ALL_NUCLIDES - ! Check to make sure either all atom percents or all weight percents are - ! given - if (.not. (all(mat % atom_density >= ZERO) .or. & - all(mat % atom_density <= ZERO))) then - call fatal_error("Cannot mix atom and weight percents in material " & - // to_str(mat % id)) - end if - - ! Determine density if it is a sum value - if (sum_density) mat % density = sum(mat % atom_density) - ! Clear lists call names % clear() - call densities % clear() call list_iso_lab % clear() ! ======================================================================= @@ -4703,11 +4580,9 @@ contains ! evaluations of particular isotopes don't exist. !=============================================================================== - subroutine expand_natural_element(name, density, names, densities) - character(*), intent(in) :: name - real(8), intent(in) :: density + subroutine expand_natural_element_names(name, names) + character(*), intent(in) :: name type(VectorChar), intent(inout) :: names - type(VectorReal), intent(inout) :: densities character(2) :: element_name @@ -4716,669 +4591,417 @@ contains select case (to_lower(element_name)) case ('h') call names % push_back('H1') - call densities % push_back(density * 0.999885_8) call names % push_back('H2') - call densities % push_back(density * 0.000115_8) case ('he') call names % push_back('He3') - call densities % push_back(density * 0.00000134_8) call names % push_back('He4') - call densities % push_back(density * 0.99999866_8) case ('li') call names % push_back('Li6') - call densities % push_back(density * 0.0759_8) call names % push_back('Li7') - call densities % push_back(density * 0.9241_8) case ('be') call names % push_back('Be9') - call densities % push_back(density) case ('b') call names % push_back('B10') - call densities % push_back(density * 0.199_8) call names % push_back('B11') - call densities % push_back(density * 0.801_8) case ('c') ! No evaluations split up Carbon into isotopes yet call names % push_back('C0') - call densities % push_back(density) case ('n') call names % push_back('N14') - call densities % push_back(density * 0.99636_8) call names % push_back('N15') - call densities % push_back(density * 0.00364_8) case ('o') if (default_expand == JEFF_32) then call names % push_back('O16') - call densities % push_back(density * 0.99757_8) call names % push_back('O17') - call densities % push_back(density * 0.00038_8) call names % push_back('O18') - call densities % push_back(density * 0.00205_8) elseif (default_expand >= JENDL_32 .and. default_expand <= JENDL_40) then call names % push_back('O16') - call densities % push_back(density) else call names % push_back('O16') - call densities % push_back(density * 0.99962_8) call names % push_back('O17') - call densities % push_back(density * 0.00038_8) end if case ('f') call names % push_back('F19') - call densities % push_back(density) case ('ne') call names % push_back('Ne20') - call densities % push_back(density * 0.9048_8) call names % push_back('Ne21') - call densities % push_back(density * 0.0027_8) call names % push_back('Ne22') - call densities % push_back(density * 0.0925_8) case ('na') call names % push_back('Na23') - call densities % push_back(density) case ('mg') call names % push_back('Mg24') - call densities % push_back(density * 0.7899_8) call names % push_back('Mg25') - call densities % push_back(density * 0.1000_8) call names % push_back('Mg26') - call densities % push_back(density * 0.1101_8) case ('al') call names % push_back('Al27') - call densities % push_back(density) case ('si') call names % push_back('Si28') - call densities % push_back(density * 0.92223_8) call names % push_back('Si29') - call densities % push_back(density * 0.04685_8) call names % push_back('Si30') - call densities % push_back(density * 0.03092_8) case ('p') call names % push_back('P31') - call densities % push_back(density) case ('s') call names % push_back('S32') - call densities % push_back(density * 0.9499_8) call names % push_back('S33') - call densities % push_back(density * 0.0075_8) call names % push_back('S34') - call densities % push_back(density * 0.0425_8) call names % push_back('S36') - call densities % push_back(density * 0.0001_8) case ('cl') call names % push_back('Cl35') - call densities % push_back(density * 0.7576_8) call names % push_back('Cl37') - call densities % push_back(density * 0.2424_8) case ('ar') call names % push_back('Ar36') - call densities % push_back(density * 0.003336_8) call names % push_back('Ar38') - call densities % push_back(density * 0.000629_8) call names % push_back('Ar40') - call densities % push_back(density * 0.996035_8) case ('k') call names % push_back('K39') - call densities % push_back(density * 0.932581_8) call names % push_back('K40') - call densities % push_back(density * 0.000117_8) call names % push_back('K41') - call densities % push_back(density * 0.067302_8) case ('ca') call names % push_back('Ca40') - call densities % push_back(density * 0.96941_8) call names % push_back('Ca42') - call densities % push_back(density * 0.00647_8) call names % push_back('Ca43') - call densities % push_back(density * 0.00135_8) call names % push_back('Ca44') - call densities % push_back(density * 0.02086_8) call names % push_back('Ca46') - call densities % push_back(density * 0.00004_8) call names % push_back('Ca48') - call densities % push_back(density * 0.00187_8) case ('sc') call names % push_back('Sc45') - call densities % push_back(density) case ('ti') call names % push_back('Ti46') - call densities % push_back(density * 0.0825_8) call names % push_back('Ti47') - call densities % push_back(density * 0.0744_8) call names % push_back('Ti48') - call densities % push_back(density * 0.7372_8) call names % push_back('Ti49') - call densities % push_back(density * 0.0541_8) call names % push_back('Ti50') - call densities % push_back(density * 0.0518_8) case ('v') if (default_expand == ENDF_BVII0 .or. default_expand == JEFF_311 & .or. default_expand == JEFF_32 .or. & (default_expand >= JENDL_32 .and. default_expand <= JENDL_33)) then call names % push_back('V0') - call densities % push_back(density) else call names % push_back('V50') - call densities % push_back(density * 0.0025_8) call names % push_back('V51') - call densities % push_back(density * 0.9975_8) end if case ('cr') call names % push_back('Cr50') - call densities % push_back(density * 0.04345_8) call names % push_back('Cr52') - call densities % push_back(density * 0.83789_8) call names % push_back('Cr53') - call densities % push_back(density * 0.09501_8) call names % push_back('Cr54') - call densities % push_back(density * 0.02365_8) case ('mn') call names % push_back('Mn55') - call densities % push_back(density) case ('fe') call names % push_back('Fe54') - call densities % push_back(density * 0.05845_8) call names % push_back('Fe56') - call densities % push_back(density * 0.91754_8) call names % push_back('Fe57') - call densities % push_back(density * 0.02119_8) call names % push_back('Fe58') - call densities % push_back(density * 0.00282_8) case ('co') call names % push_back('Co59') - call densities % push_back(density) case ('ni') call names % push_back('Ni58') - call densities % push_back(density * 0.68077_8) call names % push_back('Ni60') - call densities % push_back(density * 0.26223_8) call names % push_back('Ni61') - call densities % push_back(density * 0.011399_8) call names % push_back('Ni62') - call densities % push_back(density * 0.036346_8) call names % push_back('Ni64') - call densities % push_back(density * 0.009255_8) case ('cu') call names % push_back('Cu63') - call densities % push_back(density * 0.6915_8) call names % push_back('Cu65') - call densities % push_back(density * 0.3085_8) case ('zn') if (default_expand == ENDF_BVII0 .or. default_expand == & JEFF_311 .or. default_expand == JEFF_312) then call names % push_back('Zn0') - call densities % push_back(density) else call names % push_back('Zn64') - call densities % push_back(density * 0.4917_8) call names % push_back('Zn66') - call densities % push_back(density * 0.2773_8) call names % push_back('Zn67') - call densities % push_back(density * 0.0404_8) call names % push_back('Zn68') - call densities % push_back(density * 0.1845_8) call names % push_back('Zn70') - call densities % push_back(density * 0.0061_8) end if case ('ga') if (default_expand == JEFF_311 .or. default_expand == JEFF_312) then call names % push_back('Ga0') - call densities % push_back(density) else call names % push_back('Ga69') - call densities % push_back(density * 0.60108_8) call names % push_back('Ga71') - call densities % push_back(density * 0.39892_8) end if case ('ge') call names % push_back('Ge70') - call densities % push_back(density * 0.2057_8) call names % push_back('Ge72') - call densities % push_back(density * 0.2745_8) call names % push_back('Ge73') - call densities % push_back(density * 0.0775_8) call names % push_back('Ge74') - call densities % push_back(density * 0.3650_8) call names % push_back('Ge76') - call densities % push_back(density * 0.0773_8) case ('as') call names % push_back('As75') - call densities % push_back(density) case ('se') call names % push_back('Se74') - call densities % push_back(density * 0.0089_8) call names % push_back('Se76') - call densities % push_back(density * 0.0937_8) call names % push_back('Se77') - call densities % push_back(density * 0.0763_8) call names % push_back('Se78') - call densities % push_back(density * 0.2377_8) call names % push_back('Se80') - call densities % push_back(density * 0.4961_8) call names % push_back('Se82') - call densities % push_back(density * 0.0873_8) case ('br') call names % push_back('Br79') - call densities % push_back(density * 0.5069_8) call names % push_back('Br81') - call densities % push_back(density * 0.4931_8) case ('kr') call names % push_back('Kr78') - call densities % push_back(density * 0.00355_8) call names % push_back('Kr80') - call densities % push_back(density * 0.02286_8) call names % push_back('Kr82') - call densities % push_back(density * 0.11593_8) call names % push_back('Kr83') - call densities % push_back(density * 0.11500_8) call names % push_back('Kr84') - call densities % push_back(density * 0.56987_8) call names % push_back('Kr86') - call densities % push_back(density * 0.17279_8) case ('rb') call names % push_back('Rb85') - call densities % push_back(density * 0.7217_8) call names % push_back('Rb87') - call densities % push_back(density * 0.2783_8) case ('sr') call names % push_back('Sr84') - call densities % push_back(density * 0.0056_8) call names % push_back('Sr86') - call densities % push_back(density * 0.0986_8) call names % push_back('Sr87') - call densities % push_back(density * 0.0700_8) call names % push_back('Sr88') - call densities % push_back(density * 0.8258_8) case ('y') call names % push_back('Y89') - call densities % push_back(density) case ('zr') call names % push_back('Zr90') - call densities % push_back(density * 0.5145_8) call names % push_back('Zr91') - call densities % push_back(density * 0.1122_8) call names % push_back('Zr92') - call densities % push_back(density * 0.1715_8) call names % push_back('Zr94') - call densities % push_back(density * 0.1738_8) call names % push_back('Zr96') - call densities % push_back(density * 0.0280_8) case ('nb') call names % push_back('Nb93') - call densities % push_back(density) case ('mo') call names % push_back('Mo92') - call densities % push_back(density * 0.1453_8) call names % push_back('Mo94') - call densities % push_back(density * 0.0915_8) call names % push_back('Mo95') - call densities % push_back(density * 0.1584_8) call names % push_back('Mo96') - call densities % push_back(density * 0.1667_8) call names % push_back('Mo97') - call densities % push_back(density * 0.0960_8) call names % push_back('Mo98') - call densities % push_back(density * 0.2439_8) call names % push_back('Mo100') - call densities % push_back(density * 0.0982_8) case ('ru') call names % push_back('Ru96') - call densities % push_back(density * 0.0554_8) call names % push_back('Ru98') - call densities % push_back(density * 0.0187_8) call names % push_back('Ru99') - call densities % push_back(density * 0.1276_8) call names % push_back('Ru100') - call densities % push_back(density * 0.1260_8) call names % push_back('Ru101') - call densities % push_back(density * 0.1706_8) call names % push_back('Ru102') - call densities % push_back(density * 0.3155_8) call names % push_back('Ru104') - call densities % push_back(density * 0.1862_8) case ('rh') call names % push_back('Rh103') - call densities % push_back(density) case ('pd') call names % push_back('Pd102') - call densities % push_back(density * 0.0102_8) call names % push_back('Pd104') - call densities % push_back(density * 0.1114_8) call names % push_back('Pd105') - call densities % push_back(density * 0.2233_8) call names % push_back('Pd106') - call densities % push_back(density * 0.2733_8) call names % push_back('Pd108') - call densities % push_back(density * 0.2646_8) call names % push_back('Pd110') - call densities % push_back(density * 0.1172_8) case ('ag') call names % push_back('Ag107') - call densities % push_back(density * 0.51839_8) call names % push_back('Ag109') - call densities % push_back(density * 0.48161_8) case ('cd') call names % push_back('Cd106') - call densities % push_back(density * 0.0125_8) call names % push_back('Cd108') - call densities % push_back(density * 0.0089_8) call names % push_back('Cd110') - call densities % push_back(density * 0.1249_8) call names % push_back('Cd111') - call densities % push_back(density * 0.1280_8) call names % push_back('Cd112') - call densities % push_back(density * 0.2413_8) call names % push_back('Cd113') - call densities % push_back(density * 0.1222_8) call names % push_back('Cd114') - call densities % push_back(density * 0.2873_8) call names % push_back('Cd116') - call densities % push_back(density * 0.0749_8) case ('in') call names % push_back('In113') - call densities % push_back(density * 0.0429_8) call names % push_back('In115') - call densities % push_back(density * 0.9571_8) case ('sn') call names % push_back('Sn112') - call densities % push_back(density * 0.0097_8) call names % push_back('Sn114') - call densities % push_back(density * 0.0066_8) call names % push_back('Sn115') - call densities % push_back(density * 0.0034_8) call names % push_back('Sn116') - call densities % push_back(density * 0.1454_8) call names % push_back('Sn117') - call densities % push_back(density * 0.0768_8) call names % push_back('Sn118') - call densities % push_back(density * 0.2422_8) call names % push_back('Sn119') - call densities % push_back(density * 0.0859_8) call names % push_back('Sn120') - call densities % push_back(density * 0.3258_8) call names % push_back('Sn122') - call densities % push_back(density * 0.0463_8) call names % push_back('Sn124') - call densities % push_back(density * 0.0579_8) case ('sb') call names % push_back('Sb121') - call densities % push_back(density * 0.5721_8) call names % push_back('Sb123') - call densities % push_back(density * 0.4279_8) case ('te') call names % push_back('Te120') - call densities % push_back(density * 0.0009_8) call names % push_back('Te122') - call densities % push_back(density * 0.0255_8) call names % push_back('Te123') - call densities % push_back(density * 0.0089_8) call names % push_back('Te124') - call densities % push_back(density * 0.0474_8) call names % push_back('Te125') - call densities % push_back(density * 0.0707_8) call names % push_back('Te126') - call densities % push_back(density * 0.1884_8) call names % push_back('Te128') - call densities % push_back(density * 0.3174_8) call names % push_back('Te130') - call densities % push_back(density * 0.3408_8) case ('i') call names % push_back('I127') - call densities % push_back(density) case ('xe') call names % push_back('Xe124') - call densities % push_back(density * 0.000952_8) call names % push_back('Xe126') - call densities % push_back(density * 0.000890_8) call names % push_back('Xe128') - call densities % push_back(density * 0.019102_8) call names % push_back('Xe129') - call densities % push_back(density * 0.264006_8) call names % push_back('Xe130') - call densities % push_back(density * 0.040710_8) call names % push_back('Xe131') - call densities % push_back(density * 0.212324_8) call names % push_back('Xe132') - call densities % push_back(density * 0.269086_8) call names % push_back('Xe134') - call densities % push_back(density * 0.104357_8) call names % push_back('Xe136') - call densities % push_back(density * 0.088573_8) case ('cs') call names % push_back('Cs133') - call densities % push_back(density) case ('ba') call names % push_back('Ba130') - call densities % push_back(density * 0.00106_8) call names % push_back('Ba132') - call densities % push_back(density * 0.00101_8) call names % push_back('Ba134') - call densities % push_back(density * 0.02417_8) call names % push_back('Ba135') - call densities % push_back(density * 0.06592_8) call names % push_back('Ba136') - call densities % push_back(density * 0.07854_8) call names % push_back('Ba137') - call densities % push_back(density * 0.11232_8) call names % push_back('Ba138') - call densities % push_back(density * 0.71698_8) case ('la') call names % push_back('La138') - call densities % push_back(density * 0.0008881_8) call names % push_back('La139') - call densities % push_back(density * 0.9991119_8) case ('ce') call names % push_back('Ce136') - call densities % push_back(density * 0.00185_8) call names % push_back('Ce138') - call densities % push_back(density * 0.00251_8) call names % push_back('Ce140') - call densities % push_back(density * 0.88450_8) call names % push_back('Ce142') - call densities % push_back(density * 0.11114_8) case ('pr') call names % push_back('Pr141') - call densities % push_back(density) case ('nd') call names % push_back('Nd142') - call densities % push_back(density * 0.27152_8) call names % push_back('Nd143') - call densities % push_back(density * 0.12174_8) call names % push_back('Nd144') - call densities % push_back(density * 0.23798_8) call names % push_back('Nd145') - call densities % push_back(density * 0.08293_8) call names % push_back('Nd146') - call densities % push_back(density * 0.17189_8) call names % push_back('Nd148') - call densities % push_back(density * 0.05756_8) call names % push_back('Nd150') - call densities % push_back(density * 0.05638_8) case ('sm') call names % push_back('Sm144') - call densities % push_back(density * 0.0307_8) call names % push_back('Sm147') - call densities % push_back(density * 0.1499_8) call names % push_back('Sm148') - call densities % push_back(density * 0.1124_8) call names % push_back('Sm149') - call densities % push_back(density * 0.1382_8) call names % push_back('Sm150') - call densities % push_back(density * 0.0738_8) call names % push_back('Sm152') - call densities % push_back(density * 0.2675_8) call names % push_back('Sm154') - call densities % push_back(density * 0.2275_8) case ('eu') call names % push_back('Eu151') - call densities % push_back(density * 0.4781_8) call names % push_back('Eu153') - call densities % push_back(density * 0.5219_8) case ('gd') call names % push_back('Gd152') - call densities % push_back(density * 0.0020_8) call names % push_back('Gd154') - call densities % push_back(density * 0.0218_8) call names % push_back('Gd155') - call densities % push_back(density * 0.1480_8) call names % push_back('Gd156') - call densities % push_back(density * 0.2047_8) call names % push_back('Gd157') - call densities % push_back(density * 0.1565_8) call names % push_back('Gd158') - call densities % push_back(density * 0.2484_8) call names % push_back('Gd160') - call densities % push_back(density * 0.2186_8) case ('tb') call names % push_back('Tb159') - call densities % push_back(density) case ('dy') call names % push_back('Dy156') - call densities % push_back(density * 0.00056_8) call names % push_back('Dy158') - call densities % push_back(density * 0.00095_8) call names % push_back('Dy160') - call densities % push_back(density * 0.02329_8) call names % push_back('Dy161') - call densities % push_back(density * 0.18889_8) call names % push_back('Dy162') - call densities % push_back(density * 0.25475_8) call names % push_back('Dy163') - call densities % push_back(density * 0.24896_8) call names % push_back('Dy164') - call densities % push_back(density * 0.28260_8) case ('ho') call names % push_back('Ho165') - call densities % push_back(density) case ('er') call names % push_back('Er162') - call densities % push_back(density * 0.00139_8) call names % push_back('Er164') - call densities % push_back(density * 0.01601_8) call names % push_back('Er166') - call densities % push_back(density * 0.33503_8) call names % push_back('Er167') - call densities % push_back(density * 0.22869_8) call names % push_back('Er168') - call densities % push_back(density * 0.26978_8) call names % push_back('Er170') - call densities % push_back(density * 0.14910_8) case ('tm') call names % push_back('Tm169') - call densities % push_back(density) case ('yb') call names % push_back('Yb168') - call densities % push_back(density * 0.00123_8) call names % push_back('Yb170') - call densities % push_back(density * 0.02982_8) call names % push_back('Yb171') - call densities % push_back(density * 0.1409_8) call names % push_back('Yb172') - call densities % push_back(density * 0.2168_8) call names % push_back('Yb173') - call densities % push_back(density * 0.16103_8) call names % push_back('Yb174') - call densities % push_back(density * 0.32026_8) call names % push_back('Yb176') - call densities % push_back(density * 0.12996_8) case ('lu') call names % push_back('Lu175') - call densities % push_back(density * 0.97401_8) call names % push_back('Lu176') - call densities % push_back(density * 0.02599_8) case ('hf') call names % push_back('Hf174') - call densities % push_back(density * 0.0016_8) call names % push_back('Hf176') - call densities % push_back(density * 0.0526_8) call names % push_back('Hf177') - call densities % push_back(density * 0.1860_8) call names % push_back('Hf178') - call densities % push_back(density * 0.2728_8) call names % push_back('Hf179') - call densities % push_back(density * 0.1362_8) call names % push_back('Hf180') - call densities % push_back(density * 0.3508_8) case ('ta') if (default_expand == ENDF_BVII0 .or. & (default_expand >= JEFF_311 .and. default_expand <= JEFF_312) .or. & (default_expand >= JENDL_32 .and. default_expand <= JENDL_40)) then call names % push_back('Ta181') - call densities % push_back(density) else call names % push_back('Ta180') - call densities % push_back(density * 0.0001201_8) call names % push_back('Ta181') - call densities % push_back(density * 0.9998799_8) end if case ('w') @@ -5387,145 +5010,2292 @@ contains (default_expand >= JENDL_32 .and. default_expand <= JENDL_33)) then ! Combine W-180 with W-182 call names % push_back('W182') - call densities % push_back(density * 0.2662_8) call names % push_back('W183') - call densities % push_back(density * 0.1431_8) call names % push_back('W184') - call densities % push_back(density * 0.3064_8) call names % push_back('W186') - call densities % push_back(density * 0.2843_8) else call names % push_back('W180') - call densities % push_back(density * 0.0012_8) call names % push_back('W182') - call densities % push_back(density * 0.2650_8) call names % push_back('W183') - call densities % push_back(density * 0.1431_8) call names % push_back('W184') - call densities % push_back(density * 0.3064_8) call names % push_back('W186') - call densities % push_back(density * 0.2843_8) end if case ('re') call names % push_back('Re185') - call densities % push_back(density * 0.3740_8) call names % push_back('Re187') - call densities % push_back(density * 0.6260_8) case ('os') if (default_expand == JEFF_311 .or. default_expand == JEFF_312) then call names % push_back('Os0') - call densities % push_back(density) else call names % push_back('Os184') - call densities % push_back(density * 0.0002_8) call names % push_back('Os186') - call densities % push_back(density * 0.0159_8) call names % push_back('Os187') - call densities % push_back(density * 0.0196_8) call names % push_back('Os188') - call densities % push_back(density * 0.1324_8) call names % push_back('Os189') - call densities % push_back(density * 0.1615_8) call names % push_back('Os190') - call densities % push_back(density * 0.2626_8) call names % push_back('Os192') - call densities % push_back(density * 0.4078_8) end if case ('ir') call names % push_back('Ir191') - call densities % push_back(density * 0.373_8) call names % push_back('Ir193') - call densities % push_back(density * 0.627_8) case ('pt') if (default_expand == JEFF_311 .or. default_expand == JEFF_312) then call names % push_back('Pt0') - call densities % push_back(density) else call names % push_back('Pt190') - call densities % push_back(density * 0.00012_8) call names % push_back('Pt192') - call densities % push_back(density * 0.00782_8) call names % push_back('Pt194') - call densities % push_back(density * 0.3286_8) call names % push_back('Pt195') - call densities % push_back(density * 0.3378_8) call names % push_back('Pt196') - call densities % push_back(density * 0.2521_8) call names % push_back('Pt198') - call densities % push_back(density * 0.07356_8) end if case ('au') call names % push_back('Au197') - call densities % push_back(density) case ('hg') call names % push_back('Hg196') - call densities % push_back(density * 0.0015_8) call names % push_back('Hg198') - call densities % push_back(density * 0.0997_8) call names % push_back('Hg199') - call densities % push_back(density * 0.1687_8) call names % push_back('Hg200') - call densities % push_back(density * 0.2310_8) call names % push_back('Hg201') - call densities % push_back(density * 0.1318_8) call names % push_back('Hg202') - call densities % push_back(density * 0.2986_8) call names % push_back('Hg204') - call densities % push_back(density * 0.0687_8) case ('tl') if (default_expand == JEFF_311 .or. default_expand == JEFF_312) then call names % push_back('Tl0') - call densities % push_back(density) else call names % push_back('Tl203') - call densities % push_back(density * 0.2952_8) call names % push_back('Tl205') - call densities % push_back(density * 0.7048_8) end if case ('pb') call names % push_back('Pb204') - call densities % push_back(density * 0.014_8) call names % push_back('Pb206') - call densities % push_back(density * 0.241_8) call names % push_back('Pb207') - call densities % push_back(density * 0.221_8) call names % push_back('Pb208') - call densities % push_back(density * 0.524_8) case ('bi') call names % push_back('Bi209') - call densities % push_back(density) case ('th') call names % push_back('Th232') - call densities % push_back(density) case ('pa') call names % push_back('Pa231') - call densities % push_back(density) case ('u') call names % push_back('U234') - call densities % push_back(density * 0.000054_8) call names % push_back('U235') - call densities % push_back(density * 0.007204_8) call names % push_back('U238') - call densities % push_back(density * 0.992742_8) case default call fatal_error("Cannot expand element: " // name) end select - end subroutine expand_natural_element + end subroutine expand_natural_element_names + + + subroutine expand_natural_element_densities(name, expand_by, density, & + enrichment, densities) + character(*), intent(in) :: name + character(*), intent(in) :: expand_by + real(8), intent(in) :: density + real(8), intent(in) :: enrichment + type(VectorReal), intent(inout) :: densities + + integer :: i + integer :: n_isotopes + character(2) :: element_name + real(8) :: element_awr + real(8), allocatable :: awr(:) + real(8), allocatable :: mf(:) + + element_name = name(1:2) + + select case (to_lower(element_name)) + case ('h') + + ! Set the number of isotopes in this element + n_isotopes = 2 + + ! Allocate and initialize array for the atomic weight ratios + allocate(awr(n_isotopes)) + awr = ONE + + ! Allocate and initialize array for mole fractions + allocate(mf(n_isotopes)) + mf(1) = 0.999885_8 + mf(2) = 0.000115_8 + + ! Get the atomic weight ratios + if (expand_by == "wo") then + awr(1) = nuclides(nuclide_dict % get_key('h1')) % awr + awr(2) = nuclides(nuclide_dict % get_key('h2')) % awr + end if + + case ('he') + + ! Set the number of isotopes in this element + n_isotopes = 2 + + ! Allocate and initialize array for the atomic weight ratios + allocate(awr(n_isotopes)) + awr = ONE + + ! Allocate and initialize array for mole fractions + allocate(mf(n_isotopes)) + mf(1) = 0.00000134_8 + mf(2) = 0.99999866_8 + + ! Get the atomic weight ratios + if (expand_by == "wo") then + awr(1) = nuclides(nuclide_dict % get_key('he3')) % awr + awr(2) = nuclides(nuclide_dict % get_key('he4')) % awr + end if + + case ('li') + + ! Set the number of isotopes in this element + n_isotopes = 2 + + ! Allocate and initialize array for the atomic weight ratios + allocate(awr(n_isotopes)) + awr = ONE + + ! Allocate and initialize array for mole fractions + allocate(mf(n_isotopes)) + mf(1) = 0.0759_8 + mf(2) = 0.9241_8 + + ! Get the atomic weight ratios + if (expand_by == "wo") then + awr(1) = nuclides(nuclide_dict % get_key('li6')) % awr + awr(2) = nuclides(nuclide_dict % get_key('li7')) % awr + end if + + case ('be') + + ! Set the number of isotopes in this element + n_isotopes = 1 + + ! Allocate and initialize array for the atomic weight ratios + allocate(awr(n_isotopes)) + awr = ONE + + ! Allocate and initialize array for mole fractions + allocate(mf(n_isotopes)) + mf(1) = ONE + + ! Get the atomic weight ratios + if (expand_by == "wo") then + awr(1) = nuclides(nuclide_dict % get_key('be9')) % awr + end if + + case ('b') + + ! Set the number of isotopes in this element + n_isotopes = 2 + + ! Allocate and initialize array for the atomic weight ratios + allocate(awr(n_isotopes)) + awr = ONE + + ! Allocate and initialize array for mole fractions + allocate(mf(n_isotopes)) + mf(1) = 0.199_8 + mf(2) = 0.801_8 + + ! Get the atomic weight ratios + if (expand_by == "wo") then + awr(1) = nuclides(nuclide_dict % get_key('b10')) % awr + awr(2) = nuclides(nuclide_dict % get_key('b11')) % awr + end if + + case ('c') + + ! No evaluations split up Carbon into isotopes yet + + ! Set the number of isotopes in this element + n_isotopes = 1 + + ! Allocate and initialize array for the atomic weight ratios + allocate(awr(n_isotopes)) + awr = ONE + + ! Allocate and initialize array for mole fractions + allocate(mf(n_isotopes)) + mf(1) = ONE + + ! Get the atomic weight ratios + if (expand_by == "wo") then + awr(1) = nuclides(nuclide_dict % get_key('c0')) % awr + end if + + case ('n') + + ! Set the number of isotopes in this element + n_isotopes = 2 + + ! Allocate and initialize array for the atomic weight ratios + allocate(awr(n_isotopes)) + awr = ONE + + ! Allocate and initialize array for mole fractions + allocate(mf(n_isotopes)) + mf(1) = 0.99636_8 + mf(2) = 0.00364_8 + + ! Get the atomic weight ratios + if (expand_by == "wo") then + awr(1) = nuclides(nuclide_dict % get_key('n14')) % awr + awr(2) = nuclides(nuclide_dict % get_key('n15')) % awr + end if + + case ('o') + if (default_expand == JEFF_32) then + + ! Set the number of isotopes in this element + n_isotopes = 3 + + ! Allocate and initialize array for the atomic weight ratios + allocate(awr(n_isotopes)) + awr = ONE + + ! Allocate and initialize array for mole fractions + allocate(mf(n_isotopes)) + mf(1) = 0.99757_8 + mf(2) = 0.00038_8 + mf(3) = 0.00205_8 + + ! Get the atomic weight ratios + if (expand_by == "wo") then + awr(1) = nuclides(nuclide_dict % get_key('o16')) % awr + awr(2) = nuclides(nuclide_dict % get_key('o17')) % awr + awr(3) = nuclides(nuclide_dict % get_key('o18')) % awr + end if + elseif (default_expand >= JENDL_32 .and. default_expand <= JENDL_40) then + + ! Set the number of isotopes in this element + n_isotopes = 1 + + ! Allocate and initialize array for the atomic weight ratios + allocate(awr(n_isotopes)) + awr = ONE + + ! Allocate and initialize array for mole fractions + allocate(mf(n_isotopes)) + mf(1) = ONE + + ! Get the atomic weight ratios + if (expand_by == "wo") then + awr(1) = nuclides(nuclide_dict % get_key('o16')) % awr + end if + else + + ! Set the number of isotopes in this element + n_isotopes = 2 + + ! Allocate and initialize array for the atomic weight ratios + allocate(awr(n_isotopes)) + awr = ONE + + ! Allocate and initialize array for mole fractions + allocate(mf(n_isotopes)) + mf(1) = 0.99962_8 + mf(2) = 0.00038_8 + + ! Get the atomic weight ratios + if (expand_by == "wo") then + awr(1) = nuclides(nuclide_dict % get_key('o16')) % awr + awr(2) = nuclides(nuclide_dict % get_key('o17')) % awr + end if + end if + + case ('f') + + ! Set the number of isotopes in this element + n_isotopes = 1 + + ! Allocate and initialize array for the atomic weight ratios + allocate(awr(n_isotopes)) + awr = ONE + + ! Allocate and initialize array for mole fractions + allocate(mf(n_isotopes)) + mf(1) = ONE + + ! Get the atomic weight ratios + if (expand_by == "wo") then + awr(1) = nuclides(nuclide_dict % get_key('f19')) % awr + end if + + case ('ne') + + ! Set the number of isotopes in this element + n_isotopes = 3 + + ! Allocate and initialize array for the atomic weight ratios + allocate(awr(n_isotopes)) + awr = ONE + + ! Allocate and initialize array for mole fractions + allocate(mf(n_isotopes)) + mf(1) = 0.9048_8 + mf(2) = 0.0027_8 + mf(3) = 0.0925_8 + + ! Get the atomic weight ratios + if (expand_by == "wo") then + awr(1) = nuclides(nuclide_dict % get_key('ne20')) % awr + awr(2) = nuclides(nuclide_dict % get_key('ne21')) % awr + awr(3) = nuclides(nuclide_dict % get_key('ne22')) % awr + end if + + case ('na') + + ! Set the number of isotopes in this element + n_isotopes = 1 + + ! Allocate and initialize array for the atomic weight ratios + allocate(awr(n_isotopes)) + awr = ONE + + ! Allocate and initialize array for mole fractions + allocate(mf(n_isotopes)) + mf(1) = ONE + + ! Get the atomic weight ratios + if (expand_by == "wo") then + awr(1) = nuclides(nuclide_dict % get_key('na23')) % awr + end if + + case ('mg') + + ! Set the number of isotopes in this element + n_isotopes = 3 + + ! Allocate and initialize array for the atomic weight ratios + allocate(awr(n_isotopes)) + awr = ONE + + ! Allocate and initialize array for mole fractions + allocate(mf(n_isotopes)) + mf(1) = 0.7899_8 + mf(2) = 0.1000_8 + mf(3) = 0.1101_8 + + ! Get the atomic weight ratios + if (expand_by == "wo") then + awr(1) = nuclides(nuclide_dict % get_key('mg24')) % awr + awr(2) = nuclides(nuclide_dict % get_key('mg25')) % awr + awr(3) = nuclides(nuclide_dict % get_key('mg26')) % awr + end if + + case ('al') + + ! Set the number of isotopes in this element + n_isotopes = 1 + + ! Allocate and initialize array for the atomic weight ratios + allocate(awr(n_isotopes)) + awr = ONE + + ! Allocate and initialize array for mole fractions + allocate(mf(n_isotopes)) + mf(1) = ONE + + ! Get the atomic weight ratios + if (expand_by == "wo") then + awr(1) = nuclides(nuclide_dict % get_key('al27')) % awr + end if + + case ('si') + + ! Set the number of isotopes in this element + n_isotopes = 3 + + ! Allocate and initialize array for the atomic weight ratios + allocate(awr(n_isotopes)) + awr = ONE + + ! Allocate and initialize array for mole fractions + allocate(mf(n_isotopes)) + mf(1) = 0.92223_8 + mf(2) = 0.04685_8 + mf(3) = 0.03092_8 + + ! Get the atomic weight ratios + if (expand_by == "wo") then + awr(1) = nuclides(nuclide_dict % get_key('si28')) % awr + awr(2) = nuclides(nuclide_dict % get_key('si29')) % awr + awr(3) = nuclides(nuclide_dict % get_key('si30')) % awr + end if + + case ('p') + + ! Set the number of isotopes in this element + n_isotopes = 1 + + ! Allocate and initialize array for the atomic weight ratios + allocate(awr(n_isotopes)) + awr = ONE + + ! Allocate and initialize array for mole fractions + allocate(mf(n_isotopes)) + mf(1) = ONE + + ! Get the atomic weight ratios + if (expand_by == "wo") then + awr(1) = nuclides(nuclide_dict % get_key('p31')) % awr + end if + + case ('s') + + ! Set the number of isotopes in this element + n_isotopes = 4 + + ! Allocate and initialize array for the atomic weight ratios + allocate(awr(n_isotopes)) + awr = ONE + + ! Allocate and initialize array for mole fractions + allocate(mf(n_isotopes)) + mf(1) = 0.9499_8 + mf(2) = 0.0075_8 + mf(3) = 0.0425_8 + mf(4) = 0.0001_8 + + ! Get the atomic weight ratios + if (expand_by == "wo") then + awr(1) = nuclides(nuclide_dict % get_key('s32')) % awr + awr(2) = nuclides(nuclide_dict % get_key('s33')) % awr + awr(3) = nuclides(nuclide_dict % get_key('s34')) % awr + awr(4) = nuclides(nuclide_dict % get_key('s36')) % awr + end if + + case ('cl') + + ! Set the number of isotopes in this element + n_isotopes = 2 + + ! Allocate and initialize array for the atomic weight ratios + allocate(awr(n_isotopes)) + awr = ONE + + ! Allocate and initialize array for mole fractions + allocate(mf(n_isotopes)) + mf(1) = 0.7576_8 + mf(2) = 0.2424_8 + + ! Get the atomic weight ratios + if (expand_by == "wo") then + awr(1) = nuclides(nuclide_dict % get_key('cl35')) % awr + awr(2) = nuclides(nuclide_dict % get_key('cl37')) % awr + end if + + case ('ar') + + ! Set the number of isotopes in this element + n_isotopes = 3 + + ! Allocate and initialize array for the atomic weight ratios + allocate(awr(n_isotopes)) + awr = ONE + + ! Allocate and initialize array for mole fractions + allocate(mf(n_isotopes)) + mf(1) = 0.003336_8 + mf(2) = 0.000629_8 + mf(3) = 0.996035_8 + + ! Get the atomic weight ratios + if (expand_by == "wo") then + awr(1) = nuclides(nuclide_dict % get_key('ar36')) % awr + awr(2) = nuclides(nuclide_dict % get_key('ar38')) % awr + awr(3) = nuclides(nuclide_dict % get_key('ar40')) % awr + end if + + case ('k') + + ! Set the number of isotopes in this element + n_isotopes = 3 + + ! Allocate and initialize array for the atomic weight ratios + allocate(awr(n_isotopes)) + awr = ONE + + ! Allocate and initialize array for mole fractions + allocate(mf(n_isotopes)) + mf(1) = 0.932581_8 + mf(2) = 0.000117_8 + mf(3) = 0.067302_8 + + ! Get the atomic weight ratios + if (expand_by == "wo") then + awr(1) = nuclides(nuclide_dict % get_key('k39')) % awr + awr(2) = nuclides(nuclide_dict % get_key('k40')) % awr + awr(3) = nuclides(nuclide_dict % get_key('k41')) % awr + end if + + case ('ca') + + ! Set the number of isotopes in this element + n_isotopes = 6 + + ! Allocate and initialize array for the atomic weight ratios + allocate(awr(n_isotopes)) + awr = ONE + + ! Allocate and initialize array for mole fractions + allocate(mf(n_isotopes)) + mf(1) = 0.96941_8 + mf(2) = 0.00647_8 + mf(3) = 0.00135_8 + mf(4) = 0.02086_8 + mf(5) = 0.00004_8 + mf(6) = 0.00187_8 + + ! Get the atomic weight ratios + if (expand_by == "wo") then + awr(1) = nuclides(nuclide_dict % get_key('ca40')) % awr + awr(2) = nuclides(nuclide_dict % get_key('ca42')) % awr + awr(3) = nuclides(nuclide_dict % get_key('ca43')) % awr + awr(4) = nuclides(nuclide_dict % get_key('ca44')) % awr + awr(5) = nuclides(nuclide_dict % get_key('ca46')) % awr + awr(6) = nuclides(nuclide_dict % get_key('ca48')) % awr + end if + + case ('sc') + + ! Set the number of isotopes in this element + n_isotopes = 1 + + ! Allocate and initialize array for the atomic weight ratios + allocate(awr(n_isotopes)) + awr = ONE + + ! Allocate and initialize array for mole fractions + allocate(mf(n_isotopes)) + mf(1) = ONE + + ! Get the atomic weight ratios + if (expand_by == "wo") then + awr(1) = nuclides(nuclide_dict % get_key('sc45')) % awr + end if + + case ('ti') + + ! Set the number of isotopes in this element + n_isotopes = 5 + + ! Allocate and initialize array for the atomic weight ratios + allocate(awr(n_isotopes)) + awr = ONE + + ! Allocate and initialize array for mole fractions + allocate(mf(n_isotopes)) + mf(1) = 0.0825_8 + mf(2) = 0.0744_8 + mf(3) = 0.7372_8 + mf(4) = 0.0541_8 + mf(5) = 0.0518_8 + + ! Get the atomic weight ratios + if (expand_by == "wo") then + awr(1) = nuclides(nuclide_dict % get_key('ti46')) % awr + awr(2) = nuclides(nuclide_dict % get_key('ti47')) % awr + awr(3) = nuclides(nuclide_dict % get_key('ti48')) % awr + awr(4) = nuclides(nuclide_dict % get_key('ti49')) % awr + awr(5) = nuclides(nuclide_dict % get_key('ti50')) % awr + end if + + case ('v') + if (default_expand == ENDF_BVII0 .or. default_expand == JEFF_311 & + .or. default_expand == JEFF_32 .or. & + (default_expand >= JENDL_32 .and. default_expand <= JENDL_33)) then + + ! Set the number of isotopes in this element + n_isotopes = 1 + + ! Allocate and initialize array for the atomic weight ratios + allocate(awr(n_isotopes)) + awr = ONE + + ! Allocate and initialize array for mole fractions + allocate(mf(n_isotopes)) + mf(1) = ONE + + ! Get the atomic weight ratios + if (expand_by == "wo") then + awr(1) = nuclides(nuclide_dict % get_key('v0')) % awr + end if + + else + + ! Set the number of isotopes in this element + n_isotopes = 2 + + ! Allocate and initialize array for the atomic weight ratios + allocate(awr(n_isotopes)) + awr = ONE + + ! Allocate and initialize array for mole fractions + allocate(mf(n_isotopes)) + mf(1) = 0.0025_8 + mf(2) = 0.9975_8 + + ! Get the atomic weight ratios + if (expand_by == "wo") then + awr(1) = nuclides(nuclide_dict % get_key('v50')) % awr + awr(2) = nuclides(nuclide_dict % get_key('v51')) % awr + end if + end if + + case ('cr') + + ! Set the number of isotopes in this element + n_isotopes = 4 + + ! Allocate and initialize array for the atomic weight ratios + allocate(awr(n_isotopes)) + awr = ONE + + ! Allocate and initialize array for mole fractions + allocate(mf(n_isotopes)) + mf(1) = 0.04345_8 + mf(2) = 0.83789_8 + mf(3) = 0.09501_8 + mf(4) = 0.02365_8 + + ! Get the atomic weight ratios + if (expand_by == "wo") then + awr(1) = nuclides(nuclide_dict % get_key('cr50')) % awr + awr(2) = nuclides(nuclide_dict % get_key('cr52')) % awr + awr(3) = nuclides(nuclide_dict % get_key('cr53')) % awr + awr(4) = nuclides(nuclide_dict % get_key('cr54')) % awr + end if + + case ('mn') + + ! Set the number of isotopes in this element + n_isotopes = 1 + + ! Allocate and initialize array for the atomic weight ratios + allocate(awr(n_isotopes)) + awr = ONE + + ! Allocate and initialize array for mole fractions + allocate(mf(n_isotopes)) + mf(1) = ONE + + ! Get the atomic weight ratios + if (expand_by == "wo") then + awr(1) = nuclides(nuclide_dict % get_key('mn55')) % awr + end if + + case ('fe') + + ! Set the number of isotopes in this element + n_isotopes = 4 + + ! Allocate and initialize array for the atomic weight ratios + allocate(awr(n_isotopes)) + awr = ONE + + ! Allocate and initialize array for mole fractions + allocate(mf(n_isotopes)) + mf(1) = 0.05845_8 + mf(2) = 0.91754_8 + mf(3) = 0.02119_8 + mf(4) = 0.00282_8 + + ! Get the atomic weight ratios + if (expand_by == "wo") then + awr(1) = nuclides(nuclide_dict % get_key('fe54')) % awr + awr(2) = nuclides(nuclide_dict % get_key('fe56')) % awr + awr(3) = nuclides(nuclide_dict % get_key('fe57')) % awr + awr(4) = nuclides(nuclide_dict % get_key('fe58')) % awr + end if + + case ('co') + + ! Set the number of isotopes in this element + n_isotopes = 1 + + ! Allocate and initialize array for the atomic weight ratios + allocate(awr(n_isotopes)) + awr = ONE + + ! Allocate and initialize array for mole fractions + allocate(mf(n_isotopes)) + mf(1) = ONE + + ! Get the atomic weight ratios + if (expand_by == "wo") then + awr(1) = nuclides(nuclide_dict % get_key('co59')) % awr + end if + + case ('ni') + + ! Set the number of isotopes in this element + n_isotopes = 5 + + ! Allocate and initialize array for the atomic weight ratios + allocate(awr(n_isotopes)) + awr = ONE + + ! Allocate and initialize array for mole fractions + allocate(mf(n_isotopes)) + mf(1) = 0.68077_8 + mf(2) = 0.26223_8 + mf(3) = 0.011399_8 + mf(4) = 0.036346_8 + mf(5) = 0.009255_8 + + ! Get the atomic weight ratios + if (expand_by == "wo") then + awr(1) = nuclides(nuclide_dict % get_key('ni58')) % awr + awr(2) = nuclides(nuclide_dict % get_key('ni60')) % awr + awr(3) = nuclides(nuclide_dict % get_key('ni61')) % awr + awr(4) = nuclides(nuclide_dict % get_key('ni62')) % awr + awr(5) = nuclides(nuclide_dict % get_key('ni64')) % awr + end if + + case ('cu') + + ! Set the number of isotopes in this element + n_isotopes = 2 + + ! Allocate and initialize array for the atomic weight ratios + allocate(awr(n_isotopes)) + awr = ONE + + ! Allocate and initialize array for mole fractions + allocate(mf(n_isotopes)) + mf(1) = 0.6915_8 + mf(2) = 0.3085_8 + + ! Get the atomic weight ratios + if (expand_by == "wo") then + awr(1) = nuclides(nuclide_dict % get_key('cu63')) % awr + awr(2) = nuclides(nuclide_dict % get_key('cu65')) % awr + end if + + case ('zn') + if (default_expand == ENDF_BVII0 .or. default_expand == & + JEFF_311 .or. default_expand == JEFF_312) then + + ! Set the number of isotopes in this element + n_isotopes = 1 + + ! Allocate and initialize array for the atomic weight ratios + allocate(awr(n_isotopes)) + awr = ONE + + ! Allocate and initialize array for mole fractions + allocate(mf(n_isotopes)) + mf(1) = ONE + + ! Get the atomic weight ratios + if (expand_by == "wo") then + awr(1) = nuclides(nuclide_dict % get_key('zn0')) % awr + end if + + else + + ! Set the number of isotopes in this element + n_isotopes = 5 + + ! Allocate and initialize array for the atomic weight ratios + allocate(awr(n_isotopes)) + awr = ONE + + ! Allocate and initialize array for mole fractions + allocate(mf(n_isotopes)) + mf(1) = 0.4917_8 + mf(2) = 0.2773_8 + mf(3) = 0.0404_8 + mf(4) = 0.1845_8 + mf(5) = 0.0061_8 + + ! Get the atomic weight ratios + if (expand_by == "wo") then + awr(1) = nuclides(nuclide_dict % get_key('zn64')) % awr + awr(2) = nuclides(nuclide_dict % get_key('zn66')) % awr + awr(3) = nuclides(nuclide_dict % get_key('zn67')) % awr + awr(4) = nuclides(nuclide_dict % get_key('zn68')) % awr + awr(5) = nuclides(nuclide_dict % get_key('zn70')) % awr + end if + end if + + case ('ga') + if (default_expand == JEFF_311 .or. default_expand == JEFF_312) then + + ! Set the number of isotopes in this element + n_isotopes = 1 + + ! Allocate and initialize array for the atomic weight ratios + allocate(awr(n_isotopes)) + awr = ONE + + ! Allocate and initialize array for mole fractions + allocate(mf(n_isotopes)) + mf(1) = ONE + + ! Get the atomic weight ratios + if (expand_by == "wo") then + awr(1) = nuclides(nuclide_dict % get_key('ga0')) % awr + end if + else + + ! Set the number of isotopes in this element + n_isotopes = 2 + + ! Allocate and initialize array for the atomic weight ratios + allocate(awr(n_isotopes)) + awr = ONE + + ! Allocate and initialize array for mole fractions + allocate(mf(n_isotopes)) + mf(1) = 0.60108_8 + mf(2) = 0.39892_8 + + ! Get the atomic weight ratios + if (expand_by == "wo") then + awr(1) = nuclides(nuclide_dict % get_key('ga69')) % awr + awr(2) = nuclides(nuclide_dict % get_key('ga71')) % awr + end if + end if + + case ('ge') + + ! Set the number of isotopes in this element + n_isotopes = 5 + + ! Allocate and initialize array for the atomic weight ratios + allocate(awr(n_isotopes)) + awr = ONE + + ! Allocate and initialize array for mole fractions + allocate(mf(n_isotopes)) + mf(1) = 0.2057_8 + mf(2) = 0.2745_8 + mf(3) = 0.0775_8 + mf(4) = 0.3650_8 + mf(5) = 0.0773_8 + + ! Get the atomic weight ratios + if (expand_by == "wo") then + awr(1) = nuclides(nuclide_dict % get_key('ge70')) % awr + awr(2) = nuclides(nuclide_dict % get_key('ge72')) % awr + awr(3) = nuclides(nuclide_dict % get_key('ge73')) % awr + awr(4) = nuclides(nuclide_dict % get_key('ge74')) % awr + awr(5) = nuclides(nuclide_dict % get_key('ge76')) % awr + end if + + case ('as') + + ! Set the number of isotopes in this element + n_isotopes = 1 + + ! Allocate and initialize array for the atomic weight ratios + allocate(awr(n_isotopes)) + awr = ONE + + ! Allocate and initialize array for mole fractions + allocate(mf(n_isotopes)) + mf(1) = ONE + + ! Get the atomic weight ratios + if (expand_by == "wo") then + awr(1) = nuclides(nuclide_dict % get_key('as75')) % awr + end if + + case ('se') + + ! Set the number of isotopes in this element + n_isotopes = 6 + + ! Allocate and initialize array for the atomic weight ratios + allocate(awr(n_isotopes)) + awr = ONE + + ! Allocate and initialize array for mole fractions + allocate(mf(n_isotopes)) + mf(1) = 0.0089_8 + mf(2) = 0.0937_8 + mf(3) = 0.0763_8 + mf(4) = 0.2377_8 + mf(5) = 0.4961_8 + mf(6) = 0.0873_8 + + ! Get the atomic weight ratios + if (expand_by == "wo") then + awr(1) = nuclides(nuclide_dict % get_key('se74')) % awr + awr(2) = nuclides(nuclide_dict % get_key('se76')) % awr + awr(3) = nuclides(nuclide_dict % get_key('se77')) % awr + awr(4) = nuclides(nuclide_dict % get_key('se78')) % awr + awr(5) = nuclides(nuclide_dict % get_key('se80')) % awr + awr(6) = nuclides(nuclide_dict % get_key('se82')) % awr + end if + + case ('br') + + ! Set the number of isotopes in this element + n_isotopes = 2 + + ! Allocate and initialize array for the atomic weight ratios + allocate(awr(n_isotopes)) + awr = ONE + + ! Allocate and initialize array for mole fractions + allocate(mf(n_isotopes)) + mf(1) = 0.5069_8 + mf(2) = 0.4931_8 + + ! Get the atomic weight ratios + if (expand_by == "wo") then + awr(1) = nuclides(nuclide_dict % get_key('br79')) % awr + awr(2) = nuclides(nuclide_dict % get_key('br81')) % awr + end if + + case ('kr') + + ! Set the number of isotopes in this element + n_isotopes = 6 + + ! Allocate and initialize array for the atomic weight ratios + allocate(awr(n_isotopes)) + awr = ONE + + ! Allocate and initialize array for mole fractions + allocate(mf(n_isotopes)) + mf(1) = 0.00355_8 + mf(2) = 0.02286_8 + mf(3) = 0.11593_8 + mf(4) = 0.11500_8 + mf(5) = 0.56987_8 + mf(6) = 0.17279_8 + + ! Get the atomic weight ratios + if (expand_by == "wo") then + awr(1) = nuclides(nuclide_dict % get_key('kr78')) % awr + awr(2) = nuclides(nuclide_dict % get_key('kr80')) % awr + awr(3) = nuclides(nuclide_dict % get_key('kr82')) % awr + awr(4) = nuclides(nuclide_dict % get_key('kr83')) % awr + awr(5) = nuclides(nuclide_dict % get_key('kr84')) % awr + awr(6) = nuclides(nuclide_dict % get_key('kr86')) % awr + end if + + case ('rb') + + ! Set the number of isotopes in this element + n_isotopes = 2 + + ! Allocate and initialize array for the atomic weight ratios + allocate(awr(n_isotopes)) + awr = ONE + + ! Allocate and initialize array for mole fractions + allocate(mf(n_isotopes)) + mf(1) = 0.7217_8 + mf(2) = 0.2783_8 + + ! Get the atomic weight ratios + if (expand_by == "wo") then + awr(1) = nuclides(nuclide_dict % get_key('rb85')) % awr + awr(2) = nuclides(nuclide_dict % get_key('rb87')) % awr + end if + + case ('sr') + + ! Set the number of isotopes in this element + n_isotopes = 4 + + ! Allocate and initialize array for the atomic weight ratios + allocate(awr(n_isotopes)) + awr = ONE + + ! Allocate and initialize array for mole fractions + allocate(mf(n_isotopes)) + mf(1) = 0.0056_8 + mf(2) = 0.0986_8 + mf(3) = 0.0700_8 + mf(4) = 0.8258_8 + + ! Get the atomic weight ratios + if (expand_by == "wo") then + awr(1) = nuclides(nuclide_dict % get_key('sr84')) % awr + awr(2) = nuclides(nuclide_dict % get_key('sr86')) % awr + awr(3) = nuclides(nuclide_dict % get_key('sr87')) % awr + awr(4) = nuclides(nuclide_dict % get_key('sr88')) % awr + end if + + case ('y') + + ! Set the number of isotopes in this element + n_isotopes = 1 + + ! Allocate and initialize array for the atomic weight ratios + allocate(awr(n_isotopes)) + awr = ONE + + ! Allocate and initialize array for mole fractions + allocate(mf(n_isotopes)) + mf(1) = ONE + + ! Get the atomic weight ratios + if (expand_by == "wo") then + awr(1) = nuclides(nuclide_dict % get_key('y89')) % awr + end if + + case ('zr') + + ! Set the number of isotopes in this element + n_isotopes = 5 + + ! Allocate and initialize array for the atomic weight ratios + allocate(awr(n_isotopes)) + awr = ONE + + ! Allocate and initialize array for mole fractions + allocate(mf(n_isotopes)) + mf(1) = 0.5145_8 + mf(2) = 0.1122_8 + mf(3) = 0.1715_8 + mf(4) = 0.1738_8 + mf(5) = 0.0280_8 + + ! Get the atomic weight ratios + if (expand_by == "wo") then + awr(1) = nuclides(nuclide_dict % get_key('zr90')) % awr + awr(2) = nuclides(nuclide_dict % get_key('zr91')) % awr + awr(3) = nuclides(nuclide_dict % get_key('zr92')) % awr + awr(4) = nuclides(nuclide_dict % get_key('zr94')) % awr + awr(5) = nuclides(nuclide_dict % get_key('zr96')) % awr + end if + + case ('nb') + + ! Set the number of isotopes in this element + n_isotopes = 1 + + ! Allocate and initialize array for the atomic weight ratios + allocate(awr(n_isotopes)) + awr = ONE + + ! Allocate and initialize array for mole fractions + allocate(mf(n_isotopes)) + mf(1) = ONE + + ! Get the atomic weight ratios + if (expand_by == "wo") then + awr(1) = nuclides(nuclide_dict % get_key('nb93')) % awr + end if + + case ('mo') + + ! Set the number of isotopes in this element + n_isotopes = 7 + + ! Allocate and initialize array for the atomic weight ratios + allocate(awr(n_isotopes)) + awr = ONE + + ! Allocate and initialize array for mole fractions + allocate(mf(n_isotopes)) + mf(1) = 0.1453_8 + mf(2) = 0.0915_8 + mf(3) = 0.1584_8 + mf(4) = 0.1667_8 + mf(5) = 0.0960_8 + mf(6) = 0.2439_8 + mf(7) = 0.0982_8 + + ! Get the atomic weight ratios + if (expand_by == "wo") then + awr(1) = nuclides(nuclide_dict % get_key('mo92')) % awr + awr(2) = nuclides(nuclide_dict % get_key('mo94')) % awr + awr(3) = nuclides(nuclide_dict % get_key('mo95')) % awr + awr(4) = nuclides(nuclide_dict % get_key('mo96')) % awr + awr(5) = nuclides(nuclide_dict % get_key('mo97')) % awr + awr(6) = nuclides(nuclide_dict % get_key('mo98')) % awr + awr(7) = nuclides(nuclide_dict % get_key('mo100')) % awr + end if + + case ('ru') + + ! Set the number of isotopes in this element + n_isotopes = 7 + + ! Allocate and initialize array for the atomic weight ratios + allocate(awr(n_isotopes)) + awr = ONE + + ! Allocate and initialize array for mole fractions + allocate(mf(n_isotopes)) + mf(1) = 0.0554_8 + mf(2) = 0.0187_8 + mf(3) = 0.1276_8 + mf(4) = 0.1260_8 + mf(5) = 0.1706_8 + mf(6) = 0.3155_8 + mf(7) = 0.1862_8 + + ! Get the atomic weight ratios + if (expand_by == "wo") then + awr(1) = nuclides(nuclide_dict % get_key('ru96')) % awr + awr(2) = nuclides(nuclide_dict % get_key('ru98')) % awr + awr(3) = nuclides(nuclide_dict % get_key('ru99')) % awr + awr(4) = nuclides(nuclide_dict % get_key('ru100')) % awr + awr(5) = nuclides(nuclide_dict % get_key('ru101')) % awr + awr(6) = nuclides(nuclide_dict % get_key('ru102')) % awr + awr(7) = nuclides(nuclide_dict % get_key('ru104')) % awr + end if + + case ('rh') + + ! Set the number of isotopes in this element + n_isotopes = 1 + + ! Allocate and initialize array for the atomic weight ratios + allocate(awr(n_isotopes)) + awr = ONE + + ! Allocate and initialize array for mole fractions + allocate(mf(n_isotopes)) + mf(1) = ONE + + ! Get the atomic weight ratios + if (expand_by == "wo") then + awr(1) = nuclides(nuclide_dict % get_key('rh103')) % awr + end if + + case ('pd') + + ! Set the number of isotopes in this element + n_isotopes = 6 + + ! Allocate and initialize array for the atomic weight ratios + allocate(awr(n_isotopes)) + awr = ONE + + ! Allocate and initialize array for mole fractions + allocate(mf(n_isotopes)) + mf(1) = 0.0102_8 + mf(2) = 0.1114_8 + mf(3) = 0.2233_8 + mf(4) = 0.2733_8 + mf(5) = 0.2646_8 + mf(6) = 0.1172_8 + + ! Get the atomic weight ratios + if (expand_by == "wo") then + awr(1) = nuclides(nuclide_dict % get_key('pd102')) % awr + awr(2) = nuclides(nuclide_dict % get_key('pd104')) % awr + awr(3) = nuclides(nuclide_dict % get_key('pd105')) % awr + awr(4) = nuclides(nuclide_dict % get_key('pd106')) % awr + awr(5) = nuclides(nuclide_dict % get_key('pd108')) % awr + awr(6) = nuclides(nuclide_dict % get_key('pd110')) % awr + end if + + case ('ag') + + ! Set the number of isotopes in this element + n_isotopes = 2 + + ! Allocate and initialize array for the atomic weight ratios + allocate(awr(n_isotopes)) + awr = ONE + + ! Allocate and initialize array for mole fractions + allocate(mf(n_isotopes)) + mf(1) = 0.51839_8 + mf(2) = 0.48161_8 + + ! Get the atomic weight ratios + if (expand_by == "wo") then + awr(1) = nuclides(nuclide_dict % get_key('ag107')) % awr + awr(2) = nuclides(nuclide_dict % get_key('ag109')) % awr + end if + + case ('cd') + + ! Set the number of isotopes in this element + n_isotopes = 8 + + ! Allocate and initialize array for the atomic weight ratios + allocate(awr(n_isotopes)) + awr = ONE + + ! Allocate and initialize array for mole fractions + allocate(mf(n_isotopes)) + mf(1) = 0.0125_8 + mf(2) = 0.0089_8 + mf(3) = 0.1249_8 + mf(4) = 0.1280_8 + mf(5) = 0.2413_8 + mf(6) = 0.1222_8 + mf(7) = 0.2873_8 + mf(8) = 0.0749_8 + + ! Get the atomic weight ratios + if (expand_by == "wo") then + awr(1) = nuclides(nuclide_dict % get_key('cd106')) % awr + awr(2) = nuclides(nuclide_dict % get_key('cd108')) % awr + awr(3) = nuclides(nuclide_dict % get_key('cd110')) % awr + awr(4) = nuclides(nuclide_dict % get_key('cd111')) % awr + awr(5) = nuclides(nuclide_dict % get_key('cd112')) % awr + awr(6) = nuclides(nuclide_dict % get_key('cd113')) % awr + awr(7) = nuclides(nuclide_dict % get_key('cd114')) % awr + awr(8) = nuclides(nuclide_dict % get_key('cd116')) % awr + end if + + case ('in') + + ! Set the number of isotopes in this element + n_isotopes = 2 + + ! Allocate and initialize array for the atomic weight ratios + allocate(awr(n_isotopes)) + awr = ONE + + ! Allocate and initialize array for mole fractions + allocate(mf(n_isotopes)) + mf(1) = 0.0429_8 + mf(2) = 0.9571_8 + + ! Get the atomic weight ratios + if (expand_by == "wo") then + awr(1) = nuclides(nuclide_dict % get_key('in113')) % awr + awr(2) = nuclides(nuclide_dict % get_key('in115')) % awr + end if + + case ('sn') + + ! Set the number of isotopes in this element + n_isotopes = 10 + + ! Allocate and initialize array for the atomic weight ratios + allocate(awr(n_isotopes)) + awr = ONE + + ! Allocate and initialize array for mole fractions + allocate(mf(n_isotopes)) + mf(1) = 0.0097_8 + mf(2) = 0.0066_8 + mf(3) = 0.0034_8 + mf(4) = 0.1454_8 + mf(5) = 0.0768_8 + mf(6) = 0.2422_8 + mf(7) = 0.0859_8 + mf(8) = 0.3258_8 + mf(9) = 0.0463_8 + mf(10) = 0.0579_8 + + ! Get the atomic weight ratios + if (expand_by == "wo") then + awr(1) = nuclides(nuclide_dict % get_key('sn112')) % awr + awr(2) = nuclides(nuclide_dict % get_key('sn114')) % awr + awr(3) = nuclides(nuclide_dict % get_key('sn115')) % awr + awr(4) = nuclides(nuclide_dict % get_key('sn116')) % awr + awr(5) = nuclides(nuclide_dict % get_key('sn117')) % awr + awr(6) = nuclides(nuclide_dict % get_key('sn118')) % awr + awr(7) = nuclides(nuclide_dict % get_key('sn119')) % awr + awr(8) = nuclides(nuclide_dict % get_key('sn120')) % awr + awr(9) = nuclides(nuclide_dict % get_key('sn122')) % awr + awr(10) = nuclides(nuclide_dict % get_key('sn124')) % awr + end if + + case ('sb') + + ! Set the number of isotopes in this element + n_isotopes = 2 + + ! Allocate and initialize array for the atomic weight ratios + allocate(awr(n_isotopes)) + awr = ONE + + ! Allocate and initialize array for mole fractions + allocate(mf(n_isotopes)) + mf(1) = 0.5721_8 + mf(2) = 0.4279_8 + + ! Get the atomic weight ratios + if (expand_by == "wo") then + awr(1) = nuclides(nuclide_dict % get_key('sb121')) % awr + awr(2) = nuclides(nuclide_dict % get_key('sb123')) % awr + end if + + case ('te') + + ! Set the number of isotopes in this element + n_isotopes = 8 + + ! Allocate and initialize array for the atomic weight ratios + allocate(awr(n_isotopes)) + awr = ONE + + ! Allocate and initialize array for mole fractions + allocate(mf(n_isotopes)) + mf(1) = 0.0009_8 + mf(2) = 0.0255_8 + mf(3) = 0.0089_8 + mf(4) = 0.0474_8 + mf(5) = 0.0707_8 + mf(6) = 0.1884_8 + mf(7) = 0.3174_8 + mf(8) = 0.3408_8 + + ! Get the atomic weight ratios + if (expand_by == "wo") then + awr(1) = nuclides(nuclide_dict % get_key('te120')) % awr + awr(2) = nuclides(nuclide_dict % get_key('te122')) % awr + awr(3) = nuclides(nuclide_dict % get_key('te123')) % awr + awr(4) = nuclides(nuclide_dict % get_key('te124')) % awr + awr(5) = nuclides(nuclide_dict % get_key('te125')) % awr + awr(6) = nuclides(nuclide_dict % get_key('te126')) % awr + awr(7) = nuclides(nuclide_dict % get_key('te128')) % awr + awr(8) = nuclides(nuclide_dict % get_key('te130')) % awr + end if + + case ('i') + + ! Set the number of isotopes in this element + n_isotopes = 1 + + ! Allocate and initialize array for the atomic weight ratios + allocate(awr(n_isotopes)) + awr = ONE + + ! Allocate and initialize array for mole fractions + allocate(mf(n_isotopes)) + mf(1) = ONE + + ! Get the atomic weight ratios + if (expand_by == "wo") then + awr(1) = nuclides(nuclide_dict % get_key('i127')) % awr + end if + + case ('xe') + + ! Set the number of isotopes in this element + n_isotopes = 9 + + ! Allocate and initialize array for the atomic weight ratios + allocate(awr(n_isotopes)) + awr = ONE + + ! Allocate and initialize array for mole fractions + allocate(mf(n_isotopes)) + mf(1) = 0.000952_8 + mf(2) = 0.000890_8 + mf(3) = 0.019102_8 + mf(4) = 0.264006_8 + mf(5) = 0.040710_8 + mf(6) = 0.212324_8 + mf(7) = 0.269086_8 + mf(8) = 0.104357_8 + mf(9) = 0.088573_8 + + ! Get the atomic weight ratios + if (expand_by == "wo") then + awr(1) = nuclides(nuclide_dict % get_key('xe124')) % awr + awr(2) = nuclides(nuclide_dict % get_key('xe126')) % awr + awr(3) = nuclides(nuclide_dict % get_key('xe128')) % awr + awr(4) = nuclides(nuclide_dict % get_key('xe129')) % awr + awr(5) = nuclides(nuclide_dict % get_key('xe130')) % awr + awr(6) = nuclides(nuclide_dict % get_key('xe131')) % awr + awr(7) = nuclides(nuclide_dict % get_key('xe132')) % awr + awr(8) = nuclides(nuclide_dict % get_key('xe134')) % awr + awr(9) = nuclides(nuclide_dict % get_key('xe136')) % awr + end if + + case ('cs') + + ! Set the number of isotopes in this element + n_isotopes = 1 + + ! Allocate and initialize array for the atomic weight ratios + allocate(awr(n_isotopes)) + awr = ONE + + ! Allocate and initialize array for mole fractions + allocate(mf(n_isotopes)) + mf(1) = ONE + + ! Get the atomic weight ratios + if (expand_by == "wo") then + awr(1) = nuclides(nuclide_dict % get_key('cs133')) % awr + end if + + case ('ba') + + ! Set the number of isotopes in this element + n_isotopes = 7 + + ! Allocate and initialize array for the atomic weight ratios + allocate(awr(n_isotopes)) + awr = ONE + + ! Allocate and initialize array for mole fractions + allocate(mf(n_isotopes)) + mf(1) = 0.00106_8 + mf(2) = 0.00101_8 + mf(3) = 0.02417_8 + mf(4) = 0.06592_8 + mf(5) = 0.07854_8 + mf(6) = 0.11232_8 + mf(7) = 0.71698_8 + + ! Get the atomic weight ratios + if (expand_by == "wo") then + awr(1) = nuclides(nuclide_dict % get_key('ba130')) % awr + awr(2) = nuclides(nuclide_dict % get_key('ba132')) % awr + awr(3) = nuclides(nuclide_dict % get_key('ba134')) % awr + awr(4) = nuclides(nuclide_dict % get_key('ba135')) % awr + awr(5) = nuclides(nuclide_dict % get_key('ba136')) % awr + awr(6) = nuclides(nuclide_dict % get_key('ba137')) % awr + awr(7) = nuclides(nuclide_dict % get_key('ba138')) % awr + end if + + case ('la') + + ! Set the number of isotopes in this element + n_isotopes = 2 + + ! Allocate and initialize array for the atomic weight ratios + allocate(awr(n_isotopes)) + awr = ONE + + ! Allocate and initialize array for mole fractions + allocate(mf(n_isotopes)) + mf(1) = 0.0008881_8 + mf(2) = 0.9991119_8 + + ! Get the atomic weight ratios + if (expand_by == "wo") then + awr(1) = nuclides(nuclide_dict % get_key('la138')) % awr + awr(2) = nuclides(nuclide_dict % get_key('la139')) % awr + end if + + case ('ce') + + ! Set the number of isotopes in this element + n_isotopes = 4 + + ! Allocate and initialize array for the atomic weight ratios + allocate(awr(n_isotopes)) + awr = ONE + + ! Allocate and initialize array for mole fractions + allocate(mf(n_isotopes)) + mf(1) = 0.00185_8 + mf(2) = 0.00251_8 + mf(3) = 0.88450_8 + mf(4) = 0.11114_8 + + ! Get the atomic weight ratios + if (expand_by == "wo") then + awr(1) = nuclides(nuclide_dict % get_key('ce136')) % awr + awr(2) = nuclides(nuclide_dict % get_key('ce138')) % awr + awr(3) = nuclides(nuclide_dict % get_key('ce140')) % awr + awr(4) = nuclides(nuclide_dict % get_key('ce142')) % awr + end if + + case ('pr') + + ! Set the number of isotopes in this element + n_isotopes = 1 + + ! Allocate and initialize array for the atomic weight ratios + allocate(awr(n_isotopes)) + awr = ONE + + ! Allocate and initialize array for mole fractions + allocate(mf(n_isotopes)) + mf(1) = ONE + + ! Get the atomic weight ratios + if (expand_by == "wo") then + awr(1) = nuclides(nuclide_dict % get_key('pr141')) % awr + end if + + case ('nd') + + ! Set the number of isotopes in this element + n_isotopes = 7 + + ! Allocate and initialize array for the atomic weight ratios + allocate(awr(n_isotopes)) + awr = ONE + + ! Allocate and initialize array for mole fractions + allocate(mf(n_isotopes)) + mf(1) = 0.27152_8 + mf(2) = 0.12174_8 + mf(3) = 0.23798_8 + mf(4) = 0.08293_8 + mf(5) = 0.17189_8 + mf(6) = 0.05756_8 + mf(7) = 0.05638_8 + + ! Get the atomic weight ratios + if (expand_by == "wo") then + awr(1) = nuclides(nuclide_dict % get_key('nd142')) % awr + awr(2) = nuclides(nuclide_dict % get_key('nd143')) % awr + awr(3) = nuclides(nuclide_dict % get_key('nd144')) % awr + awr(4) = nuclides(nuclide_dict % get_key('nd145')) % awr + awr(5) = nuclides(nuclide_dict % get_key('nd146')) % awr + awr(6) = nuclides(nuclide_dict % get_key('nd148')) % awr + awr(7) = nuclides(nuclide_dict % get_key('nd150')) % awr + end if + + case ('sm') + + ! Set the number of isotopes in this element + n_isotopes = 7 + + ! Allocate and initialize array for the atomic weight ratios + allocate(awr(n_isotopes)) + awr = ONE + + ! Allocate and initialize array for mole fractions + allocate(mf(n_isotopes)) + mf(1) = 0.0307_8 + mf(2) = 0.1499_8 + mf(3) = 0.1124_8 + mf(4) = 0.1382_8 + mf(5) = 0.0738_8 + mf(6) = 0.2675_8 + mf(7) = 0.2275_8 + + ! Get the atomic weight ratios + if (expand_by == "wo") then + awr(1) = nuclides(nuclide_dict % get_key('sm144')) % awr + awr(2) = nuclides(nuclide_dict % get_key('sm147')) % awr + awr(3) = nuclides(nuclide_dict % get_key('sm148')) % awr + awr(4) = nuclides(nuclide_dict % get_key('sm149')) % awr + awr(5) = nuclides(nuclide_dict % get_key('sm150')) % awr + awr(6) = nuclides(nuclide_dict % get_key('sm152')) % awr + awr(7) = nuclides(nuclide_dict % get_key('sm154')) % awr + end if + + case ('eu') + + ! Set the number of isotopes in this element + n_isotopes = 2 + + ! Allocate and initialize array for the atomic weight ratios + allocate(awr(n_isotopes)) + awr = ONE + + ! Allocate and initialize array for mole fractions + allocate(mf(n_isotopes)) + mf(1) = 0.4781_8 + mf(2) = 0.5219_8 + + ! Get the atomic weight ratios + if (expand_by == "wo") then + awr(1) = nuclides(nuclide_dict % get_key('eu151')) % awr + awr(2) = nuclides(nuclide_dict % get_key('eu153')) % awr + end if + + case ('gd') + + ! Set the number of isotopes in this element + n_isotopes = 7 + + ! Allocate and initialize array for the atomic weight ratios + allocate(awr(n_isotopes)) + awr = ONE + + ! Allocate and initialize array for mole fractions + allocate(mf(n_isotopes)) + mf(1) = 0.0020_8 + mf(2) = 0.0218_8 + mf(3) = 0.1480_8 + mf(4) = 0.2047_8 + mf(5) = 0.1565_8 + mf(6) = 0.2484_8 + mf(7) = 0.2186_8 + + ! Get the atomic weight ratios + if (expand_by == "wo") then + awr(1) = nuclides(nuclide_dict % get_key('gd152')) % awr + awr(2) = nuclides(nuclide_dict % get_key('gd154')) % awr + awr(3) = nuclides(nuclide_dict % get_key('gd155')) % awr + awr(4) = nuclides(nuclide_dict % get_key('gd156')) % awr + awr(5) = nuclides(nuclide_dict % get_key('gd157')) % awr + awr(6) = nuclides(nuclide_dict % get_key('gd158')) % awr + awr(7) = nuclides(nuclide_dict % get_key('gd160')) % awr + end if + + case ('tb') + + ! Set the number of isotopes in this element + n_isotopes = 1 + + ! Allocate and initialize array for the atomic weight ratios + allocate(awr(n_isotopes)) + awr = ONE + + ! Allocate and initialize array for mole fractions + allocate(mf(n_isotopes)) + mf(1) = ONE + + ! Get the atomic weight ratios + if (expand_by == "wo") then + awr(1) = nuclides(nuclide_dict % get_key('tb159')) % awr + end if + + case ('dy') + + ! Set the number of isotopes in this element + n_isotopes = 7 + + ! Allocate and initialize array for the atomic weight ratios + allocate(awr(n_isotopes)) + awr = ONE + + ! Allocate and initialize array for mole fractions + allocate(mf(n_isotopes)) + mf(1) = 0.00056_8 + mf(2) = 0.00095_8 + mf(3) = 0.02329_8 + mf(4) = 0.18889_8 + mf(5) = 0.25475_8 + mf(6) = 0.24896_8 + mf(7) = 0.28260_8 + + ! Get the atomic weight ratios + if (expand_by == "wo") then + awr(1) = nuclides(nuclide_dict % get_key('dy156')) % awr + awr(2) = nuclides(nuclide_dict % get_key('dy158')) % awr + awr(3) = nuclides(nuclide_dict % get_key('dy160')) % awr + awr(4) = nuclides(nuclide_dict % get_key('dy161')) % awr + awr(5) = nuclides(nuclide_dict % get_key('dy162')) % awr + awr(6) = nuclides(nuclide_dict % get_key('dy163')) % awr + awr(7) = nuclides(nuclide_dict % get_key('dy164')) % awr + end if + + case ('ho') + + ! Set the number of isotopes in this element + n_isotopes = 1 + + ! Allocate and initialize array for the atomic weight ratios + allocate(awr(n_isotopes)) + awr = ONE + + ! Allocate and initialize array for mole fractions + allocate(mf(n_isotopes)) + mf(1) = ONE + + ! Get the atomic weight ratios + if (expand_by == "wo") then + awr(1) = nuclides(nuclide_dict % get_key('ho165')) % awr + end if + + case ('er') + + ! Set the number of isotopes in this element + n_isotopes = 6 + + ! Allocate and initialize array for the atomic weight ratios + allocate(awr(n_isotopes)) + awr = ONE + + ! Allocate and initialize array for mole fractions + allocate(mf(n_isotopes)) + mf(1) = 0.00139_8 + mf(2) = 0.01601_8 + mf(3) = 0.33503_8 + mf(4) = 0.22869_8 + mf(5) = 0.26978_8 + mf(6) = 0.14910_8 + + ! Get the atomic weight ratios + if (expand_by == "wo") then + awr(1) = nuclides(nuclide_dict % get_key('er162')) % awr + awr(2) = nuclides(nuclide_dict % get_key('er164')) % awr + awr(3) = nuclides(nuclide_dict % get_key('er166')) % awr + awr(4) = nuclides(nuclide_dict % get_key('er167')) % awr + awr(5) = nuclides(nuclide_dict % get_key('er168')) % awr + awr(6) = nuclides(nuclide_dict % get_key('er170')) % awr + end if + + case ('tm') + + ! Set the number of isotopes in this element + n_isotopes = 1 + + ! Allocate and initialize array for the atomic weight ratios + allocate(awr(n_isotopes)) + awr = ONE + + ! Allocate and initialize array for mole fractions + allocate(mf(n_isotopes)) + mf(1) = ONE + + ! Get the atomic weight ratios + if (expand_by == "wo") then + awr(1) = nuclides(nuclide_dict % get_key('tm169')) % awr + end if + + case ('yb') + + ! Set the number of isotopes in this element + n_isotopes = 7 + + ! Allocate and initialize array for the atomic weight ratios + allocate(awr(n_isotopes)) + awr = ONE + + ! Allocate and initialize array for mole fractions + allocate(mf(n_isotopes)) + mf(1) = 0.00123_8 + mf(2) = 0.02982_8 + mf(3) = 0.1409_8 + mf(4) = 0.2168_8 + mf(5) = 0.16103_8 + mf(6) = 0.32026_8 + mf(7) = 0.12996_8 + + ! Get the atomic weight ratios + if (expand_by == "wo") then + awr(1) = nuclides(nuclide_dict % get_key('yb168')) % awr + awr(2) = nuclides(nuclide_dict % get_key('yb170')) % awr + awr(3) = nuclides(nuclide_dict % get_key('yb171')) % awr + awr(4) = nuclides(nuclide_dict % get_key('yb172')) % awr + awr(5) = nuclides(nuclide_dict % get_key('yb173')) % awr + awr(6) = nuclides(nuclide_dict % get_key('yb174')) % awr + awr(7) = nuclides(nuclide_dict % get_key('yb176')) % awr + end if + + case ('lu') + + ! Set the number of isotopes in this element + n_isotopes = 2 + + ! Allocate and initialize array for the atomic weight ratios + allocate(awr(n_isotopes)) + awr = ONE + + ! Allocate and initialize array for mole fractions + allocate(mf(n_isotopes)) + mf(1) = 0.97401_8 + mf(2) = 0.02599_8 + + ! Get the atomic weight ratios + if (expand_by == "wo") then + awr(1) = nuclides(nuclide_dict % get_key('lu175')) % awr + awr(2) = nuclides(nuclide_dict % get_key('lu176')) % awr + end if + + case ('hf') + + ! Set the number of isotopes in this element + n_isotopes = 6 + + ! Allocate and initialize array for the atomic weight ratios + allocate(awr(n_isotopes)) + awr = ONE + + ! Allocate and initialize array for mole fractions + allocate(mf(n_isotopes)) + mf(1) = 0.0016_8 + mf(2) = 0.0526_8 + mf(3) = 0.1860_8 + mf(4) = 0.2728_8 + mf(5) = 0.1362_8 + mf(6) = 0.3508_8 + + ! Get the atomic weight ratios + if (expand_by == "wo") then + awr(1) = nuclides(nuclide_dict % get_key('hf174')) % awr + awr(2) = nuclides(nuclide_dict % get_key('hf176')) % awr + awr(3) = nuclides(nuclide_dict % get_key('hf177')) % awr + awr(4) = nuclides(nuclide_dict % get_key('hf178')) % awr + awr(5) = nuclides(nuclide_dict % get_key('hf179')) % awr + awr(6) = nuclides(nuclide_dict % get_key('hf180')) % awr + end if + + case ('ta') + if (default_expand == ENDF_BVII0 .or. & + (default_expand >= JEFF_311 .and. default_expand <= JEFF_312) .or. & + (default_expand >= JENDL_32 .and. default_expand <= JENDL_40)) then + + ! Set the number of isotopes in this element + n_isotopes = 1 + + ! Allocate and initialize array for the atomic weight ratios + allocate(awr(n_isotopes)) + awr = ONE + + ! Allocate and initialize array for mole fractions + allocate(mf(n_isotopes)) + mf(1) = ONE + + ! Get the atomic weight ratios + if (expand_by == "wo") then + awr(1) = nuclides(nuclide_dict % get_key('ta181')) % awr + end if + else + + ! Set the number of isotopes in this element + n_isotopes = 2 + + ! Allocate and initialize array for the atomic weight ratios + allocate(awr(n_isotopes)) + awr = ONE + + ! Allocate and initialize array for mole fractions + allocate(mf(n_isotopes)) + mf(1) = 0.0001201_8 + mf(2) = 0.9998799_8 + + ! Get the atomic weight ratios + if (expand_by == "wo") then + awr(1) = nuclides(nuclide_dict % get_key('ta180')) % awr + awr(2) = nuclides(nuclide_dict % get_key('ta181')) % awr + end if + end if + + case ('w') + if (default_expand == ENDF_BVII0 .or. default_expand == JEFF_311 & + .or. default_expand == JEFF_312 .or. & + (default_expand >= JENDL_32 .and. default_expand <= JENDL_33)) then + ! Combine W-180 with W-182 + + ! Set the number of isotopes in this element + n_isotopes = 4 + + ! Allocate and initialize array for the atomic weight ratios + allocate(awr(n_isotopes)) + awr = ONE + + ! Allocate and initialize array for mole fractions + allocate(mf(n_isotopes)) + mf(1) = 0.2662_8 + mf(2) = 0.1431_8 + mf(3) = 0.3064_8 + mf(4) = 0.2843_8 + + ! Get the atomic weight ratios + if (expand_by == "wo") then + awr(1) = nuclides(nuclide_dict % get_key('w182')) % awr + awr(2) = nuclides(nuclide_dict % get_key('w183')) % awr + awr(3) = nuclides(nuclide_dict % get_key('w184')) % awr + awr(4) = nuclides(nuclide_dict % get_key('w186')) % awr + end if + else + + ! Set the number of isotopes in this element + n_isotopes = 5 + + ! Allocate and initialize array for the atomic weight ratios + allocate(awr(n_isotopes)) + awr = ONE + + ! Allocate and initialize array for mole fractions + allocate(mf(n_isotopes)) + mf(1) = 0.0012_8 + mf(2) = 0.2650_8 + mf(3) = 0.1431_8 + mf(4) = 0.3064_8 + mf(5) = 0.2843_8 + + ! Get the atomic weight ratios + if (expand_by == "wo") then + awr(1) = nuclides(nuclide_dict % get_key('w180')) % awr + awr(2) = nuclides(nuclide_dict % get_key('w182')) % awr + awr(3) = nuclides(nuclide_dict % get_key('w183')) % awr + awr(4) = nuclides(nuclide_dict % get_key('w184')) % awr + awr(5) = nuclides(nuclide_dict % get_key('w186')) % awr + end if + end if + + case ('re') + + ! Set the number of isotopes in this element + n_isotopes = 2 + + ! Allocate and initialize array for the atomic weight ratios + allocate(awr(n_isotopes)) + awr = ONE + + ! Allocate and initialize array for mole fractions + allocate(mf(n_isotopes)) + mf(1) = 0.3740_8 + mf(2) = 0.6260_8 + + ! Get the atomic weight ratios + if (expand_by == "wo") then + awr(1) = nuclides(nuclide_dict % get_key('re185')) % awr + awr(2) = nuclides(nuclide_dict % get_key('re187')) % awr + end if + + case ('os') + if (default_expand == JEFF_311 .or. default_expand == JEFF_312) then + + ! Set the number of isotopes in this element + n_isotopes = 1 + + ! Allocate and initialize array for the atomic weight ratios + allocate(awr(n_isotopes)) + awr = ONE + + ! Allocate and initialize array for mole fractions + allocate(mf(n_isotopes)) + mf(1) = ONE + + ! Get the atomic weight ratios + if (expand_by == "wo") then + awr(1) = nuclides(nuclide_dict % get_key('os0')) % awr + end if + else + + ! Set the number of isotopes in this element + n_isotopes = 7 + + ! Allocate and initialize array for the atomic weight ratios + allocate(awr(n_isotopes)) + awr = ONE + + ! Allocate and initialize array for mole fractions + allocate(mf(n_isotopes)) + mf(1) = 0.0002_8 + mf(2) = 0.0159_8 + mf(3) = 0.0196_8 + mf(4) = 0.1324_8 + mf(5) = 0.1615_8 + mf(6) = 0.2626_8 + mf(7) = 0.4078_8 + + ! Get the atomic weight ratios + if (expand_by == "wo") then + awr(1) = nuclides(nuclide_dict % get_key('os184')) % awr + awr(2) = nuclides(nuclide_dict % get_key('os186')) % awr + awr(3) = nuclides(nuclide_dict % get_key('os187')) % awr + awr(4) = nuclides(nuclide_dict % get_key('os188')) % awr + awr(5) = nuclides(nuclide_dict % get_key('os189')) % awr + awr(6) = nuclides(nuclide_dict % get_key('os190')) % awr + awr(7) = nuclides(nuclide_dict % get_key('os192')) % awr + end if + end if + + case ('ir') + + ! Set the number of isotopes in this element + n_isotopes = 2 + + ! Allocate and initialize array for the atomic weight ratios + allocate(awr(n_isotopes)) + awr = ONE + + ! Allocate and initialize array for mole fractions + allocate(mf(n_isotopes)) + mf(1) = 0.373_8 + mf(2) = 0.627_8 + + ! Get the atomic weight ratios + if (expand_by == "wo") then + awr(1) = nuclides(nuclide_dict % get_key('ir191')) % awr + awr(2) = nuclides(nuclide_dict % get_key('ir193')) % awr + end if + + case ('pt') + if (default_expand == JEFF_311 .or. default_expand == JEFF_312) then + + ! Set the number of isotopes in this element + n_isotopes = 1 + + ! Allocate and initialize array for the atomic weight ratios + allocate(awr(n_isotopes)) + awr = ONE + + ! Allocate and initialize array for mole fractions + allocate(mf(n_isotopes)) + mf(1) = ONE + + ! Get the atomic weight ratios + if (expand_by == "wo") then + awr(1) = nuclides(nuclide_dict % get_key('pt0')) % awr + end if + + else + + ! Set the number of isotopes in this element + n_isotopes = 6 + + ! Allocate and initialize array for the atomic weight ratios + allocate(awr(n_isotopes)) + awr = ONE + + ! Allocate and initialize array for mole fractions + allocate(mf(n_isotopes)) + mf(1) = 0.00012_8 + mf(2) = 0.00782_8 + mf(3) = 0.3286_8 + mf(4) = 0.3378_8 + mf(5) = 0.2521_8 + mf(6) = 0.07356_8 + + ! Get the atomic weight ratios + if (expand_by == "wo") then + awr(1) = nuclides(nuclide_dict % get_key('pt190')) % awr + awr(2) = nuclides(nuclide_dict % get_key('pt192')) % awr + awr(3) = nuclides(nuclide_dict % get_key('pt194')) % awr + awr(4) = nuclides(nuclide_dict % get_key('pt195')) % awr + awr(5) = nuclides(nuclide_dict % get_key('pt196')) % awr + awr(6) = nuclides(nuclide_dict % get_key('pt198')) % awr + end if + end if + + case ('au') + + ! Set the number of isotopes in this element + n_isotopes = 1 + + ! Allocate and initialize array for the atomic weight ratios + allocate(awr(n_isotopes)) + awr = ONE + + ! Allocate and initialize array for mole fractions + allocate(mf(n_isotopes)) + mf(1) = ONE + + ! Get the atomic weight ratios + if (expand_by == "wo") then + awr(1) = nuclides(nuclide_dict % get_key('au197')) % awr + end if + + case ('hg') + + ! Set the number of isotopes in this element + n_isotopes = 7 + + ! Allocate and initialize array for the atomic weight ratios + allocate(awr(n_isotopes)) + awr = ONE + + ! Allocate and initialize array for mole fractions + allocate(mf(n_isotopes)) + mf(1) = 0.0015_8 + mf(2) = 0.0997_8 + mf(3) = 0.1687_8 + mf(4) = 0.2310_8 + mf(5) = 0.1318_8 + mf(6) = 0.2986_8 + mf(7) = 0.0687_8 + + ! Get the atomic weight ratios + if (expand_by == "wo") then + awr(1) = nuclides(nuclide_dict % get_key('hg196')) % awr + awr(2) = nuclides(nuclide_dict % get_key('hg198')) % awr + awr(3) = nuclides(nuclide_dict % get_key('hg199')) % awr + awr(4) = nuclides(nuclide_dict % get_key('hg200')) % awr + awr(5) = nuclides(nuclide_dict % get_key('hg201')) % awr + awr(6) = nuclides(nuclide_dict % get_key('hg202')) % awr + awr(7) = nuclides(nuclide_dict % get_key('hg204')) % awr + end if + + case ('tl') + if (default_expand == JEFF_311 .or. default_expand == JEFF_312) then + + ! Set the number of isotopes in this element + n_isotopes = 1 + + ! Allocate and initialize array for the atomic weight ratios + allocate(awr(n_isotopes)) + awr = ONE + + ! Allocate and initialize array for mole fractions + allocate(mf(n_isotopes)) + mf(1) = ONE + + ! Get the atomic weight ratios + if (expand_by == "wo") then + awr(1) = nuclides(nuclide_dict % get_key('tl0')) % awr + end if + else + + ! Set the number of isotopes in this element + n_isotopes = 2 + + ! Allocate and initialize array for the atomic weight ratios + allocate(awr(n_isotopes)) + awr = ONE + + ! Allocate and initialize array for mole fractions + allocate(mf(n_isotopes)) + mf(1) = 0.2952_8 + mf(2) = 0.7048_8 + + ! Get the atomic weight ratios + if (expand_by == "wo") then + awr(1) = nuclides(nuclide_dict % get_key('tl203')) % awr + awr(2) = nuclides(nuclide_dict % get_key('tl205')) % awr + end if + end if + + case ('pb') + + ! Set the number of isotopes in this element + n_isotopes = 4 + + ! Allocate and initialize array for the atomic weight ratios + allocate(awr(n_isotopes)) + awr = ONE + + ! Allocate and initialize array for mole fractions + allocate(mf(n_isotopes)) + mf(1) = 0.014_8 + mf(2) = 0.241_8 + mf(3) = 0.221_8 + mf(4) = 0.524_8 + + ! Get the atomic weight ratios + if (expand_by == "wo") then + awr(1) = nuclides(nuclide_dict % get_key('pb204')) % awr + awr(2) = nuclides(nuclide_dict % get_key('pb206')) % awr + awr(3) = nuclides(nuclide_dict % get_key('pb207')) % awr + awr(4) = nuclides(nuclide_dict % get_key('pb208')) % awr + end if + + case ('bi') + + ! Set the number of isotopes in this element + n_isotopes = 1 + + ! Allocate and initialize array for the atomic weight ratios + allocate(awr(n_isotopes)) + awr = ONE + + ! Allocate and initialize array for mole fractions + allocate(mf(n_isotopes)) + mf(1) = ONE + + ! Get the atomic weight ratios + if (expand_by == "wo") then + awr(1) = nuclides(nuclide_dict % get_key('bi209')) % awr + end if + + case ('th') + + ! Set the number of isotopes in this element + n_isotopes = 1 + + ! Allocate and initialize array for the atomic weight ratios + allocate(awr(n_isotopes)) + awr = ONE + + ! Allocate and initialize array for mole fractions + allocate(mf(n_isotopes)) + mf(1) = ONE + + ! Get the atomic weight ratios + if (expand_by == "wo") then + awr(1) = nuclides(nuclide_dict % get_key('th232')) % awr + end if + + case ('pa') + + ! Set the number of isotopes in this element + n_isotopes = 1 + + ! Allocate and initialize array for the atomic weight ratios + allocate(awr(n_isotopes)) + awr = ONE + + ! Allocate and initialize array for mole fractions + allocate(mf(n_isotopes)) + mf(1) = ONE + + ! Get the atomic weight ratios + if (expand_by == "wo") then + awr(1) = nuclides(nuclide_dict % get_key('pa231')) % awr + end if + + case ('u') + + ! Set the number of isotopes in this element + n_isotopes = 3 + + ! Allocate and initialize array for the atomic weight ratios + allocate(awr(n_isotopes)) + awr = ONE + + ! Allocate and initialize array for mole fractions + allocate(mf(n_isotopes)) + mf(1) = 0.000054_8 + mf(2) = 0.007204_8 + mf(3) = 0.992742_8 + + ! Get the atomic weight ratios + if (expand_by == "wo") then + awr(1) = nuclides(nuclide_dict % get_key('u234')) % awr + awr(2) = nuclides(nuclide_dict % get_key('u235')) % awr + awr(3) = nuclides(nuclide_dict % get_key('u238')) % awr + end if + + ! Modify mole fractions in enrichment provided + if (enrichment /= -ONE) then + + ! Calculate the mass fractions of isotopes + mf(1) = 0.008 * enrichment + mf(2) = enrichment + mf(3) = 1.0 - 1.008 * enrichment + + ! Convert the mass fractions to mole fractions + do i = 1, n_isotopes + mf(i) = mf(i) / awr(i) + end do + + ! Normalize the mole fractions to ONE + element_awr = sum(mf(:)) + + do i = 1, n_isotopes + mf(i) = mf(i) / element_awr + end do + end if + + case default + call fatal_error("Cannot expand element: " // name) + + end select + + if (expand_by == "wo") then + + ! Compute the element awr + element_awr = ZERO + do i = 1, n_isotopes + element_awr = element_awr + awr(i) * mf(i) + end do + + ! Normalize the awr to the element awr + do i = 1, n_isotopes + awr(i) = awr(i) / element_awr + end do + end if + + do i = 1, n_isotopes + call densities % push_back(density * mf(i) * awr(i)) + end do + + ! Deallocate arrays + deallocate(awr) + deallocate(mf) + + end subroutine expand_natural_element_densities !=============================================================================== ! GENERATE_RPN implements the shunting-yard algorithm to generate a Reverse @@ -5619,13 +7389,256 @@ contains !=============================================================================== subroutine normalize_ao() - integer :: i ! index in materials array - integer :: j ! index over nuclides in material - real(8) :: sum_percent ! summation - real(8) :: awr ! atomic weight ratio - real(8) :: x ! atom percent - logical :: percent_in_atom ! nuclides specified in atom percent? - logical :: density_in_atom ! density specified in atom/b-cm? + integer :: i ! index in materials array + integer :: j ! index over nuclides in material + real(8) :: sum_percent ! summation + real(8) :: awr ! atomic weight ratio + real(8) :: x ! atom percent + logical :: percent_in_atom ! nuclides specified in atom percent? + logical :: density_in_atom ! density specified in atom/b-cm? + logical :: file_exists ! does materials.xml exist? + character(20) :: name ! name of isotope, e.g. 92235.03c + character(MAX_WORD_LEN) :: units ! units on density + character(MAX_LINE_LEN) :: filename ! materials.xml filename + real(8) :: val ! value entered for density + real(8) :: temp_dble ! temporary double prec. real + real(8) :: enrichment ! enrichment + logical :: sum_density ! density is sum of nuclide densities + type(VectorReal) :: densities ! temporary list of nuclide densities + type(Material), pointer :: mat => null() + type(Node), pointer :: doc => null() + type(Node), pointer :: node_mat => null() + type(Node), pointer :: node_dens => null() + type(Node), pointer :: node_nuc => null() + type(Node), pointer :: node_ele => null() + type(NodeList), pointer :: node_mat_list => null() + type(NodeList), pointer :: node_nuc_list => null() + type(NodeList), pointer :: node_macro_list => null() + type(NodeList), pointer :: node_ele_list => null() + + ! Display output message + call write_message("Reading material densities from XML file...", 5) + + ! Check is materials.xml exists + filename = trim(path_input) // "materials.xml" + inquire(FILE=filename, EXIST=file_exists) + if (.not. file_exists) then + call fatal_error("Material XML file '" // trim(filename) // "' does not & + &exist!") + end if + + ! Parse materials.xml file + call open_xmldoc(doc, filename) + + ! Get pointer to list of XML + call get_node_list(doc, "material", node_mat_list) + + do i = 1, n_materials + mat => materials(i) + + ! Get pointer to i-th material node + call get_list_item(node_mat_list, i, node_mat) + + ! Get pointer to density element + if (check_for_node(node_mat, "density")) then + call get_node_ptr(node_mat, "density", node_dens) + else + call fatal_error("Must specify density element in material " & + // trim(to_str(mat % id))) + end if + + ! Copy units + call get_node_value(node_dens, "units", units) + + if (units == 'sum') then + ! If the user gave the units as 'sum', then the total density of the + ! material is taken to be the sum of the atom fractions listed on the + ! nuclides + + sum_density = .true. + + else if (units == 'macro') then + if (check_for_node(node_dens, "value")) then + ! Copy value + call get_node_value(node_dens, "value", val) + else + val = ONE + end if + + ! Set density + mat % density = val + + sum_density = .false. + + else + ! Copy value + call get_node_value(node_dens, "value", val) + + ! Check for erroneous density + sum_density = .false. + if (val <= ZERO) then + call fatal_error("Need to specify a positive density on material " & + // trim(to_str(mat % id)) // ".") + end if + ! Adjust material density based on specified units + select case(to_lower(units)) + case ('g/cc', 'g/cm3') + mat % density = -val + case ('kg/m3') + mat % density = -0.001_8 * val + case ('atom/b-cm') + mat % density = val + case ('atom/cm3', 'atom/cc') + mat % density = 1.0e-24_8 * val + case default + call fatal_error("Unkwown units '" // trim(units) & + // "' specified on material " // trim(to_str(mat % id))) + end select + end if + + ! ======================================================================== + ! READ IN NUCLIDE DENSITIES + + ! Get pointer list of XML + call get_node_list(node_mat, "macroscopic", node_macro_list) + if (get_list_size(node_macro_list) == 1) then + + call get_list_item(node_macro_list, 1, node_nuc) + + ! store nuclide name + call get_node_value(node_nuc, "name", name) + name = trim(name) + + ! Check if no atom/weight percents were specified or if both atom and + ! weight percents were specified + if (units == 'macro') then + call densities % push_back(ONE) + else + call fatal_error("Units can only be macro for macroscopic data " & + // trim(name)) + end if + else + + ! Get pointer list of XML + call get_node_list(node_mat, "nuclide", node_nuc_list) + + ! Create list of nuclides based on those specified plus natural elements + INDIVIDUAL_NUCLIDES: do j = 1, get_list_size(node_nuc_list) + + ! Combine nuclide identifier and cross section and copy into names + call get_list_item(node_nuc_list, j, node_nuc) + + ! store nuclide name + call get_node_value(node_nuc, "name", name) + name = trim(name) + + ! Check if no atom/weight percents were specified or if both atom and + ! weight percents were specified + if (units == 'macro') then + call densities % push_back(ONE) + else + if (.not. check_for_node(node_nuc, "ao") .and. & + .not. check_for_node(node_nuc, "wo")) then + call fatal_error("No atom or weight percent specified for & + &nuclide" // trim(name)) + elseif (check_for_node(node_nuc, "ao") .and. & + check_for_node(node_nuc, "wo")) then + call fatal_error("Cannot specify both atom and weight percents & + &for a nuclide: " // trim(name)) + end if + + ! If enrichment was provided, issue error + if (check_for_node(node_nuc, "enrichment")) then + call fatal_error("Cannot specify an enrichment for an isotope") + end if + + ! Copy atom/weight percents + if (check_for_node(node_nuc, "ao")) then + call get_node_value(node_nuc, "ao", temp_dble) + call densities % push_back(temp_dble) + else + call get_node_value(node_nuc, "wo", temp_dble) + call densities % push_back(-temp_dble) + end if + end if + end do INDIVIDUAL_NUCLIDES + end if + + ! ======================================================================= + ! READ AND PARSE TAGS + + ! Get pointer list of XML + call get_node_list(node_mat, "element", node_ele_list) + + NATURAL_ELEMENTS: do j = 1, get_list_size(node_ele_list) + call get_list_item(node_ele_list, j, node_ele) + + call get_node_value(node_ele, "name", name) + + ! Check if no atom/weight percents were specified or if both atom and + ! weight percents were specified + if (.not. check_for_node(node_ele, "ao") .and. & + .not. check_for_node(node_ele, "wo")) then + call fatal_error("No atom or weight percent specified for element " & + // trim(name)) + elseif (check_for_node(node_ele, "ao") .and. & + check_for_node(node_ele, "wo")) then + call fatal_error("Cannot specify both atom and weight percents for & + &element: " // trim(name)) + end if + + ! If enrichment was provided, issue error + if (check_for_node(node_ele, "enrichment")) then + + if (name /= 'U') then + call fatal_error("Enrichment is only supported for U") + end if + + call get_node_value(node_ele, "enrichment", enrichment) + + ! Check that enrichment is between ZERO and 1 / 1.008 + if (enrichment < ZERO .or. enrichment > 1 / 1.008) then + call fatal_error("U enrichment must be between 0 and 1/1.008") + end if + + else + enrichment = -ONE + end if + + ! Expand element into naturally-occurring isotopes + if (check_for_node(node_ele, "ao")) then + call get_node_value(node_ele, "ao", temp_dble) + call expand_natural_element_densities(name, "ao", temp_dble, & + enrichment, densities) + else + call get_node_value(node_ele, "wo", temp_dble) + call expand_natural_element_densities(name, "wo", -temp_dble, & + enrichment, densities) + end if + + end do NATURAL_ELEMENTS + + ! ======================================================================== + ! SET MATERIAL ATOM DENSITIES + + ALL_NUCLIDES: do j = 1, mat % n_nuclides + mat % atom_density(j) = densities % data(j) + end do ALL_NUCLIDES + + ! Check to make sure either all atom percents or all weight percents are + ! given + if (.not. (all(mat % atom_density >= ZERO) .or. & + all(mat % atom_density <= ZERO))) then + call fatal_error("Cannot mix atom and weight percents in material " & + // to_str(mat % id)) + end if + + ! Determine density if it is a sum value + if (sum_density) mat % density = sum(mat % atom_density) + + ! Clear lists + call densities % clear() + end do do i = 1, size(materials) associate (mat => materials(i)) From 663636ce2ea0601026663050e73022220255746a Mon Sep 17 00:00:00 2001 From: Sam Shaner Date: Sun, 16 Oct 2016 22:09:25 -0400 Subject: [PATCH 02/34] added enrichment and wo element support in Python API and added new tests --- docs/source/usersguide/input.rst | 14 +++- examples/python/pincell/build-xml.py | 12 ++-- openmc/element.py | 4 +- openmc/material.py | 63 ++++++++++++----- src/input_xml.F90 | 38 +++++----- tests/test_element_wo/inputs_true.dat | 1 + tests/test_element_wo/results_true.dat | 5 ++ tests/test_element_wo/test_element_wo.py | 90 ++++++++++++++++++++++++ tests/test_enrichment/inputs_true.dat | 1 + tests/test_enrichment/results_true.dat | 5 ++ tests/test_enrichment/test_enrichment.py | 90 ++++++++++++++++++++++++ tests/testing_harness.py | 1 + 12 files changed, 278 insertions(+), 46 deletions(-) create mode 100644 tests/test_element_wo/inputs_true.dat create mode 100644 tests/test_element_wo/results_true.dat create mode 100644 tests/test_element_wo/test_element_wo.py create mode 100644 tests/test_enrichment/inputs_true.dat create mode 100644 tests/test_enrichment/results_true.dat create mode 100644 tests/test_enrichment/test_enrichment.py diff --git a/docs/source/usersguide/input.rst b/docs/source/usersguide/input.rst index b1eedf59cd..94936592fe 100644 --- a/docs/source/usersguide/input.rst +++ b/docs/source/usersguide/input.rst @@ -1415,9 +1415,9 @@ Each ``material`` element can have the following attributes or sub-elements: Specifies that a natural element is present in the material. The natural element is split up into individual isotopes based on `IUPAC Isotopic Compositions of the Elements 2009`_. This element has - attributes/sub-elements called ``name``, and ``ao``. The ``name`` - attribute is the atomic symbol of the element. Finally, the ``ao`` - attribute specifies the atom percent of the element within the material, + attributes/sub-elements called ``name``, and ``ao`` or ``wo``. The ``name`` + attribute is the atomic symbol of the element. Finally, the ``ao`` and ``wo`` + attributes specify the atom or weight percent of the element within the material, respectively. One example would be as follows: .. code-block:: xml @@ -1447,6 +1447,14 @@ Each ``material`` element can have the following attributes or sub-elements: .. note:: The ``scattering`` attribute/sub-element is not used in the multi-group :ref:`energy_mode`. + An optional attribute/sub-element for uranium is ``enrichment``. This + attribute lets the user set the weight-percent enrichment of U-235 in + uranium. The weight-percent of U-234 is computed as 0.008 times the weight + percent of U-235 with U-238 comprising the balance. Valid values for + enrichment range between 0 and 1/1.008. + + *Default*: None + :sab: Associates an S(a,b) table with the material. This element has one attribute/sub-element called ``name``. The ``name`` attribute diff --git a/examples/python/pincell/build-xml.py b/examples/python/pincell/build-xml.py index 8ce4eab629..1e1e15d6d5 100644 --- a/examples/python/pincell/build-xml.py +++ b/examples/python/pincell/build-xml.py @@ -45,18 +45,14 @@ sn119 = openmc.Nuclide('Sn119') sn120 = openmc.Nuclide('Sn120') sn122 = openmc.Nuclide('Sn122') sn124 = openmc.Nuclide('Sn124') -u234 = openmc.Nuclide('U234') -u235 = openmc.Nuclide('U235') -u238 = openmc.Nuclide('U238') +u = openmc.Element('U') +o = openmc.Element('O') # Instantiate some Materials and register the appropriate Nuclides uo2 = openmc.Material(material_id=1, name='UO2 fuel at 2.4% wt enrichment') uo2.set_density('g/cm3', 10.29769) -uo2.add_nuclide(u234, 4.4843e-6) -uo2.add_nuclide(u235, 5.5815e-4) -uo2.add_nuclide(u238, 2.2408e-2) -uo2.add_nuclide(o16, 4.5829e-2) -uo2.add_nuclide(o17, 1.1164e-4) +uo2.add_element(u, 1., enrichment=0.05) +uo2.add_element(o, 2.) helium = openmc.Material(material_id=2, name='Helium for gap') helium.set_density('g/cm3', 0.001598) diff --git a/openmc/element.py b/openmc/element.py index 1b16806148..6d8f69d252 100644 --- a/openmc/element.py +++ b/openmc/element.py @@ -11,8 +11,8 @@ if sys.version_info[0] >= 3: class Element(object): - """A natural element used in a material via . Internally, OpenMC will - expand the natural element into isotopes based on the known natural + """A natural element used in a material via . Internally, OpenMC + will expand the natural element into isotopes based on the known natural abundances. Parameters diff --git a/openmc/material.py b/openmc/material.py index 0639db5629..ee071d0f47 100644 --- a/openmc/material.py +++ b/openmc/material.py @@ -58,9 +58,9 @@ class Material(object): 'atom/b-cm', 'atom/cm3', 'sum', or 'macro'. The 'macro' unit only applies in the case of a multi-group calculation. elements : list of tuple - List in which each item is a 3-tuple consisting of an - :class:`openmc.Element` instance, the percent density, and the percent - type ('ao' or 'wo'). + List in which each item is a 3-tuple or 4-tuple consisting of an + :class:`openmc.Element` instance, the percent density, the percent + type ('ao' or 'wo'), and an optional weight-percent enrichment. nuclides : list of tuple List in which each item is a 3-tuple consisting of an :class:`openmc.Nuclide` instance, the percent density, and the percent @@ -83,7 +83,7 @@ class Material(object): # (only one is allowed, hence this is different than _nuclides, etc) self._macroscopic = None - # A list of tuples (element, percent, percent type) + # A list of tuples (element, percent, percent type, enrichment (optional)) self._elements = [] # If specified, a list of table names @@ -149,9 +149,13 @@ class Material(object): string += '{0: <16}\n'.format('\tElements') - for element, percent, percent_type in self._elements: - string += '{0: <16}'.format('\t{0.name}'.format(element)) - string += '=\t{0: <12} [{1}]\n'.format(percent, percent_type) + for element in self._elements: + string += '{0: <16}'.format('\t{0.name}'.format(element[0])) + if len(element) == 3: + string += '=\t{0: <12} [{1}]\n'.format(element[1], element[2]) + else: + string += '=\t{0: <12} [{1}] {2:4.2f} % enrichment\n'\ + .format(element[1], element[2], element[3]*100.) return string @@ -402,7 +406,8 @@ class Material(object): if macroscopic.name == self._macroscopic.name: self._macroscopic = None - def add_element(self, element, percent, percent_type='ao', expand=False): + def add_element(self, element, percent, percent_type='ao', enrichment=None, + expand=False): """Add a natural element to the material Parameters @@ -414,6 +419,8 @@ class Material(object): percent_type : {'ao', 'wo'}, optional 'ao' for atom percent and 'wo' for weight percent. Defaults to atom percent. + enrichment : float, optional + Optional weight percent enrichment for uranium. Defaults to None. expand : bool, optional Whether to expand the natural element into its naturally-occurring isotopes. Defaults to False. @@ -440,6 +447,19 @@ class Material(object): 'percent type "{1}"'.format(self._id, percent_type) raise ValueError(msg) + if enrichment is not None: + if not isinstance(enrichment, Real): + msg = 'Unable to add an Element to Material ID="{0}" with a ' \ + 'non-floating point enrichment value "{1}"'\ + .format(self._id, enrichment) + raise ValueError(msg) + + elif element != 'U': + msg = 'Unable to use enrichment for element {0} which is not ' \ + 'uranium for Material ID="{1}"'.format(enrichment, + self._id) + raise ValueError(msg) + # Copy this Element to separate it from same Element in other Materials if isinstance(element, openmc.Element): element = deepcopy(element) @@ -450,10 +470,16 @@ class Material(object): if percent_type == 'wo': raise NotImplementedError('Expanding natural element based on ' 'weight percent is not yet supported.') + for isotope, abundance in element.expand(): self._nuclides.append((isotope, percent*abundance, percent_type)) + else: - self._elements.append((element, percent, percent_type)) + if enrichment is not None: + self._elements.append((element, percent, percent_type, + enrichment)) + else: + self._elements.append((element, percent, percent_type)) def remove_element(self, element): """Remove a natural element from the material @@ -525,9 +551,9 @@ class Material(object): for nuclide, density, density_type in self._nuclides: nuclides.append(nuclide.name) - for element, density, density_type in self._elements: + for element in self._elements: # Expand natural element into isotopes - for isotope, abundance in element.expand(): + for isotope, abundance in element[0].expand(): nuclides.append(isotope.name) return nuclides @@ -548,10 +574,10 @@ class Material(object): for nuclide, density, density_type in self._nuclides: nuclides[nuclide.name] = (nuclide, density) - for element, density, density_type in self._elements: + for element in self._elements: # Expand natural element into isotopes - for isotope, abundance in element.expand(): - nuclides[isotope.name] = (isotope, density*abundance) + for isotope, abundance in element[0].expand(): + nuclides[isotope.name] = (isotope, element[1]*abundance) return nuclides @@ -586,6 +612,9 @@ class Material(object): else: xml_element.set("wo", str(element[1])) + if len(element) == 4: + xml_element.set("enrichment", str(element[3])) + if not element[0].scattering is None: xml_element.set("scattering", element[0].scattering) @@ -657,12 +686,12 @@ class Material(object): comps = [] allnucs = self._nuclides + self._elements dist_per_type = allnucs[0][2] - for nuc, per, typ in allnucs: - if not typ == dist_per_type: + for nuc in allnucs: + if not nuc[2] == dist_per_type: msg = 'All nuclides and elements in a distributed ' \ 'material must have the same type, either ao or wo' raise ValueError(msg) - comps.append(per) + comps.append(nuc[1]) if self._distrib_otf_file is None: # Create values and units subelements diff --git a/src/input_xml.F90 b/src/input_xml.F90 index 1225c91ac2..8bf3f2825f 100644 --- a/src/input_xml.F90 +++ b/src/input_xml.F90 @@ -4573,10 +4573,9 @@ contains end subroutine read_mg_cross_sections_xml !=============================================================================== -! EXPAND_NATURAL_ELEMENT converts natural elements specified using an -! tag within a material into individual isotopes based on IUPAC Isotopic -! Compositions of the Elements 2009 (doi:10.1351/PAC-REP-10-06-02). In some -! cases, modifications have been made to work with ENDF/B-VII.1 where +! EXPAND_NATURAL_ELEMENT_NAMES converts natural elements specified using an +! tag within a material and adds the names to the input names array. +! In some cases, modifications have been made to work with ENDF/B-VII.1 where ! evaluations of particular isotopes don't exist. !=============================================================================== @@ -5101,21 +5100,28 @@ contains end subroutine expand_natural_element_names +!=============================================================================== +! EXPAND_NATURAL_ELEMENT_DENSITIES converts natural elements specified using an +! tag within a material into individual isotopes based on IUPAC +! Isotopic Compositions of the Elements 2009 (doi:10.1351/PAC-REP-10-06-02). In +! some cases, modifications have been made to work with ENDF/B-VII.1 where +! evaluations of particular isotopes don't exist. +!=============================================================================== subroutine expand_natural_element_densities(name, expand_by, density, & enrichment, densities) - character(*), intent(in) :: name - character(*), intent(in) :: expand_by - real(8), intent(in) :: density - real(8), intent(in) :: enrichment - type(VectorReal), intent(inout) :: densities + character(*), intent(in) :: name ! element name + character(*), intent(in) :: expand_by ! "ao" or "wo" + real(8), intent(in) :: density ! value for "ao" or "wo" + real(8), intent(in) :: enrichment ! enrichment in weight % + type(VectorReal), intent(inout) :: densities ! isotope densities vector - integer :: i - integer :: n_isotopes - character(2) :: element_name - real(8) :: element_awr - real(8), allocatable :: awr(:) - real(8), allocatable :: mf(:) + integer :: i ! iterator + integer :: n_isotopes ! number of isotopes in the element + character(2) :: element_name ! element atomic symbol + real(8) :: element_awr ! element atomic weight ratio + real(8), allocatable :: awr(:) ! isotope atomic weight ratios + real(8), allocatable :: mf(:) ! isotope mole fractions element_name = name(1:2) @@ -7247,7 +7253,7 @@ contains awr(3) = nuclides(nuclide_dict % get_key('u238')) % awr end if - ! Modify mole fractions in enrichment provided + ! Modify mole fractions if enrichment provided if (enrichment /= -ONE) then ! Calculate the mass fractions of isotopes diff --git a/tests/test_element_wo/inputs_true.dat b/tests/test_element_wo/inputs_true.dat new file mode 100644 index 0000000000..136eedb7a4 --- /dev/null +++ b/tests/test_element_wo/inputs_true.dat @@ -0,0 +1 @@ +7db97c5303ca1f0beaba1b610c0d57cede072af2200b7494515caeca7f0ca43b1e1dbda1968f4f052af6c632cbba8c92203cd53670c19350c55d2339d28b2fb2 \ No newline at end of file diff --git a/tests/test_element_wo/results_true.dat b/tests/test_element_wo/results_true.dat new file mode 100644 index 0000000000..2c37e7f782 --- /dev/null +++ b/tests/test_element_wo/results_true.dat @@ -0,0 +1,5 @@ +k-combined: +8.863826E-01 5.114399E-02 +tally 1: +7.906207E+01 +1.251720E+03 diff --git a/tests/test_element_wo/test_element_wo.py b/tests/test_element_wo/test_element_wo.py new file mode 100644 index 0000000000..1efc3e81bf --- /dev/null +++ b/tests/test_element_wo/test_element_wo.py @@ -0,0 +1,90 @@ +#!/usr/bin/env python + +import os +import sys +import glob +import hashlib +sys.path.insert(0, os.pardir) +from testing_harness import PyAPITestHarness +from input_set import PinCellInputSet +import openmc +import openmc.mgxs + + +class ElementWOTestHarness(PyAPITestHarness): + def _build_inputs(self): + + # Set the input set to use the pincell model + self._input_set = PinCellInputSet() + + # Define materials. + fuel = openmc.Material(name='Fuel') + fuel.set_density('g/cm3', 10.29769) + fuel.add_element("U", 0.88, 'wo') + fuel.add_element("O", 0.12, 'wo') + + clad = openmc.Material(name='Cladding') + clad.set_density('g/cm3', 6.55) + clad.add_element("Zr", 1.0, 'wo') + + hot_water = openmc.Material(name='Hot borated water') + hot_water.set_density('g/cm3', 0.740582) + hot_water.add_element("H", 2./18., 'wo') + hot_water.add_element("O", 16./18., 'wo') + hot_water.add_s_alpha_beta('c_H_in_H2O') + + # Define the materials file. + self._input_set.materials += (fuel, clad, hot_water) + + # Instantiate ZCylinder surfaces + fuel_or = openmc.ZCylinder(x0=0, y0=0, R=0.39218, name='Fuel OR') + clad_or = openmc.ZCylinder(x0=0, y0=0, R=0.45720, name='Clad OR') + left = openmc.XPlane(x0=-0.63, name='left') + right = openmc.XPlane(x0=0.63, name='right') + bottom = openmc.YPlane(y0=-0.63, name='bottom') + top = openmc.YPlane(y0=0.63, name='top') + + left.boundary_type = 'reflective' + right.boundary_type = 'reflective' + top.boundary_type = 'reflective' + bottom.boundary_type = 'reflective' + + # Instantiate Cells + fuel_pin = openmc.Cell(name='cell 1') + cladding = openmc.Cell(name='cell 3') + water = openmc.Cell(name='cell 2') + + # Use surface half-spaces to define regions + fuel_pin.region = -fuel_or + cladding.region = +fuel_or & -clad_or + water.region = +clad_or & +left & -right & +bottom & -top + + # Register Materials with Cells + fuel_pin.fill = fuel + cladding.fill = clad + water.fill = hot_water + + # Instantiate Universe + root = openmc.Universe(universe_id=0, name='root universe') + + # Register Cells with Universe + root.add_cells([fuel_pin, cladding, water]) + + # Instantiate a Geometry, register the root Universe, and export to XML + self._input_set.geometry.root_universe = root + + + mat_filter = openmc.MaterialFilter((fuel.id,)) + flux_tally = openmc.Tally() + flux_tally.filters = [mat_filter] + flux_tally.scores = ['flux'] + + self._input_set.tallies = openmc.Tallies() + self._input_set.tallies += [flux_tally] + self._input_set.build_default_settings() + self._input_set.export() + + +if __name__ == '__main__': + harness = ElementWOTestHarness('statepoint.10.*', True) + harness.main() diff --git a/tests/test_enrichment/inputs_true.dat b/tests/test_enrichment/inputs_true.dat new file mode 100644 index 0000000000..c3a23931f7 --- /dev/null +++ b/tests/test_enrichment/inputs_true.dat @@ -0,0 +1 @@ +9284e022d343431db161faee9290658addde59427a4e42adbdfd5069cd6bd54929bedf87ccb2fb369c91ca52c2c572e8825c4997b662ca2ac34005bf4c58ba83 \ No newline at end of file diff --git a/tests/test_enrichment/results_true.dat b/tests/test_enrichment/results_true.dat new file mode 100644 index 0000000000..cd84b2d40d --- /dev/null +++ b/tests/test_enrichment/results_true.dat @@ -0,0 +1,5 @@ +k-combined: +1.457508E+00 5.577598E-02 +tally 1: +6.199709E+01 +7.692381E+02 diff --git a/tests/test_enrichment/test_enrichment.py b/tests/test_enrichment/test_enrichment.py new file mode 100644 index 0000000000..f17c65df19 --- /dev/null +++ b/tests/test_enrichment/test_enrichment.py @@ -0,0 +1,90 @@ +#!/usr/bin/env python + +import os +import sys +import glob +import hashlib +sys.path.insert(0, os.pardir) +from testing_harness import PyAPITestHarness +from input_set import PinCellInputSet +import openmc +import openmc.mgxs + + +class EnrichmentTestHarness(PyAPITestHarness): + def _build_inputs(self): + + # Set the input set to use the pincell model + self._input_set = PinCellInputSet() + + # Define materials. + fuel = openmc.Material(name='Fuel') + fuel.set_density('g/cm3', 10.29769) + fuel.add_element("U", 0.88, 'wo', enrichment=0.05) + fuel.add_element("O", 0.12, 'wo') + + clad = openmc.Material(name='Cladding') + clad.set_density('g/cm3', 6.55) + clad.add_element("Zr", 1.0, 'wo') + + hot_water = openmc.Material(name='Hot borated water') + hot_water.set_density('g/cm3', 0.740582) + hot_water.add_element("H", 2./18., 'wo') + hot_water.add_element("O", 16./18., 'wo') + hot_water.add_s_alpha_beta('c_H_in_H2O') + + # Define the materials file. + self._input_set.materials += (fuel, clad, hot_water) + + # Instantiate ZCylinder surfaces + fuel_or = openmc.ZCylinder(x0=0, y0=0, R=0.39218, name='Fuel OR') + clad_or = openmc.ZCylinder(x0=0, y0=0, R=0.45720, name='Clad OR') + left = openmc.XPlane(x0=-0.63, name='left') + right = openmc.XPlane(x0=0.63, name='right') + bottom = openmc.YPlane(y0=-0.63, name='bottom') + top = openmc.YPlane(y0=0.63, name='top') + + left.boundary_type = 'reflective' + right.boundary_type = 'reflective' + top.boundary_type = 'reflective' + bottom.boundary_type = 'reflective' + + # Instantiate Cells + fuel_pin = openmc.Cell(name='cell 1') + cladding = openmc.Cell(name='cell 3') + water = openmc.Cell(name='cell 2') + + # Use surface half-spaces to define regions + fuel_pin.region = -fuel_or + cladding.region = +fuel_or & -clad_or + water.region = +clad_or & +left & -right & +bottom & -top + + # Register Materials with Cells + fuel_pin.fill = fuel + cladding.fill = clad + water.fill = hot_water + + # Instantiate Universe + root = openmc.Universe(universe_id=0, name='root universe') + + # Register Cells with Universe + root.add_cells([fuel_pin, cladding, water]) + + # Instantiate a Geometry, register the root Universe, and export to XML + self._input_set.geometry.root_universe = root + + + mat_filter = openmc.MaterialFilter((fuel.id,)) + flux_tally = openmc.Tally() + flux_tally.filters = [mat_filter] + flux_tally.scores = ['flux'] + + self._input_set.tallies = openmc.Tallies() + self._input_set.tallies += [flux_tally] + self._input_set.build_default_settings() + self._input_set.export() + + +if __name__ == '__main__': + harness = EnrichmentTestHarness('statepoint.10.*', True) + harness.main() diff --git a/tests/testing_harness.py b/tests/testing_harness.py index 150d124c8c..0a13e612b4 100644 --- a/tests/testing_harness.py +++ b/tests/testing_harness.py @@ -339,6 +339,7 @@ class PyAPITestHarness(TestHarness): output = [os.path.join(os.getcwd(), 'materials.xml')] output.append(os.path.join(os.getcwd(), 'geometry.xml')) output.append(os.path.join(os.getcwd(), 'settings.xml')) + output.append(os.path.join(os.getcwd(), 'tallies.xml')) output.append(os.path.join(os.getcwd(), 'inputs_test.dat')) output.append(os.path.join(os.getcwd(), 'summary.h5')) for f in output: From 22368e24d8946a691a3289b5155b8cb9e31a39d3 Mon Sep 17 00:00:00 2001 From: Sam Shaner Date: Sun, 16 Oct 2016 22:18:22 -0400 Subject: [PATCH 03/34] updated setup.py to current version in develop branch --- setup.py | 4 ---- 1 file changed, 4 deletions(-) diff --git a/setup.py b/setup.py index 9dceb1cbf7..da98506d3b 100755 --- a/setup.py +++ b/setup.py @@ -61,9 +61,5 @@ if have_cython: 'ext_modules': cythonize('openmc/data/reconstruct.pyx'), 'include_dirs': [np.get_include()] }) - import numpy as np - kwargs.update({ - 'include_dirs': [np.get_include()] - }) setup(**kwargs) From d15c735d93c4282402d8b97797386f3149d7dec1 Mon Sep 17 00:00:00 2001 From: Sam Shaner Date: Mon, 17 Oct 2016 16:52:20 -0400 Subject: [PATCH 04/34] simplified element expansion in input_xml.F90 by using global arrays --- examples/python/pincell/build-xml.py | 2 +- src/constants.F90 | 8 + src/global.F90 | 329 +++ src/input_xml.F90 | 2822 ++-------------------- tests/test_element_wo/inputs_true.dat | 2 +- tests/test_element_wo/results_true.dat | 6 +- tests/test_element_wo/test_element_wo.py | 12 + 7 files changed, 511 insertions(+), 2670 deletions(-) diff --git a/examples/python/pincell/build-xml.py b/examples/python/pincell/build-xml.py index 1e1e15d6d5..534c3ab821 100644 --- a/examples/python/pincell/build-xml.py +++ b/examples/python/pincell/build-xml.py @@ -51,7 +51,7 @@ o = openmc.Element('O') # Instantiate some Materials and register the appropriate Nuclides uo2 = openmc.Material(material_id=1, name='UO2 fuel at 2.4% wt enrichment') uo2.set_density('g/cm3', 10.29769) -uo2.add_element(u, 1., enrichment=0.05) +uo2.add_element(u, 1., enrichment=0.024) uo2.add_element(o, 2.) helium = openmc.Material(material_id=2, name='Helium for gap') diff --git a/src/constants.F90 b/src/constants.F90 index 8c321156cf..cc12969990 100644 --- a/src/constants.F90 +++ b/src/constants.F90 @@ -268,6 +268,14 @@ module constants JENDL_33 = 7, & JENDL_40 = 8 + ! Number of natural elements and nuclides in the global natural_elements + ! and natural_nuclides arrays. Note that some nuclides are repeated in order + ! to make it easy to expand natural elements for different cross section + ! libraries. + integer, parameter :: & + NUM_NATURAL_ELEMENTS = 84, & + NUM_NATURAL_NUCLIDES = 301 + ! Temperature treatment method integer, parameter :: & TEMPERATURE_NEAREST = 1, & diff --git a/src/global.F90 b/src/global.F90 index 042d530f37..40df06b4a2 100644 --- a/src/global.F90 +++ b/src/global.F90 @@ -4,6 +4,7 @@ module global use cmfd_header use constants use dict_header, only: DictCharInt, DictIntInt + use stl_vector, only: VectorChar, VectorReal use geometry_header, only: Cell, Universe, Lattice, LatticeContainer use material_header, only: Material use mesh_header, only: RegularMesh @@ -18,6 +19,7 @@ module global use trigger_header, only: KTrigger use timer_header, only: Timer use volume_header, only: VolumeCalculation + use string, only: to_str #ifdef MPIF08 use mpi_f08 @@ -129,6 +131,333 @@ module global ! Maximum Data Order integer :: max_order + ! ============================================================================ + ! ELEMENT AND NUCLIDE RELATED VARIABLES + + ! List of all possible natural element expansion isotopes + character (len=5), dimension (NUM_NATURAL_NUCLIDES), parameter :: & + natural_nuclides = [character(len=5) :: & + 'H1' , 'H2' , 'He3' , 'He4' , 'Li6' , 'Li7' , 'Be9' , 'B10' , & + 'B11' , 'C0' , 'N14' , 'N15' , 'O16' , 'O17' , 'O18' , 'O16' , & + 'O16' , 'O17' , 'F19' , 'Ne20' , 'Ne21' , 'Ne22' , 'Na23' , 'Mg24' , & + 'Mg25' , 'Mg26' , 'Al27' , 'Si28' , 'Si29' , 'Si30' , 'P31' , 'S32' , & + 'S33' , 'S34' , 'S35' , 'Cl35' , 'Cl37' , 'Ar36' , 'Ar38' , 'Ar40' , & + 'K39' , 'K40' , 'K41' , 'Ca40' , 'Ca42' , 'Ca43' , 'Ca44' , 'Ca46' , & + 'Ca48' , 'Sc45' , 'Ti46' , 'Ti47' , 'Ti48' , 'Ti49' , 'Ti50' , 'V0' , & + 'V50' , 'V51' , 'Cr50' , 'Cr52' , 'Cr53' , 'Cr54' , 'Mn55' , 'Fe54' , & + 'Fe56' , 'Fe57' , 'Fe58' , 'Co59' , 'Ni58' , 'Ni60' , 'Ni61' , 'Ni62' , & + 'Ni64' , 'Cu63' , 'Cu65' , 'Zn0' , 'Zn64' , 'Zn66' , 'Zn67' , 'Zn68' , & + 'Zn70' , 'Ga0' , 'Ga69' , 'Ga71' , 'Ge70' , 'Ge72' , 'Ge73' , 'Ge74' , & + 'Ge76' , 'As75' , 'Se74' , 'Se76' , 'Se77' , 'Se78' , 'Se80' , 'Se82' , & + 'Br79' , 'Br81' , 'Kr78' , 'Kr80' , 'Kr82' , 'Kr83' , 'Kr84' , 'Kr86' , & + 'Rb85' , 'Rb87' , 'Sr84' , 'Sr86' , 'Sr87' , 'Sr88' , 'Y89' , 'Zr90' , & + 'Zr91' , 'Zr92' , 'Zr94' , 'Zr96' , 'Nb93' , 'Mo92' , 'Mo94' , 'Mo95' , & + 'Mo96' , 'Mo97' , 'Mo98' , 'Mo100', 'Ru96' , 'Ru98' , 'Ru99' , 'Ru100', & + 'Ru101', 'Ru102', 'Ru104', 'Rh103', 'Pd102', 'Pd104', 'Pd105', 'Pd106', & + 'Pd108', 'Pd110', 'Ag107', 'Ag109', 'Cd106', 'Cd108', 'Cd110', 'Cd111', & + 'Cd112', 'Cd113', 'Cd114', 'Cd116', 'In113', 'In115', 'Sn112', 'Sn114', & + 'Sn115', 'Sn116', 'Sn117', 'Sn118', 'Sn119', 'Sn120', 'Sn122', 'Sn124', & + 'Sb121', 'Sb123', 'Te120', 'Te122', 'Te123', 'Te124', 'Te125', 'Te126', & + 'Te128', 'Te130', 'I127' , 'Xe124', 'Xe126', 'Xe128', 'Xe129', 'Xe130', & + 'Xe131', 'Xe132', 'Xe134', 'Xe136', 'Cs133', 'Ba130', 'Ba132', 'Ba134', & + 'Ba135', 'Ba136', 'Ba137', 'Ba138', 'La138', 'La139', 'Ce136', 'Ce138', & + 'Ce140', 'Ce142', 'Pr141', 'Nd142', 'Nd143', 'Nd144', 'Nd145', 'Nd146', & + 'Nd148', 'Nd150', 'Sm144', 'Sm147', 'Sm148', 'Sm149', 'Sm150', 'Sm152', & + 'Sm154', 'Eu151', 'Eu153', 'Gd152', 'Gd154', 'Gd155', 'Gd156', 'Gd157', & + 'Gd158', 'Gd160', 'Tb159', 'Dy156', 'Dy158', 'Dy160', 'Dy161', 'Dy162', & + 'Dy163', 'Dy164', 'Ho165', 'Er162', 'Er164', 'Er166', 'Er167', 'Er168', & + 'Er170', 'Tm169', 'Yb168', 'Yb170', 'Yb171', 'Yb172', 'Yb173', 'Yb174', & + 'Yb176', 'Lu175', 'Lu176', 'Hf174', 'Hf176', 'Hf177', 'Hf178', 'Hf179', & + 'Hf180', 'Ta181', 'Ta180', 'Ta181', 'W182' , 'W183' , 'W184' , 'W186' , & + 'W180' , 'W182' , 'W183' , 'W184' , 'W186' , 'Re185', 'Re187', 'Os0' , & + 'Os184', 'Os186', 'Os187', 'Os188', 'Os189', 'Os190', 'Os192', 'Ir191', & + 'Ir193', 'Pt0' , 'Pt190', 'Pt192', 'Pt194', 'Pt195', 'Pt196', 'Pt198', & + 'Au197', 'Hg196', 'Hg198', 'Hg199', 'Hg200', 'Hg201', 'Hg202', 'Hg204', & + 'Tl0' , 'Tl203', 'Tl205', 'Pb204', 'Pb206', 'Pb207', 'Pb208', 'Bi209', & + 'Th232', 'Pa231', 'U234' , 'U235' , 'U238'] + + character (len=2), dimension (NUM_NATURAL_ELEMENTS), parameter :: & + natural_elements = [character(len=2) :: & + 'h' , 'he', 'li', 'be', 'b' , 'c' , 'n' , 'o' , 'f' , 'ne', & + 'na', 'mg', 'al', 'si', 'p' , 's' , 'cl', 'ar', 'k' , 'ca', & + 'sc', 'ti', 'v' , 'cr', 'mn', 'fe', 'co', 'ni', 'cu', 'zn', & + 'ga', 'ge', 'as', 'se', 'br', 'kr', 'rb', 'sr', 'y' , 'zr', & + 'nb', 'mo', 'ru', 'rh', 'pd', 'ag', 'cd', 'in', 'sn', 'sb', & + 'te', 'i' , 'xe', 'cs', 'ba', 'la', 'ce', 'pr', 'nd', 'sm', & + 'eu', 'gd', 'tb', 'dy', 'ho', 'er', 'tm', 'yb', 'lu', 'hf', & + 'ta', 'w' , 're', 'os', 'ir', 'pt', 'au', 'hg', 'tl', 'pb', & + 'bi', 'th', 'pa', 'u'] + + integer, dimension(NUM_NATURAL_ELEMENTS) :: & + natural_nuclides_ENDF_BVII0_start = (/ & + 1 , 3 , 5 , 7 , 8 , 10 , 11 , 17 , 19 , 20 , & + 23 , 24 , 27 , 28 , 31 , 32 , 36 , 38 , 41 , 44 , & + 50 , 51 , 56 , 59 , 63 , 64 , 68 , 69 , 74 , 76 , & + 83 , 85 , 90 , 90 , 97 , 99 , 105 , 107 , 111 , 112 , & + 117 , 118 , 125 , 132 , 133 , 139 , 141 , 149 , 151 , 161 , & + 163 , 171 , 172 , 181 , 182 , 189 , 191 , 195 , 196 , 203 , & + 210 , 212 , 219 , 220 , 227 , 228 , 234 , 235 , 242 , 244 , & + 250 , 253 , 262 , 265 , 272 , 275 , 281 , 282 , 290 , 292 , & + 296 , 297 , 298 , 299 /) + + integer, dimension(NUM_NATURAL_ELEMENTS) :: & + natural_nuclides_ENDF_BVII0_end = (/ & + 3 , 5 , 7 , 8 , 10 , 11 , 13 , 19 , 20 , 23 , & + 24 , 27 , 28 , 31 , 32 , 36 , 38 , 41 , 44 , 50 , & + 51 , 56 , 57 , 63 , 64 , 68 , 69 , 74 , 76 , 77 , & + 85 , 90 , 90 , 97 , 99 , 105 , 107 , 111 , 112 , 117 , & + 118 , 125 , 132 , 133 , 139 , 141 , 149 , 151 , 161 , 163 , & + 171 , 172 , 181 , 182 , 189 , 191 , 195 , 196 , 203 , 210 , & + 212 , 219 , 220 , 227 , 228 , 234 , 235 , 242 , 244 , 250 , & + 251 , 257 , 264 , 272 , 274 , 281 , 282 , 289 , 292 , 296 , & + 297 , 298 , 299 , 302 /) + + integer, dimension(NUM_NATURAL_ELEMENTS) :: & + natural_nuclides_ENDF_BVII1_start = (/ & + 1 , 3 , 5 , 7 , 8 , 10 , 11 , 17 , 19 , 20 , & + 23 , 24 , 27 , 28 , 31 , 32 , 36 , 38 , 41 , 44 , & + 50 , 51 , 57 , 59 , 63 , 64 , 68 , 69 , 74 , 77 , & + 83 , 85 , 90 , 90 , 97 , 99 , 105 , 107 , 111 , 112 , & + 117 , 118 , 125 , 132 , 133 , 139 , 141 , 149 , 151 , 161 , & + 163 , 171 , 172 , 181 , 182 , 189 , 191 , 195 , 196 , 203 , & + 210 , 212 , 219 , 220 , 227 , 228 , 234 , 235 , 242 , 244 , & + 251 , 257 , 262 , 265 , 272 , 275 , 281 , 282 , 290 , 292 , & + 296 , 297 , 298 , 299 /) + + integer, dimension(NUM_NATURAL_ELEMENTS) :: & + natural_nuclides_ENDF_BVII1_end = (/ & + 3 , 5 , 7 , 8 , 10 , 11 , 13 , 19 , 20 , 23 , & + 24 , 27 , 28 , 31 , 32 , 36 , 38 , 41 , 44 , 50 , & + 51 , 56 , 59 , 63 , 64 , 68 , 69 , 74 , 76 , 82 , & + 85 , 90 , 90 , 97 , 99 , 105 , 107 , 111 , 112 , 117 , & + 118 , 125 , 132 , 133 , 139 , 141 , 149 , 151 , 161 , 163 , & + 171 , 172 , 181 , 182 , 189 , 191 , 195 , 196 , 203 , 210 , & + 212 , 219 , 220 , 227 , 228 , 234 , 235 , 242 , 244 , 250 , & + 253 , 262 , 264 , 272 , 274 , 281 , 282 , 289 , 292 , 296 , & + 297 , 298 , 299 , 302 /) + + integer, dimension(NUM_NATURAL_ELEMENTS) :: & + natural_nuclides_JEFF_311_start = (/ & + 1 , 3 , 5 , 7 , 8 , 10 , 11 , 17 , 19 , 20 , & + 23 , 24 , 27 , 28 , 31 , 32 , 36 , 38 , 41 , 44 , & + 50 , 51 , 56 , 59 , 63 , 64 , 68 , 69 , 74 , 76 , & + 82 , 85 , 90 , 90 , 97 , 99 , 105 , 107 , 111 , 112 , & + 117 , 118 , 125 , 132 , 133 , 139 , 141 , 149 , 151 , 161 , & + 163 , 171 , 172 , 181 , 182 , 189 , 191 , 195 , 196 , 203 , & + 210 , 212 , 219 , 220 , 227 , 228 , 234 , 235 , 242 , 244 , & + 250 , 253 , 262 , 264 , 272 , 274 , 281 , 282 , 289 , 292 , & + 296 , 297 , 298 , 299 /) + + integer, dimension(NUM_NATURAL_ELEMENTS) :: & + natural_nuclides_JEFF_311_end = (/ & + 3 , 5 , 7 , 8 , 10 , 11 , 13 , 19 , 20 , 23 , & + 24 , 27 , 28 , 31 , 32 , 36 , 38 , 41 , 44 , 50 , & + 51 , 56 , 57 , 63 , 64 , 68 , 69 , 74 , 76 , 77 , & + 83 , 90 , 90 , 97 , 99 , 105 , 107 , 111 , 112 , 117 , & + 118 , 125 , 132 , 133 , 139 , 141 , 149 , 151 , 161 , 163 , & + 171 , 172 , 181 , 182 , 189 , 191 , 195 , 196 , 203 , 210 , & + 212 , 219 , 220 , 227 , 228 , 234 , 235 , 242 , 244 , 250 , & + 251 , 257 , 264 , 265 , 274 , 275 , 282 , 289 , 290 , 296 , & + 297 , 298 , 299 , 302 /) + + integer, dimension(NUM_NATURAL_ELEMENTS) :: & + natural_nuclides_JEFF_312_start = (/ & + 1 , 3 , 5 , 7 , 8 , 10 , 11 , 17 , 19 , 20 , & + 23 , 24 , 27 , 28 , 31 , 32 , 36 , 38 , 41 , 44 , & + 50 , 51 , 57 , 59 , 63 , 64 , 68 , 69 , 74 , 76 , & + 82 , 85 , 90 , 90 , 97 , 99 , 105 , 107 , 111 , 112 , & + 117 , 118 , 125 , 132 , 133 , 139 , 141 , 149 , 151 , 161 , & + 163 , 171 , 172 , 181 , 182 , 189 , 191 , 195 , 196 , 203 , & + 210 , 212 , 219 , 220 , 227 , 228 , 234 , 235 , 242 , 244 , & + 250 , 253 , 262 , 264 , 272 , 274 , 281 , 282 , 289 , 292 , & + 296 , 297 , 298 , 299 /) + + integer, dimension(NUM_NATURAL_ELEMENTS) :: & + natural_nuclides_JEFF_312_end = (/ & + 3 , 5 , 7 , 8 , 10 , 11 , 13 , 19 , 20 , 23 , & + 24 , 27 , 28 , 31 , 32 , 36 , 38 , 41 , 44 , 50 , & + 51 , 56 , 59 , 63 , 64 , 68 , 69 , 74 , 76 , 77 , & + 83 , 90 , 90 , 97 , 99 , 105 , 107 , 111 , 112 , 117 , & + 118 , 125 , 132 , 133 , 139 , 141 , 149 , 151 , 161 , 163 , & + 171 , 172 , 181 , 182 , 189 , 191 , 195 , 196 , 203 , 210 , & + 212 , 219 , 220 , 227 , 228 , 234 , 235 , 242 , 244 , 250 , & + 251 , 257 , 264 , 265 , 274 , 275 , 282 , 289 , 290 , 296 , & + 297 , 298 , 299 , 302 /) + + integer, dimension(NUM_NATURAL_ELEMENTS) :: & + natural_nuclides_JEFF_32_start = (/ & + 1 , 3 , 5 , 7 , 8 , 10 , 11 , 13 , 19 , 20 , & + 23 , 24 , 27 , 28 , 31 , 32 , 36 , 38 , 41 , 44 , & + 50 , 51 , 56 , 59 , 63 , 64 , 68 , 69 , 74 , 77 , & + 83 , 85 , 90 , 90 , 97 , 99 , 105 , 107 , 111 , 112 , & + 117 , 118 , 125 , 132 , 133 , 139 , 141 , 149 , 151 , 161 , & + 163 , 171 , 172 , 181 , 182 , 189 , 191 , 195 , 196 , 203 , & + 210 , 212 , 219 , 220 , 227 , 228 , 234 , 235 , 242 , 244 , & + 251 , 257 , 262 , 265 , 272 , 275 , 281 , 282 , 290 , 292 , & + 296 , 297 , 298 , 299 /) + + integer, dimension(NUM_NATURAL_ELEMENTS) :: & + natural_nuclides_JEFF_32_end = (/ & + 3 , 5 , 7 , 8 , 10 , 11 , 13 , 16 , 20 , 23 , & + 24 , 27 , 28 , 31 , 32 , 36 , 38 , 41 , 44 , 50 , & + 51 , 56 , 57 , 63 , 64 , 68 , 69 , 74 , 76 , 82 , & + 85 , 90 , 90 , 97 , 99 , 105 , 107 , 111 , 112 , 117 , & + 118 , 125 , 132 , 133 , 139 , 141 , 149 , 151 , 161 , 163 , & + 171 , 172 , 181 , 182 , 189 , 191 , 195 , 196 , 203 , 210 , & + 212 , 219 , 220 , 227 , 228 , 234 , 235 , 242 , 244 , 250 , & + 253 , 262 , 264 , 272 , 274 , 281 , 282 , 289 , 292 , 296 , & + 297 , 298 , 299 , 302 /) + + integer, dimension(NUM_NATURAL_ELEMENTS) :: & + natural_nuclides_JENDL_32_start = (/ & + 1 , 3 , 5 , 7 , 8 , 10 , 11 , 16 , 19 , 20 , & + 23 , 24 , 27 , 28 , 31 , 32 , 36 , 38 , 41 , 44 , & + 50 , 51 , 56 , 59 , 63 , 64 , 68 , 69 , 74 , 77 , & + 83 , 85 , 90 , 90 , 97 , 99 , 105 , 107 , 111 , 112 , & + 117 , 118 , 125 , 132 , 133 , 139 , 141 , 149 , 151 , 161 , & + 163 , 171 , 172 , 181 , 182 , 189 , 191 , 195 , 196 , 203 , & + 210 , 212 , 219 , 220 , 227 , 228 , 234 , 235 , 242 , 244 , & + 250 , 253 , 262 , 265 , 272 , 275 , 281 , 282 , 290 , 292 , & + 296 , 297 , 298 , 299 /) + + integer, dimension(NUM_NATURAL_ELEMENTS) :: & + natural_nuclides_JENDL_32_end = (/ & + 3 , 5 , 7 , 8 , 10 , 11 , 13 , 17 , 20 , 23 , & + 24 , 27 , 28 , 31 , 32 , 36 , 38 , 41 , 44 , 50 , & + 51 , 56 , 57 , 63 , 64 , 68 , 69 , 74 , 76 , 82 , & + 85 , 90 , 90 , 97 , 99 , 105 , 107 , 111 , 112 , 117 , & + 118 , 125 , 132 , 133 , 139 , 141 , 149 , 151 , 161 , 163 , & + 171 , 172 , 181 , 182 , 189 , 191 , 195 , 196 , 203 , 210 , & + 212 , 219 , 220 , 227 , 228 , 234 , 235 , 242 , 244 , 250 , & + 251 , 257 , 264 , 272 , 274 , 281 , 282 , 289 , 292 , 296 , & + 297 , 298 , 299 , 302 /) + + integer, dimension(NUM_NATURAL_ELEMENTS) :: & + natural_nuclides_JENDL_33_start = (/ & + 1 , 3 , 5 , 7 , 8 , 10 , 11 , 16 , 19 , 20 , & + 23 , 24 , 27 , 28 , 31 , 32 , 36 , 38 , 41 , 44 , & + 50 , 51 , 56 , 59 , 63 , 64 , 68 , 69 , 74 , 77 , & + 83 , 85 , 90 , 90 , 97 , 99 , 105 , 107 , 111 , 112 , & + 117 , 118 , 125 , 132 , 133 , 139 , 141 , 149 , 151 , 161 , & + 163 , 171 , 172 , 181 , 182 , 189 , 191 , 195 , 196 , 203 , & + 210 , 212 , 219 , 220 , 227 , 228 , 234 , 235 , 242 , 244 , & + 250 , 253 , 262 , 265 , 272 , 275 , 281 , 282 , 290 , 292 , & + 296 , 297 , 298 , 299 /) + + integer, dimension(NUM_NATURAL_ELEMENTS) :: & + natural_nuclides_JENDL_33_end = (/ & + 3 , 5 , 7 , 8 , 10 , 11 , 13 , 17 , 20 , 23 , & + 24 , 27 , 28 , 31 , 32 , 36 , 38 , 41 , 44 , 50 , & + 51 , 56 , 57 , 63 , 64 , 68 , 69 , 74 , 76 , 82 , & + 85 , 90 , 90 , 97 , 99 , 105 , 107 , 111 , 112 , 117 , & + 118 , 125 , 132 , 133 , 139 , 141 , 149 , 151 , 161 , 163 , & + 171 , 172 , 181 , 182 , 189 , 191 , 195 , 196 , 203 , 210 , & + 212 , 219 , 220 , 227 , 228 , 234 , 235 , 242 , 244 , 250 , & + 251 , 257 , 264 , 272 , 274 , 281 , 282 , 289 , 292 , 296 , & + 297 , 298 , 299 , 302 /) + + integer, dimension(NUM_NATURAL_ELEMENTS) :: & + natural_nuclides_JENDL_40_start = (/ & + 1 , 3 , 5 , 7 , 8 , 10 , 11 , 16 , 19 , 20 , & + 23 , 24 , 27 , 28 , 31 , 32 , 36 , 38 , 41 , 44 , & + 50 , 51 , 57 , 59 , 63 , 64 , 68 , 69 , 74 , 77 , & + 83 , 85 , 90 , 90 , 97 , 99 , 105 , 107 , 111 , 112 , & + 117 , 118 , 125 , 132 , 133 , 139 , 141 , 149 , 151 , 161 , & + 163 , 171 , 172 , 181 , 182 , 189 , 191 , 195 , 196 , 203 , & + 210 , 212 , 219 , 220 , 227 , 228 , 234 , 235 , 242 , 244 , & + 250 , 257 , 262 , 265 , 272 , 275 , 281 , 282 , 290 , 292 , & + 296 , 297 , 298 , 299 /) + + integer, dimension(NUM_NATURAL_ELEMENTS) :: & + natural_nuclides_JENDL_40_end = (/ & + 3 , 5 , 7 , 8 , 10 , 11 , 13 , 17 , 20 , 23 , & + 24 , 27 , 28 , 31 , 32 , 36 , 38 , 41 , 44 , 50 , & + 51 , 56 , 59 , 63 , 64 , 68 , 69 , 74 , 76 , 82 , & + 85 , 90 , 90 , 97 , 99 , 105 , 107 , 111 , 112 , 117 , & + 118 , 125 , 132 , 133 , 139 , 141 , 149 , 151 , 161 , 163 , & + 171 , 172 , 181 , 182 , 189 , 191 , 195 , 196 , 203 , 210 , & + 212 , 219 , 220 , 227 , 228 , 234 , 235 , 242 , 244 , 250 , & + 251 , 262 , 264 , 272 , 274 , 281 , 282 , 289 , 292 , 296 , & + 297 , 298 , 299 , 302 /) + + real(8), dimension (NUM_NATURAL_NUCLIDES) :: natural_nuclides_mf = (/ & + 0.999885_8 , 0.000115_8 , 0.00000134_8, 0.99999866_8, & + 0.0759_8 , 0.9241_8 , ONE , 0.199_8 , & + 0.801_8 , ONE , 0.99636_8 , 0.00364_8 , & + 0.99757_8 , 0.00038_8 , 0.00205_8 , ONE , & + 0.99962_8 , 0.00038_8 , ONE , 0.9048_8 , & + 0.0027_8 , 0.0925_8 , ONE , 0.7899_8 , & + 0.1000_8 , 0.1101_8 , ONE , 0.92223_8 , & + 0.04685_8 , 0.03092_8 , ONE , 0.9499_8 , & + 0.0075_8 , 0.0425_8 , 0.0001_8 , 0.7576_8 , & + 0.2424_8 , 0.003336_8 , 0.000629_8 , 0.996035_8 , & + 0.932581_8 , 0.000117_8 , 0.067302_8 , 0.96941_8 , & + 0.00647_8 , 0.00135_8 , 0.02086_8 , 0.00004_8 , & + 0.00187_8 , ONE , 0.0825_8 , 0.0744_8 , & + 0.7372_8 , 0.0541_8 , 0.0518_8 , ONE , & + 0.0025_8 , 0.9975_8 , 0.04345_8 , 0.83789_8 , & + 0.09501_8 , 0.02365_8 , ONE , 0.05845_8 , & + 0.91754_8 , 0.02119_8 , 0.00282_8 , ONE , & + 0.68077_8 , 0.26223_8 , 0.011399_8 , 0.036346_8 , & + 0.009255_8 , 0.6915_8 , 0.3085_8 , ONE , & + 0.4917_8 , 0.2773_8 , 0.0404_8 , 0.1845_8 , & + 0.0061_8 , ONE , 0.60108_8 , 0.39892_8 , & + 0.2057_8 , 0.2745_8 , 0.0775_8 , 0.3650_8 , & + 0.0773_8 , ONE , 0.0089_8 , 0.0937_8 , & + 0.0763_8 , 0.2377_8 , 0.4961_8 , 0.0873_8 , & + 0.5069_8 , 0.4931_8 , 0.00355_8 , 0.02286_8 , & + 0.11593_8 , 0.11500_8 , 0.56987_8 , 0.17279_8 , & + 0.7217_8 , 0.2783_8 , 0.0056_8 , 0.0986_8 , & + 0.0700_8 , 0.8258_8 , ONE , 0.5145_8 , & + 0.1122_8 , 0.1715_8 , 0.1738_8 , 0.0280_8 , & + ONE , 0.1453_8 , 0.0915_8 , 0.1584_8 , & + 0.1667_8 , 0.0960_8 , 0.2439_8 , 0.0982_8 , & + 0.0554_8 , 0.0187_8 , 0.1276_8 , 0.1260_8 , & + 0.1706_8 , 0.3155_8 , 0.1862_8 , ONE , & + 0.0102_8 , 0.1114_8 , 0.2233_8 , 0.2733_8 , & + 0.2646_8 , 0.1172_8 , 0.51839_8 , 0.48161_8 , & + 0.0125_8 , 0.0089_8 , 0.1249_8 , 0.1280_8 , & + 0.2413_8 , 0.1222_8 , 0.2873_8 , 0.0749_8 , & + 0.0429_8 , 0.9571_8 , 0.0097_8 , 0.0066_8 , & + 0.0034_8 , 0.1454_8 , 0.0768_8 , 0.2422_8 , & + 0.0859_8 , 0.3258_8 , 0.0463_8 , 0.0579_8 , & + 0.5721_8 , 0.4279_8 , 0.0009_8 , 0.0255_8 , & + 0.0089_8 , 0.0474_8 , 0.0707_8 , 0.1884_8 , & + 0.3174_8 , 0.3408_8 , ONE , 0.000952_8 , & + 0.000890_8 , 0.019102_8 , 0.264006_8 , 0.040710_8 , & + 0.212324_8 , 0.269086_8 , 0.104357_8 , 0.088573_8 , & + ONE , 0.00106_8 , 0.00101_8 , 0.02417_8 , & + 0.06592_8 , 0.07854_8 , 0.11232_8 , 0.71698_8 , & + 0.0008881_8 , 0.9991119_8 , 0.00185_8 , 0.00251_8 , & + 0.88450_8 , 0.11114_8 , ONE , 0.27152_8 , & + 0.12174_8 , 0.23798_8 , 0.08293_8 , 0.17189_8 , & + 0.05756_8 , 0.05638_8 , 0.0307_8 , 0.1499_8 , & + 0.1124_8 , 0.1382_8 , 0.0738_8 , 0.2675_8 , & + 0.2275_8 , 0.4781_8 , 0.5219_8 , 0.0020_8 , & + 0.0218_8 , 0.1480_8 , 0.2047_8 , 0.1565_8 , & + 0.2484_8 , 0.2186_8 , ONE , 0.00056_8 , & + 0.00095_8 , 0.02329_8 , 0.18889_8 , 0.25475_8 , & + 0.24896_8 , 0.28260_8 , ONE , 0.00139_8 , & + 0.01601_8 , 0.33503_8 , 0.22869_8 , 0.26978_8 , & + 0.14910_8 , ONE , 0.00123_8 , 0.02982_8 , & + 0.1409_8 , 0.2168_8 , 0.16103_8 , 0.32026_8 , & + 0.12996_8 , 0.97401_8 , 0.02599_8 , 0.0016_8 , & + 0.0526_8 , 0.1860_8 , 0.2728_8 , 0.1362_8 , & + 0.3508_8 , ONE , 0.0001201_8 , 0.9998799_8 , & + 0.2662_8 , 0.1431_8 , 0.3064_8 , 0.2843_8 , & + 0.0012_8 , 0.2650_8 , 0.1431_8 , 0.3064_8 , & + 0.2843_8 , 0.3740_8 , 0.6260_8 , ONE , & + 0.0002_8 , 0.0159_8 , 0.0196_8 , 0.1324_8 , & + 0.1615_8 , 0.2626_8 , 0.4078_8 , 0.373_8 , & + 0.627_8 , ONE , 0.00012_8 , 0.00782_8 , & + 0.3286_8 , 0.3378_8 , 0.2521_8 , 0.07356_8 , & + ONE , 0.0015_8 , 0.0997_8 , 0.1687_8 , & + 0.2310_8 , 0.1318_8 , 0.2986_8 , 0.0687_8 , & + ONE , 0.2952_8 , 0.7048_8 , 0.014_8 , & + 0.241_8 , 0.221_8 , 0.524_8 , ONE , & + ONE , ONE , 0.000054_8 , 0.007204_8 , & + 0.992742_8 /) + ! ============================================================================ ! TALLY-RELATED VARIABLES diff --git a/src/input_xml.F90 b/src/input_xml.F90 index 8bf3f2825f..9e309899e6 100644 --- a/src/input_xml.F90 +++ b/src/input_xml.F90 @@ -4583,521 +4583,69 @@ contains character(*), intent(in) :: name type(VectorChar), intent(inout) :: names + integer :: i character(2) :: element_name + integer :: natural_elements_loc + integer :: nuclide_start + integer :: nuclide_end - element_name = name(1:2) + ! Convert the element name to lower case + element_name = to_lower(name(1:2)) - select case (to_lower(element_name)) - case ('h') - call names % push_back('H1') - call names % push_back('H2') - case ('he') - call names % push_back('He3') - call names % push_back('He4') - - case ('li') - call names % push_back('Li6') - call names % push_back('Li7') - - case ('be') - call names % push_back('Be9') - - case ('b') - call names % push_back('B10') - call names % push_back('B11') - - case ('c') - ! No evaluations split up Carbon into isotopes yet - call names % push_back('C0') - - case ('n') - call names % push_back('N14') - call names % push_back('N15') - - case ('o') - if (default_expand == JEFF_32) then - call names % push_back('O16') - call names % push_back('O17') - call names % push_back('O18') - elseif (default_expand >= JENDL_32 .and. default_expand <= JENDL_40) then - call names % push_back('O16') - else - call names % push_back('O16') - call names % push_back('O17') + ! Find location of element name in natural_elements + i = -1 + do i = 1, num_natural_elements + if (natural_elements(i) == element_name) then + natural_elements_loc = i end if + end do - case ('f') - call names % push_back('F19') - - case ('ne') - call names % push_back('Ne20') - call names % push_back('Ne21') - call names % push_back('Ne22') - - case ('na') - call names % push_back('Na23') - - case ('mg') - call names % push_back('Mg24') - call names % push_back('Mg25') - call names % push_back('Mg26') - - case ('al') - call names % push_back('Al27') - - case ('si') - call names % push_back('Si28') - call names % push_back('Si29') - call names % push_back('Si30') - - case ('p') - call names % push_back('P31') - - case ('s') - call names % push_back('S32') - call names % push_back('S33') - call names % push_back('S34') - call names % push_back('S36') - - case ('cl') - call names % push_back('Cl35') - call names % push_back('Cl37') - - case ('ar') - call names % push_back('Ar36') - call names % push_back('Ar38') - call names % push_back('Ar40') - - case ('k') - call names % push_back('K39') - call names % push_back('K40') - call names % push_back('K41') - - case ('ca') - call names % push_back('Ca40') - call names % push_back('Ca42') - call names % push_back('Ca43') - call names % push_back('Ca44') - call names % push_back('Ca46') - call names % push_back('Ca48') - - case ('sc') - call names % push_back('Sc45') - - case ('ti') - call names % push_back('Ti46') - call names % push_back('Ti47') - call names % push_back('Ti48') - call names % push_back('Ti49') - call names % push_back('Ti50') - - case ('v') - if (default_expand == ENDF_BVII0 .or. default_expand == JEFF_311 & - .or. default_expand == JEFF_32 .or. & - (default_expand >= JENDL_32 .and. default_expand <= JENDL_33)) then - call names % push_back('V0') - else - call names % push_back('V50') - call names % push_back('V51') - end if - - case ('cr') - call names % push_back('Cr50') - call names % push_back('Cr52') - call names % push_back('Cr53') - call names % push_back('Cr54') - - case ('mn') - call names % push_back('Mn55') - - case ('fe') - call names % push_back('Fe54') - call names % push_back('Fe56') - call names % push_back('Fe57') - call names % push_back('Fe58') - - case ('co') - call names % push_back('Co59') - - case ('ni') - call names % push_back('Ni58') - call names % push_back('Ni60') - call names % push_back('Ni61') - call names % push_back('Ni62') - call names % push_back('Ni64') - - case ('cu') - call names % push_back('Cu63') - call names % push_back('Cu65') - - case ('zn') - if (default_expand == ENDF_BVII0 .or. default_expand == & - JEFF_311 .or. default_expand == JEFF_312) then - call names % push_back('Zn0') - else - call names % push_back('Zn64') - call names % push_back('Zn66') - call names % push_back('Zn67') - call names % push_back('Zn68') - call names % push_back('Zn70') - end if - - case ('ga') - if (default_expand == JEFF_311 .or. default_expand == JEFF_312) then - call names % push_back('Ga0') - else - call names % push_back('Ga69') - call names % push_back('Ga71') - end if - - case ('ge') - call names % push_back('Ge70') - call names % push_back('Ge72') - call names % push_back('Ge73') - call names % push_back('Ge74') - call names % push_back('Ge76') - - case ('as') - call names % push_back('As75') - - case ('se') - call names % push_back('Se74') - call names % push_back('Se76') - call names % push_back('Se77') - call names % push_back('Se78') - call names % push_back('Se80') - call names % push_back('Se82') - - case ('br') - call names % push_back('Br79') - call names % push_back('Br81') - - case ('kr') - call names % push_back('Kr78') - call names % push_back('Kr80') - call names % push_back('Kr82') - call names % push_back('Kr83') - call names % push_back('Kr84') - call names % push_back('Kr86') - - case ('rb') - call names % push_back('Rb85') - call names % push_back('Rb87') - - case ('sr') - call names % push_back('Sr84') - call names % push_back('Sr86') - call names % push_back('Sr87') - call names % push_back('Sr88') - - case ('y') - call names % push_back('Y89') - - case ('zr') - call names % push_back('Zr90') - call names % push_back('Zr91') - call names % push_back('Zr92') - call names % push_back('Zr94') - call names % push_back('Zr96') - - case ('nb') - call names % push_back('Nb93') - - case ('mo') - call names % push_back('Mo92') - call names % push_back('Mo94') - call names % push_back('Mo95') - call names % push_back('Mo96') - call names % push_back('Mo97') - call names % push_back('Mo98') - call names % push_back('Mo100') - - case ('ru') - call names % push_back('Ru96') - call names % push_back('Ru98') - call names % push_back('Ru99') - call names % push_back('Ru100') - call names % push_back('Ru101') - call names % push_back('Ru102') - call names % push_back('Ru104') - - case ('rh') - call names % push_back('Rh103') - - case ('pd') - call names % push_back('Pd102') - call names % push_back('Pd104') - call names % push_back('Pd105') - call names % push_back('Pd106') - call names % push_back('Pd108') - call names % push_back('Pd110') - - case ('ag') - call names % push_back('Ag107') - call names % push_back('Ag109') - - case ('cd') - call names % push_back('Cd106') - call names % push_back('Cd108') - call names % push_back('Cd110') - call names % push_back('Cd111') - call names % push_back('Cd112') - call names % push_back('Cd113') - call names % push_back('Cd114') - call names % push_back('Cd116') - - case ('in') - call names % push_back('In113') - call names % push_back('In115') - - case ('sn') - call names % push_back('Sn112') - call names % push_back('Sn114') - call names % push_back('Sn115') - call names % push_back('Sn116') - call names % push_back('Sn117') - call names % push_back('Sn118') - call names % push_back('Sn119') - call names % push_back('Sn120') - call names % push_back('Sn122') - call names % push_back('Sn124') - - case ('sb') - call names % push_back('Sb121') - call names % push_back('Sb123') - - case ('te') - call names % push_back('Te120') - call names % push_back('Te122') - call names % push_back('Te123') - call names % push_back('Te124') - call names % push_back('Te125') - call names % push_back('Te126') - call names % push_back('Te128') - call names % push_back('Te130') - - case ('i') - call names % push_back('I127') - - case ('xe') - call names % push_back('Xe124') - call names % push_back('Xe126') - call names % push_back('Xe128') - call names % push_back('Xe129') - call names % push_back('Xe130') - call names % push_back('Xe131') - call names % push_back('Xe132') - call names % push_back('Xe134') - call names % push_back('Xe136') - - case ('cs') - call names % push_back('Cs133') - - case ('ba') - call names % push_back('Ba130') - call names % push_back('Ba132') - call names % push_back('Ba134') - call names % push_back('Ba135') - call names % push_back('Ba136') - call names % push_back('Ba137') - call names % push_back('Ba138') - - case ('la') - call names % push_back('La138') - call names % push_back('La139') - - case ('ce') - call names % push_back('Ce136') - call names % push_back('Ce138') - call names % push_back('Ce140') - call names % push_back('Ce142') - - case ('pr') - call names % push_back('Pr141') - - case ('nd') - call names % push_back('Nd142') - call names % push_back('Nd143') - call names % push_back('Nd144') - call names % push_back('Nd145') - call names % push_back('Nd146') - call names % push_back('Nd148') - call names % push_back('Nd150') - - case ('sm') - call names % push_back('Sm144') - call names % push_back('Sm147') - call names % push_back('Sm148') - call names % push_back('Sm149') - call names % push_back('Sm150') - call names % push_back('Sm152') - call names % push_back('Sm154') - - case ('eu') - call names % push_back('Eu151') - call names % push_back('Eu153') - - case ('gd') - call names % push_back('Gd152') - call names % push_back('Gd154') - call names % push_back('Gd155') - call names % push_back('Gd156') - call names % push_back('Gd157') - call names % push_back('Gd158') - call names % push_back('Gd160') - - case ('tb') - call names % push_back('Tb159') - - case ('dy') - call names % push_back('Dy156') - call names % push_back('Dy158') - call names % push_back('Dy160') - call names % push_back('Dy161') - call names % push_back('Dy162') - call names % push_back('Dy163') - call names % push_back('Dy164') - - case ('ho') - call names % push_back('Ho165') - - case ('er') - call names % push_back('Er162') - call names % push_back('Er164') - call names % push_back('Er166') - call names % push_back('Er167') - call names % push_back('Er168') - call names % push_back('Er170') - - case ('tm') - call names % push_back('Tm169') - - case ('yb') - call names % push_back('Yb168') - call names % push_back('Yb170') - call names % push_back('Yb171') - call names % push_back('Yb172') - call names % push_back('Yb173') - call names % push_back('Yb174') - call names % push_back('Yb176') - - case ('lu') - call names % push_back('Lu175') - call names % push_back('Lu176') - - case ('hf') - call names % push_back('Hf174') - call names % push_back('Hf176') - call names % push_back('Hf177') - call names % push_back('Hf178') - call names % push_back('Hf179') - call names % push_back('Hf180') - - case ('ta') - if (default_expand == ENDF_BVII0 .or. & - (default_expand >= JEFF_311 .and. default_expand <= JEFF_312) .or. & - (default_expand >= JENDL_32 .and. default_expand <= JENDL_40)) then - call names % push_back('Ta181') - else - call names % push_back('Ta180') - call names % push_back('Ta181') - end if - - case ('w') - if (default_expand == ENDF_BVII0 .or. default_expand == JEFF_311 & - .or. default_expand == JEFF_312 .or. & - (default_expand >= JENDL_32 .and. default_expand <= JENDL_33)) then - ! Combine W-180 with W-182 - call names % push_back('W182') - call names % push_back('W183') - call names % push_back('W184') - call names % push_back('W186') - else - call names % push_back('W180') - call names % push_back('W182') - call names % push_back('W183') - call names % push_back('W184') - call names % push_back('W186') - end if - - case ('re') - call names % push_back('Re185') - call names % push_back('Re187') - - case ('os') - if (default_expand == JEFF_311 .or. default_expand == JEFF_312) then - call names % push_back('Os0') - else - call names % push_back('Os184') - call names % push_back('Os186') - call names % push_back('Os187') - call names % push_back('Os188') - call names % push_back('Os189') - call names % push_back('Os190') - call names % push_back('Os192') - end if - - case ('ir') - call names % push_back('Ir191') - call names % push_back('Ir193') - - case ('pt') - if (default_expand == JEFF_311 .or. default_expand == JEFF_312) then - call names % push_back('Pt0') - else - call names % push_back('Pt190') - call names % push_back('Pt192') - call names % push_back('Pt194') - call names % push_back('Pt195') - call names % push_back('Pt196') - call names % push_back('Pt198') - end if - - case ('au') - call names % push_back('Au197') - - case ('hg') - call names % push_back('Hg196') - call names % push_back('Hg198') - call names % push_back('Hg199') - call names % push_back('Hg200') - call names % push_back('Hg201') - call names % push_back('Hg202') - call names % push_back('Hg204') - - case ('tl') - if (default_expand == JEFF_311 .or. default_expand == JEFF_312) then - call names % push_back('Tl0') - else - call names % push_back('Tl203') - call names % push_back('Tl205') - end if - - case ('pb') - call names % push_back('Pb204') - call names % push_back('Pb206') - call names % push_back('Pb207') - call names % push_back('Pb208') - - case ('bi') - call names % push_back('Bi209') - - case ('th') - call names % push_back('Th232') - - case ('pa') - call names % push_back('Pa231') - - case ('u') - call names % push_back('U234') - call names % push_back('U235') - call names % push_back('U238') - - case default + ! Issue error if element not found + if (i == -1) then call fatal_error("Cannot expand element: " // name) + end if + + ! Get start and end locations in natural_nuclides arrays + select case (default_expand) + case (ENDF_BVII0) + nuclide_start = natural_nuclides_ENDF_BVII0_start(natural_elements_loc) + nuclide_end = natural_nuclides_ENDF_BVII0_end(natural_elements_loc) + + case (ENDF_BVII1) + nuclide_start = natural_nuclides_ENDF_BVII1_start(natural_elements_loc) + nuclide_end = natural_nuclides_ENDF_BVII1_end(natural_elements_loc) + + case (JEFF_311) + nuclide_start = natural_nuclides_JEFF_311_start(natural_elements_loc) + nuclide_end = natural_nuclides_JEFF_311_end(natural_elements_loc) + + case (JEFF_312) + nuclide_start = natural_nuclides_JEFF_312_start(natural_elements_loc) + nuclide_end = natural_nuclides_JEFF_312_end(natural_elements_loc) + + case (JEFF_32) + nuclide_start = natural_nuclides_JEFF_32_start(natural_elements_loc) + nuclide_end = natural_nuclides_JEFF_32_end(natural_elements_loc) + + case (JENDL_32) + nuclide_start = natural_nuclides_JENDL_32_start(natural_elements_loc) + nuclide_end = natural_nuclides_JENDL_32_end(natural_elements_loc) + + case (JENDL_33) + nuclide_start = natural_nuclides_JENDL_33_start(natural_elements_loc) + nuclide_end = natural_nuclides_JENDL_33_end(natural_elements_loc) + + case (JENDL_40) + nuclide_start = natural_nuclides_JENDL_40_start(natural_elements_loc) + nuclide_end = natural_nuclides_JENDL_40_end(natural_elements_loc) end select + ! Add the nuclide names to the names array + do i = nuclide_start, nuclide_end-1 + call names % push_back(natural_nuclides(i)) + end do + end subroutine expand_natural_element_names !=============================================================================== @@ -5116,2169 +4664,112 @@ contains real(8), intent(in) :: enrichment ! enrichment in weight % type(VectorReal), intent(inout) :: densities ! isotope densities vector - integer :: i ! iterator - integer :: n_isotopes ! number of isotopes in the element - character(2) :: element_name ! element atomic symbol - real(8) :: element_awr ! element atomic weight ratio - real(8), allocatable :: awr(:) ! isotope atomic weight ratios - real(8), allocatable :: mf(:) ! isotope mole fractions - - element_name = name(1:2) - - select case (to_lower(element_name)) - case ('h') - - ! Set the number of isotopes in this element - n_isotopes = 2 - - ! Allocate and initialize array for the atomic weight ratios - allocate(awr(n_isotopes)) - awr = ONE - - ! Allocate and initialize array for mole fractions - allocate(mf(n_isotopes)) - mf(1) = 0.999885_8 - mf(2) = 0.000115_8 - - ! Get the atomic weight ratios - if (expand_by == "wo") then - awr(1) = nuclides(nuclide_dict % get_key('h1')) % awr - awr(2) = nuclides(nuclide_dict % get_key('h2')) % awr - end if - - case ('he') - - ! Set the number of isotopes in this element - n_isotopes = 2 - - ! Allocate and initialize array for the atomic weight ratios - allocate(awr(n_isotopes)) - awr = ONE - - ! Allocate and initialize array for mole fractions - allocate(mf(n_isotopes)) - mf(1) = 0.00000134_8 - mf(2) = 0.99999866_8 - - ! Get the atomic weight ratios - if (expand_by == "wo") then - awr(1) = nuclides(nuclide_dict % get_key('he3')) % awr - awr(2) = nuclides(nuclide_dict % get_key('he4')) % awr - end if - - case ('li') - - ! Set the number of isotopes in this element - n_isotopes = 2 - - ! Allocate and initialize array for the atomic weight ratios - allocate(awr(n_isotopes)) - awr = ONE - - ! Allocate and initialize array for mole fractions - allocate(mf(n_isotopes)) - mf(1) = 0.0759_8 - mf(2) = 0.9241_8 - - ! Get the atomic weight ratios - if (expand_by == "wo") then - awr(1) = nuclides(nuclide_dict % get_key('li6')) % awr - awr(2) = nuclides(nuclide_dict % get_key('li7')) % awr - end if - - case ('be') - - ! Set the number of isotopes in this element - n_isotopes = 1 - - ! Allocate and initialize array for the atomic weight ratios - allocate(awr(n_isotopes)) - awr = ONE - - ! Allocate and initialize array for mole fractions - allocate(mf(n_isotopes)) - mf(1) = ONE - - ! Get the atomic weight ratios - if (expand_by == "wo") then - awr(1) = nuclides(nuclide_dict % get_key('be9')) % awr - end if - - case ('b') - - ! Set the number of isotopes in this element - n_isotopes = 2 - - ! Allocate and initialize array for the atomic weight ratios - allocate(awr(n_isotopes)) - awr = ONE - - ! Allocate and initialize array for mole fractions - allocate(mf(n_isotopes)) - mf(1) = 0.199_8 - mf(2) = 0.801_8 - - ! Get the atomic weight ratios - if (expand_by == "wo") then - awr(1) = nuclides(nuclide_dict % get_key('b10')) % awr - awr(2) = nuclides(nuclide_dict % get_key('b11')) % awr - end if - - case ('c') - - ! No evaluations split up Carbon into isotopes yet - - ! Set the number of isotopes in this element - n_isotopes = 1 - - ! Allocate and initialize array for the atomic weight ratios - allocate(awr(n_isotopes)) - awr = ONE - - ! Allocate and initialize array for mole fractions - allocate(mf(n_isotopes)) - mf(1) = ONE - - ! Get the atomic weight ratios - if (expand_by == "wo") then - awr(1) = nuclides(nuclide_dict % get_key('c0')) % awr - end if - - case ('n') - - ! Set the number of isotopes in this element - n_isotopes = 2 - - ! Allocate and initialize array for the atomic weight ratios - allocate(awr(n_isotopes)) - awr = ONE - - ! Allocate and initialize array for mole fractions - allocate(mf(n_isotopes)) - mf(1) = 0.99636_8 - mf(2) = 0.00364_8 - - ! Get the atomic weight ratios - if (expand_by == "wo") then - awr(1) = nuclides(nuclide_dict % get_key('n14')) % awr - awr(2) = nuclides(nuclide_dict % get_key('n15')) % awr - end if - - case ('o') - if (default_expand == JEFF_32) then - - ! Set the number of isotopes in this element - n_isotopes = 3 - - ! Allocate and initialize array for the atomic weight ratios - allocate(awr(n_isotopes)) - awr = ONE - - ! Allocate and initialize array for mole fractions - allocate(mf(n_isotopes)) - mf(1) = 0.99757_8 - mf(2) = 0.00038_8 - mf(3) = 0.00205_8 - - ! Get the atomic weight ratios - if (expand_by == "wo") then - awr(1) = nuclides(nuclide_dict % get_key('o16')) % awr - awr(2) = nuclides(nuclide_dict % get_key('o17')) % awr - awr(3) = nuclides(nuclide_dict % get_key('o18')) % awr - end if - elseif (default_expand >= JENDL_32 .and. default_expand <= JENDL_40) then - - ! Set the number of isotopes in this element - n_isotopes = 1 - - ! Allocate and initialize array for the atomic weight ratios - allocate(awr(n_isotopes)) - awr = ONE - - ! Allocate and initialize array for mole fractions - allocate(mf(n_isotopes)) - mf(1) = ONE - - ! Get the atomic weight ratios - if (expand_by == "wo") then - awr(1) = nuclides(nuclide_dict % get_key('o16')) % awr - end if - else - - ! Set the number of isotopes in this element - n_isotopes = 2 - - ! Allocate and initialize array for the atomic weight ratios - allocate(awr(n_isotopes)) - awr = ONE - - ! Allocate and initialize array for mole fractions - allocate(mf(n_isotopes)) - mf(1) = 0.99962_8 - mf(2) = 0.00038_8 - - ! Get the atomic weight ratios - if (expand_by == "wo") then - awr(1) = nuclides(nuclide_dict % get_key('o16')) % awr - awr(2) = nuclides(nuclide_dict % get_key('o17')) % awr - end if - end if - - case ('f') - - ! Set the number of isotopes in this element - n_isotopes = 1 - - ! Allocate and initialize array for the atomic weight ratios - allocate(awr(n_isotopes)) - awr = ONE - - ! Allocate and initialize array for mole fractions - allocate(mf(n_isotopes)) - mf(1) = ONE - - ! Get the atomic weight ratios - if (expand_by == "wo") then - awr(1) = nuclides(nuclide_dict % get_key('f19')) % awr - end if - - case ('ne') - - ! Set the number of isotopes in this element - n_isotopes = 3 - - ! Allocate and initialize array for the atomic weight ratios - allocate(awr(n_isotopes)) - awr = ONE - - ! Allocate and initialize array for mole fractions - allocate(mf(n_isotopes)) - mf(1) = 0.9048_8 - mf(2) = 0.0027_8 - mf(3) = 0.0925_8 - - ! Get the atomic weight ratios - if (expand_by == "wo") then - awr(1) = nuclides(nuclide_dict % get_key('ne20')) % awr - awr(2) = nuclides(nuclide_dict % get_key('ne21')) % awr - awr(3) = nuclides(nuclide_dict % get_key('ne22')) % awr - end if - - case ('na') - - ! Set the number of isotopes in this element - n_isotopes = 1 - - ! Allocate and initialize array for the atomic weight ratios - allocate(awr(n_isotopes)) - awr = ONE - - ! Allocate and initialize array for mole fractions - allocate(mf(n_isotopes)) - mf(1) = ONE - - ! Get the atomic weight ratios - if (expand_by == "wo") then - awr(1) = nuclides(nuclide_dict % get_key('na23')) % awr - end if - - case ('mg') - - ! Set the number of isotopes in this element - n_isotopes = 3 - - ! Allocate and initialize array for the atomic weight ratios - allocate(awr(n_isotopes)) - awr = ONE - - ! Allocate and initialize array for mole fractions - allocate(mf(n_isotopes)) - mf(1) = 0.7899_8 - mf(2) = 0.1000_8 - mf(3) = 0.1101_8 - - ! Get the atomic weight ratios - if (expand_by == "wo") then - awr(1) = nuclides(nuclide_dict % get_key('mg24')) % awr - awr(2) = nuclides(nuclide_dict % get_key('mg25')) % awr - awr(3) = nuclides(nuclide_dict % get_key('mg26')) % awr - end if - - case ('al') - - ! Set the number of isotopes in this element - n_isotopes = 1 - - ! Allocate and initialize array for the atomic weight ratios - allocate(awr(n_isotopes)) - awr = ONE - - ! Allocate and initialize array for mole fractions - allocate(mf(n_isotopes)) - mf(1) = ONE - - ! Get the atomic weight ratios - if (expand_by == "wo") then - awr(1) = nuclides(nuclide_dict % get_key('al27')) % awr - end if - - case ('si') - - ! Set the number of isotopes in this element - n_isotopes = 3 - - ! Allocate and initialize array for the atomic weight ratios - allocate(awr(n_isotopes)) - awr = ONE - - ! Allocate and initialize array for mole fractions - allocate(mf(n_isotopes)) - mf(1) = 0.92223_8 - mf(2) = 0.04685_8 - mf(3) = 0.03092_8 - - ! Get the atomic weight ratios - if (expand_by == "wo") then - awr(1) = nuclides(nuclide_dict % get_key('si28')) % awr - awr(2) = nuclides(nuclide_dict % get_key('si29')) % awr - awr(3) = nuclides(nuclide_dict % get_key('si30')) % awr - end if - - case ('p') - - ! Set the number of isotopes in this element - n_isotopes = 1 - - ! Allocate and initialize array for the atomic weight ratios - allocate(awr(n_isotopes)) - awr = ONE - - ! Allocate and initialize array for mole fractions - allocate(mf(n_isotopes)) - mf(1) = ONE - - ! Get the atomic weight ratios - if (expand_by == "wo") then - awr(1) = nuclides(nuclide_dict % get_key('p31')) % awr - end if - - case ('s') - - ! Set the number of isotopes in this element - n_isotopes = 4 - - ! Allocate and initialize array for the atomic weight ratios - allocate(awr(n_isotopes)) - awr = ONE - - ! Allocate and initialize array for mole fractions - allocate(mf(n_isotopes)) - mf(1) = 0.9499_8 - mf(2) = 0.0075_8 - mf(3) = 0.0425_8 - mf(4) = 0.0001_8 - - ! Get the atomic weight ratios - if (expand_by == "wo") then - awr(1) = nuclides(nuclide_dict % get_key('s32')) % awr - awr(2) = nuclides(nuclide_dict % get_key('s33')) % awr - awr(3) = nuclides(nuclide_dict % get_key('s34')) % awr - awr(4) = nuclides(nuclide_dict % get_key('s36')) % awr - end if - - case ('cl') - - ! Set the number of isotopes in this element - n_isotopes = 2 - - ! Allocate and initialize array for the atomic weight ratios - allocate(awr(n_isotopes)) - awr = ONE - - ! Allocate and initialize array for mole fractions - allocate(mf(n_isotopes)) - mf(1) = 0.7576_8 - mf(2) = 0.2424_8 - - ! Get the atomic weight ratios - if (expand_by == "wo") then - awr(1) = nuclides(nuclide_dict % get_key('cl35')) % awr - awr(2) = nuclides(nuclide_dict % get_key('cl37')) % awr - end if - - case ('ar') - - ! Set the number of isotopes in this element - n_isotopes = 3 - - ! Allocate and initialize array for the atomic weight ratios - allocate(awr(n_isotopes)) - awr = ONE - - ! Allocate and initialize array for mole fractions - allocate(mf(n_isotopes)) - mf(1) = 0.003336_8 - mf(2) = 0.000629_8 - mf(3) = 0.996035_8 - - ! Get the atomic weight ratios - if (expand_by == "wo") then - awr(1) = nuclides(nuclide_dict % get_key('ar36')) % awr - awr(2) = nuclides(nuclide_dict % get_key('ar38')) % awr - awr(3) = nuclides(nuclide_dict % get_key('ar40')) % awr - end if - - case ('k') - - ! Set the number of isotopes in this element - n_isotopes = 3 - - ! Allocate and initialize array for the atomic weight ratios - allocate(awr(n_isotopes)) - awr = ONE - - ! Allocate and initialize array for mole fractions - allocate(mf(n_isotopes)) - mf(1) = 0.932581_8 - mf(2) = 0.000117_8 - mf(3) = 0.067302_8 - - ! Get the atomic weight ratios - if (expand_by == "wo") then - awr(1) = nuclides(nuclide_dict % get_key('k39')) % awr - awr(2) = nuclides(nuclide_dict % get_key('k40')) % awr - awr(3) = nuclides(nuclide_dict % get_key('k41')) % awr - end if - - case ('ca') - - ! Set the number of isotopes in this element - n_isotopes = 6 - - ! Allocate and initialize array for the atomic weight ratios - allocate(awr(n_isotopes)) - awr = ONE - - ! Allocate and initialize array for mole fractions - allocate(mf(n_isotopes)) - mf(1) = 0.96941_8 - mf(2) = 0.00647_8 - mf(3) = 0.00135_8 - mf(4) = 0.02086_8 - mf(5) = 0.00004_8 - mf(6) = 0.00187_8 - - ! Get the atomic weight ratios - if (expand_by == "wo") then - awr(1) = nuclides(nuclide_dict % get_key('ca40')) % awr - awr(2) = nuclides(nuclide_dict % get_key('ca42')) % awr - awr(3) = nuclides(nuclide_dict % get_key('ca43')) % awr - awr(4) = nuclides(nuclide_dict % get_key('ca44')) % awr - awr(5) = nuclides(nuclide_dict % get_key('ca46')) % awr - awr(6) = nuclides(nuclide_dict % get_key('ca48')) % awr - end if - - case ('sc') - - ! Set the number of isotopes in this element - n_isotopes = 1 - - ! Allocate and initialize array for the atomic weight ratios - allocate(awr(n_isotopes)) - awr = ONE - - ! Allocate and initialize array for mole fractions - allocate(mf(n_isotopes)) - mf(1) = ONE - - ! Get the atomic weight ratios - if (expand_by == "wo") then - awr(1) = nuclides(nuclide_dict % get_key('sc45')) % awr - end if - - case ('ti') - - ! Set the number of isotopes in this element - n_isotopes = 5 - - ! Allocate and initialize array for the atomic weight ratios - allocate(awr(n_isotopes)) - awr = ONE - - ! Allocate and initialize array for mole fractions - allocate(mf(n_isotopes)) - mf(1) = 0.0825_8 - mf(2) = 0.0744_8 - mf(3) = 0.7372_8 - mf(4) = 0.0541_8 - mf(5) = 0.0518_8 - - ! Get the atomic weight ratios - if (expand_by == "wo") then - awr(1) = nuclides(nuclide_dict % get_key('ti46')) % awr - awr(2) = nuclides(nuclide_dict % get_key('ti47')) % awr - awr(3) = nuclides(nuclide_dict % get_key('ti48')) % awr - awr(4) = nuclides(nuclide_dict % get_key('ti49')) % awr - awr(5) = nuclides(nuclide_dict % get_key('ti50')) % awr - end if - - case ('v') - if (default_expand == ENDF_BVII0 .or. default_expand == JEFF_311 & - .or. default_expand == JEFF_32 .or. & - (default_expand >= JENDL_32 .and. default_expand <= JENDL_33)) then - - ! Set the number of isotopes in this element - n_isotopes = 1 - - ! Allocate and initialize array for the atomic weight ratios - allocate(awr(n_isotopes)) - awr = ONE - - ! Allocate and initialize array for mole fractions - allocate(mf(n_isotopes)) - mf(1) = ONE - - ! Get the atomic weight ratios - if (expand_by == "wo") then - awr(1) = nuclides(nuclide_dict % get_key('v0')) % awr - end if - - else - - ! Set the number of isotopes in this element - n_isotopes = 2 - - ! Allocate and initialize array for the atomic weight ratios - allocate(awr(n_isotopes)) - awr = ONE - - ! Allocate and initialize array for mole fractions - allocate(mf(n_isotopes)) - mf(1) = 0.0025_8 - mf(2) = 0.9975_8 - - ! Get the atomic weight ratios - if (expand_by == "wo") then - awr(1) = nuclides(nuclide_dict % get_key('v50')) % awr - awr(2) = nuclides(nuclide_dict % get_key('v51')) % awr - end if - end if - - case ('cr') - - ! Set the number of isotopes in this element - n_isotopes = 4 - - ! Allocate and initialize array for the atomic weight ratios - allocate(awr(n_isotopes)) - awr = ONE - - ! Allocate and initialize array for mole fractions - allocate(mf(n_isotopes)) - mf(1) = 0.04345_8 - mf(2) = 0.83789_8 - mf(3) = 0.09501_8 - mf(4) = 0.02365_8 - - ! Get the atomic weight ratios - if (expand_by == "wo") then - awr(1) = nuclides(nuclide_dict % get_key('cr50')) % awr - awr(2) = nuclides(nuclide_dict % get_key('cr52')) % awr - awr(3) = nuclides(nuclide_dict % get_key('cr53')) % awr - awr(4) = nuclides(nuclide_dict % get_key('cr54')) % awr - end if - - case ('mn') - - ! Set the number of isotopes in this element - n_isotopes = 1 - - ! Allocate and initialize array for the atomic weight ratios - allocate(awr(n_isotopes)) - awr = ONE - - ! Allocate and initialize array for mole fractions - allocate(mf(n_isotopes)) - mf(1) = ONE - - ! Get the atomic weight ratios - if (expand_by == "wo") then - awr(1) = nuclides(nuclide_dict % get_key('mn55')) % awr - end if - - case ('fe') - - ! Set the number of isotopes in this element - n_isotopes = 4 - - ! Allocate and initialize array for the atomic weight ratios - allocate(awr(n_isotopes)) - awr = ONE - - ! Allocate and initialize array for mole fractions - allocate(mf(n_isotopes)) - mf(1) = 0.05845_8 - mf(2) = 0.91754_8 - mf(3) = 0.02119_8 - mf(4) = 0.00282_8 - - ! Get the atomic weight ratios - if (expand_by == "wo") then - awr(1) = nuclides(nuclide_dict % get_key('fe54')) % awr - awr(2) = nuclides(nuclide_dict % get_key('fe56')) % awr - awr(3) = nuclides(nuclide_dict % get_key('fe57')) % awr - awr(4) = nuclides(nuclide_dict % get_key('fe58')) % awr - end if - - case ('co') - - ! Set the number of isotopes in this element - n_isotopes = 1 - - ! Allocate and initialize array for the atomic weight ratios - allocate(awr(n_isotopes)) - awr = ONE - - ! Allocate and initialize array for mole fractions - allocate(mf(n_isotopes)) - mf(1) = ONE - - ! Get the atomic weight ratios - if (expand_by == "wo") then - awr(1) = nuclides(nuclide_dict % get_key('co59')) % awr - end if - - case ('ni') - - ! Set the number of isotopes in this element - n_isotopes = 5 - - ! Allocate and initialize array for the atomic weight ratios - allocate(awr(n_isotopes)) - awr = ONE - - ! Allocate and initialize array for mole fractions - allocate(mf(n_isotopes)) - mf(1) = 0.68077_8 - mf(2) = 0.26223_8 - mf(3) = 0.011399_8 - mf(4) = 0.036346_8 - mf(5) = 0.009255_8 - - ! Get the atomic weight ratios - if (expand_by == "wo") then - awr(1) = nuclides(nuclide_dict % get_key('ni58')) % awr - awr(2) = nuclides(nuclide_dict % get_key('ni60')) % awr - awr(3) = nuclides(nuclide_dict % get_key('ni61')) % awr - awr(4) = nuclides(nuclide_dict % get_key('ni62')) % awr - awr(5) = nuclides(nuclide_dict % get_key('ni64')) % awr - end if - - case ('cu') - - ! Set the number of isotopes in this element - n_isotopes = 2 - - ! Allocate and initialize array for the atomic weight ratios - allocate(awr(n_isotopes)) - awr = ONE - - ! Allocate and initialize array for mole fractions - allocate(mf(n_isotopes)) - mf(1) = 0.6915_8 - mf(2) = 0.3085_8 - - ! Get the atomic weight ratios - if (expand_by == "wo") then - awr(1) = nuclides(nuclide_dict % get_key('cu63')) % awr - awr(2) = nuclides(nuclide_dict % get_key('cu65')) % awr - end if - - case ('zn') - if (default_expand == ENDF_BVII0 .or. default_expand == & - JEFF_311 .or. default_expand == JEFF_312) then - - ! Set the number of isotopes in this element - n_isotopes = 1 - - ! Allocate and initialize array for the atomic weight ratios - allocate(awr(n_isotopes)) - awr = ONE - - ! Allocate and initialize array for mole fractions - allocate(mf(n_isotopes)) - mf(1) = ONE - - ! Get the atomic weight ratios - if (expand_by == "wo") then - awr(1) = nuclides(nuclide_dict % get_key('zn0')) % awr - end if - - else - - ! Set the number of isotopes in this element - n_isotopes = 5 - - ! Allocate and initialize array for the atomic weight ratios - allocate(awr(n_isotopes)) - awr = ONE - - ! Allocate and initialize array for mole fractions - allocate(mf(n_isotopes)) - mf(1) = 0.4917_8 - mf(2) = 0.2773_8 - mf(3) = 0.0404_8 - mf(4) = 0.1845_8 - mf(5) = 0.0061_8 - - ! Get the atomic weight ratios - if (expand_by == "wo") then - awr(1) = nuclides(nuclide_dict % get_key('zn64')) % awr - awr(2) = nuclides(nuclide_dict % get_key('zn66')) % awr - awr(3) = nuclides(nuclide_dict % get_key('zn67')) % awr - awr(4) = nuclides(nuclide_dict % get_key('zn68')) % awr - awr(5) = nuclides(nuclide_dict % get_key('zn70')) % awr - end if - end if - - case ('ga') - if (default_expand == JEFF_311 .or. default_expand == JEFF_312) then - - ! Set the number of isotopes in this element - n_isotopes = 1 - - ! Allocate and initialize array for the atomic weight ratios - allocate(awr(n_isotopes)) - awr = ONE - - ! Allocate and initialize array for mole fractions - allocate(mf(n_isotopes)) - mf(1) = ONE - - ! Get the atomic weight ratios - if (expand_by == "wo") then - awr(1) = nuclides(nuclide_dict % get_key('ga0')) % awr - end if - else - - ! Set the number of isotopes in this element - n_isotopes = 2 - - ! Allocate and initialize array for the atomic weight ratios - allocate(awr(n_isotopes)) - awr = ONE - - ! Allocate and initialize array for mole fractions - allocate(mf(n_isotopes)) - mf(1) = 0.60108_8 - mf(2) = 0.39892_8 - - ! Get the atomic weight ratios - if (expand_by == "wo") then - awr(1) = nuclides(nuclide_dict % get_key('ga69')) % awr - awr(2) = nuclides(nuclide_dict % get_key('ga71')) % awr - end if - end if - - case ('ge') - - ! Set the number of isotopes in this element - n_isotopes = 5 - - ! Allocate and initialize array for the atomic weight ratios - allocate(awr(n_isotopes)) - awr = ONE - - ! Allocate and initialize array for mole fractions - allocate(mf(n_isotopes)) - mf(1) = 0.2057_8 - mf(2) = 0.2745_8 - mf(3) = 0.0775_8 - mf(4) = 0.3650_8 - mf(5) = 0.0773_8 - - ! Get the atomic weight ratios - if (expand_by == "wo") then - awr(1) = nuclides(nuclide_dict % get_key('ge70')) % awr - awr(2) = nuclides(nuclide_dict % get_key('ge72')) % awr - awr(3) = nuclides(nuclide_dict % get_key('ge73')) % awr - awr(4) = nuclides(nuclide_dict % get_key('ge74')) % awr - awr(5) = nuclides(nuclide_dict % get_key('ge76')) % awr - end if - - case ('as') - - ! Set the number of isotopes in this element - n_isotopes = 1 - - ! Allocate and initialize array for the atomic weight ratios - allocate(awr(n_isotopes)) - awr = ONE - - ! Allocate and initialize array for mole fractions - allocate(mf(n_isotopes)) - mf(1) = ONE - - ! Get the atomic weight ratios - if (expand_by == "wo") then - awr(1) = nuclides(nuclide_dict % get_key('as75')) % awr - end if - - case ('se') - - ! Set the number of isotopes in this element - n_isotopes = 6 - - ! Allocate and initialize array for the atomic weight ratios - allocate(awr(n_isotopes)) - awr = ONE - - ! Allocate and initialize array for mole fractions - allocate(mf(n_isotopes)) - mf(1) = 0.0089_8 - mf(2) = 0.0937_8 - mf(3) = 0.0763_8 - mf(4) = 0.2377_8 - mf(5) = 0.4961_8 - mf(6) = 0.0873_8 - - ! Get the atomic weight ratios - if (expand_by == "wo") then - awr(1) = nuclides(nuclide_dict % get_key('se74')) % awr - awr(2) = nuclides(nuclide_dict % get_key('se76')) % awr - awr(3) = nuclides(nuclide_dict % get_key('se77')) % awr - awr(4) = nuclides(nuclide_dict % get_key('se78')) % awr - awr(5) = nuclides(nuclide_dict % get_key('se80')) % awr - awr(6) = nuclides(nuclide_dict % get_key('se82')) % awr - end if - - case ('br') - - ! Set the number of isotopes in this element - n_isotopes = 2 - - ! Allocate and initialize array for the atomic weight ratios - allocate(awr(n_isotopes)) - awr = ONE - - ! Allocate and initialize array for mole fractions - allocate(mf(n_isotopes)) - mf(1) = 0.5069_8 - mf(2) = 0.4931_8 - - ! Get the atomic weight ratios - if (expand_by == "wo") then - awr(1) = nuclides(nuclide_dict % get_key('br79')) % awr - awr(2) = nuclides(nuclide_dict % get_key('br81')) % awr - end if - - case ('kr') - - ! Set the number of isotopes in this element - n_isotopes = 6 - - ! Allocate and initialize array for the atomic weight ratios - allocate(awr(n_isotopes)) - awr = ONE - - ! Allocate and initialize array for mole fractions - allocate(mf(n_isotopes)) - mf(1) = 0.00355_8 - mf(2) = 0.02286_8 - mf(3) = 0.11593_8 - mf(4) = 0.11500_8 - mf(5) = 0.56987_8 - mf(6) = 0.17279_8 - - ! Get the atomic weight ratios - if (expand_by == "wo") then - awr(1) = nuclides(nuclide_dict % get_key('kr78')) % awr - awr(2) = nuclides(nuclide_dict % get_key('kr80')) % awr - awr(3) = nuclides(nuclide_dict % get_key('kr82')) % awr - awr(4) = nuclides(nuclide_dict % get_key('kr83')) % awr - awr(5) = nuclides(nuclide_dict % get_key('kr84')) % awr - awr(6) = nuclides(nuclide_dict % get_key('kr86')) % awr - end if - - case ('rb') - - ! Set the number of isotopes in this element - n_isotopes = 2 - - ! Allocate and initialize array for the atomic weight ratios - allocate(awr(n_isotopes)) - awr = ONE - - ! Allocate and initialize array for mole fractions - allocate(mf(n_isotopes)) - mf(1) = 0.7217_8 - mf(2) = 0.2783_8 - - ! Get the atomic weight ratios - if (expand_by == "wo") then - awr(1) = nuclides(nuclide_dict % get_key('rb85')) % awr - awr(2) = nuclides(nuclide_dict % get_key('rb87')) % awr - end if - - case ('sr') - - ! Set the number of isotopes in this element - n_isotopes = 4 - - ! Allocate and initialize array for the atomic weight ratios - allocate(awr(n_isotopes)) - awr = ONE - - ! Allocate and initialize array for mole fractions - allocate(mf(n_isotopes)) - mf(1) = 0.0056_8 - mf(2) = 0.0986_8 - mf(3) = 0.0700_8 - mf(4) = 0.8258_8 - - ! Get the atomic weight ratios - if (expand_by == "wo") then - awr(1) = nuclides(nuclide_dict % get_key('sr84')) % awr - awr(2) = nuclides(nuclide_dict % get_key('sr86')) % awr - awr(3) = nuclides(nuclide_dict % get_key('sr87')) % awr - awr(4) = nuclides(nuclide_dict % get_key('sr88')) % awr - end if - - case ('y') - - ! Set the number of isotopes in this element - n_isotopes = 1 - - ! Allocate and initialize array for the atomic weight ratios - allocate(awr(n_isotopes)) - awr = ONE - - ! Allocate and initialize array for mole fractions - allocate(mf(n_isotopes)) - mf(1) = ONE - - ! Get the atomic weight ratios - if (expand_by == "wo") then - awr(1) = nuclides(nuclide_dict % get_key('y89')) % awr - end if - - case ('zr') - - ! Set the number of isotopes in this element - n_isotopes = 5 - - ! Allocate and initialize array for the atomic weight ratios - allocate(awr(n_isotopes)) - awr = ONE - - ! Allocate and initialize array for mole fractions - allocate(mf(n_isotopes)) - mf(1) = 0.5145_8 - mf(2) = 0.1122_8 - mf(3) = 0.1715_8 - mf(4) = 0.1738_8 - mf(5) = 0.0280_8 - - ! Get the atomic weight ratios - if (expand_by == "wo") then - awr(1) = nuclides(nuclide_dict % get_key('zr90')) % awr - awr(2) = nuclides(nuclide_dict % get_key('zr91')) % awr - awr(3) = nuclides(nuclide_dict % get_key('zr92')) % awr - awr(4) = nuclides(nuclide_dict % get_key('zr94')) % awr - awr(5) = nuclides(nuclide_dict % get_key('zr96')) % awr - end if - - case ('nb') - - ! Set the number of isotopes in this element - n_isotopes = 1 - - ! Allocate and initialize array for the atomic weight ratios - allocate(awr(n_isotopes)) - awr = ONE - - ! Allocate and initialize array for mole fractions - allocate(mf(n_isotopes)) - mf(1) = ONE - - ! Get the atomic weight ratios - if (expand_by == "wo") then - awr(1) = nuclides(nuclide_dict % get_key('nb93')) % awr - end if - - case ('mo') - - ! Set the number of isotopes in this element - n_isotopes = 7 - - ! Allocate and initialize array for the atomic weight ratios - allocate(awr(n_isotopes)) - awr = ONE - - ! Allocate and initialize array for mole fractions - allocate(mf(n_isotopes)) - mf(1) = 0.1453_8 - mf(2) = 0.0915_8 - mf(3) = 0.1584_8 - mf(4) = 0.1667_8 - mf(5) = 0.0960_8 - mf(6) = 0.2439_8 - mf(7) = 0.0982_8 - - ! Get the atomic weight ratios - if (expand_by == "wo") then - awr(1) = nuclides(nuclide_dict % get_key('mo92')) % awr - awr(2) = nuclides(nuclide_dict % get_key('mo94')) % awr - awr(3) = nuclides(nuclide_dict % get_key('mo95')) % awr - awr(4) = nuclides(nuclide_dict % get_key('mo96')) % awr - awr(5) = nuclides(nuclide_dict % get_key('mo97')) % awr - awr(6) = nuclides(nuclide_dict % get_key('mo98')) % awr - awr(7) = nuclides(nuclide_dict % get_key('mo100')) % awr - end if - - case ('ru') - - ! Set the number of isotopes in this element - n_isotopes = 7 - - ! Allocate and initialize array for the atomic weight ratios - allocate(awr(n_isotopes)) - awr = ONE - - ! Allocate and initialize array for mole fractions - allocate(mf(n_isotopes)) - mf(1) = 0.0554_8 - mf(2) = 0.0187_8 - mf(3) = 0.1276_8 - mf(4) = 0.1260_8 - mf(5) = 0.1706_8 - mf(6) = 0.3155_8 - mf(7) = 0.1862_8 - - ! Get the atomic weight ratios - if (expand_by == "wo") then - awr(1) = nuclides(nuclide_dict % get_key('ru96')) % awr - awr(2) = nuclides(nuclide_dict % get_key('ru98')) % awr - awr(3) = nuclides(nuclide_dict % get_key('ru99')) % awr - awr(4) = nuclides(nuclide_dict % get_key('ru100')) % awr - awr(5) = nuclides(nuclide_dict % get_key('ru101')) % awr - awr(6) = nuclides(nuclide_dict % get_key('ru102')) % awr - awr(7) = nuclides(nuclide_dict % get_key('ru104')) % awr - end if - - case ('rh') - - ! Set the number of isotopes in this element - n_isotopes = 1 - - ! Allocate and initialize array for the atomic weight ratios - allocate(awr(n_isotopes)) - awr = ONE - - ! Allocate and initialize array for mole fractions - allocate(mf(n_isotopes)) - mf(1) = ONE - - ! Get the atomic weight ratios - if (expand_by == "wo") then - awr(1) = nuclides(nuclide_dict % get_key('rh103')) % awr - end if - - case ('pd') - - ! Set the number of isotopes in this element - n_isotopes = 6 - - ! Allocate and initialize array for the atomic weight ratios - allocate(awr(n_isotopes)) - awr = ONE - - ! Allocate and initialize array for mole fractions - allocate(mf(n_isotopes)) - mf(1) = 0.0102_8 - mf(2) = 0.1114_8 - mf(3) = 0.2233_8 - mf(4) = 0.2733_8 - mf(5) = 0.2646_8 - mf(6) = 0.1172_8 - - ! Get the atomic weight ratios - if (expand_by == "wo") then - awr(1) = nuclides(nuclide_dict % get_key('pd102')) % awr - awr(2) = nuclides(nuclide_dict % get_key('pd104')) % awr - awr(3) = nuclides(nuclide_dict % get_key('pd105')) % awr - awr(4) = nuclides(nuclide_dict % get_key('pd106')) % awr - awr(5) = nuclides(nuclide_dict % get_key('pd108')) % awr - awr(6) = nuclides(nuclide_dict % get_key('pd110')) % awr - end if - - case ('ag') - - ! Set the number of isotopes in this element - n_isotopes = 2 - - ! Allocate and initialize array for the atomic weight ratios - allocate(awr(n_isotopes)) - awr = ONE - - ! Allocate and initialize array for mole fractions - allocate(mf(n_isotopes)) - mf(1) = 0.51839_8 - mf(2) = 0.48161_8 - - ! Get the atomic weight ratios - if (expand_by == "wo") then - awr(1) = nuclides(nuclide_dict % get_key('ag107')) % awr - awr(2) = nuclides(nuclide_dict % get_key('ag109')) % awr - end if - - case ('cd') - - ! Set the number of isotopes in this element - n_isotopes = 8 - - ! Allocate and initialize array for the atomic weight ratios - allocate(awr(n_isotopes)) - awr = ONE - - ! Allocate and initialize array for mole fractions - allocate(mf(n_isotopes)) - mf(1) = 0.0125_8 - mf(2) = 0.0089_8 - mf(3) = 0.1249_8 - mf(4) = 0.1280_8 - mf(5) = 0.2413_8 - mf(6) = 0.1222_8 - mf(7) = 0.2873_8 - mf(8) = 0.0749_8 - - ! Get the atomic weight ratios - if (expand_by == "wo") then - awr(1) = nuclides(nuclide_dict % get_key('cd106')) % awr - awr(2) = nuclides(nuclide_dict % get_key('cd108')) % awr - awr(3) = nuclides(nuclide_dict % get_key('cd110')) % awr - awr(4) = nuclides(nuclide_dict % get_key('cd111')) % awr - awr(5) = nuclides(nuclide_dict % get_key('cd112')) % awr - awr(6) = nuclides(nuclide_dict % get_key('cd113')) % awr - awr(7) = nuclides(nuclide_dict % get_key('cd114')) % awr - awr(8) = nuclides(nuclide_dict % get_key('cd116')) % awr - end if - - case ('in') - - ! Set the number of isotopes in this element - n_isotopes = 2 - - ! Allocate and initialize array for the atomic weight ratios - allocate(awr(n_isotopes)) - awr = ONE - - ! Allocate and initialize array for mole fractions - allocate(mf(n_isotopes)) - mf(1) = 0.0429_8 - mf(2) = 0.9571_8 - - ! Get the atomic weight ratios - if (expand_by == "wo") then - awr(1) = nuclides(nuclide_dict % get_key('in113')) % awr - awr(2) = nuclides(nuclide_dict % get_key('in115')) % awr - end if - - case ('sn') - - ! Set the number of isotopes in this element - n_isotopes = 10 - - ! Allocate and initialize array for the atomic weight ratios - allocate(awr(n_isotopes)) - awr = ONE - - ! Allocate and initialize array for mole fractions - allocate(mf(n_isotopes)) - mf(1) = 0.0097_8 - mf(2) = 0.0066_8 - mf(3) = 0.0034_8 - mf(4) = 0.1454_8 - mf(5) = 0.0768_8 - mf(6) = 0.2422_8 - mf(7) = 0.0859_8 - mf(8) = 0.3258_8 - mf(9) = 0.0463_8 - mf(10) = 0.0579_8 - - ! Get the atomic weight ratios - if (expand_by == "wo") then - awr(1) = nuclides(nuclide_dict % get_key('sn112')) % awr - awr(2) = nuclides(nuclide_dict % get_key('sn114')) % awr - awr(3) = nuclides(nuclide_dict % get_key('sn115')) % awr - awr(4) = nuclides(nuclide_dict % get_key('sn116')) % awr - awr(5) = nuclides(nuclide_dict % get_key('sn117')) % awr - awr(6) = nuclides(nuclide_dict % get_key('sn118')) % awr - awr(7) = nuclides(nuclide_dict % get_key('sn119')) % awr - awr(8) = nuclides(nuclide_dict % get_key('sn120')) % awr - awr(9) = nuclides(nuclide_dict % get_key('sn122')) % awr - awr(10) = nuclides(nuclide_dict % get_key('sn124')) % awr - end if - - case ('sb') - - ! Set the number of isotopes in this element - n_isotopes = 2 - - ! Allocate and initialize array for the atomic weight ratios - allocate(awr(n_isotopes)) - awr = ONE - - ! Allocate and initialize array for mole fractions - allocate(mf(n_isotopes)) - mf(1) = 0.5721_8 - mf(2) = 0.4279_8 - - ! Get the atomic weight ratios - if (expand_by == "wo") then - awr(1) = nuclides(nuclide_dict % get_key('sb121')) % awr - awr(2) = nuclides(nuclide_dict % get_key('sb123')) % awr - end if - - case ('te') - - ! Set the number of isotopes in this element - n_isotopes = 8 - - ! Allocate and initialize array for the atomic weight ratios - allocate(awr(n_isotopes)) - awr = ONE - - ! Allocate and initialize array for mole fractions - allocate(mf(n_isotopes)) - mf(1) = 0.0009_8 - mf(2) = 0.0255_8 - mf(3) = 0.0089_8 - mf(4) = 0.0474_8 - mf(5) = 0.0707_8 - mf(6) = 0.1884_8 - mf(7) = 0.3174_8 - mf(8) = 0.3408_8 - - ! Get the atomic weight ratios - if (expand_by == "wo") then - awr(1) = nuclides(nuclide_dict % get_key('te120')) % awr - awr(2) = nuclides(nuclide_dict % get_key('te122')) % awr - awr(3) = nuclides(nuclide_dict % get_key('te123')) % awr - awr(4) = nuclides(nuclide_dict % get_key('te124')) % awr - awr(5) = nuclides(nuclide_dict % get_key('te125')) % awr - awr(6) = nuclides(nuclide_dict % get_key('te126')) % awr - awr(7) = nuclides(nuclide_dict % get_key('te128')) % awr - awr(8) = nuclides(nuclide_dict % get_key('te130')) % awr - end if - - case ('i') - - ! Set the number of isotopes in this element - n_isotopes = 1 - - ! Allocate and initialize array for the atomic weight ratios - allocate(awr(n_isotopes)) - awr = ONE - - ! Allocate and initialize array for mole fractions - allocate(mf(n_isotopes)) - mf(1) = ONE - - ! Get the atomic weight ratios - if (expand_by == "wo") then - awr(1) = nuclides(nuclide_dict % get_key('i127')) % awr - end if - - case ('xe') - - ! Set the number of isotopes in this element - n_isotopes = 9 - - ! Allocate and initialize array for the atomic weight ratios - allocate(awr(n_isotopes)) - awr = ONE - - ! Allocate and initialize array for mole fractions - allocate(mf(n_isotopes)) - mf(1) = 0.000952_8 - mf(2) = 0.000890_8 - mf(3) = 0.019102_8 - mf(4) = 0.264006_8 - mf(5) = 0.040710_8 - mf(6) = 0.212324_8 - mf(7) = 0.269086_8 - mf(8) = 0.104357_8 - mf(9) = 0.088573_8 - - ! Get the atomic weight ratios - if (expand_by == "wo") then - awr(1) = nuclides(nuclide_dict % get_key('xe124')) % awr - awr(2) = nuclides(nuclide_dict % get_key('xe126')) % awr - awr(3) = nuclides(nuclide_dict % get_key('xe128')) % awr - awr(4) = nuclides(nuclide_dict % get_key('xe129')) % awr - awr(5) = nuclides(nuclide_dict % get_key('xe130')) % awr - awr(6) = nuclides(nuclide_dict % get_key('xe131')) % awr - awr(7) = nuclides(nuclide_dict % get_key('xe132')) % awr - awr(8) = nuclides(nuclide_dict % get_key('xe134')) % awr - awr(9) = nuclides(nuclide_dict % get_key('xe136')) % awr - end if - - case ('cs') - - ! Set the number of isotopes in this element - n_isotopes = 1 - - ! Allocate and initialize array for the atomic weight ratios - allocate(awr(n_isotopes)) - awr = ONE - - ! Allocate and initialize array for mole fractions - allocate(mf(n_isotopes)) - mf(1) = ONE - - ! Get the atomic weight ratios - if (expand_by == "wo") then - awr(1) = nuclides(nuclide_dict % get_key('cs133')) % awr - end if - - case ('ba') - - ! Set the number of isotopes in this element - n_isotopes = 7 - - ! Allocate and initialize array for the atomic weight ratios - allocate(awr(n_isotopes)) - awr = ONE - - ! Allocate and initialize array for mole fractions - allocate(mf(n_isotopes)) - mf(1) = 0.00106_8 - mf(2) = 0.00101_8 - mf(3) = 0.02417_8 - mf(4) = 0.06592_8 - mf(5) = 0.07854_8 - mf(6) = 0.11232_8 - mf(7) = 0.71698_8 - - ! Get the atomic weight ratios - if (expand_by == "wo") then - awr(1) = nuclides(nuclide_dict % get_key('ba130')) % awr - awr(2) = nuclides(nuclide_dict % get_key('ba132')) % awr - awr(3) = nuclides(nuclide_dict % get_key('ba134')) % awr - awr(4) = nuclides(nuclide_dict % get_key('ba135')) % awr - awr(5) = nuclides(nuclide_dict % get_key('ba136')) % awr - awr(6) = nuclides(nuclide_dict % get_key('ba137')) % awr - awr(7) = nuclides(nuclide_dict % get_key('ba138')) % awr - end if - - case ('la') - - ! Set the number of isotopes in this element - n_isotopes = 2 - - ! Allocate and initialize array for the atomic weight ratios - allocate(awr(n_isotopes)) - awr = ONE - - ! Allocate and initialize array for mole fractions - allocate(mf(n_isotopes)) - mf(1) = 0.0008881_8 - mf(2) = 0.9991119_8 - - ! Get the atomic weight ratios - if (expand_by == "wo") then - awr(1) = nuclides(nuclide_dict % get_key('la138')) % awr - awr(2) = nuclides(nuclide_dict % get_key('la139')) % awr - end if - - case ('ce') - - ! Set the number of isotopes in this element - n_isotopes = 4 - - ! Allocate and initialize array for the atomic weight ratios - allocate(awr(n_isotopes)) - awr = ONE - - ! Allocate and initialize array for mole fractions - allocate(mf(n_isotopes)) - mf(1) = 0.00185_8 - mf(2) = 0.00251_8 - mf(3) = 0.88450_8 - mf(4) = 0.11114_8 - - ! Get the atomic weight ratios - if (expand_by == "wo") then - awr(1) = nuclides(nuclide_dict % get_key('ce136')) % awr - awr(2) = nuclides(nuclide_dict % get_key('ce138')) % awr - awr(3) = nuclides(nuclide_dict % get_key('ce140')) % awr - awr(4) = nuclides(nuclide_dict % get_key('ce142')) % awr - end if - - case ('pr') - - ! Set the number of isotopes in this element - n_isotopes = 1 - - ! Allocate and initialize array for the atomic weight ratios - allocate(awr(n_isotopes)) - awr = ONE - - ! Allocate and initialize array for mole fractions - allocate(mf(n_isotopes)) - mf(1) = ONE - - ! Get the atomic weight ratios - if (expand_by == "wo") then - awr(1) = nuclides(nuclide_dict % get_key('pr141')) % awr - end if - - case ('nd') - - ! Set the number of isotopes in this element - n_isotopes = 7 - - ! Allocate and initialize array for the atomic weight ratios - allocate(awr(n_isotopes)) - awr = ONE - - ! Allocate and initialize array for mole fractions - allocate(mf(n_isotopes)) - mf(1) = 0.27152_8 - mf(2) = 0.12174_8 - mf(3) = 0.23798_8 - mf(4) = 0.08293_8 - mf(5) = 0.17189_8 - mf(6) = 0.05756_8 - mf(7) = 0.05638_8 - - ! Get the atomic weight ratios - if (expand_by == "wo") then - awr(1) = nuclides(nuclide_dict % get_key('nd142')) % awr - awr(2) = nuclides(nuclide_dict % get_key('nd143')) % awr - awr(3) = nuclides(nuclide_dict % get_key('nd144')) % awr - awr(4) = nuclides(nuclide_dict % get_key('nd145')) % awr - awr(5) = nuclides(nuclide_dict % get_key('nd146')) % awr - awr(6) = nuclides(nuclide_dict % get_key('nd148')) % awr - awr(7) = nuclides(nuclide_dict % get_key('nd150')) % awr - end if - - case ('sm') - - ! Set the number of isotopes in this element - n_isotopes = 7 - - ! Allocate and initialize array for the atomic weight ratios - allocate(awr(n_isotopes)) - awr = ONE - - ! Allocate and initialize array for mole fractions - allocate(mf(n_isotopes)) - mf(1) = 0.0307_8 - mf(2) = 0.1499_8 - mf(3) = 0.1124_8 - mf(4) = 0.1382_8 - mf(5) = 0.0738_8 - mf(6) = 0.2675_8 - mf(7) = 0.2275_8 - - ! Get the atomic weight ratios - if (expand_by == "wo") then - awr(1) = nuclides(nuclide_dict % get_key('sm144')) % awr - awr(2) = nuclides(nuclide_dict % get_key('sm147')) % awr - awr(3) = nuclides(nuclide_dict % get_key('sm148')) % awr - awr(4) = nuclides(nuclide_dict % get_key('sm149')) % awr - awr(5) = nuclides(nuclide_dict % get_key('sm150')) % awr - awr(6) = nuclides(nuclide_dict % get_key('sm152')) % awr - awr(7) = nuclides(nuclide_dict % get_key('sm154')) % awr - end if - - case ('eu') - - ! Set the number of isotopes in this element - n_isotopes = 2 - - ! Allocate and initialize array for the atomic weight ratios - allocate(awr(n_isotopes)) - awr = ONE - - ! Allocate and initialize array for mole fractions - allocate(mf(n_isotopes)) - mf(1) = 0.4781_8 - mf(2) = 0.5219_8 - - ! Get the atomic weight ratios - if (expand_by == "wo") then - awr(1) = nuclides(nuclide_dict % get_key('eu151')) % awr - awr(2) = nuclides(nuclide_dict % get_key('eu153')) % awr - end if - - case ('gd') - - ! Set the number of isotopes in this element - n_isotopes = 7 - - ! Allocate and initialize array for the atomic weight ratios - allocate(awr(n_isotopes)) - awr = ONE - - ! Allocate and initialize array for mole fractions - allocate(mf(n_isotopes)) - mf(1) = 0.0020_8 - mf(2) = 0.0218_8 - mf(3) = 0.1480_8 - mf(4) = 0.2047_8 - mf(5) = 0.1565_8 - mf(6) = 0.2484_8 - mf(7) = 0.2186_8 - - ! Get the atomic weight ratios - if (expand_by == "wo") then - awr(1) = nuclides(nuclide_dict % get_key('gd152')) % awr - awr(2) = nuclides(nuclide_dict % get_key('gd154')) % awr - awr(3) = nuclides(nuclide_dict % get_key('gd155')) % awr - awr(4) = nuclides(nuclide_dict % get_key('gd156')) % awr - awr(5) = nuclides(nuclide_dict % get_key('gd157')) % awr - awr(6) = nuclides(nuclide_dict % get_key('gd158')) % awr - awr(7) = nuclides(nuclide_dict % get_key('gd160')) % awr - end if - - case ('tb') - - ! Set the number of isotopes in this element - n_isotopes = 1 - - ! Allocate and initialize array for the atomic weight ratios - allocate(awr(n_isotopes)) - awr = ONE - - ! Allocate and initialize array for mole fractions - allocate(mf(n_isotopes)) - mf(1) = ONE - - ! Get the atomic weight ratios - if (expand_by == "wo") then - awr(1) = nuclides(nuclide_dict % get_key('tb159')) % awr - end if - - case ('dy') - - ! Set the number of isotopes in this element - n_isotopes = 7 - - ! Allocate and initialize array for the atomic weight ratios - allocate(awr(n_isotopes)) - awr = ONE - - ! Allocate and initialize array for mole fractions - allocate(mf(n_isotopes)) - mf(1) = 0.00056_8 - mf(2) = 0.00095_8 - mf(3) = 0.02329_8 - mf(4) = 0.18889_8 - mf(5) = 0.25475_8 - mf(6) = 0.24896_8 - mf(7) = 0.28260_8 - - ! Get the atomic weight ratios - if (expand_by == "wo") then - awr(1) = nuclides(nuclide_dict % get_key('dy156')) % awr - awr(2) = nuclides(nuclide_dict % get_key('dy158')) % awr - awr(3) = nuclides(nuclide_dict % get_key('dy160')) % awr - awr(4) = nuclides(nuclide_dict % get_key('dy161')) % awr - awr(5) = nuclides(nuclide_dict % get_key('dy162')) % awr - awr(6) = nuclides(nuclide_dict % get_key('dy163')) % awr - awr(7) = nuclides(nuclide_dict % get_key('dy164')) % awr - end if - - case ('ho') - - ! Set the number of isotopes in this element - n_isotopes = 1 - - ! Allocate and initialize array for the atomic weight ratios - allocate(awr(n_isotopes)) - awr = ONE - - ! Allocate and initialize array for mole fractions - allocate(mf(n_isotopes)) - mf(1) = ONE - - ! Get the atomic weight ratios - if (expand_by == "wo") then - awr(1) = nuclides(nuclide_dict % get_key('ho165')) % awr - end if - - case ('er') - - ! Set the number of isotopes in this element - n_isotopes = 6 - - ! Allocate and initialize array for the atomic weight ratios - allocate(awr(n_isotopes)) - awr = ONE - - ! Allocate and initialize array for mole fractions - allocate(mf(n_isotopes)) - mf(1) = 0.00139_8 - mf(2) = 0.01601_8 - mf(3) = 0.33503_8 - mf(4) = 0.22869_8 - mf(5) = 0.26978_8 - mf(6) = 0.14910_8 - - ! Get the atomic weight ratios - if (expand_by == "wo") then - awr(1) = nuclides(nuclide_dict % get_key('er162')) % awr - awr(2) = nuclides(nuclide_dict % get_key('er164')) % awr - awr(3) = nuclides(nuclide_dict % get_key('er166')) % awr - awr(4) = nuclides(nuclide_dict % get_key('er167')) % awr - awr(5) = nuclides(nuclide_dict % get_key('er168')) % awr - awr(6) = nuclides(nuclide_dict % get_key('er170')) % awr - end if - - case ('tm') - - ! Set the number of isotopes in this element - n_isotopes = 1 - - ! Allocate and initialize array for the atomic weight ratios - allocate(awr(n_isotopes)) - awr = ONE - - ! Allocate and initialize array for mole fractions - allocate(mf(n_isotopes)) - mf(1) = ONE - - ! Get the atomic weight ratios - if (expand_by == "wo") then - awr(1) = nuclides(nuclide_dict % get_key('tm169')) % awr - end if - - case ('yb') - - ! Set the number of isotopes in this element - n_isotopes = 7 - - ! Allocate and initialize array for the atomic weight ratios - allocate(awr(n_isotopes)) - awr = ONE - - ! Allocate and initialize array for mole fractions - allocate(mf(n_isotopes)) - mf(1) = 0.00123_8 - mf(2) = 0.02982_8 - mf(3) = 0.1409_8 - mf(4) = 0.2168_8 - mf(5) = 0.16103_8 - mf(6) = 0.32026_8 - mf(7) = 0.12996_8 - - ! Get the atomic weight ratios - if (expand_by == "wo") then - awr(1) = nuclides(nuclide_dict % get_key('yb168')) % awr - awr(2) = nuclides(nuclide_dict % get_key('yb170')) % awr - awr(3) = nuclides(nuclide_dict % get_key('yb171')) % awr - awr(4) = nuclides(nuclide_dict % get_key('yb172')) % awr - awr(5) = nuclides(nuclide_dict % get_key('yb173')) % awr - awr(6) = nuclides(nuclide_dict % get_key('yb174')) % awr - awr(7) = nuclides(nuclide_dict % get_key('yb176')) % awr - end if - - case ('lu') - - ! Set the number of isotopes in this element - n_isotopes = 2 - - ! Allocate and initialize array for the atomic weight ratios - allocate(awr(n_isotopes)) - awr = ONE - - ! Allocate and initialize array for mole fractions - allocate(mf(n_isotopes)) - mf(1) = 0.97401_8 - mf(2) = 0.02599_8 - - ! Get the atomic weight ratios - if (expand_by == "wo") then - awr(1) = nuclides(nuclide_dict % get_key('lu175')) % awr - awr(2) = nuclides(nuclide_dict % get_key('lu176')) % awr - end if - - case ('hf') - - ! Set the number of isotopes in this element - n_isotopes = 6 - - ! Allocate and initialize array for the atomic weight ratios - allocate(awr(n_isotopes)) - awr = ONE - - ! Allocate and initialize array for mole fractions - allocate(mf(n_isotopes)) - mf(1) = 0.0016_8 - mf(2) = 0.0526_8 - mf(3) = 0.1860_8 - mf(4) = 0.2728_8 - mf(5) = 0.1362_8 - mf(6) = 0.3508_8 - - ! Get the atomic weight ratios - if (expand_by == "wo") then - awr(1) = nuclides(nuclide_dict % get_key('hf174')) % awr - awr(2) = nuclides(nuclide_dict % get_key('hf176')) % awr - awr(3) = nuclides(nuclide_dict % get_key('hf177')) % awr - awr(4) = nuclides(nuclide_dict % get_key('hf178')) % awr - awr(5) = nuclides(nuclide_dict % get_key('hf179')) % awr - awr(6) = nuclides(nuclide_dict % get_key('hf180')) % awr - end if - - case ('ta') - if (default_expand == ENDF_BVII0 .or. & - (default_expand >= JEFF_311 .and. default_expand <= JEFF_312) .or. & - (default_expand >= JENDL_32 .and. default_expand <= JENDL_40)) then - - ! Set the number of isotopes in this element - n_isotopes = 1 - - ! Allocate and initialize array for the atomic weight ratios - allocate(awr(n_isotopes)) - awr = ONE - - ! Allocate and initialize array for mole fractions - allocate(mf(n_isotopes)) - mf(1) = ONE - - ! Get the atomic weight ratios - if (expand_by == "wo") then - awr(1) = nuclides(nuclide_dict % get_key('ta181')) % awr - end if - else - - ! Set the number of isotopes in this element - n_isotopes = 2 - - ! Allocate and initialize array for the atomic weight ratios - allocate(awr(n_isotopes)) - awr = ONE - - ! Allocate and initialize array for mole fractions - allocate(mf(n_isotopes)) - mf(1) = 0.0001201_8 - mf(2) = 0.9998799_8 - - ! Get the atomic weight ratios - if (expand_by == "wo") then - awr(1) = nuclides(nuclide_dict % get_key('ta180')) % awr - awr(2) = nuclides(nuclide_dict % get_key('ta181')) % awr - end if - end if - - case ('w') - if (default_expand == ENDF_BVII0 .or. default_expand == JEFF_311 & - .or. default_expand == JEFF_312 .or. & - (default_expand >= JENDL_32 .and. default_expand <= JENDL_33)) then - ! Combine W-180 with W-182 - - ! Set the number of isotopes in this element - n_isotopes = 4 - - ! Allocate and initialize array for the atomic weight ratios - allocate(awr(n_isotopes)) - awr = ONE - - ! Allocate and initialize array for mole fractions - allocate(mf(n_isotopes)) - mf(1) = 0.2662_8 - mf(2) = 0.1431_8 - mf(3) = 0.3064_8 - mf(4) = 0.2843_8 - - ! Get the atomic weight ratios - if (expand_by == "wo") then - awr(1) = nuclides(nuclide_dict % get_key('w182')) % awr - awr(2) = nuclides(nuclide_dict % get_key('w183')) % awr - awr(3) = nuclides(nuclide_dict % get_key('w184')) % awr - awr(4) = nuclides(nuclide_dict % get_key('w186')) % awr - end if - else - - ! Set the number of isotopes in this element - n_isotopes = 5 - - ! Allocate and initialize array for the atomic weight ratios - allocate(awr(n_isotopes)) - awr = ONE - - ! Allocate and initialize array for mole fractions - allocate(mf(n_isotopes)) - mf(1) = 0.0012_8 - mf(2) = 0.2650_8 - mf(3) = 0.1431_8 - mf(4) = 0.3064_8 - mf(5) = 0.2843_8 - - ! Get the atomic weight ratios - if (expand_by == "wo") then - awr(1) = nuclides(nuclide_dict % get_key('w180')) % awr - awr(2) = nuclides(nuclide_dict % get_key('w182')) % awr - awr(3) = nuclides(nuclide_dict % get_key('w183')) % awr - awr(4) = nuclides(nuclide_dict % get_key('w184')) % awr - awr(5) = nuclides(nuclide_dict % get_key('w186')) % awr - end if - end if - - case ('re') - - ! Set the number of isotopes in this element - n_isotopes = 2 - - ! Allocate and initialize array for the atomic weight ratios - allocate(awr(n_isotopes)) - awr = ONE - - ! Allocate and initialize array for mole fractions - allocate(mf(n_isotopes)) - mf(1) = 0.3740_8 - mf(2) = 0.6260_8 - - ! Get the atomic weight ratios - if (expand_by == "wo") then - awr(1) = nuclides(nuclide_dict % get_key('re185')) % awr - awr(2) = nuclides(nuclide_dict % get_key('re187')) % awr - end if - - case ('os') - if (default_expand == JEFF_311 .or. default_expand == JEFF_312) then - - ! Set the number of isotopes in this element - n_isotopes = 1 - - ! Allocate and initialize array for the atomic weight ratios - allocate(awr(n_isotopes)) - awr = ONE - - ! Allocate and initialize array for mole fractions - allocate(mf(n_isotopes)) - mf(1) = ONE - - ! Get the atomic weight ratios - if (expand_by == "wo") then - awr(1) = nuclides(nuclide_dict % get_key('os0')) % awr - end if - else - - ! Set the number of isotopes in this element - n_isotopes = 7 - - ! Allocate and initialize array for the atomic weight ratios - allocate(awr(n_isotopes)) - awr = ONE - - ! Allocate and initialize array for mole fractions - allocate(mf(n_isotopes)) - mf(1) = 0.0002_8 - mf(2) = 0.0159_8 - mf(3) = 0.0196_8 - mf(4) = 0.1324_8 - mf(5) = 0.1615_8 - mf(6) = 0.2626_8 - mf(7) = 0.4078_8 - - ! Get the atomic weight ratios - if (expand_by == "wo") then - awr(1) = nuclides(nuclide_dict % get_key('os184')) % awr - awr(2) = nuclides(nuclide_dict % get_key('os186')) % awr - awr(3) = nuclides(nuclide_dict % get_key('os187')) % awr - awr(4) = nuclides(nuclide_dict % get_key('os188')) % awr - awr(5) = nuclides(nuclide_dict % get_key('os189')) % awr - awr(6) = nuclides(nuclide_dict % get_key('os190')) % awr - awr(7) = nuclides(nuclide_dict % get_key('os192')) % awr - end if - end if - - case ('ir') - - ! Set the number of isotopes in this element - n_isotopes = 2 - - ! Allocate and initialize array for the atomic weight ratios - allocate(awr(n_isotopes)) - awr = ONE - - ! Allocate and initialize array for mole fractions - allocate(mf(n_isotopes)) - mf(1) = 0.373_8 - mf(2) = 0.627_8 - - ! Get the atomic weight ratios - if (expand_by == "wo") then - awr(1) = nuclides(nuclide_dict % get_key('ir191')) % awr - awr(2) = nuclides(nuclide_dict % get_key('ir193')) % awr - end if - - case ('pt') - if (default_expand == JEFF_311 .or. default_expand == JEFF_312) then - - ! Set the number of isotopes in this element - n_isotopes = 1 - - ! Allocate and initialize array for the atomic weight ratios - allocate(awr(n_isotopes)) - awr = ONE - - ! Allocate and initialize array for mole fractions - allocate(mf(n_isotopes)) - mf(1) = ONE - - ! Get the atomic weight ratios - if (expand_by == "wo") then - awr(1) = nuclides(nuclide_dict % get_key('pt0')) % awr - end if - - else - - ! Set the number of isotopes in this element - n_isotopes = 6 - - ! Allocate and initialize array for the atomic weight ratios - allocate(awr(n_isotopes)) - awr = ONE - - ! Allocate and initialize array for mole fractions - allocate(mf(n_isotopes)) - mf(1) = 0.00012_8 - mf(2) = 0.00782_8 - mf(3) = 0.3286_8 - mf(4) = 0.3378_8 - mf(5) = 0.2521_8 - mf(6) = 0.07356_8 - - ! Get the atomic weight ratios - if (expand_by == "wo") then - awr(1) = nuclides(nuclide_dict % get_key('pt190')) % awr - awr(2) = nuclides(nuclide_dict % get_key('pt192')) % awr - awr(3) = nuclides(nuclide_dict % get_key('pt194')) % awr - awr(4) = nuclides(nuclide_dict % get_key('pt195')) % awr - awr(5) = nuclides(nuclide_dict % get_key('pt196')) % awr - awr(6) = nuclides(nuclide_dict % get_key('pt198')) % awr - end if - end if - - case ('au') - - ! Set the number of isotopes in this element - n_isotopes = 1 - - ! Allocate and initialize array for the atomic weight ratios - allocate(awr(n_isotopes)) - awr = ONE - - ! Allocate and initialize array for mole fractions - allocate(mf(n_isotopes)) - mf(1) = ONE - - ! Get the atomic weight ratios - if (expand_by == "wo") then - awr(1) = nuclides(nuclide_dict % get_key('au197')) % awr - end if - - case ('hg') - - ! Set the number of isotopes in this element - n_isotopes = 7 - - ! Allocate and initialize array for the atomic weight ratios - allocate(awr(n_isotopes)) - awr = ONE - - ! Allocate and initialize array for mole fractions - allocate(mf(n_isotopes)) - mf(1) = 0.0015_8 - mf(2) = 0.0997_8 - mf(3) = 0.1687_8 - mf(4) = 0.2310_8 - mf(5) = 0.1318_8 - mf(6) = 0.2986_8 - mf(7) = 0.0687_8 - - ! Get the atomic weight ratios - if (expand_by == "wo") then - awr(1) = nuclides(nuclide_dict % get_key('hg196')) % awr - awr(2) = nuclides(nuclide_dict % get_key('hg198')) % awr - awr(3) = nuclides(nuclide_dict % get_key('hg199')) % awr - awr(4) = nuclides(nuclide_dict % get_key('hg200')) % awr - awr(5) = nuclides(nuclide_dict % get_key('hg201')) % awr - awr(6) = nuclides(nuclide_dict % get_key('hg202')) % awr - awr(7) = nuclides(nuclide_dict % get_key('hg204')) % awr - end if - - case ('tl') - if (default_expand == JEFF_311 .or. default_expand == JEFF_312) then - - ! Set the number of isotopes in this element - n_isotopes = 1 - - ! Allocate and initialize array for the atomic weight ratios - allocate(awr(n_isotopes)) - awr = ONE - - ! Allocate and initialize array for mole fractions - allocate(mf(n_isotopes)) - mf(1) = ONE - - ! Get the atomic weight ratios - if (expand_by == "wo") then - awr(1) = nuclides(nuclide_dict % get_key('tl0')) % awr - end if - else - - ! Set the number of isotopes in this element - n_isotopes = 2 - - ! Allocate and initialize array for the atomic weight ratios - allocate(awr(n_isotopes)) - awr = ONE - - ! Allocate and initialize array for mole fractions - allocate(mf(n_isotopes)) - mf(1) = 0.2952_8 - mf(2) = 0.7048_8 - - ! Get the atomic weight ratios - if (expand_by == "wo") then - awr(1) = nuclides(nuclide_dict % get_key('tl203')) % awr - awr(2) = nuclides(nuclide_dict % get_key('tl205')) % awr - end if - end if - - case ('pb') - - ! Set the number of isotopes in this element - n_isotopes = 4 - - ! Allocate and initialize array for the atomic weight ratios - allocate(awr(n_isotopes)) - awr = ONE - - ! Allocate and initialize array for mole fractions - allocate(mf(n_isotopes)) - mf(1) = 0.014_8 - mf(2) = 0.241_8 - mf(3) = 0.221_8 - mf(4) = 0.524_8 - - ! Get the atomic weight ratios - if (expand_by == "wo") then - awr(1) = nuclides(nuclide_dict % get_key('pb204')) % awr - awr(2) = nuclides(nuclide_dict % get_key('pb206')) % awr - awr(3) = nuclides(nuclide_dict % get_key('pb207')) % awr - awr(4) = nuclides(nuclide_dict % get_key('pb208')) % awr - end if - - case ('bi') - - ! Set the number of isotopes in this element - n_isotopes = 1 - - ! Allocate and initialize array for the atomic weight ratios - allocate(awr(n_isotopes)) - awr = ONE - - ! Allocate and initialize array for mole fractions - allocate(mf(n_isotopes)) - mf(1) = ONE - - ! Get the atomic weight ratios - if (expand_by == "wo") then - awr(1) = nuclides(nuclide_dict % get_key('bi209')) % awr - end if - - case ('th') - - ! Set the number of isotopes in this element - n_isotopes = 1 - - ! Allocate and initialize array for the atomic weight ratios - allocate(awr(n_isotopes)) - awr = ONE - - ! Allocate and initialize array for mole fractions - allocate(mf(n_isotopes)) - mf(1) = ONE - - ! Get the atomic weight ratios - if (expand_by == "wo") then - awr(1) = nuclides(nuclide_dict % get_key('th232')) % awr - end if - - case ('pa') - - ! Set the number of isotopes in this element - n_isotopes = 1 - - ! Allocate and initialize array for the atomic weight ratios - allocate(awr(n_isotopes)) - awr = ONE - - ! Allocate and initialize array for mole fractions - allocate(mf(n_isotopes)) - mf(1) = ONE - - ! Get the atomic weight ratios - if (expand_by == "wo") then - awr(1) = nuclides(nuclide_dict % get_key('pa231')) % awr - end if - - case ('u') - - ! Set the number of isotopes in this element - n_isotopes = 3 - - ! Allocate and initialize array for the atomic weight ratios - allocate(awr(n_isotopes)) - awr = ONE - - ! Allocate and initialize array for mole fractions - allocate(mf(n_isotopes)) - mf(1) = 0.000054_8 - mf(2) = 0.007204_8 - mf(3) = 0.992742_8 - - ! Get the atomic weight ratios - if (expand_by == "wo") then - awr(1) = nuclides(nuclide_dict % get_key('u234')) % awr - awr(2) = nuclides(nuclide_dict % get_key('u235')) % awr - awr(3) = nuclides(nuclide_dict % get_key('u238')) % awr - end if - - ! Modify mole fractions if enrichment provided - if (enrichment /= -ONE) then - - ! Calculate the mass fractions of isotopes - mf(1) = 0.008 * enrichment - mf(2) = enrichment - mf(3) = 1.0 - 1.008 * enrichment - - ! Convert the mass fractions to mole fractions - do i = 1, n_isotopes - mf(i) = mf(i) / awr(i) - end do - - ! Normalize the mole fractions to ONE - element_awr = sum(mf(:)) - - do i = 1, n_isotopes - mf(i) = mf(i) / element_awr - end do - end if - - case default + integer :: i ! iterators + integer :: n_isotopes ! number of isotopes in the element + integer :: natural_elements_loc ! location in global array + integer :: nuclide_start ! ending nuclide in global array + integer :: nuclide_end ! starting nuclide in global array + character(2) :: element_name ! element atomic symbol + real(8) :: element_awr ! element atomic weight ratio + real(8), allocatable :: awr(:) ! isotope atomic weight ratios + real(8), allocatable :: mf(:) ! isotope mole fractions + + element_name = to_lower(name(1:2)) + + ! Find location of element name in natural_elements + i = -1 + do i = 1, num_natural_elements + if (natural_elements(i) == element_name) then + natural_elements_loc = i + end if + end do + + ! Issue error if element not found + if (i == -1) then call fatal_error("Cannot expand element: " // name) + end if + + ! Get start and end locations in natural_nuclides arrays + select case (default_expand) + case (ENDF_BVII0) + nuclide_start = natural_nuclides_ENDF_BVII0_start(natural_elements_loc) + nuclide_end = natural_nuclides_ENDF_BVII0_end(natural_elements_loc) + + case (ENDF_BVII1) + nuclide_start = natural_nuclides_ENDF_BVII1_start(natural_elements_loc) + nuclide_end = natural_nuclides_ENDF_BVII1_end(natural_elements_loc) + + case (JEFF_311) + nuclide_start = natural_nuclides_JEFF_311_start(natural_elements_loc) + nuclide_end = natural_nuclides_JEFF_311_end(natural_elements_loc) + + case (JEFF_312) + nuclide_start = natural_nuclides_JEFF_312_start(natural_elements_loc) + nuclide_end = natural_nuclides_JEFF_312_end(natural_elements_loc) + + case (JEFF_32) + nuclide_start = natural_nuclides_JEFF_32_start(natural_elements_loc) + nuclide_end = natural_nuclides_JEFF_32_end(natural_elements_loc) + + case (JENDL_32) + nuclide_start = natural_nuclides_JENDL_32_start(natural_elements_loc) + nuclide_end = natural_nuclides_JENDL_32_end(natural_elements_loc) + + case (JENDL_33) + nuclide_start = natural_nuclides_JENDL_33_start(natural_elements_loc) + nuclide_end = natural_nuclides_JENDL_33_end(natural_elements_loc) + + case (JENDL_40) + nuclide_start = natural_nuclides_JENDL_40_start(natural_elements_loc) + nuclide_end = natural_nuclides_JENDL_40_end(natural_elements_loc) end select + ! Set the number of isotopes in this element + n_isotopes = nuclide_end - nuclide_start + + ! Allocate and initialize array for the atomic weight ratios + allocate(awr(n_isotopes)) + awr = ONE + + ! Allocate and initialize array for mole fractions + allocate(mf(n_isotopes)) + + ! Add the nuclide names to the names array + do i = nuclide_start, nuclide_end-1 + mf(i - nuclide_start + 1) = natural_nuclides_mf(i) + end do + + ! Get the atomic weight ratios + if (expand_by == "wo") then + do i = nuclide_start, nuclide_end-1 + awr(i - nuclide_start + 1) = nuclides(nuclide_dict % & + get_key(to_lower(natural_nuclides(i)))) % awr + end do + end if + + ! Modify mole fractions if enrichment provided + if (enrichment /= -ONE .and. element_name == 'u') then + + ! Calculate the mass fractions of isotopes + mf(1) = 0.008 * enrichment + mf(2) = enrichment + mf(3) = 1.0 - 1.008 * enrichment + + ! Convert the mass fractions to mole fractions + do i = 1, n_isotopes + mf(i) = mf(i) / awr(i) + end do + + ! Normalize the mole fractions to ONE + element_awr = sum(mf(:)) + do i = 1, n_isotopes + mf(i) = mf(i) / element_awr + end do + end if + + ! Compute the ratio of the nuclide atomic weights to the element atomic + ! weight if (expand_by == "wo") then ! Compute the element awr @@ -7293,6 +4784,7 @@ contains end do end if + ! Add the densities to the master array do i = 1, n_isotopes call densities % push_back(density * mf(i) * awr(i)) end do diff --git a/tests/test_element_wo/inputs_true.dat b/tests/test_element_wo/inputs_true.dat index 136eedb7a4..d1c378eda0 100644 --- a/tests/test_element_wo/inputs_true.dat +++ b/tests/test_element_wo/inputs_true.dat @@ -1 +1 @@ -7db97c5303ca1f0beaba1b610c0d57cede072af2200b7494515caeca7f0ca43b1e1dbda1968f4f052af6c632cbba8c92203cd53670c19350c55d2339d28b2fb2 \ No newline at end of file +d9d8fda898e7c324c48c42ab64744acfd463a385cde30c827b0d757a4b52caee6bab87d45ad82fb40e8aa949b7fadbcd511a0ba2325ed707ff8cb9e9da7375c5 \ No newline at end of file diff --git a/tests/test_element_wo/results_true.dat b/tests/test_element_wo/results_true.dat index 2c37e7f782..0b4e58f946 100644 --- a/tests/test_element_wo/results_true.dat +++ b/tests/test_element_wo/results_true.dat @@ -1,5 +1,5 @@ k-combined: -8.863826E-01 5.114399E-02 +8.550315E-01 1.245826E-01 tally 1: -7.906207E+01 -1.251720E+03 +7.975160E+01 +1.273177E+03 diff --git a/tests/test_element_wo/test_element_wo.py b/tests/test_element_wo/test_element_wo.py index 1efc3e81bf..1d8422acac 100644 --- a/tests/test_element_wo/test_element_wo.py +++ b/tests/test_element_wo/test_element_wo.py @@ -23,6 +23,18 @@ class ElementWOTestHarness(PyAPITestHarness): fuel.add_element("U", 0.88, 'wo') fuel.add_element("O", 0.12, 'wo') + # Add the natural elements that are in the NNDC data to the fuel + for element in ['H', 'He', 'Li', 'Be', 'B', 'C', 'N', 'O', 'F', \ + 'Na', 'Mg', 'Al', 'Si', 'P', 'Cl', 'Ar', 'K', \ + 'Ca', 'Sc', 'Ti', 'V', 'Cr', 'Mn', 'Fe', 'Co', 'Ni', \ + 'Cu', 'Zn', 'Ga', 'Ge', 'As', 'Se', 'Br', 'Kr', 'Rb', \ + 'Sr', 'Y', 'Zr', 'Nb', 'Mo', 'Ru', 'Rh', 'Pd', 'Ag', \ + 'Cd', 'In', 'Sn', 'Sb', 'Te', 'I', 'Xe', 'Cs', 'Ba', \ + 'La', 'Ce', 'Pr', 'Nd', 'Sm', 'Eu', 'Gd', 'Tb', 'Dy', \ + 'Ho', 'Er', 'Tm', 'Lu', 'Hf', 'Ta', 'W', 'Re', \ + 'Ir', 'Au', 'Hg', 'Tl', 'Pb', 'Bi', 'Th', 'Pa']: + fuel.add_element(element, 1.e-8, 'wo') + clad = openmc.Material(name='Cladding') clad.set_density('g/cm3', 6.55) clad.add_element("Zr", 1.0, 'wo') From 7142a2c303d0959da2390a8c0021ad0aa3a234b4 Mon Sep 17 00:00:00 2001 From: Sam Shaner Date: Mon, 17 Oct 2016 17:29:32 -0400 Subject: [PATCH 05/34] removed unnecessary includes in global.F90 --- src/global.F90 | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/global.F90 b/src/global.F90 index 40df06b4a2..a18894a538 100644 --- a/src/global.F90 +++ b/src/global.F90 @@ -4,7 +4,6 @@ module global use cmfd_header use constants use dict_header, only: DictCharInt, DictIntInt - use stl_vector, only: VectorChar, VectorReal use geometry_header, only: Cell, Universe, Lattice, LatticeContainer use material_header, only: Material use mesh_header, only: RegularMesh @@ -19,7 +18,6 @@ module global use trigger_header, only: KTrigger use timer_header, only: Timer use volume_header, only: VolumeCalculation - use string, only: to_str #ifdef MPIF08 use mpi_f08 From ed36d06fdb6cf53ce7593914fd41fe369cf75b31 Mon Sep 17 00:00:00 2001 From: Sam Shaner Date: Mon, 17 Oct 2016 17:34:16 -0400 Subject: [PATCH 06/34] capitalized num_natural_elements in input_xml.F90 --- src/input_xml.F90 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/input_xml.F90 b/src/input_xml.F90 index 9e309899e6..5f9a909ff6 100644 --- a/src/input_xml.F90 +++ b/src/input_xml.F90 @@ -4594,7 +4594,7 @@ contains ! Find location of element name in natural_elements i = -1 - do i = 1, num_natural_elements + do i = 1, NUM_NATURAL_ELEMENTS if (natural_elements(i) == element_name) then natural_elements_loc = i end if @@ -4678,7 +4678,7 @@ contains ! Find location of element name in natural_elements i = -1 - do i = 1, num_natural_elements + do i = 1, NUM_NATURAL_ELEMENTS if (natural_elements(i) == element_name) then natural_elements_loc = i end if From 36817319d47d319b547fceba356fc63798fd059e Mon Sep 17 00:00:00 2001 From: Sam Shaner Date: Mon, 17 Oct 2016 17:42:15 -0400 Subject: [PATCH 07/34] changed wording of isotope to nuclide in input_xml.F90 --- src/input_xml.F90 | 44 ++++++++++++++++++++++---------------------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/src/input_xml.F90 b/src/input_xml.F90 index 5f9a909ff6..344b594138 100644 --- a/src/input_xml.F90 +++ b/src/input_xml.F90 @@ -2127,7 +2127,7 @@ contains integer :: index_nuclide ! index in nuclides integer :: index_sab ! index in sab_tables logical :: file_exists ! does materials.xml exist? - character(20) :: name ! name of isotope, e.g. 92235.03c + character(20) :: name ! name of nuclide, e.g. 92235.03c character(MAX_LINE_LEN) :: filename ! absolute path to materials.xml character(MAX_LINE_LEN) :: temp_str ! temporary string when reading type(VectorChar) :: names ! temporary list of nuclide names @@ -2314,7 +2314,7 @@ contains ! Get current number of nuclides n_nuc_ele = names % size() - ! Expand element into naturally-occurring isotopes + ! Expand element into naturally-occurring nuclides call expand_natural_element_names(name, names) ! Compute number of new nuclides from the natural element expansion @@ -4576,7 +4576,7 @@ contains ! EXPAND_NATURAL_ELEMENT_NAMES converts natural elements specified using an ! tag within a material and adds the names to the input names array. ! In some cases, modifications have been made to work with ENDF/B-VII.1 where -! evaluations of particular isotopes don't exist. +! evaluations of particular nuclides don't exist. !=============================================================================== subroutine expand_natural_element_names(name, names) @@ -4650,10 +4650,10 @@ contains !=============================================================================== ! EXPAND_NATURAL_ELEMENT_DENSITIES converts natural elements specified using an -! tag within a material into individual isotopes based on IUPAC +! tag within a material into individual nuclides based on IUPAC ! Isotopic Compositions of the Elements 2009 (doi:10.1351/PAC-REP-10-06-02). In ! some cases, modifications have been made to work with ENDF/B-VII.1 where -! evaluations of particular isotopes don't exist. +! evaluations of particular nuclides don't exist. !=============================================================================== subroutine expand_natural_element_densities(name, expand_by, density, & @@ -4662,17 +4662,17 @@ contains character(*), intent(in) :: expand_by ! "ao" or "wo" real(8), intent(in) :: density ! value for "ao" or "wo" real(8), intent(in) :: enrichment ! enrichment in weight % - type(VectorReal), intent(inout) :: densities ! isotope densities vector + type(VectorReal), intent(inout) :: densities ! nuclide densities vector integer :: i ! iterators - integer :: n_isotopes ! number of isotopes in the element + integer :: n_nuclides ! number of nuclides in the element integer :: natural_elements_loc ! location in global array integer :: nuclide_start ! ending nuclide in global array integer :: nuclide_end ! starting nuclide in global array character(2) :: element_name ! element atomic symbol real(8) :: element_awr ! element atomic weight ratio - real(8), allocatable :: awr(:) ! isotope atomic weight ratios - real(8), allocatable :: mf(:) ! isotope mole fractions + real(8), allocatable :: awr(:) ! nuclide atomic weight ratios + real(8), allocatable :: mf(:) ! nuclide mole fractions element_name = to_lower(name(1:2)) @@ -4725,15 +4725,15 @@ contains end select - ! Set the number of isotopes in this element - n_isotopes = nuclide_end - nuclide_start + ! Set the number of nuclides in this element + n_nuclides = nuclide_end - nuclide_start ! Allocate and initialize array for the atomic weight ratios - allocate(awr(n_isotopes)) + allocate(awr(n_nuclides)) awr = ONE ! Allocate and initialize array for mole fractions - allocate(mf(n_isotopes)) + allocate(mf(n_nuclides)) ! Add the nuclide names to the names array do i = nuclide_start, nuclide_end-1 @@ -4751,19 +4751,19 @@ contains ! Modify mole fractions if enrichment provided if (enrichment /= -ONE .and. element_name == 'u') then - ! Calculate the mass fractions of isotopes + ! Calculate the mass fractions of nuclides mf(1) = 0.008 * enrichment mf(2) = enrichment mf(3) = 1.0 - 1.008 * enrichment ! Convert the mass fractions to mole fractions - do i = 1, n_isotopes + do i = 1, n_nuclides mf(i) = mf(i) / awr(i) end do ! Normalize the mole fractions to ONE element_awr = sum(mf(:)) - do i = 1, n_isotopes + do i = 1, n_nuclides mf(i) = mf(i) / element_awr end do end if @@ -4774,18 +4774,18 @@ contains ! Compute the element awr element_awr = ZERO - do i = 1, n_isotopes + do i = 1, n_nuclides element_awr = element_awr + awr(i) * mf(i) end do ! Normalize the awr to the element awr - do i = 1, n_isotopes + do i = 1, n_nuclides awr(i) = awr(i) / element_awr end do end if ! Add the densities to the master array - do i = 1, n_isotopes + do i = 1, n_nuclides call densities % push_back(density * mf(i) * awr(i)) end do @@ -4895,7 +4895,7 @@ contains logical :: percent_in_atom ! nuclides specified in atom percent? logical :: density_in_atom ! density specified in atom/b-cm? logical :: file_exists ! does materials.xml exist? - character(20) :: name ! name of isotope, e.g. 92235.03c + character(20) :: name ! name of nuclide, e.g. 92235.03c character(MAX_WORD_LEN) :: units ! units on density character(MAX_LINE_LEN) :: filename ! materials.xml filename real(8) :: val ! value entered for density @@ -5047,7 +5047,7 @@ contains ! If enrichment was provided, issue error if (check_for_node(node_nuc, "enrichment")) then - call fatal_error("Cannot specify an enrichment for an isotope") + call fatal_error("Cannot specify an enrichment for a nuclide") end if ! Copy atom/weight percents @@ -5103,7 +5103,7 @@ contains enrichment = -ONE end if - ! Expand element into naturally-occurring isotopes + ! Expand element into naturally-occurring nuclides if (check_for_node(node_ele, "ao")) then call get_node_value(node_ele, "ao", temp_dble) call expand_natural_element_densities(name, "ao", temp_dble, & From 21bcf08318db8458c802d5255c816fdd4345f11c Mon Sep 17 00:00:00 2001 From: Sam Shaner Date: Mon, 17 Oct 2016 17:49:13 -0400 Subject: [PATCH 08/34] removed removal of tallies.xml file in testing_harness.py --- tests/testing_harness.py | 1 - 1 file changed, 1 deletion(-) diff --git a/tests/testing_harness.py b/tests/testing_harness.py index 0a13e612b4..150d124c8c 100644 --- a/tests/testing_harness.py +++ b/tests/testing_harness.py @@ -339,7 +339,6 @@ class PyAPITestHarness(TestHarness): output = [os.path.join(os.getcwd(), 'materials.xml')] output.append(os.path.join(os.getcwd(), 'geometry.xml')) output.append(os.path.join(os.getcwd(), 'settings.xml')) - output.append(os.path.join(os.getcwd(), 'tallies.xml')) output.append(os.path.join(os.getcwd(), 'inputs_test.dat')) output.append(os.path.join(os.getcwd(), 'summary.h5')) for f in output: From f059475bca036a65695734ea4fa98f2f25565501 Mon Sep 17 00:00:00 2001 From: Sam Shaner Date: Mon, 17 Oct 2016 21:09:38 -0400 Subject: [PATCH 09/34] removed enrichment from Fortran code and embedded in Python API --- openmc/material.py | 102 ++++++++++++++++++++++++++++++--------------- openmc/nuclide.py | 15 +++++++ src/input_xml.F90 | 51 ++--------------------- 3 files changed, 87 insertions(+), 81 deletions(-) diff --git a/openmc/material.py b/openmc/material.py index ee071d0f47..b0158b107b 100644 --- a/openmc/material.py +++ b/openmc/material.py @@ -58,9 +58,9 @@ class Material(object): 'atom/b-cm', 'atom/cm3', 'sum', or 'macro'. The 'macro' unit only applies in the case of a multi-group calculation. elements : list of tuple - List in which each item is a 3-tuple or 4-tuple consisting of an - :class:`openmc.Element` instance, the percent density, the percent - type ('ao' or 'wo'), and an optional weight-percent enrichment. + List in which each item is a 3-tuple consisting of an + :class:`openmc.Element` instance, the percent density, and the percent + type ('ao' or 'wo'). nuclides : list of tuple List in which each item is a 3-tuple consisting of an :class:`openmc.Nuclide` instance, the percent density, and the percent @@ -83,7 +83,7 @@ class Material(object): # (only one is allowed, hence this is different than _nuclides, etc) self._macroscopic = None - # A list of tuples (element, percent, percent type, enrichment (optional)) + # A list of tuples (element, percent, percent type) self._elements = [] # If specified, a list of table names @@ -149,13 +149,9 @@ class Material(object): string += '{0: <16}\n'.format('\tElements') - for element in self._elements: - string += '{0: <16}'.format('\t{0.name}'.format(element[0])) - if len(element) == 3: - string += '=\t{0: <12} [{1}]\n'.format(element[1], element[2]) - else: - string += '=\t{0: <12} [{1}] {2:4.2f} % enrichment\n'\ - .format(element[1], element[2], element[3]*100.) + for element, percent, percent_type in self._elements: + string += '{0: <16}'.format('\t{0.name}'.format(element)) + string += '=\t{0: <12} [{1}]\n'.format(percent, percent_type) return string @@ -466,20 +462,58 @@ class Material(object): else: element = openmc.Element(element) - if expand: - if percent_type == 'wo': - raise NotImplementedError('Expanding natural element based on ' - 'weight percent is not yet supported.') + if expand or enrichment is not None: - for isotope, abundance in element.expand(): + # Get the isotopes and their natural abundances + isotopes, abundances = zip(*element.expand()) + abundances = list(abundances) + n_isotopes = len(isotopes) + + # Create a list of atomic masses + atomic_masses = [] + for i,isotope in enumerate(isotopes): + atomic_masses.append(openmc.data.atomic_mass(isotope.name)) + + # Modify mole fractions if enrichment provided + if enrichment is not None: + + u234 = [i for i,iso in enumerate(isotopes) if iso.name == 'U234'][0] + u235 = [i for i,iso in enumerate(isotopes) if iso.name == 'U235'][0] + u238 = [i for i,iso in enumerate(isotopes) if iso.name == 'U238'][0] + + # Calculate the mass fractions of nuclides + abundances[u234] = 0.008 * enrichment + abundances[u235] = enrichment + abundances[u238] = 1.0 - 1.008 * enrichment + + # Convert the mass fractions to mole fractions + for i in range(n_isotopes): + abundances[i] /= atomic_masses[i] + + # Normalize the mole fractions to one + sum_abundances = sum(abundances) + for i in range(n_isotopes): + abundances[i] /= sum_abundances + + # Compute the ratio of the isotope atomic massess to the element + # atomic mass + if percent_type == 'wo': + + # Compute the element awr + element_am = 0. + for i in range(n_isotopes): + element_am += atomic_masses[i] * abundances[i] + + # Multiply the abundances by the ratio of the isotope atomic + # mass to the element atomic mass + for i in range(n_isotopes): + abundances[i] *= atomic_masses[i] / element_am + + for isotope, abundance in zip(isotopes, abundances): self._nuclides.append((isotope, percent*abundance, percent_type)) else: - if enrichment is not None: - self._elements.append((element, percent, percent_type, - enrichment)) - else: - self._elements.append((element, percent, percent_type)) + self._elements.append((element, percent, percent_type)) def remove_element(self, element): """Remove a natural element from the material @@ -496,10 +530,15 @@ class Material(object): 'since it is not an Element'.format(self.id, element) raise ValueError(msg) - # If the Material contains the Nuclide, delete it + # If the Material contains the Element, delete it for elm in self._elements: if element == elm: - self._nuclides.remove(elm) + self._elements.remove(elm) + + # If the Material contains Nuclides of the Element, delete them + for nuc in self._nuclides: + if nuc.get_element().name == element.name: + self._nuclides.remove(nuc) def add_s_alpha_beta(self, name): r"""Add an :math:`S(\alpha,\beta)` table to the material @@ -551,9 +590,9 @@ class Material(object): for nuclide, density, density_type in self._nuclides: nuclides.append(nuclide.name) - for element in self._elements: + for element, density, density_type in self._elements: # Expand natural element into isotopes - for isotope, abundance in element[0].expand(): + for isotope, abundance in element.expand(): nuclides.append(isotope.name) return nuclides @@ -576,8 +615,8 @@ class Material(object): for element in self._elements: # Expand natural element into isotopes - for isotope, abundance in element[0].expand(): - nuclides[isotope.name] = (isotope, element[1]*abundance) + for isotope, abundance in element.expand(): + nuclides[isotope.name] = (isotope, density*abundance) return nuclides @@ -612,9 +651,6 @@ class Material(object): else: xml_element.set("wo", str(element[1])) - if len(element) == 4: - xml_element.set("enrichment", str(element[3])) - if not element[0].scattering is None: xml_element.set("scattering", element[0].scattering) @@ -686,12 +722,12 @@ class Material(object): comps = [] allnucs = self._nuclides + self._elements dist_per_type = allnucs[0][2] - for nuc in allnucs: - if not nuc[2] == dist_per_type: + for nuc, per, typ in allnucs: + if not typ == dist_per_type: msg = 'All nuclides and elements in a distributed ' \ 'material must have the same type, either ao or wo' raise ValueError(msg) - comps.append(nuc[1]) + comps.append(per) if self._distrib_otf_file is None: # Create values and units subelements diff --git a/openmc/nuclide.py b/openmc/nuclide.py index 11c59e6879..73edd606b9 100644 --- a/openmc/nuclide.py +++ b/openmc/nuclide.py @@ -1,6 +1,8 @@ from numbers import Integral import sys import warnings +import itertools +import openmc from openmc.checkvalue import check_type @@ -94,3 +96,16 @@ class Nuclide(object): raise ValueError(msg) self._scattering = scattering + + def get_element(self): + """Returns the element of a nuclide + + Returns + ------- + element : openmc.Element + Element of nuclide + + """ + + element_name = "".join(itertools.takewhile(str.isalpha, name)) + return openmc.Element(element_name) diff --git a/src/input_xml.F90 b/src/input_xml.F90 index 344b594138..00b7dfe865 100644 --- a/src/input_xml.F90 +++ b/src/input_xml.F90 @@ -4657,11 +4657,10 @@ contains !=============================================================================== subroutine expand_natural_element_densities(name, expand_by, density, & - enrichment, densities) + densities) character(*), intent(in) :: name ! element name character(*), intent(in) :: expand_by ! "ao" or "wo" real(8), intent(in) :: density ! value for "ao" or "wo" - real(8), intent(in) :: enrichment ! enrichment in weight % type(VectorReal), intent(inout) :: densities ! nuclide densities vector integer :: i ! iterators @@ -4748,26 +4747,6 @@ contains end do end if - ! Modify mole fractions if enrichment provided - if (enrichment /= -ONE .and. element_name == 'u') then - - ! Calculate the mass fractions of nuclides - mf(1) = 0.008 * enrichment - mf(2) = enrichment - mf(3) = 1.0 - 1.008 * enrichment - - ! Convert the mass fractions to mole fractions - do i = 1, n_nuclides - mf(i) = mf(i) / awr(i) - end do - - ! Normalize the mole fractions to ONE - element_awr = sum(mf(:)) - do i = 1, n_nuclides - mf(i) = mf(i) / element_awr - end do - end if - ! Compute the ratio of the nuclide atomic weights to the element atomic ! weight if (expand_by == "wo") then @@ -4900,7 +4879,6 @@ contains character(MAX_LINE_LEN) :: filename ! materials.xml filename real(8) :: val ! value entered for density real(8) :: temp_dble ! temporary double prec. real - real(8) :: enrichment ! enrichment logical :: sum_density ! density is sum of nuclide densities type(VectorReal) :: densities ! temporary list of nuclide densities type(Material), pointer :: mat => null() @@ -5045,11 +5023,6 @@ contains &for a nuclide: " // trim(name)) end if - ! If enrichment was provided, issue error - if (check_for_node(node_nuc, "enrichment")) then - call fatal_error("Cannot specify an enrichment for a nuclide") - end if - ! Copy atom/weight percents if (check_for_node(node_nuc, "ao")) then call get_node_value(node_nuc, "ao", temp_dble) @@ -5085,33 +5058,15 @@ contains &element: " // trim(name)) end if - ! If enrichment was provided, issue error - if (check_for_node(node_ele, "enrichment")) then - - if (name /= 'U') then - call fatal_error("Enrichment is only supported for U") - end if - - call get_node_value(node_ele, "enrichment", enrichment) - - ! Check that enrichment is between ZERO and 1 / 1.008 - if (enrichment < ZERO .or. enrichment > 1 / 1.008) then - call fatal_error("U enrichment must be between 0 and 1/1.008") - end if - - else - enrichment = -ONE - end if - ! Expand element into naturally-occurring nuclides if (check_for_node(node_ele, "ao")) then call get_node_value(node_ele, "ao", temp_dble) call expand_natural_element_densities(name, "ao", temp_dble, & - enrichment, densities) + densities) else call get_node_value(node_ele, "wo", temp_dble) call expand_natural_element_densities(name, "wo", -temp_dble, & - enrichment, densities) + densities) end if end do NATURAL_ELEMENTS From cf34c229a7d28939c31b03914a9f1db141a30694 Mon Sep 17 00:00:00 2001 From: Sam Shaner Date: Mon, 17 Oct 2016 21:45:24 -0400 Subject: [PATCH 10/34] fixed issue with normalizing mass fractions and reverted documentation --- docs/source/usersguide/input.rst | 14 ++------- examples/xml/pincell/materials.xml | 7 +++-- openmc/material.py | 19 +++++++---- src/input_xml.F90 | 45 +++++++++++++-------------- tests/test_enrichment/inputs_true.dat | 2 +- 5 files changed, 43 insertions(+), 44 deletions(-) diff --git a/docs/source/usersguide/input.rst b/docs/source/usersguide/input.rst index 94936592fe..b1eedf59cd 100644 --- a/docs/source/usersguide/input.rst +++ b/docs/source/usersguide/input.rst @@ -1415,9 +1415,9 @@ Each ``material`` element can have the following attributes or sub-elements: Specifies that a natural element is present in the material. The natural element is split up into individual isotopes based on `IUPAC Isotopic Compositions of the Elements 2009`_. This element has - attributes/sub-elements called ``name``, and ``ao`` or ``wo``. The ``name`` - attribute is the atomic symbol of the element. Finally, the ``ao`` and ``wo`` - attributes specify the atom or weight percent of the element within the material, + attributes/sub-elements called ``name``, and ``ao``. The ``name`` + attribute is the atomic symbol of the element. Finally, the ``ao`` + attribute specifies the atom percent of the element within the material, respectively. One example would be as follows: .. code-block:: xml @@ -1447,14 +1447,6 @@ Each ``material`` element can have the following attributes or sub-elements: .. note:: The ``scattering`` attribute/sub-element is not used in the multi-group :ref:`energy_mode`. - An optional attribute/sub-element for uranium is ``enrichment``. This - attribute lets the user set the weight-percent enrichment of U-235 in - uranium. The weight-percent of U-234 is computed as 0.008 times the weight - percent of U-235 with U-238 comprising the balance. Valid values for - enrichment range between 0 and 1/1.008. - - *Default*: None - :sab: Associates an S(a,b) table with the material. This element has one attribute/sub-element called ``name``. The ``name`` attribute diff --git a/examples/xml/pincell/materials.xml b/examples/xml/pincell/materials.xml index 629dd7a6b2..9f9afa3843 100644 --- a/examples/xml/pincell/materials.xml +++ b/examples/xml/pincell/materials.xml @@ -9,8 +9,11 @@ - - + + + + + diff --git a/openmc/material.py b/openmc/material.py index b0158b107b..5a72d774b6 100644 --- a/openmc/material.py +++ b/openmc/material.py @@ -477,9 +477,12 @@ class Material(object): # Modify mole fractions if enrichment provided if enrichment is not None: - u234 = [i for i,iso in enumerate(isotopes) if iso.name == 'U234'][0] - u235 = [i for i,iso in enumerate(isotopes) if iso.name == 'U235'][0] - u238 = [i for i,iso in enumerate(isotopes) if iso.name == 'U238'][0] + u234 = [i for i,iso in enumerate(isotopes) \ + if iso.name == 'U234'][0] + u235 = [i for i,iso in enumerate(isotopes) \ + if iso.name == 'U235'][0] + u238 = [i for i,iso in enumerate(isotopes) \ + if iso.name == 'U238'][0] # Calculate the mass fractions of nuclides abundances[u234] = 0.008 * enrichment @@ -504,11 +507,15 @@ class Material(object): for i in range(n_isotopes): element_am += atomic_masses[i] * abundances[i] - # Multiply the abundances by the ratio of the isotope atomic - # mass to the element atomic mass + # Convert the molar fractions to mass fractions for i in range(n_isotopes): abundances[i] *= atomic_masses[i] / element_am + # Normalize the mass fractions to one + sum_abundances = sum(abundances) + for i in range(n_isotopes): + abundances[i] /= sum_abundances + for isotope, abundance in zip(isotopes, abundances): self._nuclides.append((isotope, percent*abundance, percent_type)) @@ -613,7 +620,7 @@ class Material(object): for nuclide, density, density_type in self._nuclides: nuclides[nuclide.name] = (nuclide, density) - for element in self._elements: + for element, density, density_type in self._elements: # Expand natural element into isotopes for isotope, abundance in element.expand(): nuclides[isotope.name] = (isotope, density*abundance) diff --git a/src/input_xml.F90 b/src/input_xml.F90 index 00b7dfe865..358970905b 100644 --- a/src/input_xml.F90 +++ b/src/input_xml.F90 @@ -4671,7 +4671,7 @@ contains character(2) :: element_name ! element atomic symbol real(8) :: element_awr ! element atomic weight ratio real(8), allocatable :: awr(:) ! nuclide atomic weight ratios - real(8), allocatable :: mf(:) ! nuclide mole fractions + real(8), allocatable :: mf(:) ! nuclide mole or mass fractions element_name = to_lower(name(1:2)) @@ -4727,10 +4727,6 @@ contains ! Set the number of nuclides in this element n_nuclides = nuclide_end - nuclide_start - ! Allocate and initialize array for the atomic weight ratios - allocate(awr(n_nuclides)) - awr = ONE - ! Allocate and initialize array for mole fractions allocate(mf(n_nuclides)) @@ -4739,37 +4735,38 @@ contains mf(i - nuclide_start + 1) = natural_nuclides_mf(i) end do - ! Get the atomic weight ratios - if (expand_by == "wo") then - do i = nuclide_start, nuclide_end-1 - awr(i - nuclide_start + 1) = nuclides(nuclide_dict % & - get_key(to_lower(natural_nuclides(i)))) % awr - end do - end if - ! Compute the ratio of the nuclide atomic weights to the element atomic ! weight if (expand_by == "wo") then - ! Compute the element awr - element_awr = ZERO - do i = 1, n_nuclides - element_awr = element_awr + awr(i) * mf(i) + ! Allocate array for the atomic weight ratios + allocate(awr(n_nuclides)) + + ! Get the atomic weight ratios + do i = nuclide_start, nuclide_end-1 + awr(i - nuclide_start + 1) = nuclides(nuclide_dict % & + get_key(to_lower(natural_nuclides(i)))) % awr end do - ! Normalize the awr to the element awr - do i = 1, n_nuclides - awr(i) = awr(i) / element_awr - end do + ! Compute the element awr + element_awr = sum(awr * mf) + + ! Convert the mole fractions to mass fractions + mf = mf * awr / element_awr + + ! Normalize the mass fractions to ONE + mf = mf / sum(mf) + + ! Deallocate array for the atomic weight ratios + deallocate(awr) end if ! Add the densities to the master array do i = 1, n_nuclides - call densities % push_back(density * mf(i) * awr(i)) + call densities % push_back(density * mf(i)) end do - ! Deallocate arrays - deallocate(awr) + ! Deallocate array for mole or mass fractions deallocate(mf) end subroutine expand_natural_element_densities diff --git a/tests/test_enrichment/inputs_true.dat b/tests/test_enrichment/inputs_true.dat index c3a23931f7..25091b440a 100644 --- a/tests/test_enrichment/inputs_true.dat +++ b/tests/test_enrichment/inputs_true.dat @@ -1 +1 @@ -9284e022d343431db161faee9290658addde59427a4e42adbdfd5069cd6bd54929bedf87ccb2fb369c91ca52c2c572e8825c4997b662ca2ac34005bf4c58ba83 \ No newline at end of file +1fe2d58365b5c8baf45766e788815bef715805ca96bb63480f50b2283b34c90408c19b52996e2b0da6afe1595b94a43aef7a72a3f47513131784275ed9092e89 \ No newline at end of file From 867fdf1ac87d0b1183c58a0c34b3005c39c2be91 Mon Sep 17 00:00:00 2001 From: Sam Shaner Date: Mon, 17 Oct 2016 21:48:28 -0400 Subject: [PATCH 11/34] fixed typo in material.py --- openmc/material.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openmc/material.py b/openmc/material.py index 5a72d774b6..deacaa2456 100644 --- a/openmc/material.py +++ b/openmc/material.py @@ -502,7 +502,7 @@ class Material(object): # atomic mass if percent_type == 'wo': - # Compute the element awr + # Compute the element atomic mass element_am = 0. for i in range(n_isotopes): element_am += atomic_masses[i] * abundances[i] From 1505a9297f9f0f4c504ed0dab98849b00d991ea6 Mon Sep 17 00:00:00 2001 From: Sam Shaner Date: Tue, 18 Oct 2016 07:30:35 -0400 Subject: [PATCH 12/34] added warning for enrichments over 6 percent and removed some elements from elements wo test --- openmc/material.py | 39 +++++++++++++++--------- tests/test_element_wo/inputs_true.dat | 2 +- tests/test_element_wo/results_true.dat | 6 ++-- tests/test_element_wo/test_element_wo.py | 17 +++++------ tests/test_enrichment/test_enrichment.py | 5 +++ tests/test_tallies/test_tallies.py | 2 +- 6 files changed, 42 insertions(+), 29 deletions(-) diff --git a/openmc/material.py b/openmc/material.py index deacaa2456..bfcad9a325 100644 --- a/openmc/material.py +++ b/openmc/material.py @@ -443,6 +443,12 @@ class Material(object): 'percent type "{1}"'.format(self._id, percent_type) raise ValueError(msg) + # Copy this Element to separate it from same Element in other Materials + if isinstance(element, openmc.Element): + element = deepcopy(element) + else: + element = openmc.Element(element) + if enrichment is not None: if not isinstance(enrichment, Real): msg = 'Unable to add an Element to Material ID="{0}" with a ' \ @@ -450,17 +456,20 @@ class Material(object): .format(self._id, enrichment) raise ValueError(msg) - elif element != 'U': + elif element.name != 'U': msg = 'Unable to use enrichment for element {0} which is not ' \ - 'uranium for Material ID="{1}"'.format(enrichment, + 'uranium for Material ID="{1}"'.format(element.name, self._id) raise ValueError(msg) - # Copy this Element to separate it from same Element in other Materials - if isinstance(element, openmc.Element): - element = deepcopy(element) - else: - element = openmc.Element(element) + if enrichment > 0.06: + msg = 'A uranium enrichment of {0} was given for Material ID='\ + '"{0}". OpenMC assumes the U234/U235 mass ratio is '\ + 'constant at 0.008, which is only valid at low ' \ + 'enrichments. Consider setting the isotopic ' \ + 'composition manually for enrichments over 6%.'.\ + format(self._id) + warnings.warn(msg) if expand or enrichment is not None: @@ -477,14 +486,16 @@ class Material(object): # Modify mole fractions if enrichment provided if enrichment is not None: - u234 = [i for i,iso in enumerate(isotopes) \ - if iso.name == 'U234'][0] - u235 = [i for i,iso in enumerate(isotopes) \ - if iso.name == 'U235'][0] - u238 = [i for i,iso in enumerate(isotopes) \ - if iso.name == 'U238'][0] + # Get the indices for the uranium isotopes + for i,iso in enumerate(isotopes): + if iso.name == 'U234': + u234 = i + elif iso.name == 'U235': + u235 = i + elif iso.name == 'U238': + u238 = i - # Calculate the mass fractions of nuclides + # Calculate the mass fractions of isotopes abundances[u234] = 0.008 * enrichment abundances[u235] = enrichment abundances[u238] = 1.0 - 1.008 * enrichment diff --git a/tests/test_element_wo/inputs_true.dat b/tests/test_element_wo/inputs_true.dat index d1c378eda0..db45f358b8 100644 --- a/tests/test_element_wo/inputs_true.dat +++ b/tests/test_element_wo/inputs_true.dat @@ -1 +1 @@ -d9d8fda898e7c324c48c42ab64744acfd463a385cde30c827b0d757a4b52caee6bab87d45ad82fb40e8aa949b7fadbcd511a0ba2325ed707ff8cb9e9da7375c5 \ No newline at end of file +6f1239c0f681f0bf405bcf090d4ec88c8a551ba4f4d49679fcbd6394b15d12e562d792c74dffbdd8f2b5e7945432d3fcea57922e4fe9d8e88fdc6741870cd366 \ No newline at end of file diff --git a/tests/test_element_wo/results_true.dat b/tests/test_element_wo/results_true.dat index 0b4e58f946..aa5a71a7bd 100644 --- a/tests/test_element_wo/results_true.dat +++ b/tests/test_element_wo/results_true.dat @@ -1,5 +1,5 @@ k-combined: -8.550315E-01 1.245826E-01 +8.318639E-01 1.165753E-01 tally 1: -7.975160E+01 -1.273177E+03 +8.059858E+01 +1.299961E+03 diff --git a/tests/test_element_wo/test_element_wo.py b/tests/test_element_wo/test_element_wo.py index 1d8422acac..bcccb3183e 100644 --- a/tests/test_element_wo/test_element_wo.py +++ b/tests/test_element_wo/test_element_wo.py @@ -23,16 +23,8 @@ class ElementWOTestHarness(PyAPITestHarness): fuel.add_element("U", 0.88, 'wo') fuel.add_element("O", 0.12, 'wo') - # Add the natural elements that are in the NNDC data to the fuel - for element in ['H', 'He', 'Li', 'Be', 'B', 'C', 'N', 'O', 'F', \ - 'Na', 'Mg', 'Al', 'Si', 'P', 'Cl', 'Ar', 'K', \ - 'Ca', 'Sc', 'Ti', 'V', 'Cr', 'Mn', 'Fe', 'Co', 'Ni', \ - 'Cu', 'Zn', 'Ga', 'Ge', 'As', 'Se', 'Br', 'Kr', 'Rb', \ - 'Sr', 'Y', 'Zr', 'Nb', 'Mo', 'Ru', 'Rh', 'Pd', 'Ag', \ - 'Cd', 'In', 'Sn', 'Sb', 'Te', 'I', 'Xe', 'Cs', 'Ba', \ - 'La', 'Ce', 'Pr', 'Nd', 'Sm', 'Eu', 'Gd', 'Tb', 'Dy', \ - 'Ho', 'Er', 'Tm', 'Lu', 'Hf', 'Ta', 'W', 'Re', \ - 'Ir', 'Au', 'Hg', 'Tl', 'Pb', 'Bi', 'Th', 'Pa']: + # Add some natural elements to the fuel + for element in [ 'Ir', 'Au', 'Hg', 'Tl', 'Pb', 'Bi', 'Th', 'Pa']: fuel.add_element(element, 1.e-8, 'wo') clad = openmc.Material(name='Cladding') @@ -96,6 +88,11 @@ class ElementWOTestHarness(PyAPITestHarness): self._input_set.build_default_settings() self._input_set.export() + def _cleanup(self): + super(ElementWOTestHarness, self)._cleanup() + f = os.path.join(os.getcwd(), 'tallies.xml') + if os.path.exists(f): os.remove(f) + if __name__ == '__main__': harness = ElementWOTestHarness('statepoint.10.*', True) diff --git a/tests/test_enrichment/test_enrichment.py b/tests/test_enrichment/test_enrichment.py index f17c65df19..85d88e7ec8 100644 --- a/tests/test_enrichment/test_enrichment.py +++ b/tests/test_enrichment/test_enrichment.py @@ -84,6 +84,11 @@ class EnrichmentTestHarness(PyAPITestHarness): self._input_set.build_default_settings() self._input_set.export() + def _cleanup(self): + super(EnrichmentTestHarness, self)._cleanup() + f = os.path.join(os.getcwd(), 'tallies.xml') + if os.path.exists(f): os.remove(f) + if __name__ == '__main__': harness = EnrichmentTestHarness('statepoint.10.*', True) diff --git a/tests/test_tallies/test_tallies.py b/tests/test_tallies/test_tallies.py index aa3aa208bc..07ca5bfdaf 100644 --- a/tests/test_tallies/test_tallies.py +++ b/tests/test_tallies/test_tallies.py @@ -122,7 +122,7 @@ class TalliesTestHarness(PyAPITestHarness): t.filters = [cell_filter] t.scores = ['absorption', 'delayed-nu-fission', 'events', 'fission', 'inverse-velocity', 'kappa-fission', '(n,2n)', '(n,n1)', - '(n,gamma)', 'nu-fission', 'scatter', 'elastic', + '(n,gamma)', 'nu-fission', 'scatter', 'elastic', 'total', 'prompt-nu-fission', 'fission-q-prompt', 'fission-q-recoverable'] score_tallies[0].estimator = 'tracklength' From 052417b9c3e02415260a58b72afe60e055492e0d Mon Sep 17 00:00:00 2001 From: Sam Shaner Date: Tue, 18 Oct 2016 08:25:41 -0400 Subject: [PATCH 13/34] changed enrichment warning from 6 to 5 % --- openmc/material.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/openmc/material.py b/openmc/material.py index bfcad9a325..e26b996d56 100644 --- a/openmc/material.py +++ b/openmc/material.py @@ -462,12 +462,12 @@ class Material(object): self._id) raise ValueError(msg) - if enrichment > 0.06: + if enrichment > 0.05: msg = 'A uranium enrichment of {0} was given for Material ID='\ '"{0}". OpenMC assumes the U234/U235 mass ratio is '\ 'constant at 0.008, which is only valid at low ' \ 'enrichments. Consider setting the isotopic ' \ - 'composition manually for enrichments over 6%.'.\ + 'composition manually for enrichments over 5%.'.\ format(self._id) warnings.warn(msg) From 6b687e9bf501f3e1c38628ada7b6ce8cdb9463f4 Mon Sep 17 00:00:00 2001 From: Sam Shaner Date: Tue, 18 Oct 2016 08:59:59 -0400 Subject: [PATCH 14/34] updated test results and fixed a few typos --- openmc/material.py | 4 ++-- tests/test_element_wo/inputs_true.dat | 2 +- tests/test_element_wo/results_true.dat | 6 +++--- tests/test_element_wo/test_element_wo.py | 6 +++--- tests/test_enrichment/inputs_true.dat | 2 +- tests/test_enrichment/results_true.dat | 6 +++--- tests/test_enrichment/test_enrichment.py | 6 +++--- 7 files changed, 16 insertions(+), 16 deletions(-) diff --git a/openmc/material.py b/openmc/material.py index e26b996d56..0b295ba98e 100644 --- a/openmc/material.py +++ b/openmc/material.py @@ -464,11 +464,11 @@ class Material(object): if enrichment > 0.05: msg = 'A uranium enrichment of {0} was given for Material ID='\ - '"{0}". OpenMC assumes the U234/U235 mass ratio is '\ + '"{1}". OpenMC assumes the U234/U235 mass ratio is '\ 'constant at 0.008, which is only valid at low ' \ 'enrichments. Consider setting the isotopic ' \ 'composition manually for enrichments over 5%.'.\ - format(self._id) + format(enrichment, self._id) warnings.warn(msg) if expand or enrichment is not None: diff --git a/tests/test_element_wo/inputs_true.dat b/tests/test_element_wo/inputs_true.dat index db45f358b8..adfd1742a2 100644 --- a/tests/test_element_wo/inputs_true.dat +++ b/tests/test_element_wo/inputs_true.dat @@ -1 +1 @@ -6f1239c0f681f0bf405bcf090d4ec88c8a551ba4f4d49679fcbd6394b15d12e562d792c74dffbdd8f2b5e7945432d3fcea57922e4fe9d8e88fdc6741870cd366 \ No newline at end of file +0d54ed29b2a348854d99d36f602b188766465b41e70536647578c61d076909a2351b5c4cafbbdc62dd00f36bf2685f231fae7c75d1289befddd2da79042e31a7 \ No newline at end of file diff --git a/tests/test_element_wo/results_true.dat b/tests/test_element_wo/results_true.dat index aa5a71a7bd..ad5a0c2280 100644 --- a/tests/test_element_wo/results_true.dat +++ b/tests/test_element_wo/results_true.dat @@ -1,5 +1,5 @@ k-combined: -8.318639E-01 1.165753E-01 +8.617147E-01 2.915803E-02 tally 1: -8.059858E+01 -1.299961E+03 +7.879002E+01 +1.242562E+03 diff --git a/tests/test_element_wo/test_element_wo.py b/tests/test_element_wo/test_element_wo.py index bcccb3183e..a5d35f4c56 100644 --- a/tests/test_element_wo/test_element_wo.py +++ b/tests/test_element_wo/test_element_wo.py @@ -24,7 +24,7 @@ class ElementWOTestHarness(PyAPITestHarness): fuel.add_element("O", 0.12, 'wo') # Add some natural elements to the fuel - for element in [ 'Ir', 'Au', 'Hg', 'Tl', 'Pb', 'Bi', 'Th', 'Pa']: + for element in ['Ir', 'Au', 'Hg', 'Tl', 'Pb', 'Bi', 'Th', 'Pa']: fuel.add_element(element, 1.e-8, 'wo') clad = openmc.Material(name='Cladding') @@ -33,8 +33,8 @@ class ElementWOTestHarness(PyAPITestHarness): hot_water = openmc.Material(name='Hot borated water') hot_water.set_density('g/cm3', 0.740582) - hot_water.add_element("H", 2./18., 'wo') - hot_water.add_element("O", 16./18., 'wo') + hot_water.add_element("H", 0.1111, 'wo') + hot_water.add_element("O", 0.8889, 'wo') hot_water.add_s_alpha_beta('c_H_in_H2O') # Define the materials file. diff --git a/tests/test_enrichment/inputs_true.dat b/tests/test_enrichment/inputs_true.dat index 25091b440a..572a4e1ff0 100644 --- a/tests/test_enrichment/inputs_true.dat +++ b/tests/test_enrichment/inputs_true.dat @@ -1 +1 @@ -1fe2d58365b5c8baf45766e788815bef715805ca96bb63480f50b2283b34c90408c19b52996e2b0da6afe1595b94a43aef7a72a3f47513131784275ed9092e89 \ No newline at end of file +47d753380f995651e6cec8e3648ff9e4ac254fc80919014124f4f6674afc95262006eda3821b4d6dcf09e29f28f5e21840c9b76b95c1c7f8ae522faac2386090 \ No newline at end of file diff --git a/tests/test_enrichment/results_true.dat b/tests/test_enrichment/results_true.dat index cd84b2d40d..347c39ff3c 100644 --- a/tests/test_enrichment/results_true.dat +++ b/tests/test_enrichment/results_true.dat @@ -1,5 +1,5 @@ k-combined: -1.457508E+00 5.577598E-02 +1.385412E+00 1.198466E-01 tally 1: -6.199709E+01 -7.692381E+02 +6.197393E+01 +7.688717E+02 diff --git a/tests/test_enrichment/test_enrichment.py b/tests/test_enrichment/test_enrichment.py index 85d88e7ec8..8d04112edd 100644 --- a/tests/test_enrichment/test_enrichment.py +++ b/tests/test_enrichment/test_enrichment.py @@ -20,7 +20,7 @@ class EnrichmentTestHarness(PyAPITestHarness): # Define materials. fuel = openmc.Material(name='Fuel') fuel.set_density('g/cm3', 10.29769) - fuel.add_element("U", 0.88, 'wo', enrichment=0.05) + fuel.add_element("U", 0.88, 'wo', enrichment=0.0495) fuel.add_element("O", 0.12, 'wo') clad = openmc.Material(name='Cladding') @@ -29,8 +29,8 @@ class EnrichmentTestHarness(PyAPITestHarness): hot_water = openmc.Material(name='Hot borated water') hot_water.set_density('g/cm3', 0.740582) - hot_water.add_element("H", 2./18., 'wo') - hot_water.add_element("O", 16./18., 'wo') + hot_water.add_element("H", 0.1111, 'wo') + hot_water.add_element("O", 0.8889, 'wo') hot_water.add_s_alpha_beta('c_H_in_H2O') # Define the materials file. From bc3b597be5cd1027a8919b77f7b12da07024173a Mon Sep 17 00:00:00 2001 From: Sam Shaner Date: Thu, 20 Oct 2016 08:50:55 -0400 Subject: [PATCH 15/34] fixed issue in input_xml.F90 with nuclide densities not being set early enough for MG mode --- src/input_xml.F90 | 35 ++++++++++++++++++++++++----------- 1 file changed, 24 insertions(+), 11 deletions(-) diff --git a/src/input_xml.F90 b/src/input_xml.F90 index 9aff28f909..54d56d2942 100644 --- a/src/input_xml.F90 +++ b/src/input_xml.F90 @@ -2139,6 +2139,9 @@ contains call time_read_xs % stop() end if + ! Assign and normalize nuclide densities + call assign_nuclide_densities() + ! Clear dictionary call library_dict % clear() end subroutine read_materials @@ -2159,10 +2162,10 @@ contains integer :: index_sab ! index in sab_tables logical :: file_exists ! does materials.xml exist? character(20) :: name ! name of nuclide, e.g. 92235.03c - character(MAX_LINE_LEN) :: filename ! absolute path to materials.xml - character(MAX_LINE_LEN) :: temp_str ! temporary string when reading - type(VectorChar) :: names ! temporary list of nuclide names - type(VectorInt) :: list_iso_lab ! temporary list of isotropic lab scatterers + character(MAX_LINE_LEN) :: filename ! absolute path to materials.xml + character(MAX_LINE_LEN) :: temp_str ! temporary string when reading + type(VectorChar) :: names ! temporary list of nuclide names + type(VectorInt) :: list_iso_lab ! temporary list of isotropic lab scatterers type(Material), pointer :: mat => null() type(Node), pointer :: doc => null() type(Node), pointer :: node_mat => null() @@ -4872,17 +4875,12 @@ contains end subroutine generate_rpn !=============================================================================== -! NORMALIZE_AO normalizes the atom or weight percentages for each material +! ASSIGN_NUCLIDE_DENSITIES Assign and normalize nuclide densities !=============================================================================== - subroutine normalize_ao() + subroutine assign_nuclide_densities() integer :: i ! index in materials array integer :: j ! index over nuclides in material - real(8) :: sum_percent ! summation - real(8) :: awr ! atomic weight ratio - real(8) :: x ! atom percent - logical :: percent_in_atom ! nuclides specified in atom percent? - logical :: density_in_atom ! density specified in atom/b-cm? logical :: file_exists ! does materials.xml exist? character(20) :: name ! name of nuclide, e.g. 92235.03c character(MAX_WORD_LEN) :: units ! units on density @@ -5103,6 +5101,21 @@ contains call densities % clear() end do + end subroutine assign_nuclide_densities + +!=============================================================================== +! NORMALIZE_AO Normalize the nuclide atom percents +!=============================================================================== + + subroutine normalize_ao() + integer :: i ! index in materials array + integer :: j ! index over nuclides in material + real(8) :: sum_percent ! summation + real(8) :: awr ! atomic weight ratio + real(8) :: x ! atom percent + logical :: percent_in_atom ! nuclides specified in atom percent? + logical :: density_in_atom ! density specified in atom/b-cm? + do i = 1, size(materials) associate (mat => materials(i)) percent_in_atom = (mat % atom_density(1) > ZERO) From 5708ff9d777dc4264af39b043b6c173db149be85 Mon Sep 17 00:00:00 2001 From: Sam Shaner Date: Thu, 20 Oct 2016 09:46:29 -0400 Subject: [PATCH 16/34] converted isotopes from iterator to list for python 3 compatibility --- openmc/material.py | 1 + 1 file changed, 1 insertion(+) diff --git a/openmc/material.py b/openmc/material.py index bdb5519c6b..71dd9076e7 100644 --- a/openmc/material.py +++ b/openmc/material.py @@ -475,6 +475,7 @@ class Material(object): # Get the isotopes and their natural abundances isotopes, abundances = zip(*element.expand()) abundances = list(abundances) + isotopes = list(isotopes) n_isotopes = len(isotopes) # Create a list of atomic masses From 716b6a92f51043a5f52416ffeff7a06b280af3bd Mon Sep 17 00:00:00 2001 From: Sam Shaner Date: Sat, 22 Oct 2016 16:36:02 -0400 Subject: [PATCH 17/34] removed element expansion in Fortran and added it to Python API --- openmc/element.py | 174 +++++- openmc/material.py | 247 ++++---- openmc/settings.py | 14 +- src/constants.F90 | 19 - src/global.F90 | 346 +----------- src/input_xml.F90 | 525 +++++------------- tests/input_set.py | 2 +- tests/test_complex_cell/materials.xml | 4 +- tests/test_complex_cell/results_true.dat | 18 +- tests/test_element_wo/inputs_true.dat | 2 +- tests/test_element_wo/results_true.dat | 6 +- tests/test_element_wo/test_element_wo.py | 1 - tests/test_enrichment/inputs_true.dat | 2 +- tests/test_enrichment/results_true.dat | 6 +- tests/test_enrichment/test_enrichment.py | 1 - tests/test_mg_basic/inputs_true.dat | 2 +- tests/test_mg_max_order/inputs_true.dat | 2 +- tests/test_mg_nuclide/inputs_true.dat | 2 +- tests/test_mg_tallies/inputs_true.dat | 2 +- .../test_mgxs_library_ce_to_mg.py | 4 +- tests/test_natural_element/geometry.xml | 94 ---- tests/test_natural_element/materials.xml | 62 --- tests/test_natural_element/results_true.dat | 2 - tests/test_natural_element/settings.xml | 22 - .../test_natural_element.py | 11 - tests/test_triso/inputs_true.dat | 2 +- tests/test_triso/plots.xml | 6 - 27 files changed, 497 insertions(+), 1081 deletions(-) delete mode 100644 tests/test_natural_element/geometry.xml delete mode 100644 tests/test_natural_element/materials.xml delete mode 100644 tests/test_natural_element/results_true.dat delete mode 100644 tests/test_natural_element/settings.xml delete mode 100644 tests/test_natural_element/test_natural_element.py delete mode 100644 tests/test_triso/plots.xml diff --git a/openmc/element.py b/openmc/element.py index 6ea1cb1373..ecea2b8c3f 100644 --- a/openmc/element.py +++ b/openmc/element.py @@ -1,12 +1,13 @@ import re import sys +import os from six import string_types import openmc from openmc.checkvalue import check_type, check_length from openmc.data import NATURAL_ABUNDANCE - +from xml.etree import ElementTree as ET class Element(object): """A natural element used in a material via . Internally, OpenMC @@ -90,9 +91,29 @@ class Element(object): self._scattering = scattering - def expand(self): + def expand(self, percent, percent_type, enrichment=None, + cross_sections=None): """Expand natural element into its naturally-occurring isotopes. + An optional cross_sections argument or the OPENMC_CROSS_SECTIONS + environment variable is used to specify a cross_sections.xml file. + If the cross_sections.xml file is found, the element is expanded only + into the isotopes/nuclides present in cross_sections.xml. If no + cross_sections.xml file is found, the element is expanded based on its + naturally occurring isotopes. + + Parameters + ---------- + percent : float + Atom or weight percent + percent_type : {'ao', 'wo'} + 'ao' for atom percent and 'wo' for weight percent + enrichment : float, optional + Enrichment percent for U235 in U. Default is None + (natural composition). + cross_sections : str, optional + Location of cross_sections.xml file. Default is None. + Returns ------- isotopes : list @@ -102,9 +123,150 @@ class Element(object): """ + # Get the nuclides present in nature + natural_nuclides = set() + for nuclide in sorted(NATURAL_ABUNDANCE.keys()): + if re.match(r'{}\d+'.format(self.name), nuclide): + natural_nuclides.add(int(nuclide[len(self.name):])) + + # Create lists to store the expanded nuclides and abundances + nuclides = [] + abundances = [] + + # If cross_sections is None, get the cross sections from the + # OPENMC_CROSS_SECTIONS environment variable + if cross_sections is None: + cross_sections = os.environ.get('OPENMC_CROSS_SECTIONS') + + # If a cross_sections library is present, check natural nuclides + # against the nuclides in the library + if cross_sections is not None: + + library_nuclides = set() + tree = ET.parse(cross_sections) + root = tree.getroot() + for child in root: + nuclide = child.attrib['materials'] + if re.match(r'{}\d+'.format(self.name), nuclide) and \ + '_m' not in nuclide: + library_nuclides.add(int(nuclide[len(self.name):])) + + # Get a set of the mutual and absent nuclides + mutual_nuclides = natural_nuclides.intersection(library_nuclides) + absent_nuclides = natural_nuclides.difference(mutual_nuclides) + mutual_nuclides = sorted(list(mutual_nuclides)) + absent_nuclides = sorted(list(absent_nuclides)) + + # If all natural nuclides are present in the library, expand element + # using all natural nuclides + if len(absent_nuclides) == 0: + for nuclide, abundance in sorted(NATURAL_ABUNDANCE.items()): + if re.match(r'{}\d+'.format(self.name), nuclide): + nuclides.append(openmc.Nuclide(nuclide)) + abundances.append(abundance) + + # If no natural elements are present in the library, check if the + # 0 element is present. If so, set the abundance to 1 for this + # nuclide. Else, raise an error. + elif len(mutual_nuclides) == 0: + if 0 in library_nuclides: + nuclides.append(openmc.Nuclide(self.name + '0')) + abundances.append(1.0) + else: + msg = 'Unable to expand element {0} because the cross '\ + 'section library provided does not contain any of '\ + 'the natural isotopes for that element.'\ + .format(self.name) + raise ValueError(msg) + + # If some, but not all, natural nuclides are in the library, add + # the mutual nuclides. For the absent nuclides, increment the + # abundance of the nearest mutual nuclide with their abundances. + else: + + # Add the mutual isotopes + nuclides_a = [] + for nuclide, abundance in sorted(NATURAL_ABUNDANCE.items()): + if re.match(r'{}\d+'.format(self.name), nuclide) and \ + int(nuclide[len(self.name):]) in mutual_nuclides: + nuclides.append(openmc.Nuclide(nuclide)) + nuclides_a.append(int(nuclide[len(self.name):])) + abundances.append(abundance) + + # Adjust the abundances for the absent nuclides + for nuclide, abundance in sorted(NATURAL_ABUNDANCE.items()): + if re.match(r'{}\d+'.format(self.name), nuclide) and \ + int(nuclide[len(self.name):]) in absent_nuclides: + + # Get index to the nearest nuclide + a = int(nuclide[len(self.name):]) + i = min(list(range(len(nuclides_a))), key=lambda j: \ + abs(nuclides_a[j] - a)) + + # Increment abundance of the nearest nuclide + abundances[i] += abundance + + # If a cross_section library is not present, expand the element into + # its natural nuclides + else: + for nuclide, abundance in sorted(NATURAL_ABUNDANCE.items()): + if re.match(r'{}\d+'.format(self.name), nuclide): + nuclides.append(openmc.Nuclide(nuclide)) + abundances.append(abundance) + + # Create a list of atomic masses + n_nuclides = len(nuclides) + atomic_masses = [] + for nuclide in nuclides: + atomic_masses.append(openmc.data.atomic_mass(nuclide.name)) + + # Modify mole fractions if enrichment provided + if enrichment is not None: + + # Get the indices for the uranium nuclides + for i,nuc in enumerate(nuclides): + if nuc.name == 'U234': + u234 = i + elif nuc.name == 'U235': + u235 = i + elif nuc.name == 'U238': + u238 = i + + # Calculate the mass fractions of isotopes + abundances[u234] = 0.008 * enrichment + abundances[u235] = enrichment + abundances[u238] = 1.0 - 1.008 * enrichment + + # Convert the mass fractions to mole fractions + for i in range(n_nuclides): + abundances[i] /= atomic_masses[i] + + # Normalize the mole fractions to one + sum_abundances = sum(abundances) + for i in range(n_nuclides): + abundances[i] /= sum_abundances + + # Compute the ratio of the nuclide atomic massess to the element + # atomic mass + if percent_type == 'wo': + + # Compute the element atomic mass + element_am = 0. + for i in range(n_nuclides): + element_am += atomic_masses[i] * abundances[i] + + # Convert the molar fractions to mass fractions + for i in range(n_nuclides): + abundances[i] *= atomic_masses[i] / element_am + + # Normalize the mass fractions to one + sum_abundances = sum(abundances) + for i in range(n_nuclides): + abundances[i] /= sum_abundances + isotopes = [] - for isotope, abundance in sorted(NATURAL_ABUNDANCE.items()): - if re.match(r'{}\d+'.format(self.name), isotope): - nuc = openmc.Nuclide(isotope) - isotopes.append((nuc, abundance)) + for nuclide, abundance in zip(nuclides, abundances): + pct = float('{:2.10f}'.format(percent*abundance)) + isotopes.append((nuclide, pct, percent_type)) + return isotopes diff --git a/openmc/material.py b/openmc/material.py index 71dd9076e7..cfd098c345 100644 --- a/openmc/material.py +++ b/openmc/material.py @@ -57,9 +57,9 @@ class Material(object): 'atom/b-cm', 'atom/cm3', 'sum', or 'macro'. The 'macro' unit only applies in the case of a multi-group calculation. elements : list of tuple - List in which each item is a 3-tuple consisting of an - :class:`openmc.Element` instance, the percent density, and the percent - type ('ao' or 'wo'). + List in which each item is a 4-tuple consisting of an + :class:`openmc.Element` instance, the percent density, the percent + type ('ao' or 'wo'), and enrichment. nuclides : list of tuple List in which each item is a 3-tuple consisting of an :class:`openmc.Nuclide` instance, the percent density, and the percent @@ -82,7 +82,7 @@ class Material(object): # (only one is allowed, hence this is different than _nuclides, etc) self._macroscopic = None - # A list of tuples (element, percent, percent type) + # A list of tuples (element, percent, percent type, enrichment) self._elements = [] # If specified, a list of table names @@ -148,9 +148,13 @@ class Material(object): string += '{0: <16}\n'.format('\tElements') - for element, percent, percent_type in self._elements: + for element, percent, percent_type, enr in self._elements: string += '{0: <16}'.format('\t{0.name}'.format(element)) - string += '=\t{0: <12} [{1}]\n'.format(percent, percent_type) + if enr is None: + string += '=\t{0: <12} [{1}]\n'.format(percent, percent_type) + else: + string += '=\t{0: <12} [{1}] @ {2} w/o enrichment\n'\ + .format(percent, percent_type, enr) return string @@ -401,8 +405,7 @@ class Material(object): if macroscopic.name == self._macroscopic.name: self._macroscopic = None - def add_element(self, element, percent, percent_type='ao', enrichment=None, - expand=False): + def add_element(self, element, percent, percent_type='ao', enrichment=None): """Add a natural element to the material Parameters @@ -416,9 +419,6 @@ class Material(object): percent. enrichment : float, optional Optional weight percent enrichment for uranium. Defaults to None. - expand : bool, optional - Whether to expand the natural element into its naturally-occurring - isotopes. Defaults to False. """ @@ -470,68 +470,7 @@ class Material(object): format(enrichment, self._id) warnings.warn(msg) - if expand or enrichment is not None: - - # Get the isotopes and their natural abundances - isotopes, abundances = zip(*element.expand()) - abundances = list(abundances) - isotopes = list(isotopes) - n_isotopes = len(isotopes) - - # Create a list of atomic masses - atomic_masses = [] - for i,isotope in enumerate(isotopes): - atomic_masses.append(openmc.data.atomic_mass(isotope.name)) - - # Modify mole fractions if enrichment provided - if enrichment is not None: - - # Get the indices for the uranium isotopes - for i,iso in enumerate(isotopes): - if iso.name == 'U234': - u234 = i - elif iso.name == 'U235': - u235 = i - elif iso.name == 'U238': - u238 = i - - # Calculate the mass fractions of isotopes - abundances[u234] = 0.008 * enrichment - abundances[u235] = enrichment - abundances[u238] = 1.0 - 1.008 * enrichment - - # Convert the mass fractions to mole fractions - for i in range(n_isotopes): - abundances[i] /= atomic_masses[i] - - # Normalize the mole fractions to one - sum_abundances = sum(abundances) - for i in range(n_isotopes): - abundances[i] /= sum_abundances - - # Compute the ratio of the isotope atomic massess to the element - # atomic mass - if percent_type == 'wo': - - # Compute the element atomic mass - element_am = 0. - for i in range(n_isotopes): - element_am += atomic_masses[i] * abundances[i] - - # Convert the molar fractions to mass fractions - for i in range(n_isotopes): - abundances[i] *= atomic_masses[i] / element_am - - # Normalize the mass fractions to one - sum_abundances = sum(abundances) - for i in range(n_isotopes): - abundances[i] /= sum_abundances - - for isotope, abundance in zip(isotopes, abundances): - self._nuclides.append((isotope, percent*abundance, percent_type)) - - else: - self._elements.append((element, percent, percent_type)) + self._elements.append((element, percent, percent_type, enrichment)) def remove_element(self, element): """Remove a natural element from the material @@ -553,11 +492,6 @@ class Material(object): if element == elm: self._elements.remove(elm) - # If the Material contains Nuclides of the Element, delete them - for nuc in self._nuclides: - if nuc.get_element().name == element.name: - self._nuclides.remove(nuc) - def add_s_alpha_beta(self, name): r"""Add an :math:`S(\alpha,\beta)` table to the material @@ -586,7 +520,6 @@ class Material(object): self._sab.append(new_name) - def make_isotropic_in_lab(self): for nuclide, percent, percent_type in self._nuclides: nuclide.scattering = 'iso-in-lab' @@ -605,13 +538,15 @@ class Material(object): nuclides = [] - for nuclide, density, density_type in self._nuclides: + for nuclide, percent, percent_type in self._nuclides: nuclides.append(nuclide.name) - for element, density, density_type in self._elements: + for ele, ele_pct, ele_pct_type, enr in self._elements: + # Expand natural element into isotopes - for isotope, abundance in element.expand(): - nuclides.append(isotope.name) + isotopes = ele.expand(ele_pct, ele_pct_type, enr) + for iso, iso_pct, iso_pct_type in isotopes: + nuclides.append(iso.name) return nuclides @@ -621,8 +556,8 @@ class Material(object): Returns ------- nuclides : dict - Dictionary whose keys are nuclide names and values are 2-tuples of - (nuclide, density) + Dictionary whose keys are nuclide names and values are 3-tuples of + (nuclide, density percent, density percent type) """ @@ -631,10 +566,12 @@ class Material(object): for nuclide, density, density_type in self._nuclides: nuclides[nuclide.name] = (nuclide, density) - for element, density, density_type in self._elements: + for ele, ele_pct, ele_pct_type, enr in self._elements: + # Expand natural element into isotopes - for isotope, abundance in element.expand(): - nuclides[isotope.name] = (isotope, density*abundance) + isotopes = ele.expand(ele_pct, ele_pct_type, enr) + for iso, iso_pct, iso_pct_type in isotopes: + nuclides[iso.name] = (iso, iso_pct, iso_pct_type) return nuclides @@ -659,22 +596,20 @@ class Material(object): return xml_element - def _get_element_xml(self, element, distrib=False): - xml_element = ET.Element("element") - xml_element.set("name", str(element[0].name)) + def _get_element_xml(self, element, cross_sections, distrib=False): - if not distrib: - if element[2] == 'ao': - xml_element.set("ao", str(element[1])) - else: - xml_element.set("wo", str(element[1])) + # Get the nuclides in this element + nuclides = element[0].expand(element[1], element[2], element[3], + cross_sections) - if not element[0].scattering is None: - xml_element.set("scattering", element[0].scattering) + xml_elements = [] + for nuclide in nuclides: + xml_elements.append(self._get_nuclide_xml(nuclide, distrib)) - return xml_element + return xml_elements def _get_nuclides_xml(self, nuclides, distrib=False): + xml_elements = [] for nuclide in nuclides: @@ -682,15 +617,19 @@ class Material(object): return xml_elements - def _get_elements_xml(self, elements, distrib=False): + def _get_elements_xml(self, elements, cross_sections, distrib=False): + xml_elements = [] for element in elements: - xml_elements.append(self._get_element_xml(element, distrib)) + nuclide_elements = self._get_element_xml(element, cross_sections, + distrib) + for nuclide_element in nuclide_elements: + xml_elements.append(nuclide_element) return xml_elements - def get_material_xml(self): + def get_material_xml(self, cross_sections): """Return XML representation of the material Returns @@ -726,7 +665,8 @@ class Material(object): element.append(subelement) # Create element XML subelements - subelements = self._get_elements_xml(self._elements) + subelements = self._get_elements_xml(self._elements, + cross_sections) for subelement in subelements: element.append(subelement) else: @@ -740,12 +680,12 @@ class Material(object): comps = [] allnucs = self._nuclides + self._elements dist_per_type = allnucs[0][2] - for nuc, per, typ in allnucs: - if not typ == dist_per_type: + for nuc in allnucs: + if not nuc[2] == dist_per_type: msg = 'All nuclides and elements in a distributed ' \ 'material must have the same type, either ao or wo' raise ValueError(msg) - comps.append(per) + comps.append(nuc[1]) if self._distrib_otf_file is None: # Create values and units subelements @@ -760,12 +700,15 @@ class Material(object): if self._macroscopic is None: # Create nuclide XML subelements - subelements = self._get_nuclides_xml(self._nuclides, distrib=True) + subelements = self._get_nuclides_xml(self._nuclides, + distrib=True) for subelement_nuc in subelements: subelement.append(subelement_nuc) # Create element XML subelements - subelements = self._get_elements_xml(self._elements, distrib=True) + subelements = self._get_elements_xml(self._elements, + cross_sections, + distrib=True) for subsubelement in subelements: subelement.append(subsubelement) else: @@ -800,15 +743,81 @@ class Materials(cv.CheckedList): ---------- materials : Iterable of openmc.Material Materials to add to the collection + cross_sections : str + Indicates the path to an XML cross section listing file (usually named + cross_sections.xml). If it is not set, the + :envvar:`OPENMC_CROSS_SECTIONS` environment variable will be used for + continuous-energy calculations and + :envvar:`OPENMC_MG_CROSS_SECTIONS` will be used for multi-group + calculations to find the path to the XML cross section file. + multipole_library : str + Indicates the path to a directory containing a windowed multipole + cross section library. If it is not set, the + :envvar:`OPENMC_MULTIPOLE_LIBRARY` environment variable will be used. A + multipole library is optional. + temperature : dict + Defines a default temperature and method for treating intermediate + temperatures at which nuclear data doesn't exist. Accepted keys are + 'default', 'method', 'tolerance', and 'multipole'. The value for + 'default' should be a float representing the default temperature in + Kelvin. The value for 'method' should be 'nearest' or 'interpolation'. + If the method is 'nearest', 'tolerance' indicates a range of temperature + within which cross sections may be used. 'multipole' is a boolean + indicating whether or not the windowed multipole method should be used + to evaluate resolved resonance cross sections. """ def __init__(self, materials=None): super(Materials, self).__init__(Material, 'materials collection') + self._materials_file = ET.Element("materials") + self._cross_sections = None + self._multipole_library = None + self._temperature = {} + if materials is not None: self += materials + @property + def cross_sections(self): + return self._cross_sections + + @property + def multipole_library(self): + return self._multipole_library + + @property + def temperature(self): + return self._temperature + + @cross_sections.setter + def cross_sections(self, cross_sections): + cv.check_type('cross sections', cross_sections, string_types) + self._cross_sections = cross_sections + + @multipole_library.setter + def multipole_library(self, multipole_library): + cv.check_type('cross sections', multipole_library, string_types) + self._multipole_library = multipole_library + + @temperature.setter + def temperature(self, temperature): + cv.check_type('temperature settings', temperature, Mapping) + for key, value in temperature.items(): + cv.check_value('temperature key', key, + ['default', 'method', 'tolerance', 'multipole']) + if key == 'default': + cv.check_type('default temperature', value, Real) + elif key == 'method': + cv.check_value('temperature method', value, + ['nearest', 'interpolation']) + elif key == 'tolerance': + cv.check_type('temperature tolerance', value, Real) + elif key == 'multipole': + cv.check_type('temperature multipole', value, bool) + self._temperature = temperature + def add_material(self, material): """Append material to collection @@ -891,9 +900,26 @@ class Materials(cv.CheckedList): def _create_material_subelements(self): for material in self: - xml_element = material.get_material_xml() + xml_element = material.get_material_xml(self.cross_sections) self._materials_file.append(xml_element) + def _create_cross_sections_subelement(self): + if self._cross_sections is not None: + element = ET.SubElement(self._materials_file, "cross_sections") + element.text = str(self._cross_sections) + + def _create_multipole_library_subelement(self): + if self._multipole_library is not None: + element = ET.SubElement(self._materials_file, "multipole_library") + element.text = str(self._multipole_library) + + def _create_temperature_subelements(self): + if self.temperature: + for key, value in sorted(self.temperature.items()): + element = ET.SubElement(self._materials_file, + "temperature_{}".format(key)) + element.text = str(value) + def export_to_xml(self, path='materials.xml'): """Export material collection to an XML file. @@ -908,6 +934,9 @@ class Materials(cv.CheckedList): self._materials_file.clear() self._create_material_subelements() + self._create_cross_sections_subelement() + self._create_multipole_library_subelement() + self._create_temperature_subelements() # Clean the indentation in the file to be user-readable sort_xml_elements(self._materials_file) diff --git a/openmc/settings.py b/openmc/settings.py index a214b02f3a..75878226e9 100644 --- a/openmc/settings.py +++ b/openmc/settings.py @@ -603,12 +603,19 @@ class Settings(object): @cross_sections.setter def cross_sections(self, cross_sections): + warnings.warn('Settings.cross_sections has been deprecated and will be ' + 'removed in a future version. Materials.cross_sections ' + 'should defined instead.', DeprecationWarning) cv.check_type('cross sections', cross_sections, string_types) self._cross_sections = cross_sections @multipole_library.setter def multipole_library(self, multipole_library): - cv.check_type('cross sections', multipole_library, string_types) + warnings.warn('Settings.multipole_library has been deprecated and will ' + 'be removed in a future version. ' + 'Materials.multipole_library should defined instead.', + DeprecationWarning) + cv.check_type('multipole library', multipole_library, string_types) self._multipole_library = multipole_library @ptables.setter @@ -713,6 +720,11 @@ class Settings(object): @temperature.setter def temperature(self, temperature): + + warnings.warn('Settings.temperature has been deprecated and will ' + 'be removed in a future version. Materials.temperature ' + 'should defined instead.', DeprecationWarning) + cv.check_type('temperature settings', temperature, Mapping) for key, value in temperature.items(): cv.check_value('temperature key', key, diff --git a/src/constants.F90 b/src/constants.F90 index cc12969990..c42631c1c9 100644 --- a/src/constants.F90 +++ b/src/constants.F90 @@ -257,25 +257,6 @@ module constants ! Maximum number of partial fission reactions integer, parameter :: PARTIAL_FISSION_MAX = 4 - ! Major cross section libraries - integer, parameter :: & - ENDF_BVII0 = 1, & - ENDF_BVII1 = 2, & - JEFF_311 = 3, & - JEFF_312 = 4, & - JEFF_32 = 5, & - JENDL_32 = 6, & - JENDL_33 = 7, & - JENDL_40 = 8 - - ! Number of natural elements and nuclides in the global natural_elements - ! and natural_nuclides arrays. Note that some nuclides are repeated in order - ! to make it easy to expand natural elements for different cross section - ! libraries. - integer, parameter :: & - NUM_NATURAL_ELEMENTS = 84, & - NUM_NATURAL_NUCLIDES = 301 - ! Temperature treatment method integer, parameter :: & TEMPERATURE_NEAREST = 1, & diff --git a/src/global.F90 b/src/global.F90 index cc835d1bce..09a8422a11 100644 --- a/src/global.F90 +++ b/src/global.F90 @@ -96,9 +96,6 @@ module global ! Unreoslved resonance probablity tables logical :: urr_ptables_on = .true. - ! What to assume for expanding natural elements - integer :: default_expand = ENDF_BVII1 - ! Default temperature and method for choosing temperatures integer :: temperature_method = TEMPERATURE_NEAREST logical :: temperature_multipole = .false. @@ -132,333 +129,6 @@ module global ! Number of points to use in the Legendre to tabular conversion integer :: legendre_to_tabular_points = 33 - ! ============================================================================ - ! ELEMENT AND NUCLIDE RELATED VARIABLES - - ! List of all possible natural element expansion isotopes - character (len=5), dimension (NUM_NATURAL_NUCLIDES), parameter :: & - natural_nuclides = [character(len=5) :: & - 'H1' , 'H2' , 'He3' , 'He4' , 'Li6' , 'Li7' , 'Be9' , 'B10' , & - 'B11' , 'C0' , 'N14' , 'N15' , 'O16' , 'O17' , 'O18' , 'O16' , & - 'O16' , 'O17' , 'F19' , 'Ne20' , 'Ne21' , 'Ne22' , 'Na23' , 'Mg24' , & - 'Mg25' , 'Mg26' , 'Al27' , 'Si28' , 'Si29' , 'Si30' , 'P31' , 'S32' , & - 'S33' , 'S34' , 'S35' , 'Cl35' , 'Cl37' , 'Ar36' , 'Ar38' , 'Ar40' , & - 'K39' , 'K40' , 'K41' , 'Ca40' , 'Ca42' , 'Ca43' , 'Ca44' , 'Ca46' , & - 'Ca48' , 'Sc45' , 'Ti46' , 'Ti47' , 'Ti48' , 'Ti49' , 'Ti50' , 'V0' , & - 'V50' , 'V51' , 'Cr50' , 'Cr52' , 'Cr53' , 'Cr54' , 'Mn55' , 'Fe54' , & - 'Fe56' , 'Fe57' , 'Fe58' , 'Co59' , 'Ni58' , 'Ni60' , 'Ni61' , 'Ni62' , & - 'Ni64' , 'Cu63' , 'Cu65' , 'Zn0' , 'Zn64' , 'Zn66' , 'Zn67' , 'Zn68' , & - 'Zn70' , 'Ga0' , 'Ga69' , 'Ga71' , 'Ge70' , 'Ge72' , 'Ge73' , 'Ge74' , & - 'Ge76' , 'As75' , 'Se74' , 'Se76' , 'Se77' , 'Se78' , 'Se80' , 'Se82' , & - 'Br79' , 'Br81' , 'Kr78' , 'Kr80' , 'Kr82' , 'Kr83' , 'Kr84' , 'Kr86' , & - 'Rb85' , 'Rb87' , 'Sr84' , 'Sr86' , 'Sr87' , 'Sr88' , 'Y89' , 'Zr90' , & - 'Zr91' , 'Zr92' , 'Zr94' , 'Zr96' , 'Nb93' , 'Mo92' , 'Mo94' , 'Mo95' , & - 'Mo96' , 'Mo97' , 'Mo98' , 'Mo100', 'Ru96' , 'Ru98' , 'Ru99' , 'Ru100', & - 'Ru101', 'Ru102', 'Ru104', 'Rh103', 'Pd102', 'Pd104', 'Pd105', 'Pd106', & - 'Pd108', 'Pd110', 'Ag107', 'Ag109', 'Cd106', 'Cd108', 'Cd110', 'Cd111', & - 'Cd112', 'Cd113', 'Cd114', 'Cd116', 'In113', 'In115', 'Sn112', 'Sn114', & - 'Sn115', 'Sn116', 'Sn117', 'Sn118', 'Sn119', 'Sn120', 'Sn122', 'Sn124', & - 'Sb121', 'Sb123', 'Te120', 'Te122', 'Te123', 'Te124', 'Te125', 'Te126', & - 'Te128', 'Te130', 'I127' , 'Xe124', 'Xe126', 'Xe128', 'Xe129', 'Xe130', & - 'Xe131', 'Xe132', 'Xe134', 'Xe136', 'Cs133', 'Ba130', 'Ba132', 'Ba134', & - 'Ba135', 'Ba136', 'Ba137', 'Ba138', 'La138', 'La139', 'Ce136', 'Ce138', & - 'Ce140', 'Ce142', 'Pr141', 'Nd142', 'Nd143', 'Nd144', 'Nd145', 'Nd146', & - 'Nd148', 'Nd150', 'Sm144', 'Sm147', 'Sm148', 'Sm149', 'Sm150', 'Sm152', & - 'Sm154', 'Eu151', 'Eu153', 'Gd152', 'Gd154', 'Gd155', 'Gd156', 'Gd157', & - 'Gd158', 'Gd160', 'Tb159', 'Dy156', 'Dy158', 'Dy160', 'Dy161', 'Dy162', & - 'Dy163', 'Dy164', 'Ho165', 'Er162', 'Er164', 'Er166', 'Er167', 'Er168', & - 'Er170', 'Tm169', 'Yb168', 'Yb170', 'Yb171', 'Yb172', 'Yb173', 'Yb174', & - 'Yb176', 'Lu175', 'Lu176', 'Hf174', 'Hf176', 'Hf177', 'Hf178', 'Hf179', & - 'Hf180', 'Ta181', 'Ta180', 'Ta181', 'W182' , 'W183' , 'W184' , 'W186' , & - 'W180' , 'W182' , 'W183' , 'W184' , 'W186' , 'Re185', 'Re187', 'Os0' , & - 'Os184', 'Os186', 'Os187', 'Os188', 'Os189', 'Os190', 'Os192', 'Ir191', & - 'Ir193', 'Pt0' , 'Pt190', 'Pt192', 'Pt194', 'Pt195', 'Pt196', 'Pt198', & - 'Au197', 'Hg196', 'Hg198', 'Hg199', 'Hg200', 'Hg201', 'Hg202', 'Hg204', & - 'Tl0' , 'Tl203', 'Tl205', 'Pb204', 'Pb206', 'Pb207', 'Pb208', 'Bi209', & - 'Th232', 'Pa231', 'U234' , 'U235' , 'U238'] - - character (len=2), dimension (NUM_NATURAL_ELEMENTS), parameter :: & - natural_elements = [character(len=2) :: & - 'h' , 'he', 'li', 'be', 'b' , 'c' , 'n' , 'o' , 'f' , 'ne', & - 'na', 'mg', 'al', 'si', 'p' , 's' , 'cl', 'ar', 'k' , 'ca', & - 'sc', 'ti', 'v' , 'cr', 'mn', 'fe', 'co', 'ni', 'cu', 'zn', & - 'ga', 'ge', 'as', 'se', 'br', 'kr', 'rb', 'sr', 'y' , 'zr', & - 'nb', 'mo', 'ru', 'rh', 'pd', 'ag', 'cd', 'in', 'sn', 'sb', & - 'te', 'i' , 'xe', 'cs', 'ba', 'la', 'ce', 'pr', 'nd', 'sm', & - 'eu', 'gd', 'tb', 'dy', 'ho', 'er', 'tm', 'yb', 'lu', 'hf', & - 'ta', 'w' , 're', 'os', 'ir', 'pt', 'au', 'hg', 'tl', 'pb', & - 'bi', 'th', 'pa', 'u'] - - integer, dimension(NUM_NATURAL_ELEMENTS) :: & - natural_nuclides_ENDF_BVII0_start = (/ & - 1 , 3 , 5 , 7 , 8 , 10 , 11 , 17 , 19 , 20 , & - 23 , 24 , 27 , 28 , 31 , 32 , 36 , 38 , 41 , 44 , & - 50 , 51 , 56 , 59 , 63 , 64 , 68 , 69 , 74 , 76 , & - 83 , 85 , 90 , 90 , 97 , 99 , 105 , 107 , 111 , 112 , & - 117 , 118 , 125 , 132 , 133 , 139 , 141 , 149 , 151 , 161 , & - 163 , 171 , 172 , 181 , 182 , 189 , 191 , 195 , 196 , 203 , & - 210 , 212 , 219 , 220 , 227 , 228 , 234 , 235 , 242 , 244 , & - 250 , 253 , 262 , 265 , 272 , 275 , 281 , 282 , 290 , 292 , & - 296 , 297 , 298 , 299 /) - - integer, dimension(NUM_NATURAL_ELEMENTS) :: & - natural_nuclides_ENDF_BVII0_end = (/ & - 3 , 5 , 7 , 8 , 10 , 11 , 13 , 19 , 20 , 23 , & - 24 , 27 , 28 , 31 , 32 , 36 , 38 , 41 , 44 , 50 , & - 51 , 56 , 57 , 63 , 64 , 68 , 69 , 74 , 76 , 77 , & - 85 , 90 , 90 , 97 , 99 , 105 , 107 , 111 , 112 , 117 , & - 118 , 125 , 132 , 133 , 139 , 141 , 149 , 151 , 161 , 163 , & - 171 , 172 , 181 , 182 , 189 , 191 , 195 , 196 , 203 , 210 , & - 212 , 219 , 220 , 227 , 228 , 234 , 235 , 242 , 244 , 250 , & - 251 , 257 , 264 , 272 , 274 , 281 , 282 , 289 , 292 , 296 , & - 297 , 298 , 299 , 302 /) - - integer, dimension(NUM_NATURAL_ELEMENTS) :: & - natural_nuclides_ENDF_BVII1_start = (/ & - 1 , 3 , 5 , 7 , 8 , 10 , 11 , 17 , 19 , 20 , & - 23 , 24 , 27 , 28 , 31 , 32 , 36 , 38 , 41 , 44 , & - 50 , 51 , 57 , 59 , 63 , 64 , 68 , 69 , 74 , 77 , & - 83 , 85 , 90 , 90 , 97 , 99 , 105 , 107 , 111 , 112 , & - 117 , 118 , 125 , 132 , 133 , 139 , 141 , 149 , 151 , 161 , & - 163 , 171 , 172 , 181 , 182 , 189 , 191 , 195 , 196 , 203 , & - 210 , 212 , 219 , 220 , 227 , 228 , 234 , 235 , 242 , 244 , & - 251 , 257 , 262 , 265 , 272 , 275 , 281 , 282 , 290 , 292 , & - 296 , 297 , 298 , 299 /) - - integer, dimension(NUM_NATURAL_ELEMENTS) :: & - natural_nuclides_ENDF_BVII1_end = (/ & - 3 , 5 , 7 , 8 , 10 , 11 , 13 , 19 , 20 , 23 , & - 24 , 27 , 28 , 31 , 32 , 36 , 38 , 41 , 44 , 50 , & - 51 , 56 , 59 , 63 , 64 , 68 , 69 , 74 , 76 , 82 , & - 85 , 90 , 90 , 97 , 99 , 105 , 107 , 111 , 112 , 117 , & - 118 , 125 , 132 , 133 , 139 , 141 , 149 , 151 , 161 , 163 , & - 171 , 172 , 181 , 182 , 189 , 191 , 195 , 196 , 203 , 210 , & - 212 , 219 , 220 , 227 , 228 , 234 , 235 , 242 , 244 , 250 , & - 253 , 262 , 264 , 272 , 274 , 281 , 282 , 289 , 292 , 296 , & - 297 , 298 , 299 , 302 /) - - integer, dimension(NUM_NATURAL_ELEMENTS) :: & - natural_nuclides_JEFF_311_start = (/ & - 1 , 3 , 5 , 7 , 8 , 10 , 11 , 17 , 19 , 20 , & - 23 , 24 , 27 , 28 , 31 , 32 , 36 , 38 , 41 , 44 , & - 50 , 51 , 56 , 59 , 63 , 64 , 68 , 69 , 74 , 76 , & - 82 , 85 , 90 , 90 , 97 , 99 , 105 , 107 , 111 , 112 , & - 117 , 118 , 125 , 132 , 133 , 139 , 141 , 149 , 151 , 161 , & - 163 , 171 , 172 , 181 , 182 , 189 , 191 , 195 , 196 , 203 , & - 210 , 212 , 219 , 220 , 227 , 228 , 234 , 235 , 242 , 244 , & - 250 , 253 , 262 , 264 , 272 , 274 , 281 , 282 , 289 , 292 , & - 296 , 297 , 298 , 299 /) - - integer, dimension(NUM_NATURAL_ELEMENTS) :: & - natural_nuclides_JEFF_311_end = (/ & - 3 , 5 , 7 , 8 , 10 , 11 , 13 , 19 , 20 , 23 , & - 24 , 27 , 28 , 31 , 32 , 36 , 38 , 41 , 44 , 50 , & - 51 , 56 , 57 , 63 , 64 , 68 , 69 , 74 , 76 , 77 , & - 83 , 90 , 90 , 97 , 99 , 105 , 107 , 111 , 112 , 117 , & - 118 , 125 , 132 , 133 , 139 , 141 , 149 , 151 , 161 , 163 , & - 171 , 172 , 181 , 182 , 189 , 191 , 195 , 196 , 203 , 210 , & - 212 , 219 , 220 , 227 , 228 , 234 , 235 , 242 , 244 , 250 , & - 251 , 257 , 264 , 265 , 274 , 275 , 282 , 289 , 290 , 296 , & - 297 , 298 , 299 , 302 /) - - integer, dimension(NUM_NATURAL_ELEMENTS) :: & - natural_nuclides_JEFF_312_start = (/ & - 1 , 3 , 5 , 7 , 8 , 10 , 11 , 17 , 19 , 20 , & - 23 , 24 , 27 , 28 , 31 , 32 , 36 , 38 , 41 , 44 , & - 50 , 51 , 57 , 59 , 63 , 64 , 68 , 69 , 74 , 76 , & - 82 , 85 , 90 , 90 , 97 , 99 , 105 , 107 , 111 , 112 , & - 117 , 118 , 125 , 132 , 133 , 139 , 141 , 149 , 151 , 161 , & - 163 , 171 , 172 , 181 , 182 , 189 , 191 , 195 , 196 , 203 , & - 210 , 212 , 219 , 220 , 227 , 228 , 234 , 235 , 242 , 244 , & - 250 , 253 , 262 , 264 , 272 , 274 , 281 , 282 , 289 , 292 , & - 296 , 297 , 298 , 299 /) - - integer, dimension(NUM_NATURAL_ELEMENTS) :: & - natural_nuclides_JEFF_312_end = (/ & - 3 , 5 , 7 , 8 , 10 , 11 , 13 , 19 , 20 , 23 , & - 24 , 27 , 28 , 31 , 32 , 36 , 38 , 41 , 44 , 50 , & - 51 , 56 , 59 , 63 , 64 , 68 , 69 , 74 , 76 , 77 , & - 83 , 90 , 90 , 97 , 99 , 105 , 107 , 111 , 112 , 117 , & - 118 , 125 , 132 , 133 , 139 , 141 , 149 , 151 , 161 , 163 , & - 171 , 172 , 181 , 182 , 189 , 191 , 195 , 196 , 203 , 210 , & - 212 , 219 , 220 , 227 , 228 , 234 , 235 , 242 , 244 , 250 , & - 251 , 257 , 264 , 265 , 274 , 275 , 282 , 289 , 290 , 296 , & - 297 , 298 , 299 , 302 /) - - integer, dimension(NUM_NATURAL_ELEMENTS) :: & - natural_nuclides_JEFF_32_start = (/ & - 1 , 3 , 5 , 7 , 8 , 10 , 11 , 13 , 19 , 20 , & - 23 , 24 , 27 , 28 , 31 , 32 , 36 , 38 , 41 , 44 , & - 50 , 51 , 56 , 59 , 63 , 64 , 68 , 69 , 74 , 77 , & - 83 , 85 , 90 , 90 , 97 , 99 , 105 , 107 , 111 , 112 , & - 117 , 118 , 125 , 132 , 133 , 139 , 141 , 149 , 151 , 161 , & - 163 , 171 , 172 , 181 , 182 , 189 , 191 , 195 , 196 , 203 , & - 210 , 212 , 219 , 220 , 227 , 228 , 234 , 235 , 242 , 244 , & - 251 , 257 , 262 , 265 , 272 , 275 , 281 , 282 , 290 , 292 , & - 296 , 297 , 298 , 299 /) - - integer, dimension(NUM_NATURAL_ELEMENTS) :: & - natural_nuclides_JEFF_32_end = (/ & - 3 , 5 , 7 , 8 , 10 , 11 , 13 , 16 , 20 , 23 , & - 24 , 27 , 28 , 31 , 32 , 36 , 38 , 41 , 44 , 50 , & - 51 , 56 , 57 , 63 , 64 , 68 , 69 , 74 , 76 , 82 , & - 85 , 90 , 90 , 97 , 99 , 105 , 107 , 111 , 112 , 117 , & - 118 , 125 , 132 , 133 , 139 , 141 , 149 , 151 , 161 , 163 , & - 171 , 172 , 181 , 182 , 189 , 191 , 195 , 196 , 203 , 210 , & - 212 , 219 , 220 , 227 , 228 , 234 , 235 , 242 , 244 , 250 , & - 253 , 262 , 264 , 272 , 274 , 281 , 282 , 289 , 292 , 296 , & - 297 , 298 , 299 , 302 /) - - integer, dimension(NUM_NATURAL_ELEMENTS) :: & - natural_nuclides_JENDL_32_start = (/ & - 1 , 3 , 5 , 7 , 8 , 10 , 11 , 16 , 19 , 20 , & - 23 , 24 , 27 , 28 , 31 , 32 , 36 , 38 , 41 , 44 , & - 50 , 51 , 56 , 59 , 63 , 64 , 68 , 69 , 74 , 77 , & - 83 , 85 , 90 , 90 , 97 , 99 , 105 , 107 , 111 , 112 , & - 117 , 118 , 125 , 132 , 133 , 139 , 141 , 149 , 151 , 161 , & - 163 , 171 , 172 , 181 , 182 , 189 , 191 , 195 , 196 , 203 , & - 210 , 212 , 219 , 220 , 227 , 228 , 234 , 235 , 242 , 244 , & - 250 , 253 , 262 , 265 , 272 , 275 , 281 , 282 , 290 , 292 , & - 296 , 297 , 298 , 299 /) - - integer, dimension(NUM_NATURAL_ELEMENTS) :: & - natural_nuclides_JENDL_32_end = (/ & - 3 , 5 , 7 , 8 , 10 , 11 , 13 , 17 , 20 , 23 , & - 24 , 27 , 28 , 31 , 32 , 36 , 38 , 41 , 44 , 50 , & - 51 , 56 , 57 , 63 , 64 , 68 , 69 , 74 , 76 , 82 , & - 85 , 90 , 90 , 97 , 99 , 105 , 107 , 111 , 112 , 117 , & - 118 , 125 , 132 , 133 , 139 , 141 , 149 , 151 , 161 , 163 , & - 171 , 172 , 181 , 182 , 189 , 191 , 195 , 196 , 203 , 210 , & - 212 , 219 , 220 , 227 , 228 , 234 , 235 , 242 , 244 , 250 , & - 251 , 257 , 264 , 272 , 274 , 281 , 282 , 289 , 292 , 296 , & - 297 , 298 , 299 , 302 /) - - integer, dimension(NUM_NATURAL_ELEMENTS) :: & - natural_nuclides_JENDL_33_start = (/ & - 1 , 3 , 5 , 7 , 8 , 10 , 11 , 16 , 19 , 20 , & - 23 , 24 , 27 , 28 , 31 , 32 , 36 , 38 , 41 , 44 , & - 50 , 51 , 56 , 59 , 63 , 64 , 68 , 69 , 74 , 77 , & - 83 , 85 , 90 , 90 , 97 , 99 , 105 , 107 , 111 , 112 , & - 117 , 118 , 125 , 132 , 133 , 139 , 141 , 149 , 151 , 161 , & - 163 , 171 , 172 , 181 , 182 , 189 , 191 , 195 , 196 , 203 , & - 210 , 212 , 219 , 220 , 227 , 228 , 234 , 235 , 242 , 244 , & - 250 , 253 , 262 , 265 , 272 , 275 , 281 , 282 , 290 , 292 , & - 296 , 297 , 298 , 299 /) - - integer, dimension(NUM_NATURAL_ELEMENTS) :: & - natural_nuclides_JENDL_33_end = (/ & - 3 , 5 , 7 , 8 , 10 , 11 , 13 , 17 , 20 , 23 , & - 24 , 27 , 28 , 31 , 32 , 36 , 38 , 41 , 44 , 50 , & - 51 , 56 , 57 , 63 , 64 , 68 , 69 , 74 , 76 , 82 , & - 85 , 90 , 90 , 97 , 99 , 105 , 107 , 111 , 112 , 117 , & - 118 , 125 , 132 , 133 , 139 , 141 , 149 , 151 , 161 , 163 , & - 171 , 172 , 181 , 182 , 189 , 191 , 195 , 196 , 203 , 210 , & - 212 , 219 , 220 , 227 , 228 , 234 , 235 , 242 , 244 , 250 , & - 251 , 257 , 264 , 272 , 274 , 281 , 282 , 289 , 292 , 296 , & - 297 , 298 , 299 , 302 /) - - integer, dimension(NUM_NATURAL_ELEMENTS) :: & - natural_nuclides_JENDL_40_start = (/ & - 1 , 3 , 5 , 7 , 8 , 10 , 11 , 16 , 19 , 20 , & - 23 , 24 , 27 , 28 , 31 , 32 , 36 , 38 , 41 , 44 , & - 50 , 51 , 57 , 59 , 63 , 64 , 68 , 69 , 74 , 77 , & - 83 , 85 , 90 , 90 , 97 , 99 , 105 , 107 , 111 , 112 , & - 117 , 118 , 125 , 132 , 133 , 139 , 141 , 149 , 151 , 161 , & - 163 , 171 , 172 , 181 , 182 , 189 , 191 , 195 , 196 , 203 , & - 210 , 212 , 219 , 220 , 227 , 228 , 234 , 235 , 242 , 244 , & - 250 , 257 , 262 , 265 , 272 , 275 , 281 , 282 , 290 , 292 , & - 296 , 297 , 298 , 299 /) - - integer, dimension(NUM_NATURAL_ELEMENTS) :: & - natural_nuclides_JENDL_40_end = (/ & - 3 , 5 , 7 , 8 , 10 , 11 , 13 , 17 , 20 , 23 , & - 24 , 27 , 28 , 31 , 32 , 36 , 38 , 41 , 44 , 50 , & - 51 , 56 , 59 , 63 , 64 , 68 , 69 , 74 , 76 , 82 , & - 85 , 90 , 90 , 97 , 99 , 105 , 107 , 111 , 112 , 117 , & - 118 , 125 , 132 , 133 , 139 , 141 , 149 , 151 , 161 , 163 , & - 171 , 172 , 181 , 182 , 189 , 191 , 195 , 196 , 203 , 210 , & - 212 , 219 , 220 , 227 , 228 , 234 , 235 , 242 , 244 , 250 , & - 251 , 262 , 264 , 272 , 274 , 281 , 282 , 289 , 292 , 296 , & - 297 , 298 , 299 , 302 /) - - real(8), dimension (NUM_NATURAL_NUCLIDES) :: natural_nuclides_mf = (/ & - 0.999885_8 , 0.000115_8 , 0.00000134_8, 0.99999866_8, & - 0.0759_8 , 0.9241_8 , ONE , 0.199_8 , & - 0.801_8 , ONE , 0.99636_8 , 0.00364_8 , & - 0.99757_8 , 0.00038_8 , 0.00205_8 , ONE , & - 0.99962_8 , 0.00038_8 , ONE , 0.9048_8 , & - 0.0027_8 , 0.0925_8 , ONE , 0.7899_8 , & - 0.1000_8 , 0.1101_8 , ONE , 0.92223_8 , & - 0.04685_8 , 0.03092_8 , ONE , 0.9499_8 , & - 0.0075_8 , 0.0425_8 , 0.0001_8 , 0.7576_8 , & - 0.2424_8 , 0.003336_8 , 0.000629_8 , 0.996035_8 , & - 0.932581_8 , 0.000117_8 , 0.067302_8 , 0.96941_8 , & - 0.00647_8 , 0.00135_8 , 0.02086_8 , 0.00004_8 , & - 0.00187_8 , ONE , 0.0825_8 , 0.0744_8 , & - 0.7372_8 , 0.0541_8 , 0.0518_8 , ONE , & - 0.0025_8 , 0.9975_8 , 0.04345_8 , 0.83789_8 , & - 0.09501_8 , 0.02365_8 , ONE , 0.05845_8 , & - 0.91754_8 , 0.02119_8 , 0.00282_8 , ONE , & - 0.68077_8 , 0.26223_8 , 0.011399_8 , 0.036346_8 , & - 0.009255_8 , 0.6915_8 , 0.3085_8 , ONE , & - 0.4917_8 , 0.2773_8 , 0.0404_8 , 0.1845_8 , & - 0.0061_8 , ONE , 0.60108_8 , 0.39892_8 , & - 0.2057_8 , 0.2745_8 , 0.0775_8 , 0.3650_8 , & - 0.0773_8 , ONE , 0.0089_8 , 0.0937_8 , & - 0.0763_8 , 0.2377_8 , 0.4961_8 , 0.0873_8 , & - 0.5069_8 , 0.4931_8 , 0.00355_8 , 0.02286_8 , & - 0.11593_8 , 0.11500_8 , 0.56987_8 , 0.17279_8 , & - 0.7217_8 , 0.2783_8 , 0.0056_8 , 0.0986_8 , & - 0.0700_8 , 0.8258_8 , ONE , 0.5145_8 , & - 0.1122_8 , 0.1715_8 , 0.1738_8 , 0.0280_8 , & - ONE , 0.1453_8 , 0.0915_8 , 0.1584_8 , & - 0.1667_8 , 0.0960_8 , 0.2439_8 , 0.0982_8 , & - 0.0554_8 , 0.0187_8 , 0.1276_8 , 0.1260_8 , & - 0.1706_8 , 0.3155_8 , 0.1862_8 , ONE , & - 0.0102_8 , 0.1114_8 , 0.2233_8 , 0.2733_8 , & - 0.2646_8 , 0.1172_8 , 0.51839_8 , 0.48161_8 , & - 0.0125_8 , 0.0089_8 , 0.1249_8 , 0.1280_8 , & - 0.2413_8 , 0.1222_8 , 0.2873_8 , 0.0749_8 , & - 0.0429_8 , 0.9571_8 , 0.0097_8 , 0.0066_8 , & - 0.0034_8 , 0.1454_8 , 0.0768_8 , 0.2422_8 , & - 0.0859_8 , 0.3258_8 , 0.0463_8 , 0.0579_8 , & - 0.5721_8 , 0.4279_8 , 0.0009_8 , 0.0255_8 , & - 0.0089_8 , 0.0474_8 , 0.0707_8 , 0.1884_8 , & - 0.3174_8 , 0.3408_8 , ONE , 0.000952_8 , & - 0.000890_8 , 0.019102_8 , 0.264006_8 , 0.040710_8 , & - 0.212324_8 , 0.269086_8 , 0.104357_8 , 0.088573_8 , & - ONE , 0.00106_8 , 0.00101_8 , 0.02417_8 , & - 0.06592_8 , 0.07854_8 , 0.11232_8 , 0.71698_8 , & - 0.0008881_8 , 0.9991119_8 , 0.00185_8 , 0.00251_8 , & - 0.88450_8 , 0.11114_8 , ONE , 0.27152_8 , & - 0.12174_8 , 0.23798_8 , 0.08293_8 , 0.17189_8 , & - 0.05756_8 , 0.05638_8 , 0.0307_8 , 0.1499_8 , & - 0.1124_8 , 0.1382_8 , 0.0738_8 , 0.2675_8 , & - 0.2275_8 , 0.4781_8 , 0.5219_8 , 0.0020_8 , & - 0.0218_8 , 0.1480_8 , 0.2047_8 , 0.1565_8 , & - 0.2484_8 , 0.2186_8 , ONE , 0.00056_8 , & - 0.00095_8 , 0.02329_8 , 0.18889_8 , 0.25475_8 , & - 0.24896_8 , 0.28260_8 , ONE , 0.00139_8 , & - 0.01601_8 , 0.33503_8 , 0.22869_8 , 0.26978_8 , & - 0.14910_8 , ONE , 0.00123_8 , 0.02982_8 , & - 0.1409_8 , 0.2168_8 , 0.16103_8 , 0.32026_8 , & - 0.12996_8 , 0.97401_8 , 0.02599_8 , 0.0016_8 , & - 0.0526_8 , 0.1860_8 , 0.2728_8 , 0.1362_8 , & - 0.3508_8 , ONE , 0.0001201_8 , 0.9998799_8 , & - 0.2662_8 , 0.1431_8 , 0.3064_8 , 0.2843_8 , & - 0.0012_8 , 0.2650_8 , 0.1431_8 , 0.3064_8 , & - 0.2843_8 , 0.3740_8 , 0.6260_8 , ONE , & - 0.0002_8 , 0.0159_8 , 0.0196_8 , 0.1324_8 , & - 0.1615_8 , 0.2626_8 , 0.4078_8 , 0.373_8 , & - 0.627_8 , ONE , 0.00012_8 , 0.00782_8 , & - 0.3286_8 , 0.3378_8 , 0.2521_8 , 0.07356_8 , & - ONE , 0.0015_8 , 0.0997_8 , 0.1687_8 , & - 0.2310_8 , 0.1318_8 , 0.2986_8 , 0.0687_8 , & - ONE , 0.2952_8 , 0.7048_8 , 0.014_8 , & - 0.241_8 , 0.221_8 , 0.524_8 , ONE , & - ONE , ONE , 0.000054_8 , 0.007204_8 , & - 0.992742_8 /) - ! ============================================================================ ! TALLY-RELATED VARIABLES @@ -647,14 +317,14 @@ module global logical :: restart_run = .false. integer :: restart_batch - character(MAX_FILE_LEN) :: path_input ! Path to input file - character(MAX_FILE_LEN) :: path_cross_sections ! Path to cross_sections.xml - character(MAX_FILE_LEN) :: path_multipole ! Path to wmp library - character(MAX_FILE_LEN) :: path_source = '' ! Path to binary source - character(MAX_FILE_LEN) :: path_state_point ! Path to binary state point - character(MAX_FILE_LEN) :: path_source_point ! Path to binary source point - character(MAX_FILE_LEN) :: path_particle_restart ! Path to particle restart - character(MAX_FILE_LEN) :: path_output = '' ! Path to output directory + character(MAX_FILE_LEN) :: path_input ! Path to input file + character(MAX_FILE_LEN) :: path_cross_sections = '' ! Path to cross_sections.xml + character(MAX_FILE_LEN) :: path_multipole ! Path to wmp library + character(MAX_FILE_LEN) :: path_source = '' ! Path to binary source + character(MAX_FILE_LEN) :: path_state_point ! Path to binary state point + character(MAX_FILE_LEN) :: path_source_point ! Path to binary source point + character(MAX_FILE_LEN) :: path_particle_restart ! Path to particle restart + character(MAX_FILE_LEN) :: path_output = '' ! Path to output directory ! The verbosity controls how much information will be printed to the ! screen and in logs diff --git a/src/input_xml.F90 b/src/input_xml.F90 index 54d56d2942..8973d8fdaa 100644 --- a/src/input_xml.F90 +++ b/src/input_xml.F90 @@ -81,7 +81,6 @@ contains real(8), allocatable :: temp_real(:) integer :: n_tracks logical :: file_exists - character(MAX_FILE_LEN) :: env_variable character(MAX_WORD_LEN) :: type character(MAX_LINE_LEN) :: filename type(Node), pointer :: doc => null() @@ -138,55 +137,24 @@ contains end if end if - ! Find cross_sections.xml file -- the first place to look is the - ! settings.xml file. If no file is found there, then we check the - ! CROSS_SECTIONS environment variable - if (.not. check_for_node(doc, "cross_sections")) then - ! No cross_sections.xml file specified in settings.xml, check - ! environment variable - if (run_CE) then - call get_environment_variable("OPENMC_CROSS_SECTIONS", env_variable) - if (len_trim(env_variable) == 0) then - call get_environment_variable("CROSS_SECTIONS", env_variable) - if (len_trim(env_variable) == 0) then - call fatal_error("No cross_sections.xml file was specified in & - &settings.xml or in the OPENMC_CROSS_SECTIONS environment & - &variable. OpenMC needs such a file to identify where to & - &find ACE cross section libraries. Please consult the & - &user's guide at http://mit-crpg.github.io/openmc for & - &information on how to set up ACE cross section libraries.") - else - call warning("The CROSS_SECTIONS environment variable is & - &deprecated. Please update your environment to use & - &OPENMC_CROSS_SECTIONS instead.") - end if - end if - path_cross_sections = trim(env_variable) - else - call get_environment_variable("OPENMC_MG_CROSS_SECTIONS", env_variable) - if (len_trim(env_variable) == 0) then - call fatal_error("No mgxs.xml file was specified in & - &settings.xml or in the OPENMC_MG_CROSS_SECTIONS environment & - &variable. OpenMC needs such a file to identify where to & - &find ACE cross section libraries. Please consult the user's & - &guide at http://mit-crpg.github.io/openmc for information on & - &how to set up ACE cross section libraries.") - else - path_cross_sections = trim(env_variable) - end if - end if - else + ! Look for deprecated cross_sections.xml file in settings.xml + if (check_for_node(doc, "cross_sections")) then + call warning("Setting cross_sections in settings.xml has been deprecated. & + &The cross_sections are now set in materials.xml and the & + &cross_sections input to materials.xml and OPENMC_CROSS_SECTIONS & + &environment variable will take precendent over setting & + &cross_sections in settings.xml.") call get_node_value(doc, "cross_sections", path_cross_sections) end if - ! Find the windowed multipole library + ! Look for deprecated windowed_multipole file in settings.xml if (run_mode /= MODE_PLOTTING) then - if (.not. check_for_node(doc, "multipole_library")) then - ! No library location specified in settings.xml, check - ! environment variable - call get_environment_variable("OPENMC_MULTIPOLE_LIBRARY", env_variable) - path_multipole = trim(env_variable) - else + if (check_for_node(doc, "multipole_library")) then + call warning("Setting multipole_library in settings.xml has been & + &deprecated. The multipole_library is now set in materials.xml and& + & the multipole_library input to materials.xml and & + &OPENMC_MULTIPOLE_LIBRARY environment variable will take & + &precendent over setting multipole_library in settings.xml.") call get_node_value(doc, "multipole_library", path_multipole) end if if (.not. ends_with(path_multipole, "/")) & @@ -1055,32 +1023,6 @@ contains end if end if - ! Natural element expansion option - if (check_for_node(doc, "natural_elements")) then - call get_node_value(doc, "natural_elements", temp_str) - select case (to_lower(temp_str)) - case ('endf/b-vii.0') - default_expand = ENDF_BVII0 - case ('endf/b-vii.1') - default_expand = ENDF_BVII1 - case ('jeff-3.1.1') - default_expand = JEFF_311 - case ('jeff-3.1.2') - default_expand = JEFF_312 - case ('jeff-3.2') - default_expand = JEFF_32 - case ('jendl-3.2') - default_expand = JENDL_32 - case ('jendl-3.3') - default_expand = JENDL_33 - case ('jendl-4.0') - default_expand = JENDL_40 - case default - call fatal_error("Unknown natural element expansion option: " & - // trim(temp_str)) - end select - end if - call get_node_list(doc, "volume_calc", node_vol_list) n = get_list_size(node_vol_list) allocate(volume_calcs(n)) @@ -1091,9 +1033,17 @@ contains ! Get temperature settings if (check_for_node(doc, "temperature_default")) then + call warning("Setting temperature_default in settings.xml has been & + &deprecated. temperature_default is now set in materials.xml and & + &its input to materials.xml will take precendent & + &over setting it in settings.xml.") call get_node_value(doc, "temperature_default", temperature_default) end if if (check_for_node(doc, "temperature_method")) then + call warning("Setting temperature_method in settings.xml has been & + &deprecated. temperature_method is now set in materials.xml and & + &its input to materials.xml will take precendent & + &over setting it in settings.xml.") call get_node_value(doc, "temperature_method", temp_str) select case (to_lower(temp_str)) case ('nearest') @@ -1105,9 +1055,17 @@ contains end select end if if (check_for_node(doc, "temperature_tolerance")) then + call warning("Setting temperature_tolerance in settings.xml has been & + &deprecated. temperature_tolerance is now set in materials.xml and & + &its input to materials.xml will take precendent & + &over setting it in settings.xml.") call get_node_value(doc, "temperature_tolerance", temperature_tolerance) end if if (check_for_node(doc, "temperature_multipole")) then + call warning("Setting temperature_multipole in settings.xml has been & + &deprecated. temperature_multipole is now set in materials.xml and & + &its input to materials.xml will take precendent & + &over setting it in settings.xml.") call get_node_value(doc, "temperature_multipole", temp_str) select case (to_lower(temp_str)) case ('true', '1') @@ -2095,7 +2053,115 @@ contains type(Library), allocatable :: libraries(:) type(VectorReal), allocatable :: nuc_temps(:) ! List of T to read for each nuclide type(VectorReal), allocatable :: sab_temps(:) ! List of T to read for each S(a,b) - real(8), allocatable :: material_temps(:) + character(MAX_LINE_LEN) :: temp_str + real(8), allocatable :: material_temps(:) + logical :: file_exists + character(MAX_FILE_LEN) :: env_variable + character(MAX_LINE_LEN) :: filename + type(Node), pointer :: doc => null() + + ! Display output message + call write_message("Reading materials XML file...", 5) + + ! Check is materials.xml exists + filename = trim(path_input) // "materials.xml" + inquire(FILE=filename, EXIST=file_exists) + if (.not. file_exists) then + call fatal_error("Material XML file '" // trim(filename) // "' does not & + &exist!") + end if + + ! Parse materials.xml file + call open_xmldoc(doc, filename) + + ! Find cross_sections.xml file -- the first place to look is the + ! materials.xml file. If no file is found there, then we check the + ! CROSS_SECTIONS environment variable + if (.not. check_for_node(doc, "cross_sections")) then + ! No cross_sections.xml file specified in settings.xml, check + ! environment variable + if (run_CE) then + call get_environment_variable("OPENMC_CROSS_SECTIONS", env_variable) + if (len_trim(env_variable) == 0) then + call get_environment_variable("CROSS_SECTIONS", env_variable) + if (len_trim(env_variable) == 0 .and. path_cross_sections == '') then + call fatal_error("No cross_sections.xml file was specified in & + &materials.xml, settings.xml, or in the OPENMC_CROSS_SECTIONS& + & environment variable. OpenMC needs such a file to identify & + &where to find ACE cross section libraries. Please consult the& + & user's guide at http://mit-crpg.github.io/openmc for & + &information on how to set up ACE cross section libraries.") + else + call warning("The CROSS_SECTIONS environment variable is & + &deprecated. Please update your environment to use & + &OPENMC_CROSS_SECTIONS instead.") + end if + end if + path_cross_sections = trim(env_variable) + else + call get_environment_variable("OPENMC_MG_CROSS_SECTIONS", env_variable) + if (len_trim(env_variable) == 0 .and. path_cross_sections == '') then + call fatal_error("No mgxs.xml file was specified in & + &materials.xml or in the OPENMC_MG_CROSS_SECTIONS environment & + &variable. OpenMC needs such a file to identify where to & + &find ACE cross section libraries. Please consult the user's & + &guide at http://mit-crpg.github.io/openmc for information on & + &how to set up ACE cross section libraries.") + else + path_cross_sections = trim(env_variable) + end if + end if + else + call get_node_value(doc, "cross_sections", path_cross_sections) + end if + + ! Find the windowed multipole library + if (run_mode /= MODE_PLOTTING) then + if (.not. check_for_node(doc, "multipole_library")) then + ! No library location specified in materials.xml, check + ! environment variable + call get_environment_variable("OPENMC_MULTIPOLE_LIBRARY", env_variable) + path_multipole = trim(env_variable) + else + call get_node_value(doc, "multipole_library", path_multipole) + end if + if (.not. ends_with(path_multipole, "/")) & + path_multipole = trim(path_multipole) // "/" + end if + + ! Get temperature settings + if (check_for_node(doc, "temperature_default")) then + call get_node_value(doc, "temperature_default", temperature_default) + end if + if (check_for_node(doc, "temperature_method")) then + call get_node_value(doc, "temperature_method", temp_str) + select case (to_lower(temp_str)) + case ('nearest') + temperature_method = TEMPERATURE_NEAREST + case ('interpolation') + temperature_method = TEMPERATURE_INTERPOLATION + case default + call fatal_error("Unknown temperature method: " // trim(temp_str)) + end select + end if + if (check_for_node(doc, "temperature_tolerance")) then + call get_node_value(doc, "temperature_tolerance", temperature_tolerance) + end if + if (check_for_node(doc, "temperature_multipole")) then + call get_node_value(doc, "temperature_multipole", temp_str) + select case (to_lower(temp_str)) + case ('true', '1') + temperature_multipole = .true. + case ('false', '0') + temperature_multipole = .false. + case default + call fatal_error("Unrecognized value for in & + &materials.xml") + end select + end if + + ! Close materials XML file + call close_xmldoc(doc) if (run_CE) then call read_ce_cross_sections_xml(libraries) @@ -2153,10 +2219,8 @@ contains integer :: i ! loop index for materials integer :: j ! loop index for nuclides - integer :: k ! loop index for elements integer :: n ! number of nuclides integer :: n_sab ! number of sab tables for a material - integer :: n_nuc_ele ! number of nuclides in an element integer :: i_library ! index in libraries array integer :: index_nuclide ! index in nuclides integer :: index_sab ! index in sab_tables @@ -2170,17 +2234,12 @@ contains type(Node), pointer :: doc => null() type(Node), pointer :: node_mat => null() type(Node), pointer :: node_nuc => null() - type(Node), pointer :: node_ele => null() type(Node), pointer :: node_sab => null() type(NodeList), pointer :: node_mat_list => null() type(NodeList), pointer :: node_nuc_list => null() type(NodeList), pointer :: node_macro_list => null() - type(NodeList), pointer :: node_ele_list => null() type(NodeList), pointer :: node_sab_list => null() - ! Display output message - call write_message("Reading materials XML file...", 5) - ! Check is materials.xml exists filename = trim(path_input) // "materials.xml" inquire(FILE=filename, EXIST=file_exists) @@ -2240,10 +2299,9 @@ contains ! Check to ensure material has at least one nuclide if (.not. check_for_node(node_mat, "nuclide") .and. & - .not. check_for_node(node_mat, "element") .and. & .not. check_for_node(node_mat, "macroscopic")) then - call fatal_error("No macroscopic data, nuclides or natural elements & - &specified on material " // trim(to_str(mat % id))) + call fatal_error("No macroscopic data or nuclides specified on & + &material " // trim(to_str(mat % id))) end if ! Create list of macroscopic x/s based on those specified, just treat @@ -2279,7 +2337,7 @@ contains ! Get pointer list of XML call get_node_list(node_mat, "nuclide", node_nuc_list) - ! Create list of nuclides based on those specified plus natural elements + ! Create list of nuclides based on those specified INDIVIDUAL_NUCLIDES: do j = 1, get_list_size(node_nuc_list) ! Combine nuclide identifier and cross section and copy into names call get_list_item(node_nuc_list, j, node_nuc) @@ -2317,66 +2375,6 @@ contains end do INDIVIDUAL_NUCLIDES end if - ! ======================================================================= - ! READ AND PARSE TAGS - - ! Get pointer list of XML - call get_node_list(node_mat, "element", node_ele_list) - - NATURAL_ELEMENTS: do j = 1, get_list_size(node_ele_list) - call get_list_item(node_ele_list, j, node_ele) - - ! Check for empty name on natural element - if (.not. check_for_node(node_ele, "name")) then - call fatal_error("No name specified on nuclide in material " & - // trim(to_str(mat % id))) - end if - call get_node_value(node_ele, "name", name) - - ! Check if no atom/weight percents were specified or if both atom and - ! weight percents were specified - if (.not. check_for_node(node_ele, "ao") .and. & - .not. check_for_node(node_ele, "wo")) then - call fatal_error("No atom or weight percent specified for element " & - // trim(name)) - elseif (check_for_node(node_ele, "ao") .and. & - check_for_node(node_ele, "wo")) then - call fatal_error("Cannot specify both atom and weight percents for & - &element: " // trim(name)) - end if - - ! Get current number of nuclides - n_nuc_ele = names % size() - - ! Expand element into naturally-occurring nuclides - call expand_natural_element_names(name, names) - - ! Compute number of new nuclides from the natural element expansion - n_nuc_ele = names % size() - n_nuc_ele - - ! Check enforced isotropic lab scattering - if (run_CE) then - if (check_for_node(node_ele, "scattering")) then - call get_node_value(node_ele, "scattering", temp_str) - else - temp_str = "data" - end if - - ! Set ace or iso-in-lab scattering for each nuclide in element - do k = 1, n_nuc_ele - if (adjustl(to_lower(temp_str)) == "iso-in-lab") then - call list_iso_lab % push_back(1) - else if (adjustl(to_lower(temp_str)) == "data") then - call list_iso_lab % push_back(0) - else - call fatal_error("Scattering must be isotropic in lab or follow& - & the ACE file data") - end if - end do - end if - - end do NATURAL_ELEMENTS - ! ======================================================================== ! COPY NUCLIDES TO ARRAYS IN MATERIAL @@ -4588,205 +4586,6 @@ contains end subroutine read_mg_cross_sections_header -!=============================================================================== -! EXPAND_NATURAL_ELEMENT_NAMES converts natural elements specified using an -! tag within a material and adds the names to the input names array. -! In some cases, modifications have been made to work with ENDF/B-VII.1 where -! evaluations of particular nuclides don't exist. -!=============================================================================== - - subroutine expand_natural_element_names(name, names) - character(*), intent(in) :: name - type(VectorChar), intent(inout) :: names - - integer :: i - character(2) :: element_name - integer :: natural_elements_loc - integer :: nuclide_start - integer :: nuclide_end - - ! Convert the element name to lower case - element_name = to_lower(name(1:2)) - - ! Find location of element name in natural_elements - i = -1 - do i = 1, NUM_NATURAL_ELEMENTS - if (natural_elements(i) == element_name) then - natural_elements_loc = i - end if - end do - - ! Issue error if element not found - if (i == -1) then - call fatal_error("Cannot expand element: " // name) - end if - - ! Get start and end locations in natural_nuclides arrays - select case (default_expand) - case (ENDF_BVII0) - nuclide_start = natural_nuclides_ENDF_BVII0_start(natural_elements_loc) - nuclide_end = natural_nuclides_ENDF_BVII0_end(natural_elements_loc) - - case (ENDF_BVII1) - nuclide_start = natural_nuclides_ENDF_BVII1_start(natural_elements_loc) - nuclide_end = natural_nuclides_ENDF_BVII1_end(natural_elements_loc) - - case (JEFF_311) - nuclide_start = natural_nuclides_JEFF_311_start(natural_elements_loc) - nuclide_end = natural_nuclides_JEFF_311_end(natural_elements_loc) - - case (JEFF_312) - nuclide_start = natural_nuclides_JEFF_312_start(natural_elements_loc) - nuclide_end = natural_nuclides_JEFF_312_end(natural_elements_loc) - - case (JEFF_32) - nuclide_start = natural_nuclides_JEFF_32_start(natural_elements_loc) - nuclide_end = natural_nuclides_JEFF_32_end(natural_elements_loc) - - case (JENDL_32) - nuclide_start = natural_nuclides_JENDL_32_start(natural_elements_loc) - nuclide_end = natural_nuclides_JENDL_32_end(natural_elements_loc) - - case (JENDL_33) - nuclide_start = natural_nuclides_JENDL_33_start(natural_elements_loc) - nuclide_end = natural_nuclides_JENDL_33_end(natural_elements_loc) - - case (JENDL_40) - nuclide_start = natural_nuclides_JENDL_40_start(natural_elements_loc) - nuclide_end = natural_nuclides_JENDL_40_end(natural_elements_loc) - - end select - - ! Add the nuclide names to the names array - do i = nuclide_start, nuclide_end-1 - call names % push_back(natural_nuclides(i)) - end do - - end subroutine expand_natural_element_names - -!=============================================================================== -! EXPAND_NATURAL_ELEMENT_DENSITIES converts natural elements specified using an -! tag within a material into individual nuclides based on IUPAC -! Isotopic Compositions of the Elements 2009 (doi:10.1351/PAC-REP-10-06-02). In -! some cases, modifications have been made to work with ENDF/B-VII.1 where -! evaluations of particular nuclides don't exist. -!=============================================================================== - - subroutine expand_natural_element_densities(name, expand_by, density, & - densities) - character(*), intent(in) :: name ! element name - character(*), intent(in) :: expand_by ! "ao" or "wo" - real(8), intent(in) :: density ! value for "ao" or "wo" - type(VectorReal), intent(inout) :: densities ! nuclide densities vector - - integer :: i ! iterators - integer :: n_nuclides ! number of nuclides in the element - integer :: natural_elements_loc ! location in global array - integer :: nuclide_start ! ending nuclide in global array - integer :: nuclide_end ! starting nuclide in global array - character(2) :: element_name ! element atomic symbol - real(8) :: element_awr ! element atomic weight ratio - real(8), allocatable :: awr(:) ! nuclide atomic weight ratios - real(8), allocatable :: mf(:) ! nuclide mole or mass fractions - - element_name = to_lower(name(1:2)) - - ! Find location of element name in natural_elements - i = -1 - do i = 1, NUM_NATURAL_ELEMENTS - if (natural_elements(i) == element_name) then - natural_elements_loc = i - end if - end do - - ! Issue error if element not found - if (i == -1) then - call fatal_error("Cannot expand element: " // name) - end if - - ! Get start and end locations in natural_nuclides arrays - select case (default_expand) - case (ENDF_BVII0) - nuclide_start = natural_nuclides_ENDF_BVII0_start(natural_elements_loc) - nuclide_end = natural_nuclides_ENDF_BVII0_end(natural_elements_loc) - - case (ENDF_BVII1) - nuclide_start = natural_nuclides_ENDF_BVII1_start(natural_elements_loc) - nuclide_end = natural_nuclides_ENDF_BVII1_end(natural_elements_loc) - - case (JEFF_311) - nuclide_start = natural_nuclides_JEFF_311_start(natural_elements_loc) - nuclide_end = natural_nuclides_JEFF_311_end(natural_elements_loc) - - case (JEFF_312) - nuclide_start = natural_nuclides_JEFF_312_start(natural_elements_loc) - nuclide_end = natural_nuclides_JEFF_312_end(natural_elements_loc) - - case (JEFF_32) - nuclide_start = natural_nuclides_JEFF_32_start(natural_elements_loc) - nuclide_end = natural_nuclides_JEFF_32_end(natural_elements_loc) - - case (JENDL_32) - nuclide_start = natural_nuclides_JENDL_32_start(natural_elements_loc) - nuclide_end = natural_nuclides_JENDL_32_end(natural_elements_loc) - - case (JENDL_33) - nuclide_start = natural_nuclides_JENDL_33_start(natural_elements_loc) - nuclide_end = natural_nuclides_JENDL_33_end(natural_elements_loc) - - case (JENDL_40) - nuclide_start = natural_nuclides_JENDL_40_start(natural_elements_loc) - nuclide_end = natural_nuclides_JENDL_40_end(natural_elements_loc) - - end select - - ! Set the number of nuclides in this element - n_nuclides = nuclide_end - nuclide_start - - ! Allocate and initialize array for mole fractions - allocate(mf(n_nuclides)) - - ! Add the nuclide names to the names array - do i = nuclide_start, nuclide_end-1 - mf(i - nuclide_start + 1) = natural_nuclides_mf(i) - end do - - ! Compute the ratio of the nuclide atomic weights to the element atomic - ! weight - if (expand_by == "wo") then - - ! Allocate array for the atomic weight ratios - allocate(awr(n_nuclides)) - - ! Get the atomic weight ratios - do i = nuclide_start, nuclide_end-1 - awr(i - nuclide_start + 1) = nuclides(nuclide_dict % & - get_key(to_lower(natural_nuclides(i)))) % awr - end do - - ! Compute the element awr - element_awr = sum(awr * mf) - - ! Convert the mole fractions to mass fractions - mf = mf * awr / element_awr - - ! Normalize the mass fractions to ONE - mf = mf / sum(mf) - - ! Deallocate array for the atomic weight ratios - deallocate(awr) - end if - - ! Add the densities to the master array - do i = 1, n_nuclides - call densities % push_back(density * mf(i)) - end do - - ! Deallocate array for mole or mass fractions - deallocate(mf) - - end subroutine expand_natural_element_densities - !=============================================================================== ! GENERATE_RPN implements the shunting-yard algorithm to generate a Reverse ! Polish notation (RPN) expression for the region specification of a cell given @@ -4894,11 +4693,9 @@ contains type(Node), pointer :: node_mat => null() type(Node), pointer :: node_dens => null() type(Node), pointer :: node_nuc => null() - type(Node), pointer :: node_ele => null() type(NodeList), pointer :: node_mat_list => null() type(NodeList), pointer :: node_nuc_list => null() type(NodeList), pointer :: node_macro_list => null() - type(NodeList), pointer :: node_ele_list => null() ! Display output message call write_message("Reading material densities from XML file...", 5) @@ -5006,7 +4803,7 @@ contains ! Get pointer list of XML call get_node_list(node_mat, "nuclide", node_nuc_list) - ! Create list of nuclides based on those specified plus natural elements + ! Create list of nuclides based on those specified INDIVIDUAL_NUCLIDES: do j = 1, get_list_size(node_nuc_list) ! Combine nuclide identifier and cross section and copy into names @@ -5043,42 +4840,6 @@ contains end do INDIVIDUAL_NUCLIDES end if - ! ======================================================================= - ! READ AND PARSE TAGS - - ! Get pointer list of XML - call get_node_list(node_mat, "element", node_ele_list) - - NATURAL_ELEMENTS: do j = 1, get_list_size(node_ele_list) - call get_list_item(node_ele_list, j, node_ele) - - call get_node_value(node_ele, "name", name) - - ! Check if no atom/weight percents were specified or if both atom and - ! weight percents were specified - if (.not. check_for_node(node_ele, "ao") .and. & - .not. check_for_node(node_ele, "wo")) then - call fatal_error("No atom or weight percent specified for element " & - // trim(name)) - elseif (check_for_node(node_ele, "ao") .and. & - check_for_node(node_ele, "wo")) then - call fatal_error("Cannot specify both atom and weight percents for & - &element: " // trim(name)) - end if - - ! Expand element into naturally-occurring nuclides - if (check_for_node(node_ele, "ao")) then - call get_node_value(node_ele, "ao", temp_dble) - call expand_natural_element_densities(name, "ao", temp_dble, & - densities) - else - call get_node_value(node_ele, "wo", temp_dble) - call expand_natural_element_densities(name, "wo", -temp_dble, & - densities) - end if - - end do NATURAL_ELEMENTS - ! ======================================================================== ! SET MATERIAL ATOM DENSITIES diff --git a/tests/input_set.py b/tests/input_set.py index 0d5a78bab9..458c1ef35e 100644 --- a/tests/input_set.py +++ b/tests/input_set.py @@ -757,6 +757,7 @@ class MGInputSet(InputSet): # Define the materials file self.xs_data = xs self.materials += mats + self.materials.cross_sections = "../1d_mgxs.h5" # Define surfaces. # Assembly/Problem Boundary @@ -793,7 +794,6 @@ class MGInputSet(InputSet): self.settings.source = Source(space=Box([0.0, 0.0, 0.0], [10.0, 10.0, 5.])) self.settings.energy_mode = "multi-group" - self.settings.cross_sections = "../1d_mgxs.h5" def build_defualt_plots(self): plot = openmc.Plot() diff --git a/tests/test_complex_cell/materials.xml b/tests/test_complex_cell/materials.xml index 6edf0a5f9c..69abdc96f4 100644 --- a/tests/test_complex_cell/materials.xml +++ b/tests/test_complex_cell/materials.xml @@ -11,11 +11,11 @@ - + - + diff --git a/tests/test_complex_cell/results_true.dat b/tests/test_complex_cell/results_true.dat index da3acd2aa3..a5aa837e02 100644 --- a/tests/test_complex_cell/results_true.dat +++ b/tests/test_complex_cell/results_true.dat @@ -1,11 +1,11 @@ k-combined: -2.531110E-01 3.041974E-03 +2.511523E-01 2.296777E-03 tally 1: -2.594626E+00 -1.346701E+00 -2.683653E+00 -1.440725E+00 -9.933862E-01 -1.977011E-01 -1.112289E-01 -2.476655E-03 +2.578905E+00 +1.331155E+00 +2.688693E+00 +1.447930E+00 +9.863774E-01 +1.948549E-01 +1.123802E-01 +2.527538E-03 diff --git a/tests/test_element_wo/inputs_true.dat b/tests/test_element_wo/inputs_true.dat index adfd1742a2..9f59e56f22 100644 --- a/tests/test_element_wo/inputs_true.dat +++ b/tests/test_element_wo/inputs_true.dat @@ -1 +1 @@ -0d54ed29b2a348854d99d36f602b188766465b41e70536647578c61d076909a2351b5c4cafbbdc62dd00f36bf2685f231fae7c75d1289befddd2da79042e31a7 \ No newline at end of file +c472877dd96f51dcfd7b45ec1c230c3847b26eb1f0a97751bb175b70eafff2ad8ee97e3ed8691a3bc8bf8f27c074a9d34021322988185bb04c3e55958f40589b \ No newline at end of file diff --git a/tests/test_element_wo/results_true.dat b/tests/test_element_wo/results_true.dat index ad5a0c2280..6ff7f2872e 100644 --- a/tests/test_element_wo/results_true.dat +++ b/tests/test_element_wo/results_true.dat @@ -1,5 +1,5 @@ k-combined: -8.617147E-01 2.915803E-02 +8.781218E-01 2.426380E-02 tally 1: -7.879002E+01 -1.242562E+03 +8.505928E+01 +1.447208E+03 diff --git a/tests/test_element_wo/test_element_wo.py b/tests/test_element_wo/test_element_wo.py index a5d35f4c56..1acb73137a 100644 --- a/tests/test_element_wo/test_element_wo.py +++ b/tests/test_element_wo/test_element_wo.py @@ -77,7 +77,6 @@ class ElementWOTestHarness(PyAPITestHarness): # Instantiate a Geometry, register the root Universe, and export to XML self._input_set.geometry.root_universe = root - mat_filter = openmc.MaterialFilter((fuel.id,)) flux_tally = openmc.Tally() flux_tally.filters = [mat_filter] diff --git a/tests/test_enrichment/inputs_true.dat b/tests/test_enrichment/inputs_true.dat index 572a4e1ff0..86c8f82f05 100644 --- a/tests/test_enrichment/inputs_true.dat +++ b/tests/test_enrichment/inputs_true.dat @@ -1 +1 @@ -47d753380f995651e6cec8e3648ff9e4ac254fc80919014124f4f6674afc95262006eda3821b4d6dcf09e29f28f5e21840c9b76b95c1c7f8ae522faac2386090 \ No newline at end of file +6f8d495cd7537f8ca29355664b31d429fe13f656a868852769b27ef9566e7bb683973322e41a92bab65beb1ba6cf477698b30a7ae6bc17d2e34cb44751e8c81d \ No newline at end of file diff --git a/tests/test_enrichment/results_true.dat b/tests/test_enrichment/results_true.dat index 347c39ff3c..b457c2071c 100644 --- a/tests/test_enrichment/results_true.dat +++ b/tests/test_enrichment/results_true.dat @@ -1,5 +1,5 @@ k-combined: -1.385412E+00 1.198466E-01 +1.508419E+00 3.763047E-02 tally 1: -6.197393E+01 -7.688717E+02 +6.274668E+01 +7.902869E+02 diff --git a/tests/test_enrichment/test_enrichment.py b/tests/test_enrichment/test_enrichment.py index 8d04112edd..ac22f43ed4 100644 --- a/tests/test_enrichment/test_enrichment.py +++ b/tests/test_enrichment/test_enrichment.py @@ -73,7 +73,6 @@ class EnrichmentTestHarness(PyAPITestHarness): # Instantiate a Geometry, register the root Universe, and export to XML self._input_set.geometry.root_universe = root - mat_filter = openmc.MaterialFilter((fuel.id,)) flux_tally = openmc.Tally() flux_tally.filters = [mat_filter] diff --git a/tests/test_mg_basic/inputs_true.dat b/tests/test_mg_basic/inputs_true.dat index 08917ab7db..6834e8e64c 100644 --- a/tests/test_mg_basic/inputs_true.dat +++ b/tests/test_mg_basic/inputs_true.dat @@ -1 +1 @@ -115218221500e60ea43145875324a9a6800366fcc97357ef4cd8182f9253e114cbe1c7481dd3bdd8d7dce5983e2cb757ae0a2e05ede236d94cba7909703ba7f7 \ No newline at end of file +12abd69924751d1cf2a296ce799bfb2a6a4e744ffc49eef5a5cee8b764254caa3783c406cff71238c5608b454f451953479fb4caad45460a013225ab8de2271e \ No newline at end of file diff --git a/tests/test_mg_max_order/inputs_true.dat b/tests/test_mg_max_order/inputs_true.dat index 3056e8cbdf..ddb555692e 100644 --- a/tests/test_mg_max_order/inputs_true.dat +++ b/tests/test_mg_max_order/inputs_true.dat @@ -1 +1 @@ -139d760cd83eab001ed3fd52d7146fb5f30b7021b26ada6a1e425f5446185ac6fa61ac2ac58aa9e895981e10540160b7ae7428c833024679ef1ca762715e2d51 \ No newline at end of file +1f82e622b36562a0a14536fe24c95ee9c901c428f7f082f245afae5c699ccd647aaf31a49790822ceb7ec136bdb75f8e25c3677642f73702ca2e30b058f6b440 \ No newline at end of file diff --git a/tests/test_mg_nuclide/inputs_true.dat b/tests/test_mg_nuclide/inputs_true.dat index 57aa5d33f0..95f65c29e0 100644 --- a/tests/test_mg_nuclide/inputs_true.dat +++ b/tests/test_mg_nuclide/inputs_true.dat @@ -1 +1 @@ -6d03b988671fe21dfe2a908685536edb3059e5bdda7974ddfa65c7f63cecb7f6b3fce49bc1533ef2787e284121779653cb14a66cfd709258e4b07d8bd7571843 \ No newline at end of file +ec7f0697d22668dcc4cdaf134c58b9f84137730d52cb44264ee9205369abcf995b2f66847d620715cd609bd2f5f865294374978f8fb89f182962e40801171cba \ No newline at end of file diff --git a/tests/test_mg_tallies/inputs_true.dat b/tests/test_mg_tallies/inputs_true.dat index 6b0ff76b15..7be35573cd 100644 --- a/tests/test_mg_tallies/inputs_true.dat +++ b/tests/test_mg_tallies/inputs_true.dat @@ -1 +1 @@ -8c496e13f9456bedcc0789ffdca81913596cca3c7867717ced38c3063b6cdc8949bd204c98723b72c1b456e3fc85fc90e6710482b0c74e5e29283902a5d9ed50 \ No newline at end of file +54cd9db30bc8e671591d76e8da2b5dead54eb4cead1eef09a005e96ca2c0fd707872e0cc21f31d198915b156605de78322fbb7957698ea8febceb23f048e44ad \ No newline at end of file diff --git a/tests/test_mgxs_library_ce_to_mg/test_mgxs_library_ce_to_mg.py b/tests/test_mgxs_library_ce_to_mg/test_mgxs_library_ce_to_mg.py index eee528e88e..8a97d8c32d 100644 --- a/tests/test_mgxs_library_ce_to_mg/test_mgxs_library_ce_to_mg.py +++ b/tests/test_mgxs_library_ce_to_mg/test_mgxs_library_ce_to_mg.py @@ -60,8 +60,8 @@ class MGXSTestHarness(PyAPITestHarness): self._input_set.mgxs_file, self._input_set.materials, \ self._input_set.geometry = self.mgxs_lib.create_mg_mode() - # Modify settings so we can run in MG mode - self._input_set.settings.cross_sections = './mgxs.h5' + # Modify materials and settings so we can run in MG mode + self._input_set.materials.cross_sections = './mgxs.h5' self._input_set.settings.energy_mode = 'multi-group' # Write modified input files diff --git a/tests/test_natural_element/geometry.xml b/tests/test_natural_element/geometry.xml deleted file mode 100644 index b6b4bd817b..0000000000 --- a/tests/test_natural_element/geometry.xml +++ /dev/null @@ -1,94 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tests/test_natural_element/materials.xml b/tests/test_natural_element/materials.xml deleted file mode 100644 index 6568951f43..0000000000 --- a/tests/test_natural_element/materials.xml +++ /dev/null @@ -1,62 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tests/test_natural_element/results_true.dat b/tests/test_natural_element/results_true.dat deleted file mode 100644 index cc4a12f749..0000000000 --- a/tests/test_natural_element/results_true.dat +++ /dev/null @@ -1,2 +0,0 @@ -k-combined: -1.034427E+00 1.583807E-02 diff --git a/tests/test_natural_element/settings.xml b/tests/test_natural_element/settings.xml deleted file mode 100644 index f903c92e72..0000000000 --- a/tests/test_natural_element/settings.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - - 10 - 5 - 400 - - - endf/b-vii.1 - - - - box - 0 0 0 1 1 1 - - - - - diff --git a/tests/test_natural_element/test_natural_element.py b/tests/test_natural_element/test_natural_element.py deleted file mode 100644 index 2a595f3e66..0000000000 --- a/tests/test_natural_element/test_natural_element.py +++ /dev/null @@ -1,11 +0,0 @@ -#!/usr/bin/env python - -import os -import sys -sys.path.insert(0, os.pardir) -from testing_harness import TestHarness - - -if __name__ == '__main__': - harness = TestHarness('statepoint.10.*') - harness.main() diff --git a/tests/test_triso/inputs_true.dat b/tests/test_triso/inputs_true.dat index 561877ad93..47837fc7c4 100644 --- a/tests/test_triso/inputs_true.dat +++ b/tests/test_triso/inputs_true.dat @@ -1 +1 @@ -b22973093e2b0690b30fb1262a11e27004555b796c446d256cb58a1d7329888ab60c1b93729b3d74bb015b98aa434416daa2dc2aee526eb8df0e9052911f94b4 \ No newline at end of file +3fdba48bb553aa75723e9ab226aeb873d4ebfc5934081263cf27063645e63036ec1088f1977fa38f45a95ed793bdb7b2a0e7a1f948b2a5b5b366110df72e8f0d \ No newline at end of file diff --git a/tests/test_triso/plots.xml b/tests/test_triso/plots.xml deleted file mode 100644 index 60ae7d9d8f..0000000000 --- a/tests/test_triso/plots.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - From b0a5be1c1ce9dc3eebbcad803237ccf918f2028f Mon Sep 17 00:00:00 2001 From: Sam Shaner Date: Mon, 24 Oct 2016 09:12:57 -0400 Subject: [PATCH 18/34] updated documentation and comments in Python API --- docs/source/usersguide/input.rst | 117 ++++++-------------------- openmc/element.py | 37 +++++--- openmc/material.py | 4 + openmc/nuclide.py | 6 +- src/input_xml.F90 | 86 +++++-------------- tests/test_element_wo/inputs_true.dat | 2 +- tests/test_enrichment/inputs_true.dat | 2 +- 7 files changed, 80 insertions(+), 174 deletions(-) diff --git a/docs/source/usersguide/input.rst b/docs/source/usersguide/input.rst index 6327d4106a..74de4caa41 100644 --- a/docs/source/usersguide/input.rst +++ b/docs/source/usersguide/input.rst @@ -105,19 +105,6 @@ standard deviation. *Default*: false -.. _cross_sections: - -```` Element ----------------------------- - -The ```` element has no attributes and simply indicates the path -to an XML cross section listing file (usually named cross_sections.xml). If this -element is absent from the settings.xml file, the -:envvar:`OPENMC_CROSS_SECTIONS` environment variable will be used to find the -path to the XML cross section listing when in continuous-energy mode, and the -:envvar:`OPENMC_MG_CROSS_SECTIONS` environment variable will be used in -multi-group mode. - ```` Element -------------------- @@ -289,20 +276,6 @@ based on the recommended value in LA-UR-14-24530_. .. note:: This element is not used in the multi-group :ref:`energy_mode`. -.. _multipole_library: - -```` Element -------------------------------- - -The ```` element indicates the directory containing a -windowed multipole library. If a windowed multipole library is available, -OpenMC can use it for on-the-fly Doppler-broadening of resolved resonance range -cross sections. If this element is absent from the settings.xml file, the -:envvar:`OPENMC_MULTIPOLE_LIBRARY` environment variable will be used. - - .. note:: The element must also be set to "true" for - windowed multipole functionality. - ```` Element --------------------------- @@ -316,29 +289,6 @@ then, OpenMC will only use up to the :math:`P_1` data. .. note:: This element is not used in the continuous-energy :ref:`energy_mode`. -.. _natural_elements: - -```` Element ------------------------------- - -The ```` element indicates to OpenMC what nuclides are -available in the cross section library when expanding an ```` into -separate isotopes (see :ref:`material`). The accepted values are: - - - ENDF/B-VII.0 - - ENDF/B-VII.1 - - JEFF-3.1.1 - - JEFF-3.1.2 - - JEFF-3.2 - - JENDL-3.2 - - JENDL-3.3 - - JENDL-4.0 - -Note that the value is case-insensitive, so "ENDF/B-VII.1" is equivalent to -"endf/b-vii.1". - - *Default*: ENDF/B-VII.1 - ```` Element ----------------------- @@ -1368,6 +1318,33 @@ Here is an example of a properly defined 2d hexagonal lattice: Materials Specification -- materials.xml ---------------------------------------- +.. _cross_sections: + +```` Element +---------------------------- + +The ```` element has no attributes and simply indicates the path +to an XML cross section listing file (usually named cross_sections.xml). If this +element is absent from the settings.xml file, the +:envvar:`OPENMC_CROSS_SECTIONS` environment variable will be used to find the +path to the XML cross section listing when in continuous-energy mode, and the +:envvar:`OPENMC_MG_CROSS_SECTIONS` environment variable will be used in +multi-group mode. + +.. _multipole_library: + +```` Element +------------------------------- + +The ```` element indicates the directory containing a +windowed multipole library. If a windowed multipole library is available, +OpenMC can use it for on-the-fly Doppler-broadening of resolved resonance range +cross sections. If this element is absent from the settings.xml file, the +:envvar:`OPENMC_MULTIPOLE_LIBRARY` environment variable will be used. + + .. note:: The element must also be set to "true" for + windowed multipole functionality. + .. _material: ```` Element @@ -1440,43 +1417,6 @@ Each ``material`` element can have the following attributes or sub-elements: .. note:: The ``scattering`` attribute/sub-element is not used in the multi-group :ref:`energy_mode`. - :element: - - Specifies that a natural element is present in the material. The natural - element is split up into individual isotopes based on `IUPAC Isotopic - Compositions of the Elements 2009`_. This element has - attributes/sub-elements called ``name``, and ``ao``. The ``name`` - attribute is the atomic symbol of the element. Finally, the ``ao`` - attribute specifies the atom percent of the element within the material, - respectively. One example would be as follows: - - .. code-block:: xml - - - - - - - In some cross section libraries, certain naturally occurring isotopes do not - have cross sections. The :ref:`natural_elements` option determines how a - natural element is split into isotopes in these cases. - - *Default*: None - - An optional attribute/sub-element for each element is ``scattering``. This - attribute may be set to "data" to use the scattering laws specified by the - cross section library (default). Alternatively, when set to "iso-in-lab", - the scattering laws are used to sample the outgoing energy but an - isotropic-in-lab distribution is used to sample the outgoing angle at each - scattering interaction. The ``scattering`` attribute may be most useful - when using OpenMC to compute multi-group cross-sections for deterministic - transport codes and to quantify the effects of anisotropic scattering. - - *Default*: None - - .. note:: The ``scattering`` attribute/sub-element is not used in the - multi-group :ref:`energy_mode`. - :sab: Associates an S(a,b) table with the material. This element has one attribute/sub-element called ``name``. The ``name`` attribute @@ -1503,9 +1443,6 @@ Each ``material`` element can have the following attributes or sub-elements: *Default*: None -.. _IUPAC Isotopic Compositions of the Elements 2009: - http://pac.iupac.org/publications/pac/pdf/2011/pdf/8302x0397.pdf - ------------------------------------ Tallies Specification -- tallies.xml ------------------------------------ diff --git a/openmc/element.py b/openmc/element.py index ecea2b8c3f..d3d3ac95da 100644 --- a/openmc/element.py +++ b/openmc/element.py @@ -84,9 +84,9 @@ class Element(object): @scattering.setter def scattering(self, scattering): - if not scattering in ['data', 'iso-in-lab']: - msg = 'Unable to set scattering for Element to {0} ' \ - 'which is not "data" or "iso-in-lab"'.format(scattering) + if not scattering in ['data', 'iso-in-lab', None]: + msg = 'Unable to set scattering for Element to {0} which ' \ + 'is not "data", "iso-in-lab", or None'.format(scattering) raise ValueError(msg) self._scattering = scattering @@ -123,11 +123,14 @@ class Element(object): """ + # Get the length of this elements atomic symbol + name_len = len(self.name) + # Get the nuclides present in nature natural_nuclides = set() for nuclide in sorted(NATURAL_ABUNDANCE.keys()): if re.match(r'{}\d+'.format(self.name), nuclide): - natural_nuclides.add(int(nuclide[len(self.name):])) + natural_nuclides.add(int(nuclide[name_len:])) # Create lists to store the expanded nuclides and abundances nuclides = [] @@ -149,7 +152,7 @@ class Element(object): nuclide = child.attrib['materials'] if re.match(r'{}\d+'.format(self.name), nuclide) and \ '_m' not in nuclide: - library_nuclides.add(int(nuclide[len(self.name):])) + library_nuclides.add(int(nuclide[name_len:])) # Get a set of the mutual and absent nuclides mutual_nuclides = natural_nuclides.intersection(library_nuclides) @@ -162,7 +165,9 @@ class Element(object): if len(absent_nuclides) == 0: for nuclide, abundance in sorted(NATURAL_ABUNDANCE.items()): if re.match(r'{}\d+'.format(self.name), nuclide): - nuclides.append(openmc.Nuclide(nuclide)) + nuc = openmc.Nuclide(nuclide) + nuc.scattering = self.scattering + nuclides.append(nuc) abundances.append(abundance) # If no natural elements are present in the library, check if the @@ -170,7 +175,9 @@ class Element(object): # nuclide. Else, raise an error. elif len(mutual_nuclides) == 0: if 0 in library_nuclides: - nuclides.append(openmc.Nuclide(self.name + '0')) + nuc = openmc.Nuclide(self.name + '0') + nuc.scattering = self.scattering + nuclides.append(nuc) abundances.append(1.0) else: msg = 'Unable to expand element {0} because the cross '\ @@ -188,18 +195,20 @@ class Element(object): nuclides_a = [] for nuclide, abundance in sorted(NATURAL_ABUNDANCE.items()): if re.match(r'{}\d+'.format(self.name), nuclide) and \ - int(nuclide[len(self.name):]) in mutual_nuclides: - nuclides.append(openmc.Nuclide(nuclide)) - nuclides_a.append(int(nuclide[len(self.name):])) + int(nuclide[name_len:]) in mutual_nuclides: + nuc = openmc.Nuclide(nuclide) + nuc.scattering = self.scattering + nuclides.append(nuc) + nuclides_a.append(int(nuclide[name_len:])) abundances.append(abundance) # Adjust the abundances for the absent nuclides for nuclide, abundance in sorted(NATURAL_ABUNDANCE.items()): if re.match(r'{}\d+'.format(self.name), nuclide) and \ - int(nuclide[len(self.name):]) in absent_nuclides: + int(nuclide[name_len:]) in absent_nuclides: # Get index to the nearest nuclide - a = int(nuclide[len(self.name):]) + a = int(nuclide[name_len:]) i = min(list(range(len(nuclides_a))), key=lambda j: \ abs(nuclides_a[j] - a)) @@ -264,9 +273,9 @@ class Element(object): for i in range(n_nuclides): abundances[i] /= sum_abundances + # Create a list of the isotopes in this element isotopes = [] for nuclide, abundance in zip(nuclides, abundances): - pct = float('{:2.10f}'.format(percent*abundance)) - isotopes.append((nuclide, pct, percent_type)) + isotopes.append((nuclide, percent*abundance, percent_type)) return isotopes diff --git a/openmc/material.py b/openmc/material.py index cfd098c345..7b63ec8004 100644 --- a/openmc/material.py +++ b/openmc/material.py @@ -461,6 +461,10 @@ class Material(object): self._id) raise ValueError(msg) + # Check that the enrichment is in the valid range + cv.check_less_than('enrichment', enrichment, 1/1.008, equality=True) + cv.check_greater_than('enrichment', enrichment, 0., equality=True) + if enrichment > 0.05: msg = 'A uranium enrichment of {0} was given for Material ID='\ '"{1}". OpenMC assumes the U234/U235 mass ratio is '\ diff --git a/openmc/nuclide.py b/openmc/nuclide.py index 03616a313f..79b51e68a2 100644 --- a/openmc/nuclide.py +++ b/openmc/nuclide.py @@ -89,9 +89,9 @@ class Nuclide(object): @scattering.setter def scattering(self, scattering): - if not scattering in ['data', 'iso-in-lab']: - msg = 'Unable to set scattering for Nuclide to {0} ' \ - 'which is not "data" or "iso-in-lab"'.format(scattering) + if not scattering in ['data', 'iso-in-lab', None]: + msg = 'Unable to set scattering for Nuclide to {0} which ' \ + 'is not "data", "iso-in-lab", or None'.format(scattering) raise ValueError(msg) self._scattering = scattering diff --git a/src/input_xml.F90 b/src/input_xml.F90 index 8973d8fdaa..3eb2cf2d4e 100644 --- a/src/input_xml.F90 +++ b/src/input_xml.F90 @@ -139,10 +139,10 @@ contains ! Look for deprecated cross_sections.xml file in settings.xml if (check_for_node(doc, "cross_sections")) then - call warning("Setting cross_sections in settings.xml has been deprecated. & - &The cross_sections are now set in materials.xml and the & - &cross_sections input to materials.xml and OPENMC_CROSS_SECTIONS & - &environment variable will take precendent over setting & + call warning("Setting cross_sections in settings.xml has been deprecated.& + & The cross_sections are now set in materials.xml and the & + &cross_sections input to materials.xml and the OPENMC_CROSS_SECTIONS& + & environment variable will take precendent over setting & &cross_sections in settings.xml.") call get_node_value(doc, "cross_sections", path_cross_sections) end if @@ -152,7 +152,7 @@ contains if (check_for_node(doc, "multipole_library")) then call warning("Setting multipole_library in settings.xml has been & &deprecated. The multipole_library is now set in materials.xml and& - & the multipole_library input to materials.xml and & + & the multipole_library input to materials.xml and the & &OPENMC_MULTIPOLE_LIBRARY environment variable will take & &precendent over setting multipole_library in settings.xml.") call get_node_value(doc, "multipole_library", path_multipole) @@ -1033,17 +1033,9 @@ contains ! Get temperature settings if (check_for_node(doc, "temperature_default")) then - call warning("Setting temperature_default in settings.xml has been & - &deprecated. temperature_default is now set in materials.xml and & - &its input to materials.xml will take precendent & - &over setting it in settings.xml.") call get_node_value(doc, "temperature_default", temperature_default) end if if (check_for_node(doc, "temperature_method")) then - call warning("Setting temperature_method in settings.xml has been & - &deprecated. temperature_method is now set in materials.xml and & - &its input to materials.xml will take precendent & - &over setting it in settings.xml.") call get_node_value(doc, "temperature_method", temp_str) select case (to_lower(temp_str)) case ('nearest') @@ -1055,17 +1047,9 @@ contains end select end if if (check_for_node(doc, "temperature_tolerance")) then - call warning("Setting temperature_tolerance in settings.xml has been & - &deprecated. temperature_tolerance is now set in materials.xml and & - &its input to materials.xml will take precendent & - &over setting it in settings.xml.") call get_node_value(doc, "temperature_tolerance", temperature_tolerance) end if if (check_for_node(doc, "temperature_multipole")) then - call warning("Setting temperature_multipole in settings.xml has been & - &deprecated. temperature_multipole is now set in materials.xml and & - &its input to materials.xml will take precendent & - &over setting it in settings.xml.") call get_node_value(doc, "temperature_multipole", temp_str) select case (to_lower(temp_str)) case ('true', '1') @@ -2076,7 +2060,7 @@ contains ! Find cross_sections.xml file -- the first place to look is the ! materials.xml file. If no file is found there, then we check the - ! CROSS_SECTIONS environment variable + ! OPENMC_CROSS_SECTIONS environment variable if (.not. check_for_node(doc, "cross_sections")) then ! No cross_sections.xml file specified in settings.xml, check ! environment variable @@ -2084,6 +2068,8 @@ contains call get_environment_variable("OPENMC_CROSS_SECTIONS", env_variable) if (len_trim(env_variable) == 0) then call get_environment_variable("CROSS_SECTIONS", env_variable) + ! FIXME: When deprecated option of setting the cross sections in + ! settings.xml is removed, remove ".and. path_cross_sections == ''" if (len_trim(env_variable) == 0 .and. path_cross_sections == '') then call fatal_error("No cross_sections.xml file was specified in & &materials.xml, settings.xml, or in the OPENMC_CROSS_SECTIONS& @@ -2100,13 +2086,15 @@ contains path_cross_sections = trim(env_variable) else call get_environment_variable("OPENMC_MG_CROSS_SECTIONS", env_variable) + ! FIXME: When deprecated option of setting the mg cross sections in + ! settings.xml is removed, remove ".and. path_cross_sections == ''" if (len_trim(env_variable) == 0 .and. path_cross_sections == '') then - call fatal_error("No mgxs.xml file was specified in & + call fatal_error("No mgxs.h5 file was specified in & &materials.xml or in the OPENMC_MG_CROSS_SECTIONS environment & &variable. OpenMC needs such a file to identify where to & - &find ACE cross section libraries. Please consult the user's & + &find MG cross section libraries. Please consult the user's & &guide at http://mit-crpg.github.io/openmc for information on & - &how to set up ACE cross section libraries.") + &how to set up MG cross section libraries.") else path_cross_sections = trim(env_variable) end if @@ -2129,40 +2117,10 @@ contains path_multipole = trim(path_multipole) // "/" end if - ! Get temperature settings - if (check_for_node(doc, "temperature_default")) then - call get_node_value(doc, "temperature_default", temperature_default) - end if - if (check_for_node(doc, "temperature_method")) then - call get_node_value(doc, "temperature_method", temp_str) - select case (to_lower(temp_str)) - case ('nearest') - temperature_method = TEMPERATURE_NEAREST - case ('interpolation') - temperature_method = TEMPERATURE_INTERPOLATION - case default - call fatal_error("Unknown temperature method: " // trim(temp_str)) - end select - end if - if (check_for_node(doc, "temperature_tolerance")) then - call get_node_value(doc, "temperature_tolerance", temperature_tolerance) - end if - if (check_for_node(doc, "temperature_multipole")) then - call get_node_value(doc, "temperature_multipole", temp_str) - select case (to_lower(temp_str)) - case ('true', '1') - temperature_multipole = .true. - case ('false', '0') - temperature_multipole = .false. - case default - call fatal_error("Unrecognized value for in & - &materials.xml") - end select - end if - ! Close materials XML file call close_xmldoc(doc) + ! Now that the cross_sections.xml or mgxs.h5 has been located, read it in if (run_CE) then call read_ce_cross_sections_xml(libraries) else @@ -2225,12 +2183,12 @@ contains integer :: index_nuclide ! index in nuclides integer :: index_sab ! index in sab_tables logical :: file_exists ! does materials.xml exist? - character(20) :: name ! name of nuclide, e.g. 92235.03c + character(20) :: name ! name of nuclide, e.g. 92235.03c character(MAX_LINE_LEN) :: filename ! absolute path to materials.xml character(MAX_LINE_LEN) :: temp_str ! temporary string when reading type(VectorChar) :: names ! temporary list of nuclide names type(VectorInt) :: list_iso_lab ! temporary list of isotropic lab scatterers - type(Material), pointer :: mat => null() + type(Material), pointer :: mat => null() type(Node), pointer :: doc => null() type(Node), pointer :: node_mat => null() type(Node), pointer :: node_nuc => null() @@ -4674,7 +4632,8 @@ contains end subroutine generate_rpn !=============================================================================== -! ASSIGN_NUCLIDE_DENSITIES Assign and normalize nuclide densities +! ASSIGN_NUCLIDE_DENSITIES Read in the nuclide densities from materials.xml +! and assign to the corresponding nuclides. !=============================================================================== subroutine assign_nuclide_densities() @@ -4731,16 +4690,13 @@ contains ! Copy units call get_node_value(node_dens, "units", units) + ! If the units is 'sum', then the total density of the material is taken + ! to be the sum of the atom fractions listed on the nuclides if (units == 'sum') then - ! If the user gave the units as 'sum', then the total density of the - ! material is taken to be the sum of the atom fractions listed on the - ! nuclides - sum_density = .true. else if (units == 'macro') then if (check_for_node(node_dens, "value")) then - ! Copy value call get_node_value(node_dens, "value", val) else val = ONE @@ -4752,7 +4708,6 @@ contains sum_density = .false. else - ! Copy value call get_node_value(node_dens, "value", val) ! Check for erroneous density @@ -4761,6 +4716,7 @@ contains call fatal_error("Need to specify a positive density on material " & // trim(to_str(mat % id)) // ".") end if + ! Adjust material density based on specified units select case(to_lower(units)) case ('g/cc', 'g/cm3') diff --git a/tests/test_element_wo/inputs_true.dat b/tests/test_element_wo/inputs_true.dat index 9f59e56f22..da97abc339 100644 --- a/tests/test_element_wo/inputs_true.dat +++ b/tests/test_element_wo/inputs_true.dat @@ -1 +1 @@ -c472877dd96f51dcfd7b45ec1c230c3847b26eb1f0a97751bb175b70eafff2ad8ee97e3ed8691a3bc8bf8f27c074a9d34021322988185bb04c3e55958f40589b \ No newline at end of file +f270ae43a29c53065678b419629ad713f5a4cc23c75825fee4da049d4159756f463fec86263a8dea6ce10fff6d60b24ebf100e8f5cc80e6d4fc31297ae1709ed \ No newline at end of file diff --git a/tests/test_enrichment/inputs_true.dat b/tests/test_enrichment/inputs_true.dat index 86c8f82f05..49acd2945a 100644 --- a/tests/test_enrichment/inputs_true.dat +++ b/tests/test_enrichment/inputs_true.dat @@ -1 +1 @@ -6f8d495cd7537f8ca29355664b31d429fe13f656a868852769b27ef9566e7bb683973322e41a92bab65beb1ba6cf477698b30a7ae6bc17d2e34cb44751e8c81d \ No newline at end of file +835357f7b3c10f1153bb5842978075d9bb788d639759f143dfe58064865712fdf4e17ce50747949411e7c5215f33371e883e48b670509e222fa338bbfe613b80 \ No newline at end of file From 6b1ff6128464ff7f0d9fad31bc4bbbf58cdf566c Mon Sep 17 00:00:00 2001 From: Sam Shaner Date: Mon, 24 Oct 2016 09:50:46 -0400 Subject: [PATCH 19/34] updated input files --- .../python/pincell_multigroup/build-xml.py | 2 +- examples/xml/pincell_multigroup/materials.xml | 3 ++ examples/xml/pincell_multigroup/settings.xml | 2 - openmc/element.py | 3 +- openmc/material.py | 40 ------------------- openmc/settings.py | 4 -- src/input_xml.F90 | 2 +- tests/test_element_wo/inputs_true.dat | 2 +- tests/test_enrichment/inputs_true.dat | 2 +- 9 files changed, 9 insertions(+), 51 deletions(-) diff --git a/examples/python/pincell_multigroup/build-xml.py b/examples/python/pincell_multigroup/build-xml.py index 216c565397..1dcfc896bf 100644 --- a/examples/python/pincell_multigroup/build-xml.py +++ b/examples/python/pincell_multigroup/build-xml.py @@ -83,6 +83,7 @@ water.add_macroscopic(h2o_data) # Instantiate a Materials collection and export to XML materials_file = openmc.Materials([uo2, water]) +materials_file.cross_sections = "./mgxs.h5" materials_file.export_to_xml() @@ -132,7 +133,6 @@ geometry.export_to_xml() # Instantiate a Settings object, set all runtime parameters, and export to XML settings_file = openmc.Settings() settings_file.energy_mode = "multi-group" -settings_file.cross_sections = "./mgxs.h5" settings_file.batches = batches settings_file.inactive = inactive settings_file.particles = particles diff --git a/examples/xml/pincell_multigroup/materials.xml b/examples/xml/pincell_multigroup/materials.xml index f75d7ef6f4..61a5cc697a 100644 --- a/examples/xml/pincell_multigroup/materials.xml +++ b/examples/xml/pincell_multigroup/materials.xml @@ -1,5 +1,8 @@ + + ./mgxs.h5 + diff --git a/examples/xml/pincell_multigroup/settings.xml b/examples/xml/pincell_multigroup/settings.xml index ab716d9e47..9adc17c9d0 100644 --- a/examples/xml/pincell_multigroup/settings.xml +++ b/examples/xml/pincell_multigroup/settings.xml @@ -34,6 +34,4 @@ false - ./mgxs.h5 - diff --git a/openmc/element.py b/openmc/element.py index d3d3ac95da..10dfa06bc6 100644 --- a/openmc/element.py +++ b/openmc/element.py @@ -276,6 +276,7 @@ class Element(object): # Create a list of the isotopes in this element isotopes = [] for nuclide, abundance in zip(nuclides, abundances): - isotopes.append((nuclide, percent*abundance, percent_type)) + pct = float('{:2.8g}'.format(percent*abundance)) + isotopes.append((nuclide, pct, percent_type)) return isotopes diff --git a/openmc/material.py b/openmc/material.py index 7b63ec8004..f203878c1f 100644 --- a/openmc/material.py +++ b/openmc/material.py @@ -759,16 +759,6 @@ class Materials(cv.CheckedList): cross section library. If it is not set, the :envvar:`OPENMC_MULTIPOLE_LIBRARY` environment variable will be used. A multipole library is optional. - temperature : dict - Defines a default temperature and method for treating intermediate - temperatures at which nuclear data doesn't exist. Accepted keys are - 'default', 'method', 'tolerance', and 'multipole'. The value for - 'default' should be a float representing the default temperature in - Kelvin. The value for 'method' should be 'nearest' or 'interpolation'. - If the method is 'nearest', 'tolerance' indicates a range of temperature - within which cross sections may be used. 'multipole' is a boolean - indicating whether or not the windowed multipole method should be used - to evaluate resolved resonance cross sections. """ @@ -778,7 +768,6 @@ class Materials(cv.CheckedList): self._materials_file = ET.Element("materials") self._cross_sections = None self._multipole_library = None - self._temperature = {} if materials is not None: self += materials @@ -791,10 +780,6 @@ class Materials(cv.CheckedList): def multipole_library(self): return self._multipole_library - @property - def temperature(self): - return self._temperature - @cross_sections.setter def cross_sections(self, cross_sections): cv.check_type('cross sections', cross_sections, string_types) @@ -805,23 +790,6 @@ class Materials(cv.CheckedList): cv.check_type('cross sections', multipole_library, string_types) self._multipole_library = multipole_library - @temperature.setter - def temperature(self, temperature): - cv.check_type('temperature settings', temperature, Mapping) - for key, value in temperature.items(): - cv.check_value('temperature key', key, - ['default', 'method', 'tolerance', 'multipole']) - if key == 'default': - cv.check_type('default temperature', value, Real) - elif key == 'method': - cv.check_value('temperature method', value, - ['nearest', 'interpolation']) - elif key == 'tolerance': - cv.check_type('temperature tolerance', value, Real) - elif key == 'multipole': - cv.check_type('temperature multipole', value, bool) - self._temperature = temperature - def add_material(self, material): """Append material to collection @@ -917,13 +885,6 @@ class Materials(cv.CheckedList): element = ET.SubElement(self._materials_file, "multipole_library") element.text = str(self._multipole_library) - def _create_temperature_subelements(self): - if self.temperature: - for key, value in sorted(self.temperature.items()): - element = ET.SubElement(self._materials_file, - "temperature_{}".format(key)) - element.text = str(value) - def export_to_xml(self, path='materials.xml'): """Export material collection to an XML file. @@ -940,7 +901,6 @@ class Materials(cv.CheckedList): self._create_material_subelements() self._create_cross_sections_subelement() self._create_multipole_library_subelement() - self._create_temperature_subelements() # Clean the indentation in the file to be user-readable sort_xml_elements(self._materials_file) diff --git a/openmc/settings.py b/openmc/settings.py index 75878226e9..683324fa2e 100644 --- a/openmc/settings.py +++ b/openmc/settings.py @@ -721,10 +721,6 @@ class Settings(object): @temperature.setter def temperature(self, temperature): - warnings.warn('Settings.temperature has been deprecated and will ' - 'be removed in a future version. Materials.temperature ' - 'should defined instead.', DeprecationWarning) - cv.check_type('temperature settings', temperature, Mapping) for key, value in temperature.items(): cv.check_value('temperature key', key, diff --git a/src/input_xml.F90 b/src/input_xml.F90 index 3eb2cf2d4e..cb65a0d351 100644 --- a/src/input_xml.F90 +++ b/src/input_xml.F90 @@ -2095,7 +2095,7 @@ contains &find MG cross section libraries. Please consult the user's & &guide at http://mit-crpg.github.io/openmc for information on & &how to set up MG cross section libraries.") - else + else if (len_trim(env_variable) /= 0) then path_cross_sections = trim(env_variable) end if end if diff --git a/tests/test_element_wo/inputs_true.dat b/tests/test_element_wo/inputs_true.dat index da97abc339..068fa25cd8 100644 --- a/tests/test_element_wo/inputs_true.dat +++ b/tests/test_element_wo/inputs_true.dat @@ -1 +1 @@ -f270ae43a29c53065678b419629ad713f5a4cc23c75825fee4da049d4159756f463fec86263a8dea6ce10fff6d60b24ebf100e8f5cc80e6d4fc31297ae1709ed \ No newline at end of file +89207d3b5639e54be2d2a3e4f8ea38a3b7d438c3d3da9d80d76b9fed9f2d44168dfad0ea273891a817ea87ba144107fdd3b9e1b89a2c8c08880a53d645e4af9a \ No newline at end of file diff --git a/tests/test_enrichment/inputs_true.dat b/tests/test_enrichment/inputs_true.dat index 49acd2945a..34f9afe7e5 100644 --- a/tests/test_enrichment/inputs_true.dat +++ b/tests/test_enrichment/inputs_true.dat @@ -1 +1 @@ -835357f7b3c10f1153bb5842978075d9bb788d639759f143dfe58064865712fdf4e17ce50747949411e7c5215f33371e883e48b670509e222fa338bbfe613b80 \ No newline at end of file +87a238e2fef484680349715d37fcac80b10a8b503381923e1aa324c462156802dc01ce07a38ab5d00878dbe26cebede7879227c819334be071086c8b5cb3e5ee \ No newline at end of file From af29379f12386a978aaa285265a76c5771206c05 Mon Sep 17 00:00:00 2001 From: Sam Shaner Date: Tue, 25 Oct 2016 17:21:48 -0400 Subject: [PATCH 20/34] removed shortening of nuclide pct in element.expand() --- openmc/element.py | 3 ++- tests/test_element_wo/inputs_true.dat | 2 +- tests/test_enrichment/inputs_true.dat | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/openmc/element.py b/openmc/element.py index 10dfa06bc6..bd601f2587 100644 --- a/openmc/element.py +++ b/openmc/element.py @@ -276,7 +276,8 @@ class Element(object): # Create a list of the isotopes in this element isotopes = [] for nuclide, abundance in zip(nuclides, abundances): - pct = float('{:2.8g}'.format(percent*abundance)) + #pct = float('{:2.8g}'.format()) + pct = percent*abundance isotopes.append((nuclide, pct, percent_type)) return isotopes diff --git a/tests/test_element_wo/inputs_true.dat b/tests/test_element_wo/inputs_true.dat index 068fa25cd8..da97abc339 100644 --- a/tests/test_element_wo/inputs_true.dat +++ b/tests/test_element_wo/inputs_true.dat @@ -1 +1 @@ -89207d3b5639e54be2d2a3e4f8ea38a3b7d438c3d3da9d80d76b9fed9f2d44168dfad0ea273891a817ea87ba144107fdd3b9e1b89a2c8c08880a53d645e4af9a \ No newline at end of file +f270ae43a29c53065678b419629ad713f5a4cc23c75825fee4da049d4159756f463fec86263a8dea6ce10fff6d60b24ebf100e8f5cc80e6d4fc31297ae1709ed \ No newline at end of file diff --git a/tests/test_enrichment/inputs_true.dat b/tests/test_enrichment/inputs_true.dat index 34f9afe7e5..49acd2945a 100644 --- a/tests/test_enrichment/inputs_true.dat +++ b/tests/test_enrichment/inputs_true.dat @@ -1 +1 @@ -87a238e2fef484680349715d37fcac80b10a8b503381923e1aa324c462156802dc01ce07a38ab5d00878dbe26cebede7879227c819334be071086c8b5cb3e5ee \ No newline at end of file +835357f7b3c10f1153bb5842978075d9bb788d639759f143dfe58064865712fdf4e17ce50747949411e7c5215f33371e883e48b670509e222fa338bbfe613b80 \ No newline at end of file From a042ff60ed86dd70a71783b09bbe1a3efa0c74b4 Mon Sep 17 00:00:00 2001 From: Sam Shaner Date: Tue, 25 Oct 2016 20:54:56 -0400 Subject: [PATCH 21/34] addressed PR comments --- .../pythonapi/examples/mgxs-part-iv.ipynb | 223 ++++++------- openmc/element.py | 147 ++++---- openmc/material.py | 8 +- openmc/nuclide.py | 13 - src/input_xml.F90 | 313 +++++++----------- src/relaxng/materials.rnc | 4 + src/relaxng/settings.rnc | 4 - tests/input_set.py | 25 +- tests/test_element_wo/inputs_true.dat | 1 - tests/test_element_wo/results_true.dat | 5 - tests/test_element_wo/test_element_wo.py | 123 ++----- tests/test_enrichment/inputs_true.dat | 1 - tests/test_enrichment/results_true.dat | 5 - tests/test_enrichment/test_enrichment.py | 108 ++---- 14 files changed, 349 insertions(+), 631 deletions(-) delete mode 100644 tests/test_element_wo/inputs_true.dat delete mode 100644 tests/test_element_wo/results_true.dat delete mode 100644 tests/test_enrichment/inputs_true.dat delete mode 100644 tests/test_enrichment/results_true.dat diff --git a/docs/source/pythonapi/examples/mgxs-part-iv.ipynb b/docs/source/pythonapi/examples/mgxs-part-iv.ipynb index 74bbfb7d35..eb100c60d6 100644 --- a/docs/source/pythonapi/examples/mgxs-part-iv.ipynb +++ b/docs/source/pythonapi/examples/mgxs-part-iv.ipynb @@ -429,7 +429,7 @@ "outputs": [ { "data": { - "image/png": "iVBORw0K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8kb/8ld/9nx9t/Sjw/Ltr/yt1/+337f6/b\nf0zoB3nJ/ucVc/81d/83e/957vzJbc89/8A8f8E9/5HE78XnT/4H/cs5f8Q9/8Q9f8U+/5U7f3Lb\nc88fdrzzjyvm+cuf/Uu887/c88fs88954/8vO4SjPC+2QRIAAAAldEVYdGRhdGU6Y3JlYXRlADIw\nMTYtMTAtMjVUMjA6NTE6MTQtMDQ6MDDdryDOAAAAJXRFWHRkYXRlOm1vZGlmeQAyMDE2LTEwLTI1\nVDIwOjUxOjE0LTA0OjAwrPKYcgAAAABJRU5ErkJggg==\n", "text/plain": [ "" ] @@ -575,7 +575,7 @@ "name": "stderr", "output_type": "stream", "text": [ - "/home/nelsonag/git/openmc/openmc/mgxs/library.py:373: RuntimeWarning: The P0 correction will be ignored since the scattering order 0 is greater than zero\n", + "/Users/sam/.local/lib/python2.7/site-packages/openmc-0.8.0-py2.7-macosx-10.10-x86_64.egg/openmc/mgxs/library.py:370: RuntimeWarning: The P0 correction will be ignored since the scattering order 0 is greater than zero\n", " warn(msg, RuntimeWarning)\n" ] } @@ -731,9 +731,9 @@ " Copyright | 2011-2016 Massachusetts Institute of Technology\n", " License | http://openmc.readthedocs.io/en/latest/license.html\n", " Version | 0.8.0\n", - " Git SHA1 | 9d769378838a8404a7e878a65a6bf7f9fb8e083d\n", - " Date/Time | 2016-10-04 19:54:41\n", - " OpenMP Threads | 8\n", + " Git SHA1 | 6b1ff6128464ff7f0d9fad31bc4bbbf58cdf566c\n", + " Date/Time | 2016-10-25 20:51:15\n", + " MPI Processes | 1\n", "\n", " ===========================================================================\n", " ========================> INITIALIZATION <=========================\n", @@ -741,14 +741,14 @@ "\n", " Reading settings XML file...\n", " Reading geometry XML file...\n", - " Reading cross sections XML file...\n", " Reading materials XML file...\n", - " Reading U235 from /opt/xsdata/nndc/U235.h5\n", - " Reading U238 from /opt/xsdata/nndc/U238.h5\n", - " Reading O16 from /opt/xsdata/nndc/O16.h5\n", - " Reading Zr90 from /opt/xsdata/nndc/Zr90.h5\n", - " Reading H1 from /opt/xsdata/nndc/H1.h5\n", - " Reading B10 from /opt/xsdata/nndc/B10.h5\n", + " Reading cross sections XML file...\n", + " Reading U235 from /Users/sam/git/openmc-sam/data/nndc_hdf5/U235.h5\n", + " Reading U238 from /Users/sam/git/openmc-sam/data/nndc_hdf5/U238.h5\n", + " Reading O16 from /Users/sam/git/openmc-sam/data/nndc_hdf5/O16.h5\n", + " Reading Zr90 from /Users/sam/git/openmc-sam/data/nndc_hdf5/Zr90.h5\n", + " Reading H1 from /Users/sam/git/openmc-sam/data/nndc_hdf5/H1.h5\n", + " Reading B10 from /Users/sam/git/openmc-sam/data/nndc_hdf5/B10.h5\n", " Maximum neutron transport energy: 20.0000 MeV for U235\n", " Reading tallies XML file...\n", " Building neighboring cells lists for each surface...\n", @@ -819,20 +819,20 @@ "\n", " =======================> TIMING STATISTICS <=======================\n", "\n", - " Total time for initialization = 2.5432E-01 seconds\n", - " Reading cross sections = 1.4823E-01 seconds\n", - " Total time in simulation = 7.6226E+00 seconds\n", - " Time in transport only = 7.5567E+00 seconds\n", - " Time in inactive batches = 8.4858E-01 seconds\n", - " Time in active batches = 6.7740E+00 seconds\n", - " Time synchronizing fission bank = 4.9022E-03 seconds\n", - " Sampling source sites = 3.4092E-03 seconds\n", - " SEND/RECV source sites = 1.4584E-03 seconds\n", - " Time accumulating tallies = 1.0030E-04 seconds\n", - " Total time for finalization = 3.2380E-06 seconds\n", - " Total time elapsed = 7.8942E+00 seconds\n", - " Calculation Rate (inactive) = 58922.0 neutrons/second\n", - " Calculation Rate (active) = 29524.6 neutrons/second\n", + " Total time for initialization = 6.7087E-01 seconds\n", + " Reading cross sections = 4.9140E-01 seconds\n", + " Total time in simulation = 8.2685E+01 seconds\n", + " Time in transport only = 8.2657E+01 seconds\n", + " Time in inactive batches = 1.0173E+01 seconds\n", + " Time in active batches = 7.2513E+01 seconds\n", + " Time synchronizing fission bank = 1.0907E-02 seconds\n", + " Sampling source sites = 6.1890E-03 seconds\n", + " SEND/RECV source sites = 2.7820E-03 seconds\n", + " Time accumulating tallies = 9.7300E-04 seconds\n", + " Total time for finalization = 1.4000E-05 seconds\n", + " Total time elapsed = 8.3405E+01 seconds\n", + " Calculation Rate (inactive) = 4915.21 neutrons/second\n", + " Calculation Rate (active) = 2758.14 neutrons/second\n", "\n", " ============================> RESULTS <============================\n", "\n", @@ -970,20 +970,7 @@ "metadata": { "collapsed": false }, - "outputs": [ - { - "name": "stderr", - "output_type": "stream", - "text": [ - "/home/nelsonag/git/openmc/openmc/tallies.py:1945: RuntimeWarning: invalid value encountered in true_divide\n", - " self_rel_err = data['self']['std. dev.'] / data['self']['mean']\n", - "/home/nelsonag/git/openmc/openmc/tallies.py:1946: RuntimeWarning: invalid value encountered in true_divide\n", - " other_rel_err = data['other']['std. dev.'] / data['other']['mean']\n", - "/home/nelsonag/git/openmc/openmc/tallies.py:1947: RuntimeWarning: invalid value encountered in true_divide\n", - " new_tally._mean = data['self']['mean'] / data['other']['mean']\n" - ] - } - ], + "outputs": [], "source": [ "# Create a MGXS File which can then be written to disk\n", "mgxs_file = mgxs_lib.create_mg_library(xs_type='macro', xsdata_names=['fuel', 'zircaloy', 'water'])\n", @@ -1033,8 +1020,11 @@ "# Finally, instantiate our Materials object\n", "materials_file = openmc.Materials((fuel, zircaloy, water))\n", "\n", + "# Set the location of the cross sections file\n", + "materials_file.cross_sections = './mgxs.h5'\n", + "\n", "# Export to \"materials.xml\"\n", - "materials_file.export_to_xml()\n" + "materials_file.export_to_xml()" ] }, { @@ -1060,8 +1050,7 @@ }, "outputs": [], "source": [ - "# Set the location of the cross sections file\n", - "settings_file.cross_sections = './mgxs.h5'\n", + "# Set the energy mode\n", "settings_file.energy_mode = 'multi-group'\n", "\n", "# Export to \"settings.xml\"\n", @@ -1118,9 +1107,9 @@ " Copyright | 2011-2016 Massachusetts Institute of Technology\n", " License | http://openmc.readthedocs.io/en/latest/license.html\n", " Version | 0.8.0\n", - " Git SHA1 | 9d769378838a8404a7e878a65a6bf7f9fb8e083d\n", - " Date/Time | 2016-10-04 19:54:49\n", - " OpenMP Threads | 8\n", + " Git SHA1 | 6b1ff6128464ff7f0d9fad31bc4bbbf58cdf566c\n", + " Date/Time | 2016-10-25 20:52:38\n", + " MPI Processes | 1\n", "\n", " ===========================================================================\n", " ========================> INITIALIZATION <=========================\n", @@ -1128,8 +1117,8 @@ "\n", " Reading settings XML file...\n", " Reading geometry XML file...\n", - " Reading cross sections HDF5 file...\n", " Reading materials XML file...\n", + " Reading cross sections HDF5 file...\n", " Reading tallies XML file...\n", " Loading Cross Section Data...\n", " Loading fuel Data...\n", @@ -1152,48 +1141,48 @@ " 6/1 1.04127 \n", " 7/1 1.01783 \n", " 8/1 1.03856 \n", - " 9/1 1.03637 \n", - " 10/1 1.03884 \n", - " 11/1 1.04466 \n", - " 12/1 1.01060 1.02763 +/- 0.01703\n", - " 13/1 1.02517 1.02681 +/- 0.00987\n", - " 14/1 1.05287 1.03333 +/- 0.00954\n", - " 15/1 1.04369 1.03540 +/- 0.00768\n", - " 16/1 1.01304 1.03167 +/- 0.00729\n", - " 17/1 1.04258 1.03323 +/- 0.00636\n", - " 18/1 1.02301 1.03195 +/- 0.00565\n", - " 19/1 1.03906 1.03274 +/- 0.00505\n", - " 20/1 1.04148 1.03362 +/- 0.00460\n", - " 21/1 1.01271 1.03172 +/- 0.00457\n", - " 22/1 1.02021 1.03076 +/- 0.00428\n", - " 23/1 0.99553 1.02805 +/- 0.00478\n", - " 24/1 1.02434 1.02778 +/- 0.00443\n", - " 25/1 1.02987 1.02792 +/- 0.00413\n", - " 26/1 1.01676 1.02722 +/- 0.00393\n", - " 27/1 1.02738 1.02723 +/- 0.00369\n", - " 28/1 1.04014 1.02795 +/- 0.00355\n", - " 29/1 1.02831 1.02797 +/- 0.00336\n", - " 30/1 1.02643 1.02789 +/- 0.00319\n", - " 31/1 1.03939 1.02844 +/- 0.00308\n", - " 32/1 1.03282 1.02864 +/- 0.00294\n", - " 33/1 1.00098 1.02744 +/- 0.00306\n", - " 34/1 1.01763 1.02703 +/- 0.00296\n", - " 35/1 1.01412 1.02651 +/- 0.00288\n", - " 36/1 1.01564 1.02609 +/- 0.00280\n", - " 37/1 1.02379 1.02601 +/- 0.00270\n", - " 38/1 1.03648 1.02638 +/- 0.00263\n", - " 39/1 1.03237 1.02659 +/- 0.00254\n", - " 40/1 1.03501 1.02687 +/- 0.00247\n", - " 41/1 1.02054 1.02666 +/- 0.00240\n", - " 42/1 1.05751 1.02763 +/- 0.00252\n", - " 43/1 1.00751 1.02702 +/- 0.00251\n", - " 44/1 1.04743 1.02762 +/- 0.00251\n", - " 45/1 1.05212 1.02832 +/- 0.00254\n", - " 46/1 1.01839 1.02804 +/- 0.00248\n", - " 47/1 1.00424 1.02740 +/- 0.00250\n", - " 48/1 1.03117 1.02750 +/- 0.00243\n", - " 49/1 1.00988 1.02705 +/- 0.00241\n", - " 50/1 1.01943 1.02686 +/- 0.00236\n", + " 9/1 1.03626 \n", + " 10/1 1.03858 \n", + " 11/1 1.03725 \n", + " 12/1 1.01497 1.02611 +/- 0.01114\n", + " 13/1 1.03853 1.03025 +/- 0.00765\n", + " 14/1 1.02754 1.02957 +/- 0.00545\n", + " 15/1 1.03576 1.03081 +/- 0.00440\n", + " 16/1 1.02338 1.02957 +/- 0.00380\n", + " 17/1 1.03089 1.02976 +/- 0.00322\n", + " 18/1 1.05856 1.03336 +/- 0.00455\n", + " 19/1 1.00958 1.03072 +/- 0.00481\n", + " 20/1 1.01074 1.02872 +/- 0.00474\n", + " 21/1 1.00291 1.02637 +/- 0.00489\n", + " 22/1 1.00197 1.02434 +/- 0.00490\n", + " 23/1 1.01859 1.02390 +/- 0.00453\n", + " 24/1 1.03854 1.02494 +/- 0.00432\n", + " 25/1 1.01060 1.02399 +/- 0.00414\n", + " 26/1 1.04206 1.02512 +/- 0.00403\n", + " 27/1 1.01329 1.02442 +/- 0.00385\n", + " 28/1 1.04189 1.02539 +/- 0.00376\n", + " 29/1 1.04326 1.02633 +/- 0.00368\n", + " 30/1 1.01600 1.02582 +/- 0.00353\n", + " 31/1 0.99692 1.02444 +/- 0.00363\n", + " 32/1 0.97135 1.02203 +/- 0.00422\n", + " 33/1 1.04856 1.02318 +/- 0.00419\n", + " 34/1 1.01941 1.02302 +/- 0.00402\n", + " 35/1 1.00792 1.02242 +/- 0.00390\n", + " 36/1 1.05356 1.02362 +/- 0.00393\n", + " 37/1 1.04524 1.02442 +/- 0.00387\n", + " 38/1 1.02502 1.02444 +/- 0.00373\n", + " 39/1 1.01854 1.02424 +/- 0.00360\n", + " 40/1 1.02803 1.02436 +/- 0.00348\n", + " 41/1 0.99161 1.02331 +/- 0.00353\n", + " 42/1 1.06681 1.02466 +/- 0.00368\n", + " 43/1 1.03784 1.02506 +/- 0.00359\n", + " 44/1 1.01966 1.02491 +/- 0.00348\n", + " 45/1 1.02400 1.02488 +/- 0.00338\n", + " 46/1 0.99642 1.02409 +/- 0.00338\n", + " 47/1 1.05020 1.02479 +/- 0.00336\n", + " 48/1 1.02607 1.02483 +/- 0.00327\n", + " 49/1 1.00497 1.02432 +/- 0.00323\n", + " 50/1 1.03585 1.02461 +/- 0.00316\n", " Creating state point statepoint.50.h5...\n", "\n", " ===========================================================================\n", @@ -1203,27 +1192,27 @@ "\n", " =======================> TIMING STATISTICS <=======================\n", "\n", - " Total time for initialization = 9.9611E-02 seconds\n", - " Reading cross sections = 2.2051E-02 seconds\n", - " Total time in simulation = 6.3645E+00 seconds\n", - " Time in transport only = 6.3383E+00 seconds\n", - " Time in inactive batches = 6.3592E-01 seconds\n", - " Time in active batches = 5.7285E+00 seconds\n", - " Time synchronizing fission bank = 5.1108E-03 seconds\n", - " Sampling source sites = 3.7109E-03 seconds\n", - " SEND/RECV source sites = 1.3393E-03 seconds\n", - " Time accumulating tallies = 8.0199E-05 seconds\n", - " Total time for finalization = 2.9170E-06 seconds\n", - " Total time elapsed = 6.4828E+00 seconds\n", - " Calculation Rate (inactive) = 78625.7 neutrons/second\n", - " Calculation Rate (active) = 34912.9 neutrons/second\n", + " Total time for initialization = 4.1107E-02 seconds\n", + " Reading cross sections = 5.7660E-03 seconds\n", + " Total time in simulation = 6.6928E+01 seconds\n", + " Time in transport only = 6.6906E+01 seconds\n", + " Time in inactive batches = 6.9962E+00 seconds\n", + " Time in active batches = 5.9932E+01 seconds\n", + " Time synchronizing fission bank = 9.4430E-03 seconds\n", + " Sampling source sites = 6.5990E-03 seconds\n", + " SEND/RECV source sites = 2.2240E-03 seconds\n", + " Time accumulating tallies = 9.4200E-04 seconds\n", + " Total time for finalization = 1.4000E-05 seconds\n", + " Total time elapsed = 6.7022E+01 seconds\n", + " Calculation Rate (inactive) = 7146.75 neutrons/second\n", + " Calculation Rate (active) = 3337.11 neutrons/second\n", "\n", " ============================> RESULTS <============================\n", "\n", - " k-effective (Collision) = 1.02515 +/- 0.00252\n", - " k-effective (Track-length) = 1.02686 +/- 0.00236\n", - " k-effective (Absorption) = 1.02678 +/- 0.00178\n", - " Combined k-effective = 1.02710 +/- 0.00176\n", + " k-effective (Collision) = 1.02644 +/- 0.00247\n", + " k-effective (Track-length) = 1.02461 +/- 0.00316\n", + " k-effective (Absorption) = 1.02785 +/- 0.00173\n", + " Combined k-effective = 1.02718 +/- 0.00166\n", " Leakage Fraction = 0.00000 +/- 0.00000\n", "\n" ] @@ -1305,8 +1294,8 @@ "output_type": "stream", "text": [ "Continuous-Energy keff = 1.024295\n", - "Multi-Group keff = 1.027098\n", - "bias [pcm]: -280.3\n" + "Multi-Group keff = 1.027176\n", + "bias [pcm]: -288.2\n" ] } ], @@ -1403,7 +1392,7 @@ { "data": { "text/plain": [ - "" + "" ] }, "execution_count": 40, @@ -1412,9 +1401,9 @@ }, { "data": { - "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXQAAADDCAYAAACS2+oqAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJztnXecFtXVx7+HogiCBQUF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7JP\neTDaxvYrS5nZ67cHrks/XwfsMF+dyqCMv1Ayc1A7oz3GtuK6Asyv2G4LO64PMKHk+0RyPYladRx4\nwMyeMbNDqu1MM1jS3ScDuPskIMcTxlXncDN73syuamuX0gHtMbYV1/OXVo3ttpDQmzpDtYdnKTd0\n93WArUl2ykbVdqigXAGs5O6DgUnAhVX2pzm0x9hWXM8/Wj2220JCnwgsV/J9WeCDKvmSm7QV0DAb\n/CiSy+sVcxKpAAABAElEQVT2wGQzWwq+n/h4SpX9ycTdP/LZgyWuBNatpj/NpN3FtuJ6/lGJ2G4L\nCf0ZoL+ZLW9mnYA9gLuq7FMmZraImS2afu4CDKPtzgI/x+z1JNv2gPTz/sCd89uhgDn8TQ/OBnai\n7W7npmhXsa24rjgVj+2qvssFwN1nmdkRwGiSE8zV7p5n0shqshQwKh3i3RG4yT2YDLAKlJm9/lzg\nb2Z2EPA+sGv1PJyTMv5uamaDSZ6+GA8cVjUHm0k7jG3FdYWYX7Gtof9CCFEQ2kKXixBCiFZACV0I\nIQqCEroQQhQEJXQhhCgISuhCCFEQlNCFEKIgKKELIURBUEIXQoiC8P9F0WOVRkkEkAAAAABJRU5E\nrkJggg==\n", "text/plain": [ - "" + "" ] }, "metadata": {}, @@ -1459,21 +1448,21 @@ ], "metadata": { "kernelspec": { - "display_name": "Python 3", + "display_name": "Python 2", "language": "python", - "name": "python3" + "name": "python2" }, "language_info": { "codemirror_mode": { "name": "ipython", - "version": 3 + "version": 2 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", - "pygments_lexer": "ipython3", - "version": "3.5.2" + "pygments_lexer": "ipython2", + "version": "2.7.12" } }, "nbformat": 4, diff --git a/openmc/element.py b/openmc/element.py index bd601f2587..27046266d5 100644 --- a/openmc/element.py +++ b/openmc/element.py @@ -3,16 +3,18 @@ import sys import os from six import string_types +from xml.etree import ElementTree as ET import openmc from openmc.checkvalue import check_type, check_length -from openmc.data import NATURAL_ABUNDANCE -from xml.etree import ElementTree as ET +from openmc.data import NATURAL_ABUNDANCE, atomic_mass + class Element(object): - """A natural element used in a material via . Internally, OpenMC - will expand the natural element into isotopes based on the known natural - abundances. + """A natural element that auto-expands to add the isotopes of an element to + a material in their natural abundance. Internally, the OpenMC Python API + expands the natural element into isotopes only when the materials.xml file + is created. Parameters ---------- @@ -109,7 +111,8 @@ class Element(object): percent_type : {'ao', 'wo'} 'ao' for atom percent and 'wo' for weight percent enrichment : float, optional - Enrichment percent for U235 in U. Default is None + Enrichment for U235 in weight percent. For example, input 4.95 for + 4.95 weight percent enriched U. Default is None (natural composition). cross_sections : str, optional Location of cross_sections.xml file. Default is None. @@ -123,18 +126,14 @@ class Element(object): """ - # Get the length of this elements atomic symbol - name_len = len(self.name) - # Get the nuclides present in nature natural_nuclides = set() for nuclide in sorted(NATURAL_ABUNDANCE.keys()): if re.match(r'{}\d+'.format(self.name), nuclide): - natural_nuclides.add(int(nuclide[name_len:])) + natural_nuclides.add(nuclide) - # Create lists to store the expanded nuclides and abundances - nuclides = [] - abundances = [] + # Create dict to store the expanded nuclides and abundances + abundances = {} # If cross_sections is None, get the cross sections from the # OPENMC_CROSS_SECTIONS environment variable @@ -152,9 +151,10 @@ class Element(object): nuclide = child.attrib['materials'] if re.match(r'{}\d+'.format(self.name), nuclide) and \ '_m' not in nuclide: - library_nuclides.add(int(nuclide[name_len:])) + library_nuclides.add(nuclide) - # Get a set of the mutual and absent nuclides + # Get a set of the mutual and absent nuclides. Convert to lists + # and sort to avoid different ordering between Python 2 and 3. mutual_nuclides = natural_nuclides.intersection(library_nuclides) absent_nuclides = natural_nuclides.difference(mutual_nuclides) mutual_nuclides = sorted(list(mutual_nuclides)) @@ -163,22 +163,16 @@ class Element(object): # If all natural nuclides are present in the library, expand element # using all natural nuclides if len(absent_nuclides) == 0: - for nuclide, abundance in sorted(NATURAL_ABUNDANCE.items()): - if re.match(r'{}\d+'.format(self.name), nuclide): - nuc = openmc.Nuclide(nuclide) - nuc.scattering = self.scattering - nuclides.append(nuc) - abundances.append(abundance) + for nuclide in mutual_nuclides: + abundances[nuclide] = NATURAL_ABUNDANCE[nuclide] # If no natural elements are present in the library, check if the - # 0 element is present. If so, set the abundance to 1 for this + # 0 nuclide is present. If so, set the abundance to 1 for this # nuclide. Else, raise an error. elif len(mutual_nuclides) == 0: - if 0 in library_nuclides: - nuc = openmc.Nuclide(self.name + '0') - nuc.scattering = self.scattering - nuclides.append(nuc) - abundances.append(1.0) + nuclide_0 = self.name + '0' + if nuclide_0 in library_nuclides: + abundances[nuclide_0] = 1.0 else: msg = 'Unable to expand element {0} because the cross '\ 'section library provided does not contain any of '\ @@ -187,73 +181,54 @@ class Element(object): raise ValueError(msg) # If some, but not all, natural nuclides are in the library, add - # the mutual nuclides. For the absent nuclides, increment the - # abundance of the nearest mutual nuclide with their abundances. + # the mutual nuclides. For the absent nuclides, add them based on + # our knowledge of the common cross section libraries + # (ENDF, JEFF, and JENDL) else: # Add the mutual isotopes - nuclides_a = [] - for nuclide, abundance in sorted(NATURAL_ABUNDANCE.items()): - if re.match(r'{}\d+'.format(self.name), nuclide) and \ - int(nuclide[name_len:]) in mutual_nuclides: - nuc = openmc.Nuclide(nuclide) - nuc.scattering = self.scattering - nuclides.append(nuc) - nuclides_a.append(int(nuclide[name_len:])) - abundances.append(abundance) + for nuclide in mutual_nuclides: + abundances[nuclide] = NATURAL_ABUNDANCE[nuclide] # Adjust the abundances for the absent nuclides - for nuclide, abundance in sorted(NATURAL_ABUNDANCE.items()): - if re.match(r'{}\d+'.format(self.name), nuclide) and \ - int(nuclide[name_len:]) in absent_nuclides: + for nuclide in absent_nuclides: - # Get index to the nearest nuclide - a = int(nuclide[name_len:]) - i = min(list(range(len(nuclides_a))), key=lambda j: \ - abs(nuclides_a[j] - a)) - - # Increment abundance of the nearest nuclide - abundances[i] += abundance + if nuclide == 'O18' and 'O16' in mutual_nuclides: + abundances['O16'] += NATURAL_ABUNDANCE[nuclide] + elif nuclide == 'Ta180' and 'Ta181' in mutual_nuclides: + abundances['Ta181'] += NATURAL_ABUNDANCE[nuclide] + elif nuclide == 'W180' and 'W182' in mutual_nuclides: + abundances['W182'] += NATURAL_ABUNDANCE[nuclide] + else: + msg = 'Unsure how to partition natural abundance of ' \ + 'isotope {0} into other natural isotopes of ' \ + 'this element that are present in the cross ' \ + 'section library provided. Consider adding ' \ + 'the isotopes of this element individually.' + raise ValueError(msg) # If a cross_section library is not present, expand the element into # its natural nuclides else: - for nuclide, abundance in sorted(NATURAL_ABUNDANCE.items()): - if re.match(r'{}\d+'.format(self.name), nuclide): - nuclides.append(openmc.Nuclide(nuclide)) - abundances.append(abundance) - - # Create a list of atomic masses - n_nuclides = len(nuclides) - atomic_masses = [] - for nuclide in nuclides: - atomic_masses.append(openmc.data.atomic_mass(nuclide.name)) + for nuclide in natural_nuclides: + abundances[nuclide] = NATURAL_ABUNDNACE[nuclide] # Modify mole fractions if enrichment provided if enrichment is not None: - # Get the indices for the uranium nuclides - for i,nuc in enumerate(nuclides): - if nuc.name == 'U234': - u234 = i - elif nuc.name == 'U235': - u235 = i - elif nuc.name == 'U238': - u238 = i - # Calculate the mass fractions of isotopes - abundances[u234] = 0.008 * enrichment - abundances[u235] = enrichment - abundances[u238] = 1.0 - 1.008 * enrichment + abundances['U234'] = 0.008 * enrichment + abundances['U235'] = enrichment + abundances['U238'] = 100.0 - 1.008 * enrichment # Convert the mass fractions to mole fractions - for i in range(n_nuclides): - abundances[i] /= atomic_masses[i] + for nuclide in abundances.keys(): + abundances[nuclide] /= atomic_mass(nuclide) # Normalize the mole fractions to one - sum_abundances = sum(abundances) - for i in range(n_nuclides): - abundances[i] /= sum_abundances + sum_abundances = sum(abundances.values()) + for nuclide in abundances.keys(): + abundances[nuclide] /= sum_abundances # Compute the ratio of the nuclide atomic massess to the element # atomic mass @@ -261,23 +236,23 @@ class Element(object): # Compute the element atomic mass element_am = 0. - for i in range(n_nuclides): - element_am += atomic_masses[i] * abundances[i] + for nuclide in abundances.keys(): + element_am += atomic_mass(nuclide) * abundances[nuclide] # Convert the molar fractions to mass fractions - for i in range(n_nuclides): - abundances[i] *= atomic_masses[i] / element_am + for nuclide in abundances.keys(): + abundances[nuclide] *= atomic_mass(nuclide) / element_am # Normalize the mass fractions to one - sum_abundances = sum(abundances) - for i in range(n_nuclides): - abundances[i] /= sum_abundances + sum_abundances = sum(abundances.values()) + for nuclide in abundances.keys(): + abundances[nuclide] /= sum_abundances # Create a list of the isotopes in this element isotopes = [] - for nuclide, abundance in zip(nuclides, abundances): - #pct = float('{:2.8g}'.format()) - pct = percent*abundance - isotopes.append((nuclide, pct, percent_type)) + for nuclide, abundance in abundances.items(): + nuc = openmc.Nuclide(nuclide) + nuc.scattering = self.scattering + isotopes.append((nuc, percent*abundance, percent_type)) return isotopes diff --git a/openmc/material.py b/openmc/material.py index f203878c1f..e336156428 100644 --- a/openmc/material.py +++ b/openmc/material.py @@ -418,7 +418,9 @@ class Material(object): 'ao' for atom percent and 'wo' for weight percent. Defaults to atom percent. enrichment : float, optional - Optional weight percent enrichment for uranium. Defaults to None. + Enrichment for U235 in weight percent. For example, input 4.95 for + 4.95 weight percent enriched U. Default is None + (natural composition). """ @@ -462,10 +464,10 @@ class Material(object): raise ValueError(msg) # Check that the enrichment is in the valid range - cv.check_less_than('enrichment', enrichment, 1/1.008, equality=True) + cv.check_less_than('enrichment', enrichment, 100./1.008) cv.check_greater_than('enrichment', enrichment, 0., equality=True) - if enrichment > 0.05: + if enrichment > 5.0: msg = 'A uranium enrichment of {0} was given for Material ID='\ '"{1}". OpenMC assumes the U234/U235 mass ratio is '\ 'constant at 0.008, which is only valid at low ' \ diff --git a/openmc/nuclide.py b/openmc/nuclide.py index 79b51e68a2..7d566f2d55 100644 --- a/openmc/nuclide.py +++ b/openmc/nuclide.py @@ -95,16 +95,3 @@ class Nuclide(object): raise ValueError(msg) self._scattering = scattering - - def get_element(self): - """Returns the element of a nuclide - - Returns - ------- - element : openmc.Element - Element of nuclide - - """ - - element_name = "".join(itertools.takewhile(str.isalpha, name)) - return openmc.Element(element_name) diff --git a/src/input_xml.F90 b/src/input_xml.F90 index cb65a0d351..ceff3c936f 100644 --- a/src/input_xml.F90 +++ b/src/input_xml.F90 @@ -2163,9 +2163,6 @@ contains call time_read_xs % stop() end if - ! Assign and normalize nuclide densities - call assign_nuclide_densities() - ! Clear dictionary call library_dict % clear() end subroutine read_materials @@ -2184,13 +2181,19 @@ contains integer :: index_sab ! index in sab_tables logical :: file_exists ! does materials.xml exist? character(20) :: name ! name of nuclide, e.g. 92235.03c + character(MAX_WORD_LEN) :: units ! units on density character(MAX_LINE_LEN) :: filename ! absolute path to materials.xml character(MAX_LINE_LEN) :: temp_str ! temporary string when reading + real(8) :: val ! value entered for density + real(8) :: temp_dble ! temporary double prec. real + logical :: sum_density ! density is sum of nuclide densities type(VectorChar) :: names ! temporary list of nuclide names type(VectorInt) :: list_iso_lab ! temporary list of isotropic lab scatterers + type(VectorReal) :: densities ! temporary list of nuclide densities type(Material), pointer :: mat => null() type(Node), pointer :: doc => null() type(Node), pointer :: node_mat => null() + type(Node), pointer :: node_dens => null() type(Node), pointer :: node_nuc => null() type(Node), pointer :: node_sab => null() type(NodeList), pointer :: node_mat_list => null() @@ -2252,6 +2255,60 @@ contains material_temps(i) = ERROR_REAL end if + ! Get pointer to density element + if (check_for_node(node_mat, "density")) then + call get_node_ptr(node_mat, "density", node_dens) + else + call fatal_error("Must specify density element in material " & + // trim(to_str(mat % id))) + end if + + ! Copy units + call get_node_value(node_dens, "units", units) + + ! If the units is 'sum', then the total density of the material is taken + ! to be the sum of the atom fractions listed on the nuclides + if (units == 'sum') then + sum_density = .true. + + else if (units == 'macro') then + if (check_for_node(node_dens, "value")) then + call get_node_value(node_dens, "value", val) + else + val = ONE + end if + + ! Set density + mat % density = val + + sum_density = .false. + + else + call get_node_value(node_dens, "value", val) + + ! Check for erroneous density + sum_density = .false. + if (val <= ZERO) then + call fatal_error("Need to specify a positive density on material " & + // trim(to_str(mat % id)) // ".") + end if + + ! Adjust material density based on specified units + select case(to_lower(units)) + case ('g/cc', 'g/cm3') + mat % density = -val + case ('kg/m3') + mat % density = -0.001_8 * val + case ('atom/b-cm') + mat % density = val + case ('atom/cm3', 'atom/cc') + mat % density = 1.0e-24_8 * val + case default + call fatal_error("Unkwown units '" // trim(units) & + // "' specified on material " // trim(to_str(mat % id))) + end select + end if + ! ======================================================================= ! READ AND PARSE TAGS @@ -2290,6 +2347,15 @@ contains ! save name to list call names % push_back(name) + + ! Check if no atom/weight percents were specified or if both atom and + ! weight percents were specified + if (units == 'macro') then + call densities % push_back(ONE) + else + call fatal_error("Units can only be macro for macroscopic data " & + // trim(name)) + end if else ! Get pointer list of XML @@ -2306,6 +2372,31 @@ contains // trim(to_str(mat % id))) end if + ! Check if no atom/weight percents were specified or if both atom and + ! weight percents were specified + if (units == 'macro') then + call densities % push_back(ONE) + else + if (.not. check_for_node(node_nuc, "ao") .and. & + .not. check_for_node(node_nuc, "wo")) then + call fatal_error("No atom or weight percent specified for & + &nuclide" // trim(name)) + elseif (check_for_node(node_nuc, "ao") .and. & + check_for_node(node_nuc, "wo")) then + call fatal_error("Cannot specify both atom and weight percents & + &for a nuclide: " // trim(name)) + end if + + ! Copy atom/weight percents + if (check_for_node(node_nuc, "ao")) then + call get_node_value(node_nuc, "ao", temp_dble) + call densities % push_back(temp_dble) + else + call get_node_value(node_nuc, "wo", temp_dble) + call densities % push_back(-temp_dble) + end if + end if + ! Check enforced isotropic lab scattering if (run_CE) then if (check_for_node(node_nuc, "scattering")) then @@ -2374,6 +2465,7 @@ contains ! Copy name and atom/weight percent mat % names(j) = name + mat % atom_density(j) = densities % data(j) ! Cast integer isotropic lab scattering flag to boolean if (run_CE) then @@ -2386,8 +2478,20 @@ contains end do ALL_NUCLIDES + ! Check to make sure either all atom percents or all weight percents are + ! given + if (.not. (all(mat % atom_density >= ZERO) .or. & + all(mat % atom_density <= ZERO))) then + call fatal_error("Cannot mix atom and weight percents in material " & + // to_str(mat % id)) + end if + + ! Determine density if it is a sum value + if (sum_density) mat % density = sum(mat % atom_density) + ! Clear lists call names % clear() + call densities % clear() call list_iso_lab % clear() ! ======================================================================= @@ -4631,207 +4735,18 @@ contains end do end subroutine generate_rpn -!=============================================================================== -! ASSIGN_NUCLIDE_DENSITIES Read in the nuclide densities from materials.xml -! and assign to the corresponding nuclides. -!=============================================================================== - - subroutine assign_nuclide_densities() - integer :: i ! index in materials array - integer :: j ! index over nuclides in material - logical :: file_exists ! does materials.xml exist? - character(20) :: name ! name of nuclide, e.g. 92235.03c - character(MAX_WORD_LEN) :: units ! units on density - character(MAX_LINE_LEN) :: filename ! materials.xml filename - real(8) :: val ! value entered for density - real(8) :: temp_dble ! temporary double prec. real - logical :: sum_density ! density is sum of nuclide densities - type(VectorReal) :: densities ! temporary list of nuclide densities - type(Material), pointer :: mat => null() - type(Node), pointer :: doc => null() - type(Node), pointer :: node_mat => null() - type(Node), pointer :: node_dens => null() - type(Node), pointer :: node_nuc => null() - type(NodeList), pointer :: node_mat_list => null() - type(NodeList), pointer :: node_nuc_list => null() - type(NodeList), pointer :: node_macro_list => null() - - ! Display output message - call write_message("Reading material densities from XML file...", 5) - - ! Check is materials.xml exists - filename = trim(path_input) // "materials.xml" - inquire(FILE=filename, EXIST=file_exists) - if (.not. file_exists) then - call fatal_error("Material XML file '" // trim(filename) // "' does not & - &exist!") - end if - - ! Parse materials.xml file - call open_xmldoc(doc, filename) - - ! Get pointer to list of XML - call get_node_list(doc, "material", node_mat_list) - - do i = 1, n_materials - mat => materials(i) - - ! Get pointer to i-th material node - call get_list_item(node_mat_list, i, node_mat) - - ! Get pointer to density element - if (check_for_node(node_mat, "density")) then - call get_node_ptr(node_mat, "density", node_dens) - else - call fatal_error("Must specify density element in material " & - // trim(to_str(mat % id))) - end if - - ! Copy units - call get_node_value(node_dens, "units", units) - - ! If the units is 'sum', then the total density of the material is taken - ! to be the sum of the atom fractions listed on the nuclides - if (units == 'sum') then - sum_density = .true. - - else if (units == 'macro') then - if (check_for_node(node_dens, "value")) then - call get_node_value(node_dens, "value", val) - else - val = ONE - end if - - ! Set density - mat % density = val - - sum_density = .false. - - else - call get_node_value(node_dens, "value", val) - - ! Check for erroneous density - sum_density = .false. - if (val <= ZERO) then - call fatal_error("Need to specify a positive density on material " & - // trim(to_str(mat % id)) // ".") - end if - - ! Adjust material density based on specified units - select case(to_lower(units)) - case ('g/cc', 'g/cm3') - mat % density = -val - case ('kg/m3') - mat % density = -0.001_8 * val - case ('atom/b-cm') - mat % density = val - case ('atom/cm3', 'atom/cc') - mat % density = 1.0e-24_8 * val - case default - call fatal_error("Unkwown units '" // trim(units) & - // "' specified on material " // trim(to_str(mat % id))) - end select - end if - - ! ======================================================================== - ! READ IN NUCLIDE DENSITIES - - ! Get pointer list of XML - call get_node_list(node_mat, "macroscopic", node_macro_list) - if (get_list_size(node_macro_list) == 1) then - - call get_list_item(node_macro_list, 1, node_nuc) - - ! store nuclide name - call get_node_value(node_nuc, "name", name) - name = trim(name) - - ! Check if no atom/weight percents were specified or if both atom and - ! weight percents were specified - if (units == 'macro') then - call densities % push_back(ONE) - else - call fatal_error("Units can only be macro for macroscopic data " & - // trim(name)) - end if - else - - ! Get pointer list of XML - call get_node_list(node_mat, "nuclide", node_nuc_list) - - ! Create list of nuclides based on those specified - INDIVIDUAL_NUCLIDES: do j = 1, get_list_size(node_nuc_list) - - ! Combine nuclide identifier and cross section and copy into names - call get_list_item(node_nuc_list, j, node_nuc) - - ! store nuclide name - call get_node_value(node_nuc, "name", name) - name = trim(name) - - ! Check if no atom/weight percents were specified or if both atom and - ! weight percents were specified - if (units == 'macro') then - call densities % push_back(ONE) - else - if (.not. check_for_node(node_nuc, "ao") .and. & - .not. check_for_node(node_nuc, "wo")) then - call fatal_error("No atom or weight percent specified for & - &nuclide" // trim(name)) - elseif (check_for_node(node_nuc, "ao") .and. & - check_for_node(node_nuc, "wo")) then - call fatal_error("Cannot specify both atom and weight percents & - &for a nuclide: " // trim(name)) - end if - - ! Copy atom/weight percents - if (check_for_node(node_nuc, "ao")) then - call get_node_value(node_nuc, "ao", temp_dble) - call densities % push_back(temp_dble) - else - call get_node_value(node_nuc, "wo", temp_dble) - call densities % push_back(-temp_dble) - end if - end if - end do INDIVIDUAL_NUCLIDES - end if - - ! ======================================================================== - ! SET MATERIAL ATOM DENSITIES - - ALL_NUCLIDES: do j = 1, mat % n_nuclides - mat % atom_density(j) = densities % data(j) - end do ALL_NUCLIDES - - ! Check to make sure either all atom percents or all weight percents are - ! given - if (.not. (all(mat % atom_density >= ZERO) .or. & - all(mat % atom_density <= ZERO))) then - call fatal_error("Cannot mix atom and weight percents in material " & - // to_str(mat % id)) - end if - - ! Determine density if it is a sum value - if (sum_density) mat % density = sum(mat % atom_density) - - ! Clear lists - call densities % clear() - end do - - end subroutine assign_nuclide_densities - !=============================================================================== ! NORMALIZE_AO Normalize the nuclide atom percents !=============================================================================== subroutine normalize_ao() - integer :: i ! index in materials array - integer :: j ! index over nuclides in material - real(8) :: sum_percent ! summation - real(8) :: awr ! atomic weight ratio - real(8) :: x ! atom percent - logical :: percent_in_atom ! nuclides specified in atom percent? - logical :: density_in_atom ! density specified in atom/b-cm? + integer :: i ! index in materials array + integer :: j ! index over nuclides in material + real(8) :: sum_percent ! summation + real(8) :: awr ! atomic weight ratio + real(8) :: x ! atom percent + logical :: percent_in_atom ! nuclides specified in atom percent? + logical :: density_in_atom ! density specified in atom/b-cm? do i = 1, size(materials) associate (mat => materials(i)) diff --git a/src/relaxng/materials.rnc b/src/relaxng/materials.rnc index c5f4efd6f3..134fb86cae 100644 --- a/src/relaxng/materials.rnc +++ b/src/relaxng/materials.rnc @@ -42,4 +42,8 @@ element materials { (element name { xsd:string } | attribute name { xsd:string }) }* }+ + + element cross_sections { xsd:string { maxLength = "255" } }? & + + element multipole_library { xsd:string { maxLength = "255" } }? & } diff --git a/src/relaxng/settings.rnc b/src/relaxng/settings.rnc index b05ab7d6b5..62d9451c3d 100644 --- a/src/relaxng/settings.rnc +++ b/src/relaxng/settings.rnc @@ -25,10 +25,6 @@ element settings { } ) & - element cross_sections { xsd:string { maxLength = "255" } }? & - - element multipole_library { xsd:string { maxLength = "255" } }? & - element cutoff { (element weight { xsd:double } | attribute weight { xsd:double })? & (element weight_avg { xsd:double } | attribute weight_avg { xsd:double })? diff --git a/tests/input_set.py b/tests/input_set.py index 458c1ef35e..7971a8a4cc 100644 --- a/tests/input_set.py +++ b/tests/input_set.py @@ -524,31 +524,22 @@ class PinCellInputSet(object): # Instantiate ZCylinder surfaces fuel_or = openmc.ZCylinder(x0=0, y0=0, R=0.39218, name='Fuel OR') clad_or = openmc.ZCylinder(x0=0, y0=0, R=0.45720, name='Clad OR') - left = openmc.XPlane(x0=-0.63, name='left') - right = openmc.XPlane(x0=0.63, name='right') - bottom = openmc.YPlane(y0=-0.63, name='bottom') - top = openmc.YPlane(y0=0.63, name='top') - - left.boundary_type = 'reflective' - right.boundary_type = 'reflective' - top.boundary_type = 'reflective' - bottom.boundary_type = 'reflective' + left = openmc.XPlane(x0=-0.63, name='left', boundary_type='reflective') + right = openmc.XPlane(x0=0.63, name='right', boundary_type='reflective') + bottom = openmc.YPlane(y0=-0.63, name='bottom', + boundary_type='reflective') + top = openmc.YPlane(y0=0.63, name='top', boundary_type='reflective') # Instantiate Cells - fuel_pin = openmc.Cell(name='cell 1') - cladding = openmc.Cell(name='cell 3') - water = openmc.Cell(name='cell 2') + fuel_pin = openmc.Cell(name='cell 1', fill=fuel) + cladding = openmc.Cell(name='cell 3', fill=clad) + water = openmc.Cell(name='cell 2', fill=hot_water) # Use surface half-spaces to define regions fuel_pin.region = -fuel_or cladding.region = +fuel_or & -clad_or water.region = +clad_or & +left & -right & +bottom & -top - # Register Materials with Cells - fuel_pin.fill = fuel - cladding.fill = clad - water.fill = hot_water - # Instantiate Universe root = openmc.Universe(universe_id=0, name='root universe') diff --git a/tests/test_element_wo/inputs_true.dat b/tests/test_element_wo/inputs_true.dat deleted file mode 100644 index da97abc339..0000000000 --- a/tests/test_element_wo/inputs_true.dat +++ /dev/null @@ -1 +0,0 @@ -f270ae43a29c53065678b419629ad713f5a4cc23c75825fee4da049d4159756f463fec86263a8dea6ce10fff6d60b24ebf100e8f5cc80e6d4fc31297ae1709ed \ No newline at end of file diff --git a/tests/test_element_wo/results_true.dat b/tests/test_element_wo/results_true.dat deleted file mode 100644 index 6ff7f2872e..0000000000 --- a/tests/test_element_wo/results_true.dat +++ /dev/null @@ -1,5 +0,0 @@ -k-combined: -8.781218E-01 2.426380E-02 -tally 1: -8.505928E+01 -1.447208E+03 diff --git a/tests/test_element_wo/test_element_wo.py b/tests/test_element_wo/test_element_wo.py index 1acb73137a..de3957f31e 100644 --- a/tests/test_element_wo/test_element_wo.py +++ b/tests/test_element_wo/test_element_wo.py @@ -1,98 +1,37 @@ #!/usr/bin/env python -import os -import sys -import glob -import hashlib -sys.path.insert(0, os.pardir) -from testing_harness import PyAPITestHarness -from input_set import PinCellInputSet +import numpy as np import openmc -import openmc.mgxs - - -class ElementWOTestHarness(PyAPITestHarness): - def _build_inputs(self): - - # Set the input set to use the pincell model - self._input_set = PinCellInputSet() - - # Define materials. - fuel = openmc.Material(name='Fuel') - fuel.set_density('g/cm3', 10.29769) - fuel.add_element("U", 0.88, 'wo') - fuel.add_element("O", 0.12, 'wo') - - # Add some natural elements to the fuel - for element in ['Ir', 'Au', 'Hg', 'Tl', 'Pb', 'Bi', 'Th', 'Pa']: - fuel.add_element(element, 1.e-8, 'wo') - - clad = openmc.Material(name='Cladding') - clad.set_density('g/cm3', 6.55) - clad.add_element("Zr", 1.0, 'wo') - - hot_water = openmc.Material(name='Hot borated water') - hot_water.set_density('g/cm3', 0.740582) - hot_water.add_element("H", 0.1111, 'wo') - hot_water.add_element("O", 0.8889, 'wo') - hot_water.add_s_alpha_beta('c_H_in_H2O') - - # Define the materials file. - self._input_set.materials += (fuel, clad, hot_water) - - # Instantiate ZCylinder surfaces - fuel_or = openmc.ZCylinder(x0=0, y0=0, R=0.39218, name='Fuel OR') - clad_or = openmc.ZCylinder(x0=0, y0=0, R=0.45720, name='Clad OR') - left = openmc.XPlane(x0=-0.63, name='left') - right = openmc.XPlane(x0=0.63, name='right') - bottom = openmc.YPlane(y0=-0.63, name='bottom') - top = openmc.YPlane(y0=0.63, name='top') - - left.boundary_type = 'reflective' - right.boundary_type = 'reflective' - top.boundary_type = 'reflective' - bottom.boundary_type = 'reflective' - - # Instantiate Cells - fuel_pin = openmc.Cell(name='cell 1') - cladding = openmc.Cell(name='cell 3') - water = openmc.Cell(name='cell 2') - - # Use surface half-spaces to define regions - fuel_pin.region = -fuel_or - cladding.region = +fuel_or & -clad_or - water.region = +clad_or & +left & -right & +bottom & -top - - # Register Materials with Cells - fuel_pin.fill = fuel - cladding.fill = clad - water.fill = hot_water - - # Instantiate Universe - root = openmc.Universe(universe_id=0, name='root universe') - - # Register Cells with Universe - root.add_cells([fuel_pin, cladding, water]) - - # Instantiate a Geometry, register the root Universe, and export to XML - self._input_set.geometry.root_universe = root - - mat_filter = openmc.MaterialFilter((fuel.id,)) - flux_tally = openmc.Tally() - flux_tally.filters = [mat_filter] - flux_tally.scores = ['flux'] - - self._input_set.tallies = openmc.Tallies() - self._input_set.tallies += [flux_tally] - self._input_set.build_default_settings() - self._input_set.export() - - def _cleanup(self): - super(ElementWOTestHarness, self)._cleanup() - f = os.path.join(os.getcwd(), 'tallies.xml') - if os.path.exists(f): os.remove(f) +from openmc.data import NATURAL_ABUNDANCE, atomic_mass if __name__ == '__main__': - harness = ElementWOTestHarness('statepoint.10.*', True) - harness.main() + # This test doesn't require an OpenMC run. We just need to make sure the + # element.expand() method expands elements with the proper nuclide + # compositions. + + h_am = (NATURAL_ABUNDANCE['H1'] * atomic_mass('H1') + + NATURAL_ABUNDANCE['H2'] * atomic_mass('H2')) + o_am = (NATURAL_ABUNDANCE['O17'] * atomic_mass('O17') + + (NATURAL_ABUNDANCE['O16'] + NATURAL_ABUNDANCE['O18']) + * atomic_mass('O16')) + water_am = 2 * h_am + o_am + + water = openmc.Material() + water.add_element('O', o_am / water_am, 'wo') + water.add_element('H', 2 * h_am / water_am, 'wo') + densities = water.get_nuclide_densities() + + for nuc in densities.keys(): + assert nuc in ('H1', 'H2', 'O16', 'O17') + + if nuc in ('H1', 'H2'): + val = 2 * NATURAL_ABUNDANCE[nuc] * atomic_mass(nuc) / water_am + assert np.isclose(densities[nuc][1], val, rtol=1.e-8) + if nuc == 'O16': + val = (NATURAL_ABUNDANCE[nuc] + NATURAL_ABUNDANCE['O18']) \ + * atomic_mass(nuc) / water_am + assert np.isclose(densities[nuc][1], val, rtol=1.e-8) + if nuc == 'O17': + val = NATURAL_ABUNDANCE[nuc] * atomic_mass(nuc) / water_am + assert np.isclose(densities[nuc][1], val, rtol=1.e-8) diff --git a/tests/test_enrichment/inputs_true.dat b/tests/test_enrichment/inputs_true.dat deleted file mode 100644 index 49acd2945a..0000000000 --- a/tests/test_enrichment/inputs_true.dat +++ /dev/null @@ -1 +0,0 @@ -835357f7b3c10f1153bb5842978075d9bb788d639759f143dfe58064865712fdf4e17ce50747949411e7c5215f33371e883e48b670509e222fa338bbfe613b80 \ No newline at end of file diff --git a/tests/test_enrichment/results_true.dat b/tests/test_enrichment/results_true.dat deleted file mode 100644 index b457c2071c..0000000000 --- a/tests/test_enrichment/results_true.dat +++ /dev/null @@ -1,5 +0,0 @@ -k-combined: -1.508419E+00 3.763047E-02 -tally 1: -6.274668E+01 -7.902869E+02 diff --git a/tests/test_enrichment/test_enrichment.py b/tests/test_enrichment/test_enrichment.py index ac22f43ed4..ffc1074904 100644 --- a/tests/test_enrichment/test_enrichment.py +++ b/tests/test_enrichment/test_enrichment.py @@ -1,94 +1,26 @@ #!/usr/bin/env python -import os -import sys -import glob -import hashlib -sys.path.insert(0, os.pardir) -from testing_harness import PyAPITestHarness -from input_set import PinCellInputSet +import numpy as np import openmc -import openmc.mgxs - - -class EnrichmentTestHarness(PyAPITestHarness): - def _build_inputs(self): - - # Set the input set to use the pincell model - self._input_set = PinCellInputSet() - - # Define materials. - fuel = openmc.Material(name='Fuel') - fuel.set_density('g/cm3', 10.29769) - fuel.add_element("U", 0.88, 'wo', enrichment=0.0495) - fuel.add_element("O", 0.12, 'wo') - - clad = openmc.Material(name='Cladding') - clad.set_density('g/cm3', 6.55) - clad.add_element("Zr", 1.0, 'wo') - - hot_water = openmc.Material(name='Hot borated water') - hot_water.set_density('g/cm3', 0.740582) - hot_water.add_element("H", 0.1111, 'wo') - hot_water.add_element("O", 0.8889, 'wo') - hot_water.add_s_alpha_beta('c_H_in_H2O') - - # Define the materials file. - self._input_set.materials += (fuel, clad, hot_water) - - # Instantiate ZCylinder surfaces - fuel_or = openmc.ZCylinder(x0=0, y0=0, R=0.39218, name='Fuel OR') - clad_or = openmc.ZCylinder(x0=0, y0=0, R=0.45720, name='Clad OR') - left = openmc.XPlane(x0=-0.63, name='left') - right = openmc.XPlane(x0=0.63, name='right') - bottom = openmc.YPlane(y0=-0.63, name='bottom') - top = openmc.YPlane(y0=0.63, name='top') - - left.boundary_type = 'reflective' - right.boundary_type = 'reflective' - top.boundary_type = 'reflective' - bottom.boundary_type = 'reflective' - - # Instantiate Cells - fuel_pin = openmc.Cell(name='cell 1') - cladding = openmc.Cell(name='cell 3') - water = openmc.Cell(name='cell 2') - - # Use surface half-spaces to define regions - fuel_pin.region = -fuel_or - cladding.region = +fuel_or & -clad_or - water.region = +clad_or & +left & -right & +bottom & -top - - # Register Materials with Cells - fuel_pin.fill = fuel - cladding.fill = clad - water.fill = hot_water - - # Instantiate Universe - root = openmc.Universe(universe_id=0, name='root universe') - - # Register Cells with Universe - root.add_cells([fuel_pin, cladding, water]) - - # Instantiate a Geometry, register the root Universe, and export to XML - self._input_set.geometry.root_universe = root - - mat_filter = openmc.MaterialFilter((fuel.id,)) - flux_tally = openmc.Tally() - flux_tally.filters = [mat_filter] - flux_tally.scores = ['flux'] - - self._input_set.tallies = openmc.Tallies() - self._input_set.tallies += [flux_tally] - self._input_set.build_default_settings() - self._input_set.export() - - def _cleanup(self): - super(EnrichmentTestHarness, self)._cleanup() - f = os.path.join(os.getcwd(), 'tallies.xml') - if os.path.exists(f): os.remove(f) if __name__ == '__main__': - harness = EnrichmentTestHarness('statepoint.10.*', True) - harness.main() + # This test doesn't require an OpenMC run. We just need to make sure the + # element.expand() method expands Uranium to the proper enrichment. + + uranium = openmc.Material() + uranium.add_element('U', 1.0, 'wo', 4.95) + densities = uranium.get_nuclide_densities() + + sum_densities = 0. + for nuc in densities.keys(): + assert nuc in ('U234', 'U235', 'U238') + sum_densities += densities[nuc][1] + + # Compute the weight percent U235 + enrichment = densities['U235'][1] / sum_densities + assert np.isclose(enrichment, 0.0495, rtol=1.e-8) + + # Compute the ratio of U234/U235 + u234_to_u235 = densities['U234'][1] / densities['U235'][1] + assert np.isclose(u234_to_u235, 0.008, rtol=1.e-8) From 8a02b76b96d4c3c1a013a4a22dafa0f4a61d394d Mon Sep 17 00:00:00 2001 From: Sam Shaner Date: Tue, 25 Oct 2016 21:13:14 -0400 Subject: [PATCH 22/34] fixed typo and moved a section of code in input_xml.F90 --- openmc/element.py | 2 +- src/input_xml.F90 | 52 +++++++++++++++++++++++------------------------ 2 files changed, 26 insertions(+), 28 deletions(-) diff --git a/openmc/element.py b/openmc/element.py index 27046266d5..3bc7345947 100644 --- a/openmc/element.py +++ b/openmc/element.py @@ -230,7 +230,7 @@ class Element(object): for nuclide in abundances.keys(): abundances[nuclide] /= sum_abundances - # Compute the ratio of the nuclide atomic massess to the element + # Compute the ratio of the nuclide atomic masses to the element # atomic mass if percent_type == 'wo': diff --git a/src/input_xml.F90 b/src/input_xml.F90 index ceff3c936f..c5c35d710c 100644 --- a/src/input_xml.F90 +++ b/src/input_xml.F90 @@ -2348,8 +2348,7 @@ contains ! save name to list call names % push_back(name) - ! Check if no atom/weight percents were specified or if both atom and - ! weight percents were specified + ! Set density for macroscopic data if (units == 'macro') then call densities % push_back(ONE) else @@ -2372,31 +2371,6 @@ contains // trim(to_str(mat % id))) end if - ! Check if no atom/weight percents were specified or if both atom and - ! weight percents were specified - if (units == 'macro') then - call densities % push_back(ONE) - else - if (.not. check_for_node(node_nuc, "ao") .and. & - .not. check_for_node(node_nuc, "wo")) then - call fatal_error("No atom or weight percent specified for & - &nuclide" // trim(name)) - elseif (check_for_node(node_nuc, "ao") .and. & - check_for_node(node_nuc, "wo")) then - call fatal_error("Cannot specify both atom and weight percents & - &for a nuclide: " // trim(name)) - end if - - ! Copy atom/weight percents - if (check_for_node(node_nuc, "ao")) then - call get_node_value(node_nuc, "ao", temp_dble) - call densities % push_back(temp_dble) - else - call get_node_value(node_nuc, "wo", temp_dble) - call densities % push_back(-temp_dble) - end if - end if - ! Check enforced isotropic lab scattering if (run_CE) then if (check_for_node(node_nuc, "scattering")) then @@ -2421,6 +2395,30 @@ contains ! save name to list call names % push_back(name) + ! Check if no atom/weight percents were specified or if both atom and + ! weight percents were specified + if (units == 'macro') then + call densities % push_back(ONE) + else + if (.not. check_for_node(node_nuc, "ao") .and. & + .not. check_for_node(node_nuc, "wo")) then + call fatal_error("No atom or weight percent specified for & + &nuclide" // trim(name)) + elseif (check_for_node(node_nuc, "ao") .and. & + check_for_node(node_nuc, "wo")) then + call fatal_error("Cannot specify both atom and weight percents & + &for a nuclide: " // trim(name)) + end if + + ! Copy atom/weight percents + if (check_for_node(node_nuc, "ao")) then + call get_node_value(node_nuc, "ao", temp_dble) + call densities % push_back(temp_dble) + else + call get_node_value(node_nuc, "wo", temp_dble) + call densities % push_back(-temp_dble) + end if + end if end do INDIVIDUAL_NUCLIDES end if From 0639ba3c81a85f98c674534f74e057ed2f3d1371 Mon Sep 17 00:00:00 2001 From: samuel shaner Date: Wed, 26 Oct 2016 01:44:14 +0000 Subject: [PATCH 23/34] changed triso test to use elements --- tests/test_triso/inputs_true.dat | 2 +- tests/test_triso/results_true.dat | 2 +- tests/test_triso/test_triso.py | 17 ++++++++--------- 3 files changed, 10 insertions(+), 11 deletions(-) diff --git a/tests/test_triso/inputs_true.dat b/tests/test_triso/inputs_true.dat index 47837fc7c4..856581fdef 100644 --- a/tests/test_triso/inputs_true.dat +++ b/tests/test_triso/inputs_true.dat @@ -1 +1 @@ -3fdba48bb553aa75723e9ab226aeb873d4ebfc5934081263cf27063645e63036ec1088f1977fa38f45a95ed793bdb7b2a0e7a1f948b2a5b5b366110df72e8f0d \ No newline at end of file +5859cd73807c74cce612275817d3e1c6a2b55a347b31925115dbda2d83df60345ea4617cbc3b057a2fcfef4242f0e53d66d569ecffaeed35975ca28307b354c4 \ No newline at end of file diff --git a/tests/test_triso/results_true.dat b/tests/test_triso/results_true.dat index 15107e8c84..1716b67f53 100644 --- a/tests/test_triso/results_true.dat +++ b/tests/test_triso/results_true.dat @@ -1,2 +1,2 @@ k-combined: -1.636336E+00 1.154000E-01 +1.643727E+00 5.233644E-02 diff --git a/tests/test_triso/test_triso.py b/tests/test_triso/test_triso.py index 685034491f..e79b9fa8c8 100644 --- a/tests/test_triso/test_triso.py +++ b/tests/test_triso/test_triso.py @@ -19,34 +19,33 @@ class TRISOTestHarness(PyAPITestHarness): # Define TRISO matrials fuel = openmc.Material() fuel.set_density('g/cm3', 10.5) - fuel.add_nuclide('U235', 0.14154) - fuel.add_nuclide('U238', 0.85846) - fuel.add_nuclide('C0', 0.5) - fuel.add_nuclide('O16', 1.5) + fuel.add_element('U', 0.14154, 'ao', 14.0) + fuel.add_element('C', 0.5) + fuel.add_element('O', 1.5) porous_carbon = openmc.Material() porous_carbon.set_density('g/cm3', 1.0) - porous_carbon.add_nuclide('C0', 1.0) + porous_carbon.add_element('C', 1.0) porous_carbon.add_s_alpha_beta('c_Graphite') ipyc = openmc.Material() ipyc.set_density('g/cm3', 1.90) - ipyc.add_nuclide('C0', 1.0) + ipyc.add_element('C', 1.0) ipyc.add_s_alpha_beta('c_Graphite') sic = openmc.Material() sic.set_density('g/cm3', 3.20) sic.add_element('Si', 1.0) - sic.add_nuclide('C0', 1.0) + sic.add_element('C', 1.0) opyc = openmc.Material() opyc.set_density('g/cm3', 1.87) - opyc.add_nuclide('C0', 1.0) + opyc.add_element('C', 1.0) opyc.add_s_alpha_beta('c_Graphite') graphite = openmc.Material() graphite.set_density('g/cm3', 1.1995) - graphite.add_nuclide('C0', 1.0) + graphite.add_element('C', 1.0) graphite.add_s_alpha_beta('c_Graphite') # Create TRISO particles From 6c4da4795acbc872a25c0a914730e02dcfc5611e Mon Sep 17 00:00:00 2001 From: Sam Shaner Date: Wed, 26 Oct 2016 07:45:59 -0400 Subject: [PATCH 24/34] added path insert to failing tests --- tests/test_element_wo/test_element_wo.py | 9 +++++++-- tests/test_enrichment/test_enrichment.py | 10 ++++++++-- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/tests/test_element_wo/test_element_wo.py b/tests/test_element_wo/test_element_wo.py index de3957f31e..b272077d6d 100644 --- a/tests/test_element_wo/test_element_wo.py +++ b/tests/test_element_wo/test_element_wo.py @@ -1,7 +1,12 @@ #!/usr/bin/env python +import os +import sys + import numpy as np -import openmc + +sys.path.insert(0, os.pardir) +from openmc import Material from openmc.data import NATURAL_ABUNDANCE, atomic_mass @@ -17,7 +22,7 @@ if __name__ == '__main__': * atomic_mass('O16')) water_am = 2 * h_am + o_am - water = openmc.Material() + water = Material() water.add_element('O', o_am / water_am, 'wo') water.add_element('H', 2 * h_am / water_am, 'wo') densities = water.get_nuclide_densities() diff --git a/tests/test_enrichment/test_enrichment.py b/tests/test_enrichment/test_enrichment.py index ffc1074904..74fc234f88 100644 --- a/tests/test_enrichment/test_enrichment.py +++ b/tests/test_enrichment/test_enrichment.py @@ -1,14 +1,20 @@ #!/usr/bin/env python +import os +import sys + import numpy as np -import openmc + +sys.path.insert(0, os.pardir) +from openmc import Material +from openmc.data import NATURAL_ABUNDANCE, atomic_mass if __name__ == '__main__': # This test doesn't require an OpenMC run. We just need to make sure the # element.expand() method expands Uranium to the proper enrichment. - uranium = openmc.Material() + uranium = Material() uranium.add_element('U', 1.0, 'wo', 4.95) densities = uranium.get_nuclide_densities() From c8c98f79dcb77f14c0c7b4d1d93d6a03e5b50140 Mon Sep 17 00:00:00 2001 From: Sam Shaner Date: Wed, 26 Oct 2016 08:12:26 -0400 Subject: [PATCH 25/34] updated failing tests --- openmc/material.py | 4 ++-- tests/test_element_wo/test_element_wo.py | 1 + tests/test_enrichment/test_enrichment.py | 1 + tests/test_triso/inputs_true.dat | 2 +- tests/test_triso/results_true.dat | 2 +- 5 files changed, 6 insertions(+), 4 deletions(-) diff --git a/openmc/material.py b/openmc/material.py index e336156428..ba70e09b5a 100644 --- a/openmc/material.py +++ b/openmc/material.py @@ -587,9 +587,9 @@ class Material(object): if not distrib: if nuclide[2] == 'ao': - xml_element.set("ao", str(nuclide[1])) + xml_element.set("ao", '{0:.12f}'.format(nuclide[1])) else: - xml_element.set("wo", str(nuclide[1])) + xml_element.set("wo", '{0:.12f}'.format(nuclide[1])) if not nuclide[0].scattering is None: xml_element.set("scattering", nuclide[0].scattering) diff --git a/tests/test_element_wo/test_element_wo.py b/tests/test_element_wo/test_element_wo.py index b272077d6d..e2a5726f19 100644 --- a/tests/test_element_wo/test_element_wo.py +++ b/tests/test_element_wo/test_element_wo.py @@ -6,6 +6,7 @@ import sys import numpy as np sys.path.insert(0, os.pardir) +sys.path.insert(0, os.path.join(os.pardir, os.pardir)) from openmc import Material from openmc.data import NATURAL_ABUNDANCE, atomic_mass diff --git a/tests/test_enrichment/test_enrichment.py b/tests/test_enrichment/test_enrichment.py index 74fc234f88..48416885b8 100644 --- a/tests/test_enrichment/test_enrichment.py +++ b/tests/test_enrichment/test_enrichment.py @@ -6,6 +6,7 @@ import sys import numpy as np sys.path.insert(0, os.pardir) +sys.path.insert(0, os.path.join(os.pardir, os.pardir)) from openmc import Material from openmc.data import NATURAL_ABUNDANCE, atomic_mass diff --git a/tests/test_triso/inputs_true.dat b/tests/test_triso/inputs_true.dat index 856581fdef..f4d79a7ab6 100644 --- a/tests/test_triso/inputs_true.dat +++ b/tests/test_triso/inputs_true.dat @@ -1 +1 @@ -5859cd73807c74cce612275817d3e1c6a2b55a347b31925115dbda2d83df60345ea4617cbc3b057a2fcfef4242f0e53d66d569ecffaeed35975ca28307b354c4 \ No newline at end of file +790bb9e31e72798b9407e5daba696fa35f7240feb59a99c081b96afdd5120aa9afe45b791e3293e01ae699512567feaeb7c4a77a592f781bd70a7900c9e28eae \ No newline at end of file diff --git a/tests/test_triso/results_true.dat b/tests/test_triso/results_true.dat index 1716b67f53..71805055c6 100644 --- a/tests/test_triso/results_true.dat +++ b/tests/test_triso/results_true.dat @@ -1,2 +1,2 @@ k-combined: -1.643727E+00 5.233644E-02 +1.572877E+00 1.337067E-02 From 163f153ab69366592becd6c67f8a1160ce5c0999 Mon Sep 17 00:00:00 2001 From: samuel shaner Date: Wed, 26 Oct 2016 13:45:12 +0000 Subject: [PATCH 26/34] reverted material to outputting full atomic amount to xml file --- openmc/material.py | 4 ++-- tests/test_triso/inputs_true.dat | 2 +- tests/test_triso/results_true.dat | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/openmc/material.py b/openmc/material.py index ba70e09b5a..e336156428 100644 --- a/openmc/material.py +++ b/openmc/material.py @@ -587,9 +587,9 @@ class Material(object): if not distrib: if nuclide[2] == 'ao': - xml_element.set("ao", '{0:.12f}'.format(nuclide[1])) + xml_element.set("ao", str(nuclide[1])) else: - xml_element.set("wo", '{0:.12f}'.format(nuclide[1])) + xml_element.set("wo", str(nuclide[1])) if not nuclide[0].scattering is None: xml_element.set("scattering", nuclide[0].scattering) diff --git a/tests/test_triso/inputs_true.dat b/tests/test_triso/inputs_true.dat index f4d79a7ab6..856581fdef 100644 --- a/tests/test_triso/inputs_true.dat +++ b/tests/test_triso/inputs_true.dat @@ -1 +1 @@ -790bb9e31e72798b9407e5daba696fa35f7240feb59a99c081b96afdd5120aa9afe45b791e3293e01ae699512567feaeb7c4a77a592f781bd70a7900c9e28eae \ No newline at end of file +5859cd73807c74cce612275817d3e1c6a2b55a347b31925115dbda2d83df60345ea4617cbc3b057a2fcfef4242f0e53d66d569ecffaeed35975ca28307b354c4 \ No newline at end of file diff --git a/tests/test_triso/results_true.dat b/tests/test_triso/results_true.dat index 71805055c6..1716b67f53 100644 --- a/tests/test_triso/results_true.dat +++ b/tests/test_triso/results_true.dat @@ -1,2 +1,2 @@ k-combined: -1.572877E+00 1.337067E-02 +1.643727E+00 5.233644E-02 From bfc06a7341fdc3aada51e914470f79feda60744b Mon Sep 17 00:00:00 2001 From: samuel shaner Date: Fri, 28 Oct 2016 01:06:50 +0000 Subject: [PATCH 27/34] limited precision of isotopes of expanded elements to 14 digits --- openmc/element.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/openmc/element.py b/openmc/element.py index 3bc7345947..1416ba1eb6 100644 --- a/openmc/element.py +++ b/openmc/element.py @@ -253,6 +253,7 @@ class Element(object): for nuclide, abundance in abundances.items(): nuc = openmc.Nuclide(nuclide) nuc.scattering = self.scattering - isotopes.append((nuc, percent*abundance, percent_type)) + pct = float('{:.14}'.format(percent*abundance)) + isotopes.append((nuc, pct, percent_type)) return isotopes From dfdb77619e6a5d2652e543df815c87d068061d35 Mon Sep 17 00:00:00 2001 From: samuel shaner Date: Fri, 28 Oct 2016 13:24:35 +0000 Subject: [PATCH 28/34] reverted to old triso test with 12 digits of precision on element expansion --- openmc/element.py | 4 ++-- tests/test_triso/inputs_true.dat | 2 +- tests/test_triso/plots.xml | 6 ++++++ tests/test_triso/results_true.dat | 2 +- tests/test_triso/test_triso.py | 17 +++++++++-------- 5 files changed, 19 insertions(+), 12 deletions(-) create mode 100644 tests/test_triso/plots.xml diff --git a/openmc/element.py b/openmc/element.py index 1416ba1eb6..1f72115cc4 100644 --- a/openmc/element.py +++ b/openmc/element.py @@ -193,7 +193,7 @@ class Element(object): # Adjust the abundances for the absent nuclides for nuclide in absent_nuclides: - if nuclide == 'O18' and 'O16' in mutual_nuclides: + if nuclide in ['O17', 'O18'] and 'O16' in mutual_nuclides: abundances['O16'] += NATURAL_ABUNDANCE[nuclide] elif nuclide == 'Ta180' and 'Ta181' in mutual_nuclides: abundances['Ta181'] += NATURAL_ABUNDANCE[nuclide] @@ -253,7 +253,7 @@ class Element(object): for nuclide, abundance in abundances.items(): nuc = openmc.Nuclide(nuclide) nuc.scattering = self.scattering - pct = float('{:.14}'.format(percent*abundance)) + pct = round(percent*abundance, 12) isotopes.append((nuc, pct, percent_type)) return isotopes diff --git a/tests/test_triso/inputs_true.dat b/tests/test_triso/inputs_true.dat index 856581fdef..0ca3943f42 100644 --- a/tests/test_triso/inputs_true.dat +++ b/tests/test_triso/inputs_true.dat @@ -1 +1 @@ -5859cd73807c74cce612275817d3e1c6a2b55a347b31925115dbda2d83df60345ea4617cbc3b057a2fcfef4242f0e53d66d569ecffaeed35975ca28307b354c4 \ No newline at end of file +3a356b5b6d0aaa3db8c601521e1837a6870c5e5f6d1068f4f3e9b896c0107517d99ff9676311221633169b4d79dc1c4076bff84130e6de16df7ace4da5481a60 \ No newline at end of file diff --git a/tests/test_triso/plots.xml b/tests/test_triso/plots.xml new file mode 100644 index 0000000000..60ae7d9d8f --- /dev/null +++ b/tests/test_triso/plots.xml @@ -0,0 +1,6 @@ + + + + + diff --git a/tests/test_triso/results_true.dat b/tests/test_triso/results_true.dat index 1716b67f53..15107e8c84 100644 --- a/tests/test_triso/results_true.dat +++ b/tests/test_triso/results_true.dat @@ -1,2 +1,2 @@ k-combined: -1.643727E+00 5.233644E-02 +1.636336E+00 1.154000E-01 diff --git a/tests/test_triso/test_triso.py b/tests/test_triso/test_triso.py index e79b9fa8c8..685034491f 100644 --- a/tests/test_triso/test_triso.py +++ b/tests/test_triso/test_triso.py @@ -19,33 +19,34 @@ class TRISOTestHarness(PyAPITestHarness): # Define TRISO matrials fuel = openmc.Material() fuel.set_density('g/cm3', 10.5) - fuel.add_element('U', 0.14154, 'ao', 14.0) - fuel.add_element('C', 0.5) - fuel.add_element('O', 1.5) + fuel.add_nuclide('U235', 0.14154) + fuel.add_nuclide('U238', 0.85846) + fuel.add_nuclide('C0', 0.5) + fuel.add_nuclide('O16', 1.5) porous_carbon = openmc.Material() porous_carbon.set_density('g/cm3', 1.0) - porous_carbon.add_element('C', 1.0) + porous_carbon.add_nuclide('C0', 1.0) porous_carbon.add_s_alpha_beta('c_Graphite') ipyc = openmc.Material() ipyc.set_density('g/cm3', 1.90) - ipyc.add_element('C', 1.0) + ipyc.add_nuclide('C0', 1.0) ipyc.add_s_alpha_beta('c_Graphite') sic = openmc.Material() sic.set_density('g/cm3', 3.20) sic.add_element('Si', 1.0) - sic.add_element('C', 1.0) + sic.add_nuclide('C0', 1.0) opyc = openmc.Material() opyc.set_density('g/cm3', 1.87) - opyc.add_element('C', 1.0) + opyc.add_nuclide('C0', 1.0) opyc.add_s_alpha_beta('c_Graphite') graphite = openmc.Material() graphite.set_density('g/cm3', 1.1995) - graphite.add_element('C', 1.0) + graphite.add_nuclide('C0', 1.0) graphite.add_s_alpha_beta('c_Graphite') # Create TRISO particles From 68cabf713dfa5174d9548a87e4309878bd1993f0 Mon Sep 17 00:00:00 2001 From: samuel shaner Date: Fri, 28 Oct 2016 15:07:16 +0000 Subject: [PATCH 29/34] changed precision on element expand from 12 to 10 --- openmc/element.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openmc/element.py b/openmc/element.py index 1f72115cc4..9044414b43 100644 --- a/openmc/element.py +++ b/openmc/element.py @@ -253,7 +253,7 @@ class Element(object): for nuclide, abundance in abundances.items(): nuc = openmc.Nuclide(nuclide) nuc.scattering = self.scattering - pct = round(percent*abundance, 12) + pct = round(percent*abundance, 10) isotopes.append((nuc, pct, percent_type)) return isotopes From d278b861a36f932b0c05115fd02eccd98132f195 Mon Sep 17 00:00:00 2001 From: Sam Shaner Date: Sun, 30 Oct 2016 17:25:16 -0400 Subject: [PATCH 30/34] changed element expand to use ordered dict --- openmc/element.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/openmc/element.py b/openmc/element.py index 9044414b43..cd12e8ad44 100644 --- a/openmc/element.py +++ b/openmc/element.py @@ -1,3 +1,4 @@ +from collections import OrderedDict import re import sys import os @@ -133,7 +134,7 @@ class Element(object): natural_nuclides.add(nuclide) # Create dict to store the expanded nuclides and abundances - abundances = {} + abundances = OrderedDict() # If cross_sections is None, get the cross sections from the # OPENMC_CROSS_SECTIONS environment variable @@ -253,7 +254,7 @@ class Element(object): for nuclide, abundance in abundances.items(): nuc = openmc.Nuclide(nuclide) nuc.scattering = self.scattering - pct = round(percent*abundance, 10) + pct = round(percent*abundance, 14) isotopes.append((nuc, pct, percent_type)) return isotopes From 7a500d6bfb767e76e6e28357a598f6304866f0f3 Mon Sep 17 00:00:00 2001 From: Sam Shaner Date: Sun, 30 Oct 2016 17:33:31 -0400 Subject: [PATCH 31/34] removed catenation of element expand atomic amount --- openmc/element.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/openmc/element.py b/openmc/element.py index cd12e8ad44..d56c3b3507 100644 --- a/openmc/element.py +++ b/openmc/element.py @@ -254,7 +254,6 @@ class Element(object): for nuclide, abundance in abundances.items(): nuc = openmc.Nuclide(nuclide) nuc.scattering = self.scattering - pct = round(percent*abundance, 14) - isotopes.append((nuc, pct, percent_type)) + isotopes.append((nuc, percent*abundance, percent_type)) return isotopes From bc2a7c32013bba4410b95a4aba6ea0e906bcc047 Mon Sep 17 00:00:00 2001 From: Sam Shaner Date: Mon, 31 Oct 2016 12:28:01 -0400 Subject: [PATCH 32/34] added error if element added via materials.xml file --- openmc/material.py | 2 +- src/input_xml.F90 | 12 ++++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/openmc/material.py b/openmc/material.py index e336156428..c265c90694 100644 --- a/openmc/material.py +++ b/openmc/material.py @@ -687,7 +687,7 @@ class Material(object): allnucs = self._nuclides + self._elements dist_per_type = allnucs[0][2] for nuc in allnucs: - if not nuc[2] == dist_per_type: + if nuc[2] != dist_per_type: msg = 'All nuclides and elements in a distributed ' \ 'material must have the same type, either ao or wo' raise ValueError(msg) diff --git a/src/input_xml.F90 b/src/input_xml.F90 index c5c35d710c..2cefd76f67 100644 --- a/src/input_xml.F90 +++ b/src/input_xml.F90 @@ -2198,6 +2198,7 @@ contains type(Node), pointer :: node_sab => null() type(NodeList), pointer :: node_mat_list => null() type(NodeList), pointer :: node_nuc_list => null() + type(NodeList), pointer :: node_ele_list => null() type(NodeList), pointer :: node_macro_list => null() type(NodeList), pointer :: node_sab_list => null() @@ -2309,6 +2310,17 @@ contains end select end if + ! Issue error if elements are provided + call get_node_list(node_mat, "element", node_ele_list) + + if (get_list_size(node_ele_list) > 0) then + call fatal_error("Unable to add an element to material " & + // trim(to_str(mat % id)) // " since the element option has & + &been removed from the xml input. Elements can only be added via & + &the Python API, which will expand elements into their natural & + &nuclides.") + end if + ! ======================================================================= ! READ AND PARSE TAGS From 33ce3fe1306da18087ca8dbade739914c887f0a9 Mon Sep 17 00:00:00 2001 From: Sam Shaner Date: Mon, 31 Oct 2016 12:30:23 -0400 Subject: [PATCH 33/34] removed unnecessary import itertools in nuclide.py --- openmc/nuclide.py | 1 - 1 file changed, 1 deletion(-) diff --git a/openmc/nuclide.py b/openmc/nuclide.py index 7d566f2d55..33693069f8 100644 --- a/openmc/nuclide.py +++ b/openmc/nuclide.py @@ -1,7 +1,6 @@ from numbers import Integral import sys import warnings -import itertools import openmc from six import string_types From 062a52928f90fbcf37c0235b74d351162ad00d3c Mon Sep 17 00:00:00 2001 From: Sam Shaner Date: Mon, 31 Oct 2016 12:31:22 -0400 Subject: [PATCH 34/34] removed unnecessary import openmc in nuclide.py --- openmc/nuclide.py | 1 - 1 file changed, 1 deletion(-) diff --git a/openmc/nuclide.py b/openmc/nuclide.py index 33693069f8..55afd4e9c3 100644 --- a/openmc/nuclide.py +++ b/openmc/nuclide.py @@ -1,7 +1,6 @@ from numbers import Integral import sys import warnings -import openmc from six import string_types