B OUNDARY G RAPH N EURAL N ETWORKS FOR 3D S IMULATIONS
Anonymous authors
Paper under double-blind review
A BSTRACT
The abundance of data has given machine learning considerable momentum in natural sciences and engineering.
However, the modeling of simulated physical processes remains difﬁcult.
A key problem is the correct handling of geometric boundaries.
While triangularized geometric boundaries are very common in engineering applications, they are notoriously difﬁcult to model by machine learning approaches due to their heterogeneity with respect to size and orientation.
In this work, we introduce Boundary Graph Neural Networks (BGNNs), which dynamically modify graph structures to address boundary conditions.
Boundary graph structures are constructed via modifying edges, augmenting node features, and dynamically inserting virtual nodes.
The new BGNNs are tested on complex 3D granular ﬂow processes of hoppers and rotating drums which are standard components of industrial machinery.
Using precise simulations that are obtained by an expensive and complex discrete element method, BGNNs are evaluated in terms of computational efﬁciency as well as prediction accuracy of particle ﬂows and mixing entropies.
Even if complex boundaries are present, BGNNs are able to accurately reproduce 3D granular ﬂows within simulation uncertainties over hundreds of thousands of simulation timesteps, and most notably particles completely stay within the geometric objects without using handcrafted conditions or restrictions.
I NTRODUCTION
Deep learning (Krizhevsky et al., 2012) dramatically changed scientiﬁc ﬁelds such as computer vision, natural language processing, or the medical sciences.
More recently, deep learning research has been expanded towards physical simulations such as ﬂuid dynamics, deformable materials, or aerodynamics (Li et al., 2018; Ummenhofer et al., 2019; Sanchez-Gonzalez et al., 2020; Pfaff et al., 2020).
The progress of deep learning in physical simulations was often driven by Graph Neural
Networks (GNNs) (Scarselli et al., 2009; Defferrard et al., 2016; Kipf & Welling, 2017), which proved effective when modeling interactions between many entities via forward dynamics (Battaglia et al., 2018).
Here we want to focus on learning practically relevant granular ﬂow simulations.
Granular ﬂows are ubiquitous in nature and industrial processes.
Pharmaceutical powders, plastic granulates, or rocks obtained by mining are just some examples of granular media that are used in industries and which are processed in a multitude of different ﬂow states.
Consequently, simulations of granular ﬂow processes are required for the design of many industrial processes.
Such simulations allow the optimization of devices and machinery in which particle ﬂow is essential.
These simulations are needed for a wide range of materials and material mixtures, which can have different cohesion or friction properties.
The utilized machines constitute the boundary conditions for the considered granular ﬂow processes.
Many conventional simulation approaches, that are based on a solid mathematical theory and which take complex boundaries into account, model these boundaries by triangularizations.
Therefore, industrial machinery is often represented by triangular meshes, which can be considered a standard geometric description in the engineering ﬁeld.
Figure 1 exemplarily visualizes triangularized surfaces for two standard components in industrial setups, namely a hopper (left) and a rotating drum (right).
In this work, we try to tackle the problem of accurately modeling granular processes when triangularized boundary surfaces are present.
We therefore suggest a simple extension of conventional
GNNs: Boundary Graph Neural Networks (BGNNs).
BGNNs dynamically modify graph structures to model interactions of particles and triangulated boundaries.
This is achieved by inserting virtual nodes, adding edges and modifying node and edge attributes.
We test the effectiveness of BGNNs on complex 3D granular ﬂow simulations of hoppers and rotating drums.
The data for BGNN training is obtained by precise but potentially time-consuming simulations.
The accuracy of our BGNN models is measured via various aggregate quantities, namely averaged particle positions, ﬂows, and mixing entropies.
We ensure that our BGNN models have high simulation quality by requiring high accuracy of the models in terms of these aggregate quantities.
BGNN predictions have the potential to be considerably faster than traditional granular ﬂow simulation methods while keeping the same precision.
Code, training and test data will be made public upon publication.
The main contributions of this work are:
• We introduce Boundary Graph Neural Networks (BGNNs), which dynamically modify graph structures via boundary graph structures to allow an accurate modeling of particle interactions with triangularized boundaries.
• We implement BGNNs for learning complex 3D granular ﬂow simulations of hoppers and rotating drums.
• We assess the BGNN simulation quality via the difference of relevant physical quantities between model predictions and simulations.
We show that BGNNs are able to generalize granular ﬂow dynamics over hundreds of thousands of timesteps while having the potential to be considerably faster than state-of-the-art simulation methods.
B ACKGROUND
Dataset.
Due to the fact that there are no governing equations for granular ﬂow like the NavierStokes equations for ﬂuid ﬂow (Faccanoni & Mangeney, 2013), a method similar to molecular dynamics, the Discrete Element Method (DEM) (Cundall & Strack, 1979) is used for simulating granular ﬂow.
The key idea of DEM is to represent granular media by discrete particles (e.g. spheres or polyhedra), which interact by exchanging momentum using established contact models.
LIGGGHTS (Kloss et al., 2012, see App.
A) is an open-source DEM implementation, which is able to simulate particle ﬂow for a wide range of materials and complex mesh-based wall geometries and, which therefore enables the simulation of many industrial processes.
Consequently, we used
LIGGGHTS to generate training, validation and test set simulation trajectories for granular ﬂow within different hopper and rotating drum environments.
Time transition model.
We build our method upon Sanchez-Gonzalez et al.
and use the semi-implicit Euler method to numerically integrate the equations of motion using model-predicted acceleration.
The time-transition from time 𝑡 to time 𝑡 + 1 is given by (cid:164)
x 𝑡 + 1 = (cid:164) x 𝑡 + Δ 𝑡 (cid:165)
x 𝑡 and x 𝑡 + 1 = x 𝑡 + Δ 𝑡 (cid:164) x 𝑡 + 1 , where x is the particle location, and (cid:164) x the particle velocity.
To calculate the time-transition x 𝑡 + 1 the particle acceleration (cid:165) x 𝑡 is predicted.
Graph Neural Networks.
We consider graphs G =
(V , E) , with nodes 𝑣 𝑖 ∈ V and edges 𝑒 𝑖𝑗 ∈ E , where 𝑁 -dimensional node features p 𝑣 𝑖 ∈ R 𝑁 are attached to each of the nodes.
Whether the graph
G contains an edge between a pair of nodes ( 𝑣 𝑖 , 𝑣 𝑗 ) depends on the distance between the nodes:
[Equation]
where the cut-off radius is usually a hyperparamter of the model.
Edges might have 𝑀 -dimensional edge features a 𝑖𝑗 ∈ R 𝑀 attached to each edge 𝑒 𝑖𝑗 .
Graph networks are designed to learn from graph-structured data (Scarselli et al., 2009; Kipf & Welling, 2017; Defferrard et al., 2016; Battaglia et al., 2018).
Message passing networks (Gilmer et al., 2017) are a speciﬁc type of graph neural networks and usually consist of three different types of layers: node and edge feature embedding layers, the core message passing layers, and read-out layers.
Message passing iteratively updates the embeddings of edges ( m 𝑖𝑗 ) and nodes ( h 𝑖 ), i.e., the embeddings of a 𝑖𝑗 and p 𝑣 𝑖 , at edge 𝑒 𝑖𝑗 and node 𝑣 𝑖 via:
[Equation]
where the aggregation (cid:3) 𝑒 𝑖𝑗 ∈E at node 𝑣 𝑖 in Eq.
(2) is across all nodes that are connected to node 𝑣 𝑖 via an edge 𝑒 𝑖𝑗 .
Typically (cid:3) represents a mean or max operation.
The learnable functions 𝜙 and 𝜓 are commonly presented by Multilayer Perceptrons (MLPs).
Equation (2) describes in a compact form the computation and aggregation of messages, and the subsequent update of node embeddings.
The ﬁnal node embeddings are used for predictions via read-out layers.
B OUNDARY G RAPH N EURAL N ETWORKS
Boundary Graph Neural Networks.
We introduce Boundary Graph Neural Networks (BGNNs) for modeling the time transition dynamics in simulations within complex geometries.
In BGNNs, each graph node 𝑣 𝑖 is associated to a particle with location x 𝑣 𝑖 , velocity (cid:164) x 𝑣 𝑖 and acceleration (cid:165) x 𝑣 𝑖 , which is similar to Sanchez-Gonzalez et al.
BGNNs modify and enhance the graph structure to include boundaries (see Fig. 2).
BGNNs dynamically add ˜ 𝑛 virtual nodes ˜ 𝑣 𝑗 ∈ ˜ V for boundary regions, iff the corresponding boundary region is within a cut-off radius to any other particle.
We augment the set of edges E by boundary edges ˜ 𝑒 𝑖𝑗 giving an enhanced edge set ˆ E with 𝑒 𝑖𝑗 ∈ E and ˜ 𝑒 𝑖𝑗 ∈ ˜ E .
Analogously to Eq.
(1), the existence of particle-particle edges 𝑒 𝑖𝑗 and particle-boundary edges ˜ 𝑒 𝑖𝑗 is determined via:
[Equation]
Note, that the cut-off radii cut-off 𝑒 and cut-off ˜ 𝑒 are not necessarily the same, and, 𝑑 : V × V → R , while ˜ 𝑑 : V × ˜ V
→ R , i.e. bidirectional edges are used between real nodes and unidirectional edges are used between real and virtual nodes.
In order to include more information about boundary surfaces into particle-boundary interactions, ˜ 𝑁 -dimensional node features that encode information about the inclination of triangles in space are concatenated with the existing node features p 𝑣 𝑖 ∈ R 𝑁 .
Additionally, coordinate information is used both for existing nodes ( X = { x 𝑣 0 , . . .
, x 𝑣 𝑛 − 1 } ) as well as for virtual nodes ( ˜ X = { ˜ x ˜ 𝑣 0 , . .
˜ x ˜ 𝑣 ˜ 𝑛 − 1 } ).
For virtual nodes, the additional coordinates ˜ x
˜ 𝑣 𝑗 are chosen such that they minimize the distance between points from boundaries and real particles.
The resulting set of node features ˆ P and node coordinates ˆ X are:
[Equation]
where ˆ p 𝑖 ∈ R 𝑁 + ˜ 𝑁 and ˆ x 𝑖 ∈ R 3 denote the elements of ˆ P and ˆ X , respectively.
Similarly to above, message passing updates the embeddings of edges ( ˆ m 𝑖𝑗 ) and the embeddings of nodes ( ˆ h 𝑖 ) via
[Equation]
where the aggregation (cid:3) ˆ 𝑒 𝑖𝑗 ∈ ˆ
E at node 𝑣 𝑖 in Eq.
(6) is across all real or virtual nodes that are connected to 𝑣 𝑖 via an edge ˆ 𝑒 𝑖𝑗 .
Similar to Gilmer et al.
(2017) and Satorras et al.
(2021), we make use of pairwise distances ( (cid:13)(cid:13)
ˆ x 𝑖 − ˆ x 𝑗 (cid:13)(cid:13) 2 and ˆ x 𝑖 − ˆ x 𝑗 and deterministic functions thereof). These are for
BGNNs between real and between real and virtual particles and we pass this information to the graph network as edge attributes ˆ a 𝑖𝑗 , for which an initial edge embedding ˆ m 𝑖𝑗 is determined via an edge embedding layer.
The ﬁnal node embeddings are used for the predictions via the read-out layers.
For aggregation (cid:3) , we use the mean.
The main challenges of the implementation of BGNNs are the modiﬁcation of the graph structure towards a dynamic boundary graph structure to include boundary information via the introduction of modiﬁed edges ˜ 𝑒 𝑖𝑗 , modiﬁed node features ˆ p 𝑖 , and coordinates for virtual nodes ˜ x
˜ 𝑣 𝑖 .
In the following section, we discuss how ˜ 𝑒 𝑖𝑗 , ˆ p 𝑖 , and ˜ x
˜ 𝑣 𝑖 are calculated.
D YNAMIC B OUNDARY G RAPH S TRUCTURE
A boundary graph structure, which is a dynamic modiﬁcation of the graph structure is needed for two reasons: (i) A static graph structure, which inserts many particles (number proportional to the surface area) for every boundary surface, may result in large computational costs in 3D scenes.
(ii)
For certain time frames, only some parts of the mesh might be relevant and computations can be saved.
For example, as long as particles are in free fall in a container far away from the bottom, the mesh part describing the bottom is irrelevant for the next time step.
One virtual particle is enough to describe particle boundary interactions.
Every particle “sees” at most one virtual particle representing the boundary surface area, namely that particle which has the shortest distance.
Since interaction strength decreases continuously with the distance, it is ensured that for every particle-boundary interaction that boundary point with the largest contribution is considered.
Table 1 shows average numbers of nodes (cid:12)(cid:12) V (cid:12)(cid:12) , as well as average numbers of boundary edges (cid:12)(cid:12)
˜ E (cid:12)(cid:12) and the relative increase in edges (ratio of the number of added wall edges to the total number of particle edges).
The scalability of BGNNs would suffer if more than one particle per particle-boundary interaction surface was considered
[Table]
A dynamic boundary graph structure is obtained in three stages:
• Calculating distances between real particles and triangular boundary surface areas in order to decide if a virtual particle node needs to be inserted into the graph, and subsequently obtain additional edges ˜ 𝑒 𝑖𝑗 • Obtaining positional coordinates for virtual nodes ˜ x
˜ 𝑣 𝑗 as representatives of the relevant fraction of the triangular surface area ˜ x
˜ 𝑣 𝑗 • Modifying node features ˜ p 𝑖 by including normal directions to facilitate the learning of geometric relationships between particles and boundary surfaces
Modiﬁed edges ˜ 𝑒 𝑖𝑗 via calculation of distances to boundaries.
To obtain modiﬁed edges ˜ 𝑒 𝑖𝑗 , boundary particles are dynamically inserted, but only if a real particle is close to the corresponding boundary.
The insertion of unnecessary edges into the graph is avoided.
Such edges would connect nodes of real and virtual particles, although they are far apart.
To decide whether a virtual particle has to be inserted requires the calculation of distances between pairs of real particles and mesh triangles.
Speciﬁcally, the squared distance between the particle center and the closest point on the mesh triangles is calculated (adopted from (Eberly, 1999)).
For this purpose, a location on a triangle t is parametrized by two scalar values 𝑢 and 𝑣 ∈ R :
[Equation]
where 𝑢 ≥ 0 , 𝑣 ≥ 0 , and 𝑢 + 𝑣 (cid:54) 1 , b represents one of the nodes of the triangle, and, e 0 and e 1 are vectors from b towards the other two nodes (see Fig. 3).
The minimal Euclidean squared distance 𝑞 of the point p to the triangle is given by the optimization problem:
[Equation]
The minimizing arguments 𝑢 (cid:48) and 𝑣 (cid:48) parametrize the closest point t ( 𝑢 (cid:48) , 𝑣 (cid:48) ) of the triangle to the point p .
As indicated in Fig.
3, seven cases have to be to distinguished: one case (c0) in which t ( 𝑢 (cid:48) , 𝑣 (cid:48) ) is located within the (closed) triangle, three cases (c1, c3, c5) in which t ( 𝑢 (cid:48) , 𝑣 (cid:48) ) is located on one edge of the triangle (including the edge corner points as special cases), and three cases (c2, c4, c6) in which t ( 𝑢 (cid:48) , 𝑣 (cid:48) ) is located on one of two edges (including the triangle corner points as special cases).
Whether a virtual particle is inserted is determined by Eq.
(4) and the particle-triangle distance 𝑑 .
[Figure]
Positional coordinates ˜ x
˜ 𝑣 𝑗 for virtual nodes.
After having modiﬁed the edges ˜ 𝑒 𝑖𝑗 via the calculation of distances between real particles and triangular boundary surface areas, we now have to decide where to place the virtual particles on these boundary surface areas.
For virtual particles the coordinates ˜ x ˜ 𝑣 𝑗 correspond to t ( 𝑢 (cid:48) , 𝑣 (cid:48) ) , i.e., the closest points on the triangular boundary surface areas with respect to the interacting real particle.
Modifying node features ˆ 𝑝 𝑖 by including boundary normal directions.
Typical granular ﬂow simulations comprise substantially more particle - particle interactions than particle - boundary interactions, which may impede the learning of particle - boundary interactions.
In Kipf et al.
the problem of qualitatively different interactions is addressed by introducing a dedicated message generating network for each interaction type.
We avoid such extensions of our model by means of the following two approaches.
First, we introduce additional node features, such that the neural network is able to distinguish the different types of nodes.
Second, we adapt the weight initialization of the node feature embedding ˆ 𝜓 , such that the embedding network can be trained with larger values for the additional features.
Consequently, the network can learn different dynamics for particle - particle and particle - boundary interactions.
The additional node features are: (i) type feature, i.e., a binary indicator of whether a node represents a particle that is real or virtual, and, in the latter case, (ii) the components of the normal vector (see App.
B for more information on an orientation-independent representation of the normal vectors) of the triangular surface areas (null vectors for real particles).
R ELATED W ORK
There is a rich body of literature on applications of Deep Learning in the context of physics simulations.
Most notably related to BGNNs are the works of Sanchez-Gonzalez et al.
(2020), Ummenhofer et al.
(2019), and, Li et al.
(2018), all of which propose methods of learning particle simulations without enforcing constraints.
These approaches can be contrasted to works like Ladick`y et al.
(2015) or
Schenck & Fox (2018) that utilize strong inductive biases.
Ladick`y et al.
(2015) construct features for Random Forest Regression that are inﬂuenced by Smooth Particle Hydrodynamics (Gingold &
Monaghan, 1977; Lucy, 1977).
Schenck & Fox (2018) construct a differentiable ﬂuid dynamics network that is closely related to the Position Based Fluids method (Macklin & Müller, 2013).
Importantly, both methods are built on the assumption that the governing equations of the system are known, which is typically not the case for granular ﬂow dynamics.
Complex mesh-based wall geometries have been employed to compute updates for nodes of the mesh itself (Pfaff et al., 2020).
In contrast, our simulator utilizes the mesh to represent static boundaries in a highly efﬁcient way.
We share the opinion of Sanchez-Gonzalez et al.
that the network architecture with continuous convolutions as suggested by Ummenhofer et al.
(2019) can be interpreted as GNNs.
In doing so, a difference to Sanchez-Gonzalez et al.
and our work is that Ummenhofer et al.
(2019) use static particles as special nodes in the ﬁrst message passing step only.
Consequently, the framework of Sanchez-Gonzalez et al.
(2020), which is based on Battaglia et al.
(2018), appears to be the most general to us, performing well even without explicit hierarchical clustering as suggested in DPI-Net (Li et al., 2018).
Experiments of Sanchez-Gonzalez et al.
(2020) further suggest that their simulation of sand particles are superior to the implementation of Ummenhofer et al.
However, Sanchez-Gonzalez et al.
(2020) only consider simple cuboid boundaries for their 3D simulations, leaving more realistic complex geometries as an open and yet untouched challenge.
Furthermore, they use sampled, static particles to represent boundaries for 2D simulations, which in general does not scale well for 3D simulations due to the quadratic increase of boundary particles (square areas instead of lines).
E XPERIMENTS
We test the effectiveness of BGNNs on complex 3D granular ﬂow simulations.
The development, design, and construction of many mechanical devices is based on granular ﬂow simulations.
These devices can have very different geometries and must be designed for a wide range of materials with highly varying properties.
For example, cohesion properties can range from dry, wet, to oily.
In the simulations, we consider very common device geometries and different cohesion properties to cover a wide range of situations with our available computational resources.
The two common geometries are hoppers and rotating drums (see Fig.
1, Fig. 4, and Fig. 5).
The two different cohesion properties are non-cohesive describing liquid-like, oily materials and cohesive describing dry, sand-like materials.
We compare the BGNN predictions to the simulations in two aspects: speed and accuracy.
Simulation Details.
For all experiments, gravitation acts along the 𝑧 -direction.
The upper part of the hopper is delimited along the 𝑦 -axis by two planes, which are parallel to the 𝑥 - 𝑧 plane (see
Fig. 4).
The 𝑥 -axis is delimited by two planes, that are inclined at certain angles 𝛼, 180 ◦ − 𝛼 to the 𝑥 - 𝑦 plane and at corresponding angles
𝛼 − 90 ◦ , 90 ◦ − 𝛼 to the 𝑦 - 𝑧 plane.
The hopper has an initially closed hole at the bottom, which has an adjustable radius.
The rotation axis of the drum is the 𝑦
-axis
(see Fig. 5).
The initial ﬁlling of the hopper and drum is done by randomly inserting particles into a predeﬁned region.
More information can be found in App.
C. We use around 1000 and around 3000 particles for hopper and rotating drum simulations, respectively.
In order to have trajectories with non-cohesive and cohesive particles, we use the simpliﬁed JKR model (Roessler & Katterfeld, 2019) with a cohesion energy density of
J/ 𝑚 3 and 10 5 J/ 𝑚 3 for non-cohesive and cohesive particles.
The training data consists of 30 simulation trajectories, where each trajectory consists of 100.
(250.000) simulation timesteps for hopper (rotating drum).
For BGNN training every 40 (100)-th timestep is used.
Trajectories have different angles 𝛼 and different hole radii (hopper) and different initial particle placement (drum).
Moreover, the number of particles is varied by ± 25% .
Implementation Details.
We use 5 message passing layers, with 128 and 512 nodes for intermediate node and edge representation.
The cut-off radii strongly depend on the particle size.
We use cut-off radii of 0.02 and 0.008 for rotating drum and hopper, respectively.
Cut-off radii have been treated as hyperparameter of our model.
More details can be found in App.
C.
Assessment Of Physical Quantities.
Granular ﬂow simulations should correctly describe systems on macroscopic scales in terms of particle-averaged positions ¯ x ( 𝑡 ) and particle ﬂows ¯ v ( 𝑡 ) for 𝑛 particles as a function of time: ¯ x ( 𝑡 )
=
1 𝑛 (cid:205)
𝑖 x 𝑖 ( 𝑡 ) and ¯ v ( 𝑡 ) =
1 𝑛 (cid:205) 𝑖 v 𝑖 ( 𝑡 ) .
Hoppers are devices that aim at adjusting the ﬂow of particles along the direction of gravity, which coincides with the 𝑧 -axis in our experiments.
Rotating drums are commonly utilized as mixing devices for various applications in e.g. industry, research, and agriculture.
They are essentially rotating cylinders that are partially ﬁlled with a granular material.
The mixing property of these devices is a result of numerous particle interactions under time-varying boundary conditions.
For rotating drum experiments, we quantify the extend of particle mixing via the mixing entropy (Lai & Fan, 1975).
If the z-coordinate of a particle’s initial position x 𝑖 ( 0 ) is above (below) the median z-coordinate of all particles in the initial state, we assign it to class 𝑐 = + 1 (− 1 ) .
Based on this assignment local entropies 𝑠 ( g 𝑘𝑙𝑚 , 𝑡 ) at grid cells g 𝑘𝑙𝑚 are calculated, where the indices 𝑘𝑙𝑚 identify an individual grid cell.
The local entropies 𝑠 ( g 𝑘𝑙𝑚 , 𝑡 ) are computed from particle counts 𝑛 𝑐 ( g 𝑘𝑙𝑚 , 𝑡 ) , of the respective classes 𝑐 = ± 1 .
The total number of particles in a grid cell is obtained by 𝑛 ( g 𝑘𝑙𝑚 , 𝑡 ) =
𝑛
+ 1 ( g 𝑘𝑙𝑚 , 𝑡 ) + 𝑛 − 1 ( g 𝑘𝑙𝑚 , 𝑡 ) .
Calculating the particle-number weighted average of the local mixing entropies yields the mixing entropy S ( 𝑡 ) of the entire system:
[Equation]
where 𝑓 𝑐 ( g 𝑘𝑙𝑚 , 𝑡 ) denotes the relative fraction of class 𝑐 particles in cell g 𝑘𝑙𝑚 at time 𝑡 .
Results.
In Fig.
4 and Fig.
5 results for the hopper and the rotating drum simulations are presented.
The left parts visualize granular ﬂow snapshots at different time steps, both for cohesive and noncohesive materials.
The right parts of the ﬁgures include average position and particle ﬂow plots for hopper, as well as particle ﬂow and mixing entropy plots for rotating drum simulations.
The simulation uncertainties arise due to the different distributions of the initial ﬁlling and due to a ± 25% variation in the number of particles across simulations.
Short video clips of the trajectories are added as supplement.
The difference between cohesive and non-cohesive particles is evident.
BGNNs have learned to model granular ﬂow simulations over thousands of time steps.
Most notably, hardly any particle leaves the geometric boundaries.
This is achieved without using handcrafted conditions or restrictions on the positions of the particles.
Furthermore, BGNNs have learned to model particle-boundary interactions and in doing so correctly represent the dynamics within the system.
The predicted quantities are within uncertainties of the simulations.
Therefore, we consider the BGNN predictions as sufﬁciently precise to substitute the simulations.
Figure 6 shows out-ofdistribution (OOD) scenarios, where the devices are changed with respect to the training data.
The hole size of the hopper is decreased in mean by ∼ 50%, while side wall inclination angles have been increased by ∼ 15°.
For the drum the length of the corresponding cylinder was increased in mean by ∼ 50%.
Our experiments show that our model generalizes well across variations in the geometry.
This ﬁnding demonstrates that trained BGNNs could be used in the design process of a device to study variations of geometries without retraining the model.
Table 2 gives a run-time comparison of the LIGGGHTS simulation versus a forward pass of BGNNs, which only predict every 100 time steps.
The highly optimized CPU algorithm (LIGGGHTS) and a non-optimized GPU compatible algorithm (BGNNs) are compared via their wall-clock times since the hardware settings are quite different.
Nevertheless, Tab. 2 shows that the wall-clock time of
BGNNs is shorter than the wall-clock time of the simulation.
The usage of more particles, would further increase the lead of BGNNs over the simulation in terms of wall-clock time.
For the time comparison, we use a typical simulation trajectory from our datasets with 3,408 particles, which needs approximately 2 GB GPU memory for one forward pass.
There is potentially even more space for improvement of the BGNN predictions over simulations due to the so called Young’s modulus .
For simulations, it is often assumed that energy is purely transmitted through Rayleigh waves.
Thus the time step of DEM simulations is targeted to be a fraction of the propagation time through a single, solid particle.
As such the propagation time depends on material parameters, most notably the Young’s modulus.
However, for several materials the Young’s moduli that reﬂect the true material properties, would lead to extremely small propagation times, which in turn means much more simulation steps.
Consequently, much smaller Young’s moduli are considered as an approximation, which is valid for gravity driven ﬂows (Coetzee, 2017).
However, for many cases, e.g. the penetration of a particle bed by an object, this approximation breaks down (Lommen et al., 2014).
BGNNs have the potential to be trained on very small time steps reﬂecting the true Young’s moduli and consequently generalize over much more than “just” 40 or 100 time steps.
[Table]
[Figure] [Figure]
C ONCLUSION AND F UTURE D IRECTIONS
[Figure]
We have introduced Boundary Graph Neural
Networks (BGNNs) in order to achieve an accurate neural network modeling of simulated physical processes with complex geometries.
BGNNs dynamically modify graph structures via modifying edges, augmenting node features, and dynamically inserting virtual nodes.
We have tested BGNNs on complex 3D granular ﬂow processes of hoppers and rotating drums, where BGNNs are able to accurately reproduce these ﬂows within simulation uncertainties over hundreds of thousands of timesteps.
Most notably particles stay within the geometric objects without using handcrafted conditions or restrictions.
However, it should be mentioned that successful simulations often require precise hyperparameter tuning.
So far we have not investigated materials with high Young’s moduli, and thus we have not yet tested the full generalization properties of BGNNs for such scenarios as described in Sec. 6.
Another interesting extension of our work might be to introduce a velocity dependent cut-off radius, and in doing so to also consider those interactions which are going to happen within the next timesteps although the spatial distance for particles and respective boundaries is still large.
R EPRODUCIBILITY S TATEMENT
Nearly all data used in this work is generated by ourselves.
The generalization properties strongly depend on the variability of the training samples since we used a limited number of training samples due to computational reasons.
We made sure to keep track of the used parameters to be able to reproduce these datasets.
To support the reviewing process, we provide simulation predictions for a hopper with more timesteps in animations at https://bgnn3dsim.bitbucket.io/
We have included error bars and uncertainty estimates wherever we found it necessary and appropriate.
For example, for the hopper and drum example, we considered simulation uncertainties.
We selected hyperparameters based on a separate validation set.
Besides noise terms for the sack of regularization, one might fairly similar models if applying the same training and hyperparameter selection procedure.
We have described our architecture and implementation details in Appendix C. We have further provided supporting concepts and experiments in the appendix.
For reproducibility, we plan to provide our code upon acceptance.
For reproducibility, we plan to provide our code upon acceptance.
E THICAL S TATEMENT
BGNNs might serve as a valuable tool to obtain speedups for the simulation of industrial processes.
However, models obtained, may strongly depend on the variability of the training data.
Although we performed some OOD experiments, that showed that our models might still perform well under certain geometric aberrations, it is quite clear that a single model will not be able to properly predict the ﬂow dynamics of any arbitrary conceivable granular ﬂow setups without ensuring that this behaviour might have been successfully derived from the limited training data.
Therefore, the employment of
BGNNs needs careful validation wrt.
the speciﬁc application in mind.
A D ISCRETE E LEMENT M ETHOD (DEM) SIMULATOR LIGGGHTS
The open source DEM software LIGGGHTS (Kloss et al., 2012) is based on the Molecular Dynamics code LAMMPS (Plimpton, 1995) developed by Sandia National Labs.
Due to the similarity of the underlying algorithms for neighbor list construction, output and parallelism this provided a stable basis for the contact models required for DEM.
LIGGGHTS added support for triangular mesh walls, particle insertion and new particle shapes (multispheres and superquadrics).
Several of those changes resulted in upstream contributions in LAMMPS.
Over the years LIGGGHTS has become a widely used software in both academia and industry that supports both cutting edge research and industrial applications.
Support for several physical phenomena as, e.g. liquid transfer on particles, was instrumental in its success.
However, it also highlighted requirements for additional research.
In industrial applications there often is the need to study physical phenomena which occur on different time scales, e.g. particle collisions ( O( 10 − 5 𝑠 ) ) vs. moisture content in particles ( O( 1 𝑠 ) , (Mellmann et al., 2011)), which can lead to weeks of simulation time.
While advances have been made to overcome such issues (e.g. (Kloss et al., 2017)), they remain limited in their application, due to the fact that they rely on prior simulation of the exact setup and cannot be used for interpolation of quantities directly related to the ﬂow behavior.
In 2019 LIGGGHTS was again forked and forms the basis of the commercial DEM software
Aspherix® which expands the capabilities of LIGGGHTS with polyhedral particles, a signiﬁcantly simpliﬁed input language and graphical user interface.
B N ORMAL V ECTOR R EPRESENTATIONS
There is an ambiguity in the representation of planes via normal vectors due to the two possible orientations of the normal vectors, which correspond to the same geometry.
In general, there are two possibilities of including normal vector information into the model: (i) encoding always that triangle plane normal vector which always points towards or away from the corresponding particle, (ii) including positively and negatively oriented versions of the normal vector, and order them.
We decided for option (ii) since pathological cases where the particle is in the same plane as the triangle are avoided and training is further stabilized.
In doing so, we have to deal with the fact that the network predictions should be invariant with respect to the orientation of the normal vectors.
Therefore, we deﬁne a partial ordering which is able to sort the normal vectors with respect to their orientations.
For a given normal vector n = ( 𝑛 1 , 𝑛 2 , 𝑛 3 ) ∈ R 3 , we use the following partial order function
[Equation]
to retrieve the scalar values 𝑓 𝑜 ( n ) and 𝑓 𝑜 (− n ) and sort the two vectors according to their corresponding mapped values.
Different sign combinations of the normal vectors are shown in App.
Fig.
B.1.
To test the performance of our approach, we conduct a toy experiment as well as a simulation experiment with different representations of normal vectors.
We describe both experiments in App.
B.1 and
App.
B.2.
B. R EFLECTION T OY E XAMPLE
We conduct a toy experiment to showcase that a partial ordering of normal vectors is helpful for learning 3D simulations.
In detail, we consider reﬂection ( 𝑅𝑒 𝑓 ) at a plane n as given by
[Equation]
and try to learn the reﬂection formula by a simple ReLU network, which takes the 3 components of n and v as input features and predicts the 3 components of 𝑅𝑒 𝑓 n ( v ) .
The training data consists of reﬂections at four ﬁxed walls: the top, the bottom, the left, and, the right side of a simple cube.
We use normal vectors of these walls, that point towards the inner of the cube.
When evaluating the performance of the trained models, we observe decent predictions, if the orientation of the normal vectors describing the inclination of the walls was equal to the training data (see R1-R4 in Fig.
B.2).
However, for inverted normal vectors in the test set, only networks which take a partial ordering of the normal vectors into account predict the reﬂection correctly (see R3, R4 in Fig.
B.3).
+1/ − 1/ −+1/ − 1/+ − 1/+1/ −− 1/+1/+ − 1/ − 1/+ +1/+1/
−+1/+1/+ − 1/ − 1/ −− 1/0/+1 0/+1/+1 +1/0/+1 0/ − 1/+ 0/+1/ − 1 0/ − 1/ −− 1/0/ − 1 +1/0/ −+1/+1/ − 1/+1/ +1/ − 1/ − 1/ − 1/ 0/0/+ 0/0/ −0/+1/ − 1/0/ +1/0/ 0/ − 1/
B. S IMULATION E XPERIMENT
We compare three different versions of how to include normal vector information for the hopper particle ﬂow experiments:
• not including normal vector information, and ﬁlling six node features up with zero entries instead (V1) • including single normal vector orientation, which is given by the triangle corner point order of the mesh (V2) • including both normal vector orientations (six features) (V3).
From an information perspective, it should be noted that (i) distance information (scalar distance and distance vectors) to the walls is present in the edge features of the graph and (ii) in most cases the used normal vectors are oriented towards the outside of relevant border walls.
The different particle distribution trajectories obtained by the three versions are compared by computing the Earth Movers distances (Bonneel et al., 2011; Flamary & Courty, 2017, EMD) of predicted and simulated trajectories.
We use Euclidean distances for the cost matrix, which we compute at time steps 2 0 , 2 1 , · · · , 2 16 for 5 training trajectories and 5 test trajectories.
Table B.1 shows the means ( 𝜇 ) and standard deviations ( 𝜎 ) of EMD values at different time steps and from 5 different training and test trajectories.
A paired Wilcoxon test on the concatenated trajectories, shows that V3 signiﬁcantly outperforms V1 (p-value 2.42e-04) and V2 (p-value 1.50e-03) on the test data.
Interestingly, there is less signiﬁcance on the training data, which might indicate that the usage of orientation-independent features to represent walls, helps to improve generalization performance, while it might not be that helpful for optimization purposes alone.
[Table]
ground truth: n wall normal vectors incident rays reﬂected rays predicted reﬂected rays
R1: n
R2: n , − n
R3: (cid:26) n if f o ( n ) (cid:54) f
o (− n ) − n otherwise
R4: (cid:26) n , − n if f o ( n ) (cid:54) f
o (− n ) − n , n otherwise
[Figure]
wall normal vectors incident rays reﬂected rays predicted reﬂected rays
R1: − n
R2: − n , n
R3: (cid:26) − n if f o (− n ) (cid:54) f
o ( n ) n otherwise
R4: (cid:26) − n , n if f o (− n ) (cid:54) f
o ( n ) n , − n otherwise
C E XPERIMENTS C. S IMULATION DETAILS
Hopper The initialization consists of two phases.
In a ﬁrst step, particles are randomly inserted into a small cuboid which is positioned at a certain height above the closed hole of the hopper.
This cuboid is continuously ﬁlled with particles during the initialization phase and afterwards particles freely move downwards (along the direction of gravity).
In this way, the hopper is ﬁlled up to a certain height with 20,000 particles.
In a second phase, we cut out particles from the ﬁlled mass of particles.
We do this (i) by applying randomly selected functions and by (ii) randomly ﬁltering out particles from the whole particle mass.
The randomly selected functions are e.g. hyperplanes, where we only keep particles if they are at the same side of the hyperplane.
The inserted particles have a radius of 0.002 m.
Drum For initialization we assume that the direction of gravity is different than the usual gravitation direction.
We insert particles at two random ﬁxed regions within the drum.
After the particles are inserted, they can move according to the gravitation direction during the initialization phase.
In this way, we obtain different initial particle distributions within the drum.
The inserted particles have a radius of 0.01 m.
C. I MPLEMENTATION DETAILS
Graph Neural Network Raw inputs to our graph networks are initial particle positions and the particle positions from the 5 previous frames of the simulations.
From these positions velocities are computed.
Further inputs include the particle type and the coordinates of the triangle mesh of the respective time frame.
We use residual connections (He et al., 2016) for both node and edge updates.
For both updates, we use simple two-layer MLP networks, ReLUs (Nair & Hinton, 2010) after the ﬁrst layer, and layer normalization (Ba et al., 2016) without an additional activation after the second layer.
For layer normalization we consider the 𝜖 -parameter as a hyperparameter and set it to 1 . 0 .
The networks for input embedding and read-out are similar to the message passing layers without layer normalization.
The network weights are initialized similar to He et al.
; for the input embeddings we assume an increased number of input neurons for fan_in , where we consider the additional neurons as virtual copies of e.g. the wall indication feature in order to be able to upweight the inﬂuence of these features.
We use the mean-squared error as an objective and train with Adam optimization (Kingma & Ba, 2015).
In order to facilitate learning, we provide as hyperparameter options not only (cid:13)(cid:13)
ˆ x 𝑖 − ˆ x 𝑗 (cid:13)(cid:13) 2 , ˆ x 𝑖 − ˆ x 𝑗 as features to the network, but also 1 (cid:107) ˆ x 𝑖 − ˆ x 𝑗 (cid:107) , ˆ x 𝑖 − ˆ x 𝑗 (cid:107) ˆ x 𝑖 − ˆ x 𝑗 (cid:107) 2 and 1 (cid:107) ˆ x 𝑖 − ˆ x 𝑗 (cid:107) 2 , ˆ x 𝑖 − ˆ x 𝑗 (cid:107) ˆ x 𝑖 − ˆ x 𝑗 (cid:107) 3 reﬂecting the inverse distance law and the inverse-square law, which are present in many physical laws.
We normalize input and target vectors and use a variant of Kahan summation (Kahan, 1965; Klein, 2006) in order to compute numerically stable statistics across particles of our dataset.
Hyperparameter Selection
We keep 5 trajectories for each setting aside for validation.
Criterions for hyperparameter selection are (i) that particles stay within the geometric object, and (ii) that the ground truth trajectory is reproduced.
C. E XPERIMENTAL R ESULTS F OR C OHESIVE M ATERIAL
In the following, experimental results for a cohesive material are shown.
The results in the main paper are obtained for non-cohesive granular material, i.e. material with a cohesion energy density of 0 J/ 𝑚 3 , which results in liquid-like behaviour.
Increasing the cohesion energy density to 10 5 J/ 𝑚corresponds to cohesive granular material, i.e. the particles have a strong tendency to clump together.
Figure C.1 shows the corresponding comparison of physical quantities for the cohesive granular material.
Like in the non-cohesive case, the predictions for cohesive granular material are widely in agreement with the ground truth simulation.
C. A WORD ON HOPPER OOD EXPERIMENTS
For hopper geometries (see e.g. Fig. 4), OOD experiments are characterized by an increase of the side wall inclination angles and by an decrease of the radii of the outlet sizes.
Especially due to the latter, we expect fewer particles to hit the ground for OOD architectures if particle-particle and particle-boundary interactions are correctly modeled.
In order to statistically test OOD trajectories against in-distribution trajectories, we consider the proportion of particles which have traversed through the outlet of the hopper.
We therefore create 15 in-distribution and 15 OOD trajectories for both cohesive and non-cohesive materials.
We then apply a Mann-Whitney U test which assesses the proportion of in-distribution against the proportion of OOD particles traversing the outlet.
The null hypotheses is that the same or a higher proportion of particles traverses the outlet for the case of an
OOD trajectory compared to an in-distribution trajectory.
[Table]
The Mann-Whitney U test shows that the predicted proportion values are signiﬁcantly lower for OOD than for in-distribution trajectories (p-value < 1 .
4 ∗ 10 − 4 for the cohesive material and p-value < 1 .
2 ∗ 10 − 4 for the non-cohesive material).
We remind the reader that this is expected due to the on average reduced outlet size in OOD geometries.
Furthermore, we compare the predicted proportion values of the cohesive and the non-cohesive model under the null hypothesis that the same or a higher proportion of particles traverses the outlet for the case of cohesive trajectories compared to non-cohesive trajectories.
The applied Mann-Whitney U test yields a p-value < 1 .
70 ∗ 10 − 06 for the alternate hypothesis that the proportion is lower for the cohesive model, which is also in agreement with rational arguments (cohesive particles tend to clump together) and observations.
C. M IXER
Additionally to hopper and rotating drum geometries, we apply BGNNs to the geometry of rotating mixers.
Interactions within the mixer geometry are especially challenging, since a large number of particles is affected indirectly by the blades at the border and especially those in the middle of the mixer.
Figure C.2 shows mixer dynamics
The left parts visualize granular ﬂow snapshots at different time steps, where BGNN predictions and ground truth data are contrasted.
The right parts of the ﬁgure include a ﬂow proﬁle and an entropy curve plot.
C. A BLATION STUDIES
For ablating BGNNs, three design choices are veriﬁed:
Is our sampling procedure more effective than a dense sampling of the triangularized boundary surface areas?
Is a unidirectional particle-wall interaction sufﬁcient to learn the corresponding particle-wall dynamics?
Is the mean node aggregation the right choice for the message passing node updates as outlined in Eq.
In Figs.
C.3, C.4, C.5, C.6 these three points are assessed for cohesive and non-cohesive particles in hopper and rotating drum geometries, respectively.
Consistent results across both geometries and particle types are: (i) dense sampling of the boundary surface areas did not learn particle - wall interactions well, and, (ii) max node aggregation did not seem to work.
For including bidirectional edges instead of unidirectional ones, the behaviour was not completely consistent.
[Figure]
A reason, why we have not been able to successfully train models for dense sampling may be an increased number particle-wall interactions, which might make it more complicated to successfully train such a model, especially if the number of training trajectories is limited.
For unidirectional particle - wall edges, we could successfully learn a model for cohesive particles of the hopper and for both particle types of the rotating drum; the ablation experiment was however not successful for later stages of non-cohesive particles in the hopper.
From a methodological point of view it should be noted that the reason why we skipped bidirectional edges was that unidirectional particle-wall interactions are simpler and easier to train.
In any case, the ablation experiments did not show advantages over our default model architecture, but seemed to conﬁrm our choice.
Throughout all ablation
[Figure] [Figure]
[Figure] [Figure]