WELSIM is the #1 engineering simulation software for the open-source community.
Sunday, August 24, 2025
Methods for Automatic Particle Generators
Modern engineering simulation software is not only capable of analyzing continuous domains, for instance, using the finite element method (FEM) to compute structures, fluids, or electromagnetic fields, but it also has enough computational process for discontinuous particle systems. Examples include pure particle molecular dynamics, discrete element methods (DEM), smoothed particle hydrodynamics (SPH), and coupled simulations with FEM. The primary prerequisite to compute particle systems is having the ability to generate particles within a model, including data of the particle positions, shapes, and volumes. This is similar to how in finite element analysis, a mesh containing nodes and element information must first be created.
When simulating particle systems, the first step is to generate the position, size, and shape of the particles. Thus, the particle generator becomes a critical component of the entire analysis system. A good particle generator should be able to quickly produce initial-state particles and generate particles according to various shapes and boundary conditions. Common automated particle generation methods are lattice structures, finite element mesh conversion, and network growth. This article discusses these well-known particle generation methods for SPH systems and their implementation mechanisms.
Lattice Structures
Lattice-based generation is particularly suitable for microscale materials. Typical structures include FCC (face-centered cubic) and BCC (body-centered cubic) lattices, which are often found in crystalline materials. Once the initial lattice structure is defined, the particle generator replicates this structure to fill the entire region.
Press enter or click to view image in full size
For this method of particle generation, the user needs to provide the boundary of the simulation domain (usually a bounding box), the particle type within each lattice, and the spacing between particles. Algorithmically, this is a straightforward approach, so it is widely applied in molecular dynamics and similar particle-based simulations.
Finite Element Mesh Conversion
A finite element mesh consists of nodes and elements; the element types vary depending on the model. Instances include tetrahedral and hexahedral solid meshes, as well as triangular and quadrilateral surface meshes. Since meshes can represent irregular geometries, the irregular shape stays captured once converting them into particles. In particle systems coupled with FEM, this particle generation approach allows for convenient coupling with finite element computations, as commonly seen in particle-FEM and SPH analyses.
Press enter or click to view image in full size
The general procedure for converting a mesh into particles involves calculating the centroid of each element and its characteristic size. These values determine the position and size of each particle. In principle, each finite element corresponds to one particle. However, because FEM meshes may be non-uniform, it may cause the resulting particle distribution to be uneven. Additional integration may be required to refine the generated particles, and boundary particles may also require special marking to enable the addition of boundary conditions in later simulations. In computational fluid dynamics (CFD), particles can also enter the simulation domain continuously through specified inflow boundaries. Currently, WELSIM supports particle generation from finite element meshes.
Network-Based Generation
Another common particle generation method is based on network growth, often implemented with tree and branching algorithms. Starting from an initial trunk structure, branches are allowed to grow within a fixed region according to specific rules, generating new branches (particles). By providing parameters such as a starting point, second point, segment length, gradient, and initial shape, particles can be generated iteratively. This is how new branches are created. Typically, if a new branch is too close to an existing one or belongs to the same parent particle, it is discarded. This approach incorporates randomness through stochastic processes, resulting in particle distributions with a degree of variability.
Conclusion
This article introduced conventionally used automated particle generation methods in simulation software. For FEM-related software, mesh-to-particle conversion is particularly practical, as the generated particles can be directly applied to FEM-coupled simulations. The general-purpose FEM software WELSIM already supports mesh-to-particle conversion, and users are able to export the generated particles to utilize in other analyses.
Wednesday, August 20, 2025
自动化生成仿真粒子的方法
现代工程仿真软件不仅具有分析连续介质的功能,如有限元方法计算结构、流体、或电磁场。也有增强了对非连续粒子系统的计算能力,如纯粒子的分子动力学计算,离散元,光滑粒子流体动力学(SPH),以及与有限元耦合的计算。计算粒子系统的首要条件就是能够在模型中产生粒子,包含了粒子的位置,形状,和体积大小等数据。这与有限元分析需要生成含有节点和单元信息的网格类似。
Image
在计算粒子体系时,第一步是生成粒子的位置,大小,和形状。因此,粒子生成器也就成为整个分析系统的关键部分。好的粒子生成器可以快速生成初始状态粒子,还可以根据不同的形状和边界来生成粒子。常见的自动化粒子生成方式有,晶体点阵,网络生长,和有限元网格转换。本文就讨论常见的可用于SPH系统的粒子生成方法,及其实现机理。
晶体点阵(Lattice)
使用点阵方式生成粒子是一种常见的方式,尤其适用于材料的微小尺度的计算。如材料晶体结构中常见的FCC、BCC等结构。当初始的点阵结构给定以后,粒子生成器会复制这个结构并铺满整个区域。
Image
对于此类型的粒子生成,需要用户提供整个模拟区域的边界,通常是一个矩形盒子,每个点阵中粒子类型,和粒子之间的位置。算法上,这也是一种简单直接的粒子生成方式,大量应用于分子动力学等粒子生成之中。
有限元网格转换
有限元网格是一种包含了节点与单元的数据,根据模型的不同,单元的类型也会不同。这种网格是有限元分析计算中的基础数据之一。代表性的有四面体和六面体实体单元网格,和三角形与四边形平面网格。网格可以表达不规则的形状,因此,转换成为粒子后,也可以表征不规则的形状。在与有限元结合的粒子系统中,这种粒子生成方式,能够方便与有限元计算进行耦合,如常见的粒子有限元和SPH分析。
Image
转换网格到粒子的常用方法是,获取网格每个单元的重心,和单元的直径大小。以此确定每个粒子的位置和大小。原则上每个单元会对应生成一个粒子。由于有限元网格的密度可能不均匀,以此方法生成的粒子分布也不均匀。有时需要再将生成的粒子进行均匀化处理。对于位于边界的粒子,可能还需要标记额外的内容,以方便在后续的分析中施加边界条件。如流体动力学计算(CFD)中,会在某个流入边界中不断生成粒子进入仿真区域。WELSIM已经能够根据有限元网格生成粒子的功能。
基于网络增长生成
另一种常见的粒子生成方式是通过网络增长,具体的算法上常使用树与分支的方式。初始一个树状结构的主干,允许分支在固定区域内按照一定方式生长,生成新的节点,即粒子。在输入起始点和第二个点,片段长度,梯度,初始形状等参数后。这种生成方式的核心是如何创立新的分支,通常的做法是,如果新节点与当前某个节点位置很近,或者都属于同一个父节点,则不会生成这个新节点(分支)。基于网格生成粒子的方法使用了随机数,因此生成的粒子会有一定的随机性。
Image
总结
本文介绍了仿真软件中,自动化生成粒子的常用方法。对于有限元相关的软件,网格转化为粒子的方式更为实用,可以直接将生成的粒子应用于有限元耦合计算中。通用有限元软件WELSIM已经支持了从网格到粒子的转化,用户还可以将生成的粒子导出,用于其他类型的分析。
Subscribe to:
Comments (Atom)