Particle tracking acceleration via signed distance fields in direct-accelerated geometry Monte Carlo

Đăng ngày 7/3/2019 10:05:05 PM | Thể loại: | Lần tải: 0 | Lần xem: 2 | Page: 10 | FileSize: 1.41 M | File type: PDF
Particle tracking acceleration via signed distance fields in direct-accelerated geometry Monte Carlo. This work describes the adaptation of a rendering data structure, the signed distance field, as a geometric query tool for accelerating CAD-based transport in the direct-accelerated geometry Monte Carlo toolkit. Demonstrations of its effectiveness are shown for several problems. The beginnings of a predictive model for the data structure's utilization based on various problem parameters is also introduced.
Contents lists available at ScienceDirect
Nuclear Engineering and Technology
journal homepage: www.elsevier.com/locate/net
Original Article
Particle tracking acceleration via signed distance elds in
direct-accelerated geometry Monte Carlo
Patrick C. Shriwise*, Andrew Davis, Lucas J. Jacobson, Paul P.H. Wilson
CNERG Research Group, University of Wisconsin - Madison, Madison, WI, USA
a r t i c l e
i n f o
a b s t r a c t
Article history:
Computer-aided design (CAD)-based Monte Carlo radiation transport is of value to the nuclear engi-
Received 3 June 2017
Accepted 7 August 2017
Available online 26 August 2017
neering community for its ability to conduct transport on high-delity models of nuclear systems, but it
is more computationally expensive than native geometry representations. This work describes the
adaptation of a rendering data structure, the signed distance eld, as a geometric query tool for accel-
Keywords:
Monte Carlo
Radiation Transport
CAD
DAGMC
erating CAD-based transport in the direct-accelerated geometry Monte Carlo toolkit. Demonstrations of
its effectiveness are shown for several problems. The beginnings of a predictive model for the data
structure's utilization based on various problem parameters is also introduced.
© 2017 Korean Nuclear Society, Published by Elsevier Korea LLC. This is an open access article under the
1. Introduction
signed distance eld data structureintendedfor rendering dynamic
surfaces is introduced. The remaining content describes this data
The direct-accelerated geometry Monte Carlo (DAGMC) [1]
structure's adaptation for use in accelerated particle tracking for
toolkit provides the capability for robust radiation transport on
CAD-based Monte Carlo simulations. The application of this data
CAD geometries. This allows nuclear analysis to be performed on
structure and associated tracking methods are then demonstrated
the same models that are used in other engineering domains. The
as a new method for particle tracking acceleration in DAGMC.
toolkit also has the capability to convert native Monte Carlo models
Included demonstrations of this method are shown to greatly
to computer-aided design (CAD) for further development, modi-
reduce run times in a few test problems for commonly encountered
cation, and analysis.
conditions during transport. Next, some studies involving the data
DAGMC tracks particles on discretized representations of ana-
structure's
effectiveness
for
various
problem
parameters
are
lytic CAD surfaces as triangle meshes, such that all points on any
investigated and discussed. Finally, conclusions, current limita-
given triangle are within a specied tolerance of the analytic rep-
tions, and future extensions of this work are discussed.
resentation. This mesh representation of the model is then stored in
the mesh oriented database (MOAB) [2] inwhich geometric queries
such as next surface intersection, point containment, and nearest to
2. Background
boundary are performed.
It has been shown that DAGMC can achieve robust transport
2.1. Acceleration techniques in DAGMC
equal to that of the native codes with which it communicates [3],
but that it currently takes much longer [4]. This additional time
occurs despite the acceleration techniques that DAGMC uses to
avoid searching over the large number of triangles ( 106e107).
Those acceleration techniques, implemented within MOAB, will be
briey discussed to motivate this work, which aims to further
accelerate geometry queries within DAGMC.
To begin, this article gives a brief overview of the employed
acceleration techniques in DAGMC for particle tracking. Next, the
Particle tracking in DAGMC relies on the capability to robustly
perform geometric queries on the triangle surface meshes which
represent the problem geometry. The most common form of geo-
metric query in particle tracking is a next surface crossing query.
This is called to determine if a particle within the current cell will
reach its nextevent location orcross a surface of the cell, potentially
entering a new medium with different physical characteristics,
based on the particle's current position and trajectory. Geometry
kernels in native Monte Carlo codes perform analytic calculations
for the nearest intersection along the particle's trajectory from its
* Corresponding author.
current location. In DAGMC, a similar operation is performed, but
E-mail address: shriwise@wisc.edu (P.C. Shriwise).
on the triangle surfaces that compose the current cell (or volume).
1738-5733/© 2017 Korean Nuclear Society, Published by Elsevier Korea LLC. This is an open access article under the CC BY-NC-ND license (http://creativecommons.org/
!
!
!
!
! !
!
!
! !
! !
! !
1190
P.C. Shriwise et al. / Nuclear Engineering and Technology 49 (2017) 1189e1198
The determination of the nearest triangle intersection with a tra-
over the R3 domain as:
jectory from a starting position is a well-researched problem in the
eld of ray tracing. As such, a ray tracing data structure, the
 
U R3 /R
(1)
bounding volume hierarchy (BVH) [5], is applied within MOAB to
accelerate these queries. More specically, MOAB utilizes an ori-
ented bounding box (OBB) BVH [6,7] to bound sets of triangles so
that they may be rapidly excluded from the query in large groups
via intersection checks with these OBBs.
This process begins by bounding all triangles with a single OBB.
The triangles are then split into two sets based on which side of the
where an isocontour of value, v, of the implicit surface can be
described as
Uð x Þ  v ¼ 0 (2)
for all points x satisfying that equation. For simplicity, the surface
splitting plane they are on. The splitting plane is chosen as the
current OBBs median plane which divides the number of triangles
into equal parts. OBBs are then generated for these subsets of tri-
angles. Concurrently, the new OBBs are linked tothe original OBB as
isocontour value is typically dened as 0.
By recognizing that the magnitude of Uð x Þ is in fact a minimum
interface distance function, one can construct a signed distance
function, SDVð x Þ, using the isocontour representation and the
children. This process recurs until OBBs are bounding small sets of
triangles. A hierarchical structure is created along the way which
can then be traversed to rapidly isolate sets of triangles in space. A
magnitude of the function as seen in Eq. 3 [8].
SDVð x Þ ¼ jUð x Þj
(3)
two-dimensional (2D) visualization of this process using curve
segments rather than triangles is provided in Fig. 1. Queries are
satised using data structure by performing ray-box intersection
checks with the root OBB. If an intersection with the root OBB is
found, then the children of that OBB will also be checked for an
Signed distance function generation from implicit surfaces is a
particularly valuable property of implicit surfaces. A signed dis-
tance function, SDVð x Þ, meets the following requirements for any
point x :
intersection. If the OBB has no children, it is considered a leaf node
and the triangles it bounds are then checked for an intersection
with the ray. During traversal, each time an OBB is missed by the
ray, all triangles bounded by that box are ignored. It is in this way
 SDVð x Þ ¼ 0 for all x on the surface boundary,
 SDVð x Þ<0 for all x inside the surface boundary, and
 SDVð x Þ>0 for all x outside the surface boundary.
that the search for an intersection is rapidly limited to a small
number of triangles with a high chance of intersecting with the ray.
This results in an algorithm with OðlogðNÞÞ complexity where N is
the number of entities (triangles) in the data structure. MOAB's OBB
tree can be used to satisfy point containment and closest inter-
section queries as well. Many variations of this data structure exist,
and research is in progress to further accelerate particle tracking
with these methods [4].
Implicit surfaces and level-set methods are easily extended to
represent dynamic geometries by including a time dependence in
the function, making them powerful tools for populating signed
distance elds in simulation and rendering of uids, smoke, re,
etc. In these applications the data structure is populated with
signed distance values for a given time in the rendering. The signed
distance eld can then be used to determine point containment
queries and trace rays at any time via a method in which the ray
2.2. Signed distance elds and implicit surfaces
length is repeatedly clipped using signed distance values to
approach a surface in a process called ray marching [9]. This work
Signed distance elds are commonly derived from implicit
surface functions, and variations on these functions are known as
level-set functions. Both offer a rich and versatile representation of
establishes the potential use of signed distance elds in static CAD-
based Monte Carlo radiation transport, with possible future
extension to dynamic geometries.
closed manifolds that can be used for modeling, simulation, and
rendering. The constructive solid geometry (CSG) representations
3. Signed distance eld implementation in DAGMC
seen in native Monte Carlo codes are usually formed from Boolean
combinations of predened implicit surfaces at their core. While
these predened surfaces do not give the freedom of model crea-
tion and manipulation found in many CAD systems, important
geometric information required for visualization and simulation
can be readily recovered from these implicit surfaces which may be
of value in CAD-based radiation transport simulations.
Implicit surface functions are multivariate functions dened
As an initial implementation, one signed distance eld is
generated for each volume in DAGMC with extents matching the
axis-aligned bounding box of the volume. The signed distance eld
is represented as a uniform structured mesh with a signed distance
value at each vertex in the mesh as indicated in Fig. 2. (Altering the
sign convention when populating the data structure rather than
incurring the additional computational cost of altering the sign of
values for each operation is preferable.) It is mentioned above that
signed distance elds are typically generated using an implicit,
analytic representation, but a suitable data structure for populating
the structured mesh with signed distance values is already in place
in the form of DAGMC's bounding volume hierarchy. It is a more
straightforward process to simply use DAGMC's current closest to
location algorithm to generate signed distance values than to create
an implicit surface approximation of the triangle mesh. Though the
latter may be faster, performance improvements didn't seem to be
impeded greatly by using this method to populate the data struc-
ture. This method also maintains a consistency between the in-
tersections found by the ray tracing kernel and the signed distance
eld values.
Fig. 1. Two-dimensional example of a bounding volume hierarchy using oriented
DAGMC's closest to boundary algorithm returns, among other
bounding boxes on a discretized curve.
pieces of information, the nearest intersection location and the
ob
P.C. Shriwise et al. / Nuclear Engineering and Technology 49 (2017) 1189e1198
1191
Signed distance field
3.1. Signed distance eld application in DAGMC
The signed distance eld can be used to accelerate common
Monte Carlo geometry queries by providing information about the
nearest surface crossing in any direction in a very similar manner to
the way this is accomplished in CSG representations.
Three types of geometric queries are common among the
various Monte Carlo codes that DAGMC supports. These include
next surface intersection, point containment, and closest boundary
intersection queries. Typically, a ray is red to satisfy any of these
queries in DAGMC with OðlogðNÞÞcomplexity, but it is hypothesized
that these queries can be accelerated in many cases by rst per-
forming an Oð1Þ signed distance value lookup to precondition ray
re calls and make sure they are necessary.
Point containment queries can be performed by examining the
signed distance value for the point. If the point's value is negative
(or outside of the signed distance eld data structure), then the
point is not contained within the volume. If the point's value is
positive, then the point is determined to be inside the volume.
Given that there is error associated with each of these interpolated
values, the point containment using a signed distance eld should
only be trustedif the absolute value of the signed distance is greater
than the expected error associated with the value. If this is not the
case, then a ray must be red to determine the particle's contain-
ment with respect to the volume in question.
Closest to boundary queries can be performed in a similar
Fig. 2. 2D visualization of the signed distance eld with sign conventions reversed for
manner to the point containment queries, but they are more
use in radiation transport.
dependent on the native code's intent for their use. Some Monte
Carlo codes query for the nearest volume surface intersection to
triangle on which this intersection exists. For each point in the
determine whether the particle will exit the volume before reaching
signed distance eld mesh, this algorithm is used to determine
its next physics event location. Signed distance elds are designed
the magnitude of the distance value. To determine the sign of the
for exactly this operation. In similar fashion to the point contain-
distance value, a ray is constructed from query location and the
ment case, the signed distance value should only be trusted if it is
intersection location. The dot product of this ray vector with the
greater than the error associated with the value. Additionally, the
triangle's outward normal vector is used to determine the sign of
error should be subtracted from the value, returning to the code a
the distance value. DAGMC maintains enough information to
conservative value for the nearest intersection.If the signed distance
consistently orient triangle normals such that they point outward
value's magnitude is not greater than its error evaluation, or if the
from the volume they represent. In the rare cases for which the
value is negative, then a ray should be red to determine the exact
dot product of these vectors is ambiguous, or zero, DAGMC's
location of the nearest boundary crossing for the particle's location.
point containment algorithm is used to disambiguate the value's
Next surface intersections are called by native Monte Carlo
sign.
codes to determine if a particle will cross a surface before reaching
The initial implementation of the signed distance eld employs
its next physics event location. This is the most common geometry
MOAB's structured mesh interface and data tagging for storage.
query in an average Monte Carlo simulation. Normally in DAGMC a
This interface maintains a representation of the structured mesh
ray is red each time this query is called. This can be avoided by
with vertex coordinates and handles at each point along with hex
using the signed distance eld to exclude the possibility of a surface
elements for each mesh voxel. These vertex coordinates and hex
crossing without explicitly determining the next surface intersec-
elements can be accessed using <i;j;k> indexing. While this
tion. If the sum of the signed distance values for both the current
format is somewhat memory intensive, it provides a fast path for
particle position and the next physics event location is greater than
verication, visualization, and proof of concept in the transport test
the distance between the two, then no surface crossing will occur
cases for demonstration. One can imagine a much less memory
and the particle can safely advance to the next physics event
intensive implementation inwhich only a box corner, grid step size,
location. For robustness, the error for each interpolation should be
dimensions, and the signed distance value data are stored. A
subtracted from the sum of the signed distance values as a con-
transition to an implementation like this will likely occur before
servative measure. If the expanse between the particle's current
application to production work.
location and its next physics event interaction cannot be accounted
Signed distance values can be retrieved from the structured
for by the signed distance values of the two points, then a ray will
mesh by determining which mesh voxel the point lies within. The
be red to determine the particle's next surface intersection along
point's element is accessed by determining an <i;j;k> index using
that trajectory. Fig. 4 shows a graphic representation of this process.
the point's x, y, and z values divided by the structured mesh step
Not all Monte Carlo codes provide the next physics event location
size. A trilinear interpolation of the 8-element vertex coordinates
along with the particle's current location to their geometry kernels.
and their signed distance values is then used to provide the signed
In this case, preconditioning of these queries will not be possible.
distance value for the location of interest. As a result, the
Using these methods, the storage of signed distances eld for
complexity of a signed distance value lookup from the signed dis-
volumes in DAGMC could provide a way to accelerate the Monte
tance eld is Oð1Þ. Performance improvements for geometric
Carlo queries listed above by using a Oð1Þ process to establish that
queries are based upon using this process in place of the OðlogðNÞÞ
the conditions of a geometric queryare such that a more robust and
ray tracing process.
computationally expensive ray is necessary before performing the
HƯỚNG DẪN DOWNLOAD TÀI LIỆU

Bước 1:Tại trang tài liệu slideshare.vn bạn muốn tải, click vào nút Download màu xanh lá cây ở phía trên.
Bước 2: Tại liên kết tải về, bạn chọn liên kết để tải File về máy tính. Tại đây sẽ có lựa chọn tải File được lưu trên slideshare.vn
Bước 3: Một thông báo xuất hiện ở phía cuối trình duyệt, hỏi bạn muốn lưu . - Nếu click vào Save, file sẽ được lưu về máy (Quá trình tải file nhanh hay chậm phụ thuộc vào đường truyền internet, dung lượng file bạn muốn tải)
Có nhiều phần mềm hỗ trợ việc download file về máy tính với tốc độ tải file nhanh như: Internet Download Manager (IDM), Free Download Manager, ... Tùy vào sở thích của từng người mà người dùng chọn lựa phần mềm hỗ trợ download cho máy tính của mình  
2 lần xem

Particle tracking acceleration via signed distance fields in direct-accelerated geometry Monte Carlo. This work describes the adaptation of a rendering data structure, the signed distance field, as a geometric query tool for accelerating CAD-based transport in the direct-accelerated geometry Monte Carlo toolkit. Demonstrations of its effectiveness are shown for several problems. The beginnings of a predictive model for the data structure's utilization based on various problem parameters is also introduced..

Nội dung

Nuclear Engineering and Technology 49 (2017) 1189e1198 Contents lists available at ScienceDirect Nuclear Engineering and Technology journal homepage: www.elsevier.com/locate/net Original Article Particle tracking acceleration via signed distance fields in direct-accelerated geometry Monte Carlo Patrick C. Shriwise*, Andrew Davis, Lucas J. Jacobson, Paul P.H. Wilson CNERG Research Group, University of Wisconsin - Madison, Madison, WI, USA a r t i c l e i n f o a b s t r a c t Article history: Received 3 June 2017 Accepted 7 August 2017 Available online 26 August 2017 Keywords: Monte Carlo Radiation Transport CAD DAGMC 1. Introduction Computer-aided design (CAD)-based Monte Carlo radiation transport is of value to the nuclear engi-neering community for its ability to conduct transport on high-fidelity models of nuclear systems, but it is more computationally expensive than native geometry representations. This work describes the adaptation of a rendering data structure, the signed distance field, as a geometric query tool for accel-erating CAD-based transport in the direct-accelerated geometry Monte Carlo toolkit. Demonstrations of its effectiveness are shown for several problems. The beginnings of a predictive model for the data structure's utilization based on various problem parameters is also introduced. © 2017 Korean Nuclear Society, Published by Elsevier Korea LLC. This is an open access article under the CC BY-NC-ND license (http://creativecommons.org/licenses/by-nc-nd/4.0/). signed distance field data structureintendedfor rendering dynamic surfaces is introduced. The remaining content describes this data The direct-accelerated geometry Monte Carlo (DAGMC) [1] toolkit provides the capability for robust radiation transport on CAD geometries. This allows nuclear analysis to be performed on the same models that are used in other engineering domains. The toolkit also has the capability to convert native Monte Carlo models to computer-aided design (CAD) for further development, modifi-cation, and analysis. DAGMC tracks particles on discretized representations of ana-lytic CAD surfaces as triangle meshes, such that all points on any given triangle are within a specified tolerance of the analytic rep-resentation. This mesh representation of the model is then stored in the mesh oriented database (MOAB) [2] inwhich geometric queries such as next surface intersection, point containment, and nearest to boundary are performed. It has been shown that DAGMC can achieve robust transport equal to that of the native codes with which it communicates [3], but that it currently takes much longer [4]. This additional time occurs despite the acceleration techniques that DAGMC uses to avoid searching over the large number of triangles ( 106e107). Those acceleration techniques, implemented within MOAB, will be briefly discussed to motivate this work, which aims to further accelerate geometry queries within DAGMC. To begin, this article gives a brief overview of the employed acceleration techniques in DAGMC for particle tracking. Next, the * Corresponding author. E-mail address: shriwise@wisc.edu (P.C. Shriwise). structure's adaptation for use in accelerated particle tracking for CAD-based Monte Carlo simulations. The application of this data structure and associated tracking methods are then demonstrated as a new method for particle tracking acceleration in DAGMC. Included demonstrations of this method are shown to greatly reduce run times in a few test problems for commonly encountered conditions during transport. Next, some studies involving the data structure's effectiveness for various problem parameters are investigated and discussed. Finally, conclusions, current limita-tions, and future extensions of this work are discussed. 2. Background 2.1. Acceleration techniques in DAGMC Particle tracking in DAGMC relies on the capability to robustly perform geometric queries on the triangle surface meshes which represent the problem geometry. The most common form of geo-metric query in particle tracking is a next surface crossing query. This is called to determine if a particle within the current cell will reach its nextevent location orcross a surface of the cell, potentially entering a new medium with different physical characteristics, based on the particle's current position and trajectory. Geometry kernels in native Monte Carlo codes perform analytic calculations for the nearest intersection along the particle's trajectory from its current location. In DAGMC, a similar operation is performed, but on the triangle surfaces that compose the current cell (or volume). http://dx.doi.org/10.1016/j.net.2017.08.008 1738-5733/© 2017 Korean Nuclear Society, Published by Elsevier Korea LLC. This is an open access article under the CC BY-NC-ND license (http://creativecommons.org/ licenses/by-nc-nd/4.0/). 1190 P.C. Shriwise et al. / Nuclear Engineering and Technology 49 (2017) 1189e1198 The determination of the nearest triangle intersection with a tra-jectory from a starting position is a well-researched problem in the field of ray tracing. As such, a ray tracing data structure, the bounding volume hierarchy (BVH) [5], is applied within MOAB to over the R3 domain as: U R3 /R (1) accelerate these queries. More specifically, MOAB utilizes an ori-ented bounding box (OBB) BVH [6,7] to bound sets of triangles so that they may be rapidly excluded from the query in large groups via intersection checks with these OBBs. This process begins by bounding all triangles with a single OBB. The triangles are then split into two sets based on which side of the splitting plane they are on. The splitting plane is chosen as the current OBBs median plane which divides the number of triangles into equal parts. OBBs are then generated for these subsets of tri-angles. Concurrently, the new OBBs are linked tothe original OBB as children. This process recurs until OBBs are bounding small sets of triangles. A hierarchical structure is created along the way which can then be traversed to rapidly isolate sets of triangles in space. A two-dimensional (2D) visualization of this process using curve segments rather than triangles is provided in Fig. 1. Queries are satisfied using data structure by performing ray-box intersection checks with the root OBB. If an intersection with the root OBB is found, then the children of that OBB will also be checked for an intersection. If the OBB has no children, it is considered a leaf node and the triangles it bounds are then checked for an intersection with the ray. During traversal, each time an OBB is missed by the ray, all triangles bounded by that box are ignored. It is in this way that the search for an intersection is rapidly limited to a small number of triangles with a high chance of intersecting with the ray. This results in an algorithm with OðlogðNÞÞ complexity where N is the number of entities (triangles) in the data structure. MOAB's OBB tree can be used to satisfy point containment and closest inter-section queries as well. Many variations of this data structure exist, and research is in progress to further accelerate particle tracking with these methods [4]. 2.2. Signed distance fields and implicit surfaces Signed distance fields are commonly derived from implicit surface functions, and variations on these functions are known as level-set functions. Both offer a rich and versatile representation of closed manifolds that can be used for modeling, simulation, and rendering. The constructive solid geometry (CSG) representations seen in native Monte Carlo codes are usually formed from Boolean combinations of predefined implicit surfaces at their core. While these predefined surfaces do not give the freedom of model crea-tion and manipulation found in many CAD systems, important geometric information required for visualization and simulation can be readily recovered from these implicit surfaces which may be of value in CAD-based radiation transport simulations. Implicit surface functions are multivariate functions defined Fig. 1. Two-dimensional example of a bounding volume hierarchy using oriented bounding boxes on a discretized curve. where an isocontour of value, v, of the implicit surface can be described as Uð x Þ v ¼ 0 (2) for all points x satisfying that equation. For simplicity, the surface isocontour value is typically defined as 0. By recognizing that the magnitude of Uð x Þ is in fact a minimum interface distance function, one can construct a signed distance function, SDVð x Þ, using the isocontour representation and the magnitude of the function as seen in Eq. 3 [8]. SDVð x Þ ¼ jUð x Þj (3) Signed distance function generation from implicit surfaces is a particularly valuable property of implicit surfaces. A signed dis-tance function, SDVð x Þ, meets the following requirements for any point x : SDVð x Þ ¼ 0 for all x on the surface boundary, SDVð x Þ<0 for all x inside the surface boundary, and SDVð x Þ>0 for all x outside the surface boundary. Implicit surfaces and level-set methods are easily extended to represent dynamic geometries by including a time dependence in the function, making them powerful tools for populating signed distance fields in simulation and rendering of fluids, smoke, fire, etc. In these applications the data structure is populated with signed distance values for a given time in the rendering. The signed distance field can then be used to determine point containment queries and trace rays at any time via a method in which the ray length is repeatedly clipped using signed distance values to approach a surface in a process called ray marching [9]. This work establishes the potential use of signed distance fields in static CAD-based Monte Carlo radiation transport, with possible future extension to dynamic geometries. 3. Signed distance field implementation in DAGMC As an initial implementation, one signed distance field is generated for each volume in DAGMC with extents matching the axis-aligned bounding box of the volume. The signed distance field is represented as a uniform structured mesh with a signed distance value at each vertex in the mesh as indicated in Fig. 2. (Altering the sign convention when populating the data structure rather than incurring the additional computational cost of altering the sign of values for each operation is preferable.) It is mentioned above that signed distance fields are typically generated using an implicit, analytic representation, but a suitable data structure for populating the structured mesh with signed distance values is already in place in the form of DAGMC's bounding volume hierarchy. It is a more straightforward process to simply use DAGMC's current closest to location algorithm to generate signed distance values than to create an implicit surface approximation of the triangle mesh. Though the latter may be faster, performance improvements didn't seem to be impeded greatly by using this method to populate the data struc-ture. This method also maintains a consistency between the in-tersections found by the ray tracing kernel and the signed distance field values. DAGMC's closest to boundary algorithm returns, among other pieces of information, the nearest intersection location and the P.C. Shriwise et al. / Nuclear Engineering and Technology 49 (2017) 1189e1198 1191 Signed distance field Fig. 2. 2D visualization of the signed distance field with sign conventions reversed for use in radiation transport. triangle on which this intersection exists. For each point in the signed distance field mesh, this algorithm is used to determine the magnitude of the distance value. To determine the sign of the distance value, a ray is constructed from query location and the intersection location. The dot product of this ray vector with the triangle's outward normal vector is used to determine the sign of the distance value. DAGMC maintains enough information to consistently orient triangle normals such that they point outward from the volume they represent. In the rare cases for which the dot product of these vectors is ambiguous, or zero, DAGMC's point containment algorithm is used to disambiguate the value's sign. The initial implementation of the signed distance field employs MOAB's structured mesh interface and data tagging for storage. This interface maintains a representation of the structured mesh with vertex coordinates and handles at each point along with hex elements for each mesh voxel. These vertex coordinates and hex elements can be accessed using indexing. While this format is somewhat memory intensive, it provides a fast path for verification, visualization, and proof of concept in the transport test cases for demonstration. One can imagine a much less memory intensive implementation inwhich only a box corner, grid step size, dimensions, and the signed distance value data are stored. A transition to an implementation like this will likely occur before application to production work. Signed distance values can be retrieved from the structured mesh by determining which mesh voxel the point lies within. The point's element is accessed by determining an index using the point's x, y, and z values divided by the structured mesh step size. A trilinear interpolation of the 8-element vertex coordinates and their signed distance values is then used to provide the signed distance value for the location of interest. As a result, the complexity of a signed distance value lookup from the signed dis-tance field is Oð1Þ. Performance improvements for geometric queries are based upon using this process in place of the OðlogðNÞÞ ray tracing process. 3.1. Signed distance field application in DAGMC The signed distance field can be used to accelerate common Monte Carlo geometry queries by providing information about the nearest surface crossing in any direction in a very similar manner to the way this is accomplished in CSG representations. Three types of geometric queries are common among the various Monte Carlo codes that DAGMC supports. These include next surface intersection, point containment, and closest boundary intersection queries. Typically, a ray is fired to satisfy any of these queries in DAGMC with OðlogðNÞÞcomplexity, but it is hypothesized that these queries can be accelerated in many cases by first per-forming an Oð1Þ signed distance value lookup to precondition ray fire calls and make sure they are necessary. Point containment queries can be performed by examining the signed distance value for the point. If the point's value is negative (or outside of the signed distance field data structure), then the point is not contained within the volume. If the point's value is positive, then the point is determined to be inside the volume. Given that there is error associated with each of these interpolated values, the point containment using a signed distance field should only be trustedif the absolute value of the signed distance is greater than the expected error associated with the value. If this is not the case, then a ray must be fired to determine the particle's contain-ment with respect to the volume in question. Closest to boundary queries can be performed in a similar manner to the point containment queries, but they are more dependent on the native code's intent for their use. Some Monte Carlo codes query for the nearest volume surface intersection to determine whether the particle will exit the volume before reaching its next physics event location. Signed distance fields are designed for exactly this operation. In similar fashion to the point contain-ment case, the signed distance value should only be trusted if it is greater than the error associated with the value. Additionally, the error should be subtracted from the value, returning to the code a conservative value for the nearest intersection.If the signed distance value's magnitude is not greater than its error evaluation, or if the value is negative, then a ray should be fired to determine the exact location of the nearest boundary crossing for the particle's location. Next surface intersections are called by native Monte Carlo codes to determine if a particle will cross a surface before reaching its next physics event location. This is the most common geometry query in an average Monte Carlo simulation. Normally in DAGMC a ray is fired each time this query is called. This can be avoided by using the signed distance field to exclude the possibility of a surface crossing without explicitly determining the next surface intersec-tion. If the sum of the signed distance values for both the current particle position and the next physics event location is greater than the distance between the two, then no surface crossing will occur and the particle can safely advance to the next physics event location. For robustness, the error for each interpolation should be subtracted from the sum of the signed distance values as a con-servative measure. If the expanse between the particle's current location and its next physics event interaction cannot be accounted for by the signed distance values of the two points, then a ray will be fired to determine the particle's next surface intersection along that trajectory. Fig. 4 shows a graphic representation of this process. Not all Monte Carlo codes provide the next physics event location along with the particle's current location to their geometry kernels. In this case, preconditioning of these queries will not be possible. Using these methods, the storage of signed distances field for volumes in DAGMC could provide a way to accelerate the Monte Carlo queries listed above by using a Oð1Þ process to establish that the conditions of a geometric queryare such that a more robust and computationally expensive ray is necessary before performing the 1192 P.C. Shriwise et al. / Nuclear Engineering and Technology 49 (2017) 1189e1198 ray tracing operation. It is hypothesized that in many cases during radiation transport, this process can be used to subvert many ray tracing calls and a large number of these OðlogðNÞÞ searches can be avoided. The application of the signed distance field data structure in several test problems indicates that this is true. 3.2. Signed distance value error estimation A critical component of using a sampled signed distance function as a ray firing preconditioner is the evaluation of an error limit for the interpolated signed distance values that allow DAGMC to maintain its robust particle tracking. The failure mode of concern is the scenario inwhich aninaccurate signed distance value resultsina particle being numerically moved outside of the current volume without logicallyleavingthevolume. Thiswillresult ina lostparticle or incorrect tallying of the particle's history caused by the decou-pling of the particle's logical position within the model with the numerical position in space. Such a scenario would arise from sit-uations such as that shown in Fig. 4C, in which the interpolation error is underestimated. However, overly conservative values of the errorestimationwillresult inlower utilizationof thepreconditioner, so it is importantnot to overestimate the error by too large a margin. The errorof linear interpolation is well understood when derived from continuous functions with nonzero second-order derivatives. The formula for the errorof a bilinear interpolation is providedinEq. 4. Extending this representation to 3D and examining the dominant terms of this formulation, the error of the trilinear interpolation is nominally Oðh3Þ where h is the step size of the structured mesh. Considering only these terms, the signed distance value can be found to a high degree of accuracy fora relativelycoarse mesh, but it would be unwise to ignore the remaining terms representing the principal curvature of the surface, particularly given the geometric complexity of the models commonly analyzed using DAGMC. Un-fortunately, triangulated surfaces do not provide a continuous function fromwhich this principle curvature can be evaluated, nor is there a simple way to determine the second-order derivative of the mesh at a given point without encountering a secondary error es- timate for that value as well. structure was implemented for a simple single-volume sphere model to test its utilization and demonstrate performance im-provements. The model consists of a single 10-cm-radius sphere filled with hydrogen of density 1 cm3 and a 5-MeV neutron point source at the sphere's origin. Flux and energy deposition tallies were applied to this volume for result verification between MCNP5, DAG-MCNP5, and DAG-MCNP5 with the signed distance field pre-conditioner applied. Fig. 3 shows the signed distance field (w/SDF) for a sphere of radius 10 cm using MOAB's structured mesh inter-face with a step size of 0.5 cm. The design intent in this test was for the particles to have an average mean free path significantly smaller than the size of the sphere. This highly scattering medium is expected to provide a good problem scenario for the precondi-tioner as it is most effective when particle interactions are frequently occurring far from surface interfaces. Simulations of 100 million histories were run for each implementation listed above. Signed distance field preconditioning was only implemented for next surface intersection queries. A simple sphere presents a worst case for DAG-MCNP5 in comparison to a CSG implementation such as the one that exists in MCNP5. Analytic geometry queries are very simple even in com-parison to other CSG objects, let alone in comparison to a sphere representation composed of hundreds of thousands of triangles, even with DAGMC's existing accelerations. The results of this initial test can be seen in Table 1. This initial test case indicates that signed distance field preconditioning was quite effectivedaccelerating the simulation in comparison to a normal DAGMC run by a factor of 3.5. It should be noted that no differencewas found in either the fluxor energy tallies between the two DAG-MCNP5 runs. 5. Signed distance field preconditioner utilization In effect, the preconditioner is attempting to check whether the particle will cross a surface before explicitly searching for the par-ticle's intersection with a surface along its current trajectory. If the result of this preconditioning check is always false and a ray is al- ways fired, then these checks are only adding to the computational 1 v2u 1 v2u 2 vx2 2 vy2 h mesh interval size (cm) Dx x distance to interpolation point from data point (cm) Dy y distance to interpolation point from data point (cm) u(x,y) sampled function on mesh (cm) ε error (cm) cost of the problem. This will always occur in volumes filled with (4) void, for example, as particles immediately travel from one surface to another. As a result, the signed distance field may need to be applied selectively depending on each volume's geometric and material properties for optimal performance and high utilization of the preconditioning methods. Ideally, this method will only be applied tovolumes inwhich the data structure canprecondition ray fire calls often or with high utilization of the data structure. The signed distance field is expected to have the biggest impact in performance when preconditioning next surface intersection Until a better solution is settled upon to account for the second-order terms, a more aggressive error estimate has been employed. For the work presented here, the error is evaluated as the length of a mesh element's longest diagonal (3 h). This represents an upper queries, as they are most frequently called in Monte Carlo codes when tracking particles through the geometry. As such, this type of query is the focus of utilization measurement for the remainder of this section. bound on the error of the signed distance value, as this is the farthest a location can possibly be from any of the data points while still being contained by that mesh element. This evaluation of the Rays Avoided w= SDF Number of Geometry Queries (5) error has the effect of removing any data in mesh elements which intersect with a volume's surface. This provides a robust manner of using the signed distance field even if utilization could be higher for a more optimistic approach to calculating the interpolation error. 4. Initial performance results The signed distance field (SDF) was first applied to DAGMC coupled with MCNP5 v1.6 [10] known as DAG-MCNP5. This data The utilization, U, of the signed distance field as a ray fire pre-conditioner can be described as the number of ray fire calls related to the next surface intersection queries that are avoided, divided by the total number of next surface intersection queries made by the Monte Carlo code. This value is described in Eq. 5 and can be quantified using this definition using debugging tools, such as Valgrind, during DAGMC simulations. It is expected that in most cases, as the utilization of preconditioning methods goes up, the performance of the simulation will also improve. P.C. Shriwise et al. / Nuclear Engineering and Technology 49 (2017) 1189e1198 1193 Fig. 3. A visual of a signed distance field with step size 0.5 cm surrounding the spherical volume of test case with a radius of 10 cm. f Table 1 Initial results of a signed distance field query preconditioner in DAGMC for a 5-MeV point source at the center of a single 10-cm-radius hydrogen-filled sphere (1 cm3) test case. One hundred million histories were run in each implementation. p Implementation MCNP5 DAG-MCNP5 DAG-MCNP5 w/SDF ctme (min) 2.75 25.04 7.15 wall time (min) 2.75 25.13 7.3 time precond. ratio utilization 1 N/A 9.13 N/A 2.65 0.97 l f without the signed distance field and another with the signed distance field and preconditioning enabled. Fig. 6 shows the results of this study. Utilization of the data structure in this study remains high until the hydrogen density falls to 0.1 cm3 at which point a distinct knee appears and the utilization falls off quickly. Even at the lowest density reached in the study of 0.01 cm3, the utilization of the signed distance field to avoid ray fire calls is 0.54. It is difficult to judge the impact on the performance of this simulation for these low-density values due to the limited size of the geometry and the short-lived histories. As the material density decreases, particles quickly leave the geometry after very few collisions, but Fig. 5 provides an impression of the performance of these three implementations converge as the densityof the hydrogen is varied. The application of the signed distance field allows for significantly improved perfor- mance until the density drops below 0.1 cm3 in agreement with utilization plot. To have more control over a simulation's physical Fig. 4. Visualization of ray preconditioning scenarios. The ε here represents the associated error of the signed distance value interpolation. To understand this utilization more deeply with respect to material parameters, the hydrogen density was varied from 0 to 1 cm3 in the single-volume sphere test problemwith a 5-MeV neutron point source. For each density, one simulation was performed parameters, subsequent experiments were performed using a simple simulation tool. 6. Signed distance field utilization modeling To characterize utilization of a signed distance field as a next surface intersection query preconditioner for ray fire calls in DAGMC, a pseudo Monte Carlosimulation toolwas developed using 1194 P.C. Shriwise et al. / Nuclear Engineering and Technology 49 (2017) 1189e1198 Fig. 5. Performance results for a 5-MeV neutron source at the origin of a 10-cm-radius sphere. Hydrogen density was varied from 0 to 1 cm3. Simulations of 100 million histories at each density were performed using native MCNP5, DAG-MCNP5 without the signed distance field, and DAG-MCNP5 with the signed distance field.

Tài liệu liên quan