mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-29 06:35:48 -04:00
Removed atom_percent attribute from Material derived type.
This commit is contained in:
parent
826f6b83c3
commit
06254d1a48
3 changed files with 12 additions and 16 deletions
|
|
@ -608,7 +608,7 @@ contains
|
|||
do i = 1, n_materials
|
||||
mat => materials(i)
|
||||
|
||||
percent_in_atom = (mat % atom_percent(1) > ZERO)
|
||||
percent_in_atom = (mat % atom_density(1) > ZERO)
|
||||
density_in_atom = (mat % density > ZERO)
|
||||
|
||||
sum_percent = ZERO
|
||||
|
|
@ -621,15 +621,15 @@ contains
|
|||
! by awr. thus, when a sum is done over the values, it's actually
|
||||
! sum(w/awr)
|
||||
if (.not. percent_in_atom) then
|
||||
mat % atom_percent(j) = -mat % atom_percent(j) / awr
|
||||
mat % atom_density(j) = -mat % atom_density(j) / awr
|
||||
end if
|
||||
end do
|
||||
|
||||
! determine normalized atom percents. if given atom percents, this is
|
||||
! straightforward. if given weight percents, the value is w/awr and is
|
||||
! divided by sum(w/awr)
|
||||
sum_percent = sum(mat % atom_percent)
|
||||
mat % atom_percent = mat % atom_percent / sum_percent
|
||||
sum_percent = sum(mat % atom_density)
|
||||
mat % atom_density = mat % atom_density / sum_percent
|
||||
|
||||
! Change density in g/cm^3 to atom/b-cm. Since all values are now in atom
|
||||
! percent, the sum needs to be re-evaluated as 1/sum(x*awr)
|
||||
|
|
@ -638,7 +638,7 @@ contains
|
|||
do j = 1, mat % n_nuclides
|
||||
index_list = dict_get_key(xs_listing_dict, mat % names(j))
|
||||
awr = xs_listings(index_list) % awr
|
||||
x = mat % atom_percent(j)
|
||||
x = mat % atom_density(j)
|
||||
sum_percent = sum_percent + x*awr
|
||||
end do
|
||||
sum_percent = ONE / sum_percent
|
||||
|
|
@ -646,10 +646,8 @@ contains
|
|||
/ MASS_NEUTRON * sum_percent
|
||||
end if
|
||||
|
||||
! Calculate nuclide atom densities and deallocate atom_percent array
|
||||
! since it is no longer needed past this point
|
||||
mat % atom_density = mat % density * mat % atom_percent
|
||||
deallocate(mat % atom_percent)
|
||||
! Calculate nuclide atom densities
|
||||
mat % atom_density = mat % density * mat % atom_density
|
||||
end do
|
||||
|
||||
end subroutine normalize_ao
|
||||
|
|
|
|||
|
|
@ -720,7 +720,6 @@ contains
|
|||
allocate(mat % names(n))
|
||||
allocate(mat % nuclide(n))
|
||||
allocate(mat % atom_density(n))
|
||||
allocate(mat % atom_percent(n))
|
||||
|
||||
do j = 1, mat % n_nuclides
|
||||
! Combine nuclide identifier and cross section and copy into names
|
||||
|
|
@ -777,23 +776,23 @@ contains
|
|||
|
||||
! Copy atom/weight percents
|
||||
if (nuc % ao /= ZERO) then
|
||||
mat % atom_percent(j) = nuc % ao
|
||||
mat % atom_density(j) = nuc % ao
|
||||
else
|
||||
mat % atom_percent(j) = -nuc % wo
|
||||
mat % atom_density(j) = -nuc % wo
|
||||
end if
|
||||
end do
|
||||
|
||||
! Check to make sure either all atom percents or all weight percents are
|
||||
! given
|
||||
if (.not. (all(mat % atom_percent > ZERO) .or. &
|
||||
all(mat % atom_percent < ZERO))) then
|
||||
if (.not. (all(mat % atom_density > ZERO) .or. &
|
||||
all(mat % atom_density < ZERO))) then
|
||||
message = "Cannot mix atom and weight percents in material " // &
|
||||
to_str(mat % id)
|
||||
call fatal_error()
|
||||
end if
|
||||
|
||||
! Determine density if it is a sum value
|
||||
if (sum_density) mat % density = sum(mat % atom_percent)
|
||||
if (sum_density) mat % density = sum(mat % atom_density)
|
||||
|
||||
! =======================================================================
|
||||
! READ AND PARSE <sab> TAG FOR S(a,b) DATA
|
||||
|
|
|
|||
|
|
@ -13,7 +13,6 @@ module material_header
|
|||
integer, allocatable :: nuclide(:) ! index in nuclides array
|
||||
real(8) :: density ! total atom density in atom/b-cm
|
||||
real(8), allocatable :: atom_density(:) ! nuclide atom density in atom/b-cm
|
||||
real(8), allocatable :: atom_percent(:) ! atom/weight percent (negative for weight)
|
||||
|
||||
! S(a,b) data references
|
||||
logical :: has_sab_table = .false.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue