mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-28 14:15:42 -04:00
Angular implementation updated
This commit is contained in:
parent
95a5271790
commit
4832f71083
4 changed files with 45 additions and 9 deletions
|
|
@ -1282,17 +1282,17 @@ The ``<tally>`` element accepts the following sub-elements:
|
|||
|
||||
:azimuthal:
|
||||
A monotonically increasing list of bounding particle azimuthal angles
|
||||
which represents a portion of the possible values of :math:'\[-\pi,\pi\]'.
|
||||
For example, spanning all of :math:'\[-\pi,\pi\]' with five equi-width
|
||||
which represents a portion of the possible values of :math:'\[0,2\pi\]'.
|
||||
For example, spanning all of :math:'\[0,2\pi\]' with two equi-width
|
||||
bins can be specified as:
|
||||
``<filter type="azimuthal" bins="-3.1416 -1.8850 -0.6283 0.6283 1.8850 3.1416" />``
|
||||
``<filter type="azimuthal" bins="0.0 3.1416 6.2832" />``
|
||||
|
||||
Alternatively, if only one value is provided as a bin, OpenMC will
|
||||
interpret this to mean the complete range of :math:'\[-\pi,\pi\]' should
|
||||
interpret this to mean the complete range of :math:'\[0,2\pi\]' should
|
||||
be automatically subdivided in to the provided value for the bin.
|
||||
That is, the above example of five equi-width bins spanning
|
||||
:math:'\[-\pi,\pi\]' can be instead written as:
|
||||
``<filter type="azimuthal" bins="5" />``.
|
||||
:math:'\[0,2\pi\]' can be instead written as:
|
||||
``<filter type="azimuthal" bins="2" />``.
|
||||
|
||||
:mesh:
|
||||
The ``id`` of a structured mesh to be tallied over.
|
||||
|
|
|
|||
|
|
@ -181,7 +181,6 @@ contains
|
|||
if (uvw(1) == ZERO) then
|
||||
phi = ZERO
|
||||
else
|
||||
! phi = atan(uvw(2) / uvw(1))
|
||||
phi = atan2(uvw(2), uvw(1))
|
||||
end if
|
||||
|
||||
|
|
@ -556,6 +555,8 @@ contains
|
|||
rn = ONE
|
||||
end select
|
||||
|
||||
! rn = rn * sin(phi)
|
||||
|
||||
end function calc_rn
|
||||
|
||||
!===============================================================================
|
||||
|
|
|
|||
|
|
@ -34,8 +34,6 @@ contains
|
|||
R = n
|
||||
|
||||
if (val < array(L) .or. val > array(R)) then
|
||||
write(*,*) val
|
||||
write(*,*) array
|
||||
call fatal_error("Value outside of array during binary search")
|
||||
end if
|
||||
|
||||
|
|
|
|||
|
|
@ -906,6 +906,8 @@ contains
|
|||
logical :: found_bin ! was a scoring bin found?
|
||||
logical :: start_in_mesh ! starting coordinates inside mesh?
|
||||
logical :: end_in_mesh ! ending coordinates inside mesh?
|
||||
real(8) :: theta
|
||||
real(8) :: phi
|
||||
type(TallyObject), pointer :: t
|
||||
type(StructuredMesh), pointer :: m
|
||||
type(Material), pointer :: mat
|
||||
|
|
@ -990,6 +992,41 @@ contains
|
|||
matching_bins(i) = binary_search(t % filters(i) % real_bins, &
|
||||
k + 1, p % E)
|
||||
end if
|
||||
|
||||
case (FILTER_POLAR)
|
||||
! Get theta value
|
||||
theta = acos(p % coord(1) % uvw(3))
|
||||
|
||||
! determine polar angle bin
|
||||
k = t % filters(i) % n_bins
|
||||
|
||||
! check if particle is within polar angle bins
|
||||
if (theta < t % filters(i) % real_bins(1) .or. &
|
||||
theta > t % filters(i) % real_bins(k + 1)) then
|
||||
matching_bins(i) = NO_BIN_FOUND
|
||||
else
|
||||
! search to find polar angle bin
|
||||
matching_bins(i) = binary_search(t % filters(i) % real_bins, &
|
||||
k + 1, theta)
|
||||
end if
|
||||
|
||||
case (FILTER_AZIMUTHAL)
|
||||
! make sure the correct direction vector is used
|
||||
phi = atan2(p % coord(1) % uvw(2), p % coord(1) % uvw(1))
|
||||
|
||||
! determine mu bin
|
||||
k = t % filters(i) % n_bins
|
||||
|
||||
! check if particle is within azimuthal angle bins
|
||||
if (phi < t % filters(i) % real_bins(1) .or. &
|
||||
phi > t % filters(i) % real_bins(k + 1)) then
|
||||
matching_bins(i) = NO_BIN_FOUND
|
||||
else
|
||||
! search to find azimuthal angle bin
|
||||
matching_bins(i) = binary_search(t % filters(i) % real_bins, &
|
||||
k + 1, phi)
|
||||
end if
|
||||
|
||||
end select
|
||||
|
||||
! Check if no matching bin was found
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue