WorksComputer Science
Generalized and high-efficiency arbitrary-positioned buffer for smoothed particle hydrodynamics
Abstract
This paper develops an arbitrary-positioned buffer for the smoothed particle hydrodynamics (SPH) method, whose generality and high efficiency are achieved through two techniques. First, with the local coordinate system established at each arbitrary-positioned in-/outlet, particle positions in the global coordinate system are transformed into those in it via coordinate transformation. Since one local axis is located perpendicular to the in-/outlet boundary, the position comparison between particles and the threshold line or surface can be simplified to just this coordinate dimension. Second, particle candidates subjected to position comparison at one specific in-/outlet are restricted to those within the local cell-linked lists nearby the defined buffer zone, which significantly enhances computational efficiency due to a small portion of particles being checked. With this developed buffer, particle generation and deletion at arbitrary-positioned in- and outlets of complex flows can be handled efficiently and straightforwardly. We validate the effectiveness and versatility of the developed buffer through 2-D and 3-D non-/orthogonal uni-/bidirectional flows with arbitrary-positioned in- and outlets, driven by either pressure or velocity boundary conditions.
Introduction
When simulating engineering flows, flow paths typically do not repeat, and in- and outlets may not align to facilitate the flow recirculation[1]. For this kind of smoothed particle hydrodynamics (SPH) flow simulation, the classic periodic boundary condition[2, 3], where newly inflow particles are generated by recycling outflow particles through translation, is incapable for particle generation/deletion at in-/outlet. In comparison, the open boundary condition[4, 5, 6, 7, 8] can theoretically handle this case easily due to its independent particle handling (i.e., particle generation/deletion) at in-/outlet. Several methods have been proposed in SPH literature regarding open boundary conditions. The simplest method is to employ the buffer zone consisting of several layers of buffer particles[2] [9, 10, 11]. At inlet, when a buffer particle crosses the buffer-fluid interface, a duplicate particle with the same physical state is generated, which then moves freely as an ordinary fluid particle12. Meanwhile, the original buffer particle is recycled to a periodic position at the inlet boundary. At outlet, outflowing particles are deleted once they cross the domain boundary13. A similar procedure, i.e., checking the particle’s relative position to the prescribed threshold line (in two dimensions, 2-D) or surface (in three dimensions, 3-D), is also employed in the mirror-axis technique14,15 for particle generation and deletion. Monteleone et al.16 utilized a conical scan region with an angle for particle generation, comparing the angle between the cone axis and the line connecting the neighboring particle with the cone vertex to . If there are no effective particles inside the conical scan region, i.e., for all neighboring particles, a new particle is created. However, when determining whether to establish the conical scan region on a particle, the measured distance from this particle to the in-/outlet boundary needs to be compared with both the particle spacing and the smoothing length , i.e., . In contrast, the semi-analytical boundary treatment[7] [17] does not rely on position comparison for particle generation. Specifically, when the evolutive mass of fixed-position inlet vertex particles reaches a certain threshold, a new fluid particle is created at the same location. However, regarding particle deletion, as same to the conical scan approach16, the semi-analytical boundary treatment still requires checking whether outflowing particles are outside the domain through position comparison.
Obviously, in these methods mentioned above, comparing the particle position to a prescribed threshold line or surface is the basic and necessary operation for particle generation and deletion. In SPH literature, the principles of particle generation and deletion, along with most relevant test cases, are typically illustrated based on simple orthogonal flows, where the in-/outflow direction is parallel to one coordinate axis. As the in-/outlet boundary is generally perpendicular to the in-/outflow direction, the prescribed threshold line or surface for checking the particle’s relative position is usually perpendicular to this coordinate axis as well. With this simplification, the position comparison is performed in only one coordinate dimension. However, in complex non-orthogonal flows, especially those with multiple arbitrary-positioned in- and outlets, the above solution becomes non-trivial when comparing the particle position to an arbitrary-positioned threshold line or surface. Although directly determining the particle’s relative position through the equation of the threshold line or surface can still work, the complex procedure makes it inefficient and non-generalizable. In SPH literature, some non-orthogonal flows with multiple arbitrary-positioned in- and outlets have also been conducted16,17, but systematic elaborations on how to conduct position comparison at arbitrary-positioned in-/outlet, especially with a generalized and high-efficiency approach, have rarely been mentioned. Furthermore, regarding particle detection, the straightforward way of sequentially checking all fluid particle positions will significantly decrease computational efficiency, especially in 3-D flows with multiple in- and outlets.
In this paper, based on the buffer approach, we introduce the coordinate transformation to develop a generalized and high-efficiency approach for conducting position comparison in particle generation/deletion at arbitrary-positioned in-/outlet. The particle positions in the global coordinate system are first transformed into those in the local coordinate system established at in-/outlet. Since one local axis is located perpendicular to the in-/outlet boundary, their position comparison with the threshold line or surface is performed only in this coordinate dimension. To further enhance computational efficiency, at one specific in-/outlet, the particle candidates subjected to position comparison are restricted to those within the local cell-linked lists nearby the defined buffer zone. The remainder of this paper is organized as follows. First, Section II provides a brief overview of the underlying weakly-compressible SPH (WCSPH) method. In Section III, the rationale of arbitrary-positioned uni-/bidirectional in-/outflow buffer is elaborated. Section IV details pressure and velocity boundary conditions implemented at arbitrary-positioned in-/outlet. The effectiveness and versatility of the developed arbitrary-positioned buffer are demonstrated by several 2-D and 3-D flow examples in Sections V and VI, including 2-D sloped-positioned VIPO (Velocity Inlet, Pressure Outlet) and PIVO (Pressure Inlet, Velocity Outlet) channel flows, 2-D T- and Y-shaped channel flows, the 2-D rotating sprinkler, the 3-D sloped-positioned pulsatile pipe flow, and the 3-D aorta flow. Finally, concluding remarks are given in Section VII. The code accompanying this work is implemented in the open-source SPHinXsys library18, and is available at the project website https://www.sphinxsys.org and the corresponding Github repository.
Weakly-compressible SPH method
Governing equations
Within the Lagrangian framework, the mass- and momentum-conservation equations are respectively written as
and
where is the density, the time, the velocity, the pressure, and the kinematic viscosity. Under the weakly-compressible assumption, the system of Eqs. (1) and (2) are closed by the artificial isothermal equation of state (EoS)
where is the artificial sound speed, and the initial reference density. In order to control the density variation around 1%, corresponding to the Mach number suggested by 19, is set to be with denoting the anticipated maximum flow speed.
SPH discretization
Both the mass- and momentum-conservation equations Eqs. (1) and (2) are discretized using the Riemann-based SPH scheme[22, 23] [18, 20, 21], in respect to particle
and
where is the particle mass, the dynamic viscosity, subscript the neighbor particles, and the relative velocity between particles and . Also, denotes the gradient of the kernel function , where , and the smooth length.
Furthermore, with and the average velocity between particles and . Here, constructed along the unit vector pointing from particle to , the solutions and of the inter-particle one-dimensional Riemann problem can be given as[24]
with the initial states of the Riemann problem
Here, , , and are inter-particle averages. and denotes the initial left and right states, respectively.
However, the utilization of the original intermediate pressure in Eq. (6) during the SPH discretization may lead to an excessive dissipation. To address this issue, a supplementary low dissipation Riemann solver[24] is employed, which incorporates a modification on while maintaining the intermediate velocity in Eq. (6) unconstrained
where represents the low dissipation limiter.
In order to increase the computational efficiency, the dual-criteria time stepping method[22] is employed herein. In addition, to decrease the accumulated density error during long-term simulations, the particle density is re-initialized before being updated in continuity equation Eq. (4) at each advection time step with18
where the superscript 0 represents the reference value in the initial configuration.
Transport-velocity formulation
To avoid particle clumping and void regions in SPH simulations where the tensile instability is present[25, 26], regularization is implemented to maintain a uniform particle distribution[27, 28]. Currently, the particle shifting technique (PST)[25, 26, 28, 29, 30, 31] and the transport-velocity formulation (TVF)[32] [21] are two typical schemes to address this issue. In the present work, the TVF scheme is adopted, and the particle advection velocity is rewritten as
where the global background pressure with denoting the maximum particle velocity at each time step[22]. The empirical coefficient is chosen within the range of 5.0 to 10.021.
Since the TVF scheme is applicable only to inner fluid particles far away from in-/outlet boundaries[32], accurately identifying boundary particles is a necessary prior. To avoid misidentifying and missing boundary particles[33, 34, 35] [11], the spatio-temporal identification approach11 is utilized in present work, where approximately three layers of fluid particles are identified as boundary particles.
The rationale of arbitrary-positioned buffer
In this section, we introduce the rationale of arbitrary-positioned buffer working for uni- and bidirectional flows, respectively. Although the schematic provided here is based on channel flow, this arbitrary-positioned buffer can also be implemented in free-surface open-channel flows with arbitrary-positioned in- and outlets. In this work, the C2 Wendland kernel[36] with a compact support of is employed. Since the present smoothing length following the general practice, the buffer zone should consist of at least three layers of particles to ensure full support for the inner-domain particles next to the buffer.
Unidirectional in-/outflow buffer
In Figure 1, a two-dimensional complex-geometric channel flow with multiple arbitrary-positioned in- and outlets is sketched to demonstrate the rationale of the arbitrary-positioned unidirectional in-/outflow buffer. Through the translation and rotation , the local coordinate system is established at each in-/outlet, with its axis direction aligned to the in-/outflow direction. Here, is the position of origin in the global coordinate system. The buffer, with width and length , is centered at the origin of the local coordinate system . As shown in Figure 1, one side of the buffer is aligned with the in-/outlet boundary.
Figure 1. The rationale of arbitrary-positioned unidirectional in-/outflow buffer.
In the 2-D local coordinate system, the particle position could be obtained through the following coordinate transformation
where is the corresponding particle position in the global coordinate system, and the sign of depends on the anticlockwise (+) or clockwise (−) rotation.
In comparison, for the coordinate transformation in the 3-D case, the unit vector of the rotation axis is first given by normalizing the cross product of axial vectors and in the global coordinate system, which is a vector perpendicular to the plane spanned by and with the direction given by the right-hand rule
and then its antisymmetric matrix can be written as
According to the Rodrigues’ rotation formula[37, 38, 39], the rotation matrix is defined as
where is identity matrix, and the sign of is positive.
Consequently, the particle position in the 3-D local coordinate system could be given as
In the 2-D inflow buffer, buffer particles will be periodically moved back to the inlet bound with 10,11, once they cross the buffer-fluid interface. Here, in the 3-D case. Consequently, due to its fixed buffer particle configuration, buffer particles should be identified from all fluid particles in the computational domain but only for once. In detail, by checking of all fluid particles before the flow simulation, they will be identified as buffer particles if both and (an additional criterion of for 3-D case, with denoting the buffer height), and then added into the set of buffer particles. Note that, each inflow buffer has its own set of buffer particles. During the subsequent flow evolution, when these identified buffer particles cross the buffer-fluid interface with (same for 3-D case), duplicate particles are generated with the same states as the crossing ones, and then treated as ordinary fluid particles in the inner flow domain. Meanwhile, the original buffer particles will be recycled to periodic positions at inlet bound, and their new positions in the global coordinate system are obtained through the inverse transformation of coordinates
Correspondingly, for the 3-D case, the above inverse transformation of coordinates is modified as
Algorithm 1 summarizes the working procedure of the unidirectional inflow buffer described above.
Algorithm 1: Working procedure of the arbitrary-positioned unidirectional inflow buffer.
Data: : all fluid particles in the computational domain, : buffer particles, : the number of particles being checked.
Procedure Buffer particle identification ▷Execute only once
for to do
if & for 2-D case & for 3-D case then
add it into the set of buffer particles
end
end
Procedure Particle generation
for to do
if for both 2-D and 3-D cases then
duplicate it, and then recycle it through the corresponding inverse transformation of coordinates Eq. (16) or Eq. (17)
end
end
For the 2-D outflow buffer, as shown in Figure 1, only the fluid particles within the nearby local cell-linked lists at each time step are checked. Note that, the coverage area of the local cell-linked lists is a little larger than the size of outflow buffer, approximately one layer of cells. If of these checked particles (same for 3-D case), they will be directly deleted as outflow ones. Furthermore, due to the newly inflow fluid particles and outflow buffer particles, the buffer particle configuration of the outflow buffer necessitates an update at each time step. In detail, through the relabeling approach[40], at the end of each time step (after the cell-linked lists have been rebuilt), if both and (an additional criterion of for 3-D case) of these checked particles, they will be relabeled as buffer particles by assigning the same integer, otherwise, they will not. Note that, each outflow buffer can have its exclusive integer for relabeling. Algorithm 2 summarizes the working procedure of the unidirectional outflow buffer described above.
Algorithm 2: Working procedure of the arbitrary-positioned unidirectional outflow buffer.
Data: : fluid particles within the local cell-linked lists, : the number of particles being checked.
Procedure Particle deletion
for to do
if for both 2-D and 3-D cases then
delete it
end
end
Procedure Buffer particle identification (after the cell-linked lists have been rebuilt at the end of present time step)
for to do
if & for 2-D case & for 3-D case then
relabel it as buffer particle
end
end
Bidirectional in-/outflow buffer
Based on Figure 1, Figure 2 comparatively illustrates the different setting and rationale of the arbitrary-positioned bidirectional buffer in the bidirectional flow. Here, the axis direction of the established local coordinate system at each in-/outlet is always aligned to the inflow direction, as shown in Figure 2.
Figure 2. The rationale of arbitrary-positioned bidirectional buffer.
Similarly, due to the newly inflow fluid particles and outflow buffer particles, the buffer particle configuration of the bidirectional buffer should also be updated at the end of each time step in the same way of the arbitrary-positioned unidirectional outflow buffer, where the particles being checked are also restricted to those within the nearby local cell-linked lists. Differently, particle generation and deletion during each time step only focus on identified buffer particles. If their (same for 3-D case), the same procedure for particle generation as in the arbitrary-positioned unidirectional inflow buffer will be executed. Conversely, if their (same for 3-D case), they will be directly deleted. Algorithm 3 summarizes the working procedure of the arbitrary-positioned bidirectional buffer described above.
In-/outlet boundary conditions
In this section, we introduce how to implement pressure and velocity boundary conditions at arbitrary-positioned in-/outlet through buffer particles. To cope with the truncation for density summation, the density reinitialization of Eq. (9) is not carried out for near-boundary particles (i.e., buffer particles herein).
Algorithm 3: Working procedure of the arbitrary-positioned bidirectional buffer.
Data: : fluid particles within the local cell-linked lists, : buffer particles, : the number of particles being checked.
Procedure Particle generation and deletion
for to do
if for both 2-D and 3-d cases then
duplicate it, and then recycle it through the corresponding inverse transformation of coordinates (16) or (17)
end
if for both 2-D and 3-d cases then
delete it
end
end
Procedure Buffer particle identification (after the cell-linked lists have been rebuilt at the end of present time step)
for to do
if & for 2-D case & for 3-D case then
relabel it as buffer particle
end
end
Pressure boundary condition
In the present work, the pressure boundary condition follows the work of Zhang et al.[40] In the global coordinate system, the discretized momentum equation Eq. (5), when applied to buffer particles, is modified with the prescribed boundary pressure incorporated
As mentioned by Holmes et al.[1], the velocity updated by Eq. (18) should be further projected to the normal direction of in-/outlet boundary in the global coordinate system
Here, could be expressed in the 2-D case as
and in the 3-D case as
Furthermore, to satisfy the consistency condition at the boundary, the density of the newly populated (actually recycled) particles in the buffer is obtained following the boundary pressure and EoS as
Velocity boundary condition
For the sake of simplicity, the pre-defined velocity profile is first implemented on buffer particles within the local coordinate system, for example in Figure 3,
Figure 3. The coordinate transformation on pre-defined velocity profile.
and
where is the channel radius.
Then the corresponding velocity distribution in the global coordinate system can be derived through coordinate transformation on buffer particle velocity
and
The pressure boundary condition by (18) should also be imposed at the boundary to eliminate the truncated error in approximating pressure gradient, but the prescribed boundary pressure in Eq.(18) is given as , i.e., . Furthermore, both density and pressure of newly populated (actually recycled) particles in the buffer remain unchanged.
2-D Numerical tests
In this section, to validate the effectiveness of the developed arbitrary-positioned buffer in the 2-D case, several 2-D flows are simulated, including sloped-positioned VIPO and PIVO channel flows, T- and Y-shaped channel flows, and rotating sprinkler. For the treatment of wall boundary, a one-sided Riemann solver is employed herein[24].
Sloped-positioned VIPO and PIVO channel flows
As shown in Figure 4, 2-D sloped-positioned VIPO (Velocity Inlet, Pressure Outlet) and PIVO (Pressure Inlet, Velocity Outlet) channel flows with the available analytical solution are first simulated herein. At the velocity in-/outlet, the prescribed velocity profile in the local coordinate system is analytically determined by[1, 41, 42, 43, 44].
Figure 4. Schematics of sloped-positioned VIPO (top panel) and PIVO (bottom panel) channel flows. Velocity profile is extracted at the cross-section A − A in the simulation.
where with denoting the distance between plates, and the pressure drop across a flow length of . The dynamic viscosity is set as with the fluid density and the Reynolds number . The fluid and solid-wall particles are initialized on the Cartesian Lattice with a uniform particle spacing of .
At the pressure outlet of VIPO flow and the pressure inlet of PIVO flow, the prescribed boundary pressure is set to and , respectively. Consequently, in the VIPO flow, the predicted boundary pressure at the velocity inlet should be 0.1 Pa, while at the velocity outlet of PIVO flow, it should be kept at 0 Pa. Figure 5 gives the pressure contours of VIPO and VIPO flows at time . It can be obviously observed that the pressure distributions align well with the above-mentioned theoretical expectations.
Figure 5. Pressure contours of VIPO (top panel) and PIVO (bottom panel) channel flows. Time instant .
Figure 6 illustrates the comparison between numerical and analytical velocity profiles for VIPO and PIVO channel flows. The distribution of velocity data points consistently exhibits a parabolic shape, closely aligning with the analytical solution. Specifically, the maximum velocity occurs at the channel’s centerline, while the velocity diminishes to zero near the walls due to the no-slip boundary condition enforced on the solid walls[45]. The numerical accuracy is further measured with the Root Mean Square Error Percentage (RMSEP) over the whole velocity profile2
Figure 6. Comparison of numerical and analytical velocity profiles in the local coordinate system for VIPO (left panel) and PIVO (right panel) channel flows. Time instant . The RMSEP errors for VIPO and PIVO channel flows are 1.91% and 0.96%, respectively.
where is the number of measuring points, and the analytical and numerical velocities, respectively. The RMSEP errors of VIPO and PIVO channel flows are 1.91% and 0.96%, respectively, demonstrating a high level of concordance with the analytical solution.
T- and Y-shaped channel flows
Here we conduct two preliminary 2-D application cases where daughter pipes are connected to the main pipe at different angles, i.e., T- and Y-shaped channel flows in Figure 7, and compare them to the results obtained from Fluent simulations. In the local coordinate system, the inflow velocity profile is given as with the characteristic velocity . Hence, the dynamic viscosity with the Reynolds number and fluid density . The boundary pressure at the pressure outlet is set to . The uniform particle/grid resolution is .
Figure 7. T- and Y-shaped channel flow schematics with the highlighted unidirectional inflow buffer. Velocity profile is extracted at the cross-section A − A in the simulation.
The left panels of Figure 8 illustrate the SPH velocity contours of T- and Y-shaped channel flows at time , respectively. At the fork junction, i.e., the stagnation point, the fluid velocity decreases to almost zero, especially in the T-shaped channel flow. The right panels of Figure 8 show the corresponding results of Fluent simulation with the same model settings. Although good agreement is already demonstrated in the qualitative comparison of Figure 8, we further conduct a quantitative comparison with velocity profiles extracted at the outlet, as shown in Figure 9. Both the shapes of velocity profiles from SPH and Fluent simulations present consistent parabolic forms, with nearly identical velocity magnitudes. By replacing the analytical velocity in Eq. (28) as the numerical velocity from the Fluent simulation, the RMSEP errors of T- and Y-shaped channel flows are measured as 2.29% and 3.01%, respectively, which are considered acceptable.
Figure 8. Qualitative comparison of velocity contours from SPH and Fluent simulations for T- (top panel) and Y- (bottom panel) shaped channel flows. Time instant .
Figure 9. Comparison of SPH and Fluent velocity profiles in the local coordinate system for T- (left panel) and Y- (right panel) shaped channel flows. Time instant . denotes the radius of daughter channel. The RMSEP errors for T- and Y-shaped channel flows are 2.29% and 3%, respectively.
Rotating sprinkler
To better demonstrate the versatility of the developed arbitrary-positioned buffer in engineering applications, the 2-D rotating sprinkler, referring to a lawn sprinkler, is simulated here, which is realized by rotating buffer particles with a constant angular velocity , as depicted in Figure 10. In this top view simulation, gravity is ignored, and the fluid is considered inviscid with the density of . The inflow velocity profile in the sprinkler is defined within the local coordinate system as . The uniform particle spacing is .
Figure 10. Top view of rotating sprinkler. The sprinkler consisting of buffer particles is rotating with the constant angular velocity .
Figure 11 illustrates the flowchart for rotating the sprinkler through coordinate transformation.
Figure 11. The flow chart on rotating the sprinkler through coordinate transformation.
The rotation angle is given as , where denotes the initial rotation angle at time . In the present case, the angular velocity and . Before rotating the sprinkler at , the particle generation in this unidirectional inflow buffer has already been completed in the established local coordinate system. Then, based on this local coordinate system, the positions and velocities of buffer particles are transformed to new ones through coordinate rotation at . After this rotation, the local coordinate system is reestablished according to the new position of sprinkler, preparing it for particle generation in next time step. Similarly, based on this newly established local coordinate system, the sprinkler undergoes the next rotation at , following the same procedure as at . Thus, the iterative cycle continues.
Figure 12 shows the velocity contours at different time instants. During the continuous rotation, the velocity profile within the sprinkler consistently maintains the prescribed parabolic shape, and new inflow particles at the sprinkler’s outlet are effectively generated. Due to inertia, the fluid bulk exhibits a curved shape, consistent with physical principles. At these four instants, all rotated angles of the sprinkler match the predicted angles based on the angular velocity. All these flow behaviors demonstrate the good reliability and performance of the arbitrary-positioned buffer developed by introducing the coordinate transformation.
Figure 12. Velocity contours of rotating sprinkler at different time instants.
3-D Numerical tests
In this section, to validate the effectiveness of the developed arbitrary-positioned buffer in the 3-D case, two 3-D flows with the same wall boundary condition as the 2-D flow are simulated, including the sloped-positioned pulsatile pipe flow and aorta flow.
Sloped-positioned pulsatile pipe flow
Building upon the 2-D sloped-positioned VIPO channel flow in section V A, an additional dimension, typically representing the radial direction in the 3-D case, has been included to model the 3-D sloped-positioned pulsatile pipe flow, while all other physical and geometrical parameters remain unchanged. Differently, the pressure boundary condition is imposed at both in- and outlets. When the constant pressure gradient is modified to follow a cosine function over time, i.e., , as illustrated in the upper panel of Figure 13, a bidirectional pulsatile flow is facilitated. The analytical velocity profile in the local coordinate system, i.e., at time and radius from the pipe axis, could be given as

Figure 13. The pressure gradient as a cosine function (upper panel) in the sloped-positioned pulsatile pipe flow, and the comparison (lower panel) of numerical and analytical velocity profiles in the local coordinate system at 13 indicative instants. The horizontal grid dimension in the lower panel spans a velocity range from 0 to . The errors at 13 instants, from to , are 1.43%, 2.27%, 2.8%, 3.45%, 3.29%, 2.38%, 2.91%, 2.65%, 2.89%, 3.55%, 2.43%, 1.85% and 1.35%, respectively.
where , the dimensionless Womersley number, the angular frequency of the first harmonic of a Fourier series of an oscillatory pressure gradient, the pressure gradient magnitude for the frequency , the Bessel function of first kind and order zero, the imaginary number, and the real part of a complex number.
In the present pulsatile pipe flow, the Womersley number is less than 2, which determines a parabolic shape of the pulsatile flow profile. Moreover, during the time evolution, consistent with the cosine-varying pressure gradient, both velocity magnitude and direction exhibit periodicity. The lower panel of Figure 13 correspondingly shows this periodic evolution of the parabolic shape by extracting velocity profiles at 13 instants between and . During the initial quarter, the parabolic velocity profile maintains a forward flow direction, but with a diminishing magnitude over time. The flow undergoes a reversal at , followed by gradual acceleration until reaching the maximum velocity at . In the latter half of the period, this flow behavior repeats, but with the opposite evolution of flow direction. Moreover, employing RMSEP for accuracy assessment reveals errors of approximately 3% across all 13 time instants, demonstrating a robust agreement with their corresponding analytical solutions.
Furthermore, aligning with the analytical prediction of mixed in- and outflows at time shown in the bottom panel of Figure 14, the top panel of Figure 14 depicts the mixed forward and reverse flows occurring at the in-/outlet boundary of the practical pulsatile pipe flow. This demonstrates the good performance of the arbitrary-positioned bidirectional buffer in managing particle generation and deletion.
Figure 14. Velocity profile with mixed forward and reverse flows at the in-/outlet boundary (top panel) of sloped-positioned pulsatile pipe flow, corresponding to the analytical velocity profile (bottom panel) in the local coordinate system at time instant . The velocity vector in top panel is scaled to a uniform length, with the flow direction indicated by the arrow.
Aorta flow
To investigate the feasibility of the developed arbitrary-positioned buffer for handling practical 3-D complex flows with multiple arbitrary-positioned in- and outlets, a preliminary flow simulation tion is conducted on an aorta model, as shown in Figure 15. The vascular wall is treated as a rigid body, while the blood is characterized as a Newtonian fluid with a density of [47] and a viscosity of [48].
Figure 15. Schematic of the aorta flow.
At the inlet, a velocity boundary condition featuring a plug velocity profile is enforced to facilitate unidirectional inflow. However, the velocity magnitude exhibits pulsatility, as depicted in the top panel of Figure 17, which can be approximated as Fourier series in term of time[49]

Figure 17. The time history of the inflow velocity and all outlet relative pressure.
where the empirical variables for the Fourier series are listed in Table I.
| Parameter | Value | Parameter | Value |
| 0.3782 | 8.302 | ||
| -0.1812 | -0.07725 | ||
| 0.1276 | 0.01466 | ||
| -0.08981 | 0.04295 | ||
| 0.04347 | -0.06679 | ||
| -0.05412 | 0.05679 | ||
| 0.02642 | -0.01878 | ||
| 0.008946 | 0.01869 | ||
| -0.009005 | -0.01888 |
Table I. The empirical variables for the Fourier series[49]
At all outlets, the pressure boundary condition is applied by employing the time-dependent boundary pressure , thus the bidirectional flow happens at outlets during the cyclical blood flow, as shown in bottom panel of Figure 16. Here, the 3-element (RCR) Windkessel model[50] is employed for the real-time computing of

Figure 16. Velocity contour and slices of aorta flow during the peak systole, along with indicating corresponding velocity vectors of boundary particles. Time instant . The velocity vector in bottom panel is scaled to a uniform length, with the flow direction indicated by the arrow.
where is the blood flow volume, the arterial compliance, the characteristic resistance, and the peripheral resistance. Table II lists the values of Windkessel parameters[51, 52] for allocation across diverse daughter vessels.
| Vessel | (dynes s/cm) | (cm/dynes) | (dynes s/cm) |
| Right common carotid | 1180 | 7.70E-5 | 18400 |
| Right subclavian | 1040 | 8.74E-5 | 16300 |
| Left common carotid | 1180 | 7.70E-5 | 18400 |
| Left subclavian | 970 | 9.34E-5 | 15200 |
| Descending aorta | 188 | 4.82E-4 | 2950 |
Table 2. Parameters for the Windkessel outlet boundary conditions[51, 52]
The top and middle panels of Figure 16 shows the velocity contour and slices during peak systole. In the present plug-inlet boundary condition, the velocity peak isn’t always at the center of the cross-section. Especially in the descending aorta, due to inertia, the flow inside the curved vessel is pushed towards the outer side of the arch, which is in good agreement with the observations in literature[52]. Furthermore, as depicted in the bottom panel of Figure 16, which indicates the corresponding velocity vectors of boundary particles, the present arbitrary-positioned bidirectional buffer can effectively handle particle generation and deletion at these typical mixed in- and outflow boundaries.
Figure 17 illustrates the temporal evolution of relative pressure at all outlets across 7 cardiac cycles. Notably, all observed outlet relative pressure waveforms exhibit a characteristic folding line shape, consistent with established analytical and numerical findings in literature[50]. It is pertinent to acknowledge that, relative to real physiological conditions, the parameters governing inflow velocity, Windkessel parameters of all daughter vessels, and the geometric specifications of the aorta stem from disparate data sources, thereby lacking strict alignment. Moreover, the physiological pressure data corresponding to the present aorta model are also unavailable. Consequently, our primary emphasis lies in assessing the fidelity of the blood pressure waveform rather than pressure magnitudes.
Conclusion
In this paper, we develop a generalized and high-efficiency arbitrary-positioned uni-/bidirectional buffer for SPH method. By employing coordinate transformation, the position comparison for particle generation and deletion is conducted in the local coordinate system established at each in-/outlet. Since one local axis is located perpendicular to the in-/outlet boundary, the position
comparison can be simplified and conducted only in this coordinate dimension. To further enhance computational efficiency, the particle candidates subjected to position comparison are restricted to those within the local cell-linked lists nearby the defined buffer zone. The numerical results of 2-D and 3-D flows demonstrate the excellent effectiveness and versatility of the developed buffer for particle generation and deletion at arbitrary-positioned in- and outlets. As the future work, we will implement the developed buffer in various free-surface open-channel flows with multiple arbitrary-positioned in- and outlets.
References
References
- [1]D. W. Holmes and P. Pivonka, “Novel pressure inlet and outlet boundary conditions for smoothed particle hydrodynamics, applied to real problems in porous media flow,” Journal of Computational Physics 429, 110029 (2021).
- [2]S. Braun, L. Wieth, R. Koch, and H. Bauer, “A framework for permeable boundary conditions in SPH: Inlet, Outlet, Periodicity,” (2015).
- [3]P. Negi and P. Ramachandran, “How to train your solver: Verification of boundary conditions for smoothed particle hydrodynamics,” Physics of Fluids 34 (2022).DOI
- [4]I. Federico, S. Marrone, A. Colagrossi, F. Aristodemo, and M. Antuono, “Simulating 2d open-channel flows through an sph model,” European Journal of Mechanics - B/Fluids 34, 35–46 (2012).
- [5]R. Vacondio, B. Rogers, P. Stansby, and P. Mignosa, “SPH modeling of shallow flow with open boundaries for practical flood simulation,” Journal of Hydraulic Engineering 138, 530–541 (2012).DOI
- [6]C. Alvarado-Rodriguez, J. Klapp, L. Sigalotti, J. Dominguez, and E. Sanchez, “Nonreflecting outlet boundary conditions for incompressible flows using SPH,” Computers and Fluids 159, 177–188 (2017).
- [7]M. Ferrand, A. Joly, C. Kassiotis, D. Violeau, A. Leroy, F. Morel, and B. Rogers, “Unsteady open boundaries for SPH using semi-analytical conditions and riemann solver in 2D,” Computer Physics Communications 210, 29–44 (2017).
- [8]P. Negi, P. Ramachandran, and A. Haftu, “An improved non-reflecting outlet boundary condition for weakly-compressible SPH,” Computer Methods in Applied Mechanics and Engineering 367, 113119 (2020).DOI
- [22]C. Zhang, M. Rezavand, and X. Hu, “Dual-criteria time stepping for weakly compressible smoothed particle hydrodynamics,” Journal of Computational Physics 404, 109135 (2020).DOI
- [23]C. Zhang, Y. Wei, F. Dias, and X. Hu, “An efficient fully lagrangian solver for modeling wave interaction with oscillating wave surge converter,” Ocean Engineering 236, 109540 (2021).
- [24]C. Zhang, X. Hu, and N. Adams, “A weakly compressible SPH method based on a low-dissipation Riemann solver,” Journal of Computational Physics 335 (2017).DOI
- [25]S. Lind, R. Xu, P. Stansby, and B. Rogers, “Incompressible smoothed particle hydrodynamics for free-surface flows: A generalised diffusion-based algorithm for stability and validations for impulsive flows and propagating waves.” Journal of Computational Physics 231, 1499–1523 (2012).DOI
- [26]G. Oger, S. Marrone, D. Le Touzé, and M. de Leffe, “Sph accuracy improvement through the combination of a quasi-lagrangian shifting transport velocity and consistent ale formalisms,” Journal of Computational Physics 313, 76–98 (2016).DOI
- [27]S. Litvinov, X. Hu, and N. A. Adams, “Towards consistence and convergence of conservative sph approximations,” Journal of Computational Physics 301, 394–401 (2015).
- [28]P. Negi and P. Ramachandran, “Techniques for second-order convergent weakly compressible smoothed particle hydrodynamics schemes without boundaries,” Physics of Fluids 34, 087125 (2022).
- [29]A. Skillen, S. Lind, P. Stansby, and B. Rogers, “Incompressible smoothed particle hydrodynamics (sph) with reduced temporal noise and generalised fickian smoothing applied to body-water slam and efficient wave-body interaction,” Computer Methods in Applied Mechanics and Engineering 265, 163–173 (2013).DOI
- [30]A. Khayyer, H. Gotoh, and Y. Shimizu, “Comparative study on accuracy and conservation properties of two particle regularization schemes and proposal of an optimized particle shifting scheme in isph context,” Journal of Computational Physics 332, 236–256 (2017).
- [31]P. Sun, A. Colagrossi, S. Marrone, and A. Zhang, “The delta plus-sph model: Simple procedures for a further improvement of the sph scheme,” Computer Methods in Applied Mechanics and Engineering 315, 25–49 (2017).
- [32]S. Adami, X. Hu, and N. Adams, “A transport-velocity formulation for smoothed particle hydrodynamics,” Journal of Computational Physics 241, 292–307 (2013).DOI
- [33]G. Dilts, “Moving-least-squares-particle hydrodynamics—I. Consistency and stability,” International Journal for Numerical Methods in Engineering 44, 1115–1155 (1999).
- [34]34 A. Haque and G. Dilts, “Three-dimensional boundary detection for particle methods,” Journal of Computational Physics 226, 1710–1730 (2007).
- [35]35 E. Lee, C. Moulinec, R. Xu, D. Violeau, D. Laurence, and P. Stansby, “Comparisons of weakly compressible and truly incompressible algorithms for the SPH mesh free particle method,” Journal of Computational Physics 227, 8417–8436 (2008).
- [36]36 H. Wendland, “Piecewise polynomial, positive definite and compactly supported radial functions of minimal degree,” Advances in Computational Mathematics 4, 389–396 (1995).
- [37]37 H. Cheng and K. C. Gupta, “An Historical Note on Finite Rotations,” Journal of Applied Mechanics 56, 139–145 (1989).
- [38]38 L. Fraiture, “A history of the description of the three-dimensional finite rotation,” The Journal of the Astronautical Sciences 57, 207–232 (2009).
- [39]39 J. S. Dai, “Euler–rodrigues formula variations, quaternion conjugation and intrinsic connections,” Mechanism and Machine Theory 92, 144–152 (2015).
- [40]40 S. Zhang, Y. Fan, D. Wu, C. Zhang, and X. Hu, “Dynamical pressure boundary condition for weakly-compressible smoothed particle hydrodynamics,” arXiv preprint arXiv:2403.09485 (2024).DOI
- [41]41 J. P. Morris, P. J. Fox, and Y. Zhu, “Modeling Low Reynolds Number Incompressible Flows Using SPH,” Journal of Computational Physics 136, 214–226 (1997).
- [42]42 H. Takeda, S. M. Miyama, and M. Sekiya, “Numerical Simulation of Viscous Flow by Smoothed Particle Hydrodynamics,” Progress of Theoretical Physics 92, 939–960 (1994).
- [43]43 L. D. G. Sigalotti, J. Klapp, E. Sira, Y. Meleán, and A. Hasmy, “SPH simulations of time-dependent Poiseuille flow at low Reynolds numbers,” Journal of Computational Physics 191, 622–638 (2003).
- [44]44 D. Holmes, J. Williams, and P. Tilke, “Smooth particle hydrodynamics simulations of low reynolds number flows through porous media,” International Journal for Numerical and Analytical Methods in Geomechanics 35, 419 – 437 (2011).
- [45]45 S. Adami, X. Hu, and N. Adams, “A generalized wall boundary condition for smoothed particle hydrodynamics,” Journal of Computational Physics 231, 7057–7075 (2012).
- [47]47 K. Laganà, R. Balossino, F. Migliavacca, G. Pennati, E. L. Bove, M. R. de Leval, and G. Dubini, “Multiscale modeling of the cardiovascular system: application to the study of pulmonary and coronary perfusions in the univentricular circulation,” Journal of Biomechanics 38, 1129–1141 (2005).
- [48]D. Gallo, G. De Santis, F. Negri, D. Tresoldi, R. Ponzini, D. Massai, M. Deriu, P. Segers, B. Verhegghe, G. Rizzo, and U. Morbiducci, “On the use of in vivo measured flow rates as boundary conditions for image-based hemodynamic models of the human aorta: Implications for indicators of abnormal flow,” Annals of biomedical engineering 40, 729–41 (2012).
- [49]I. Taib, M. S. A. Paisal, A. E. Ismail, A. M. Tajul Arifin, and N. Darlis, “An analysis of blood pressure waveform using windkessel model for normotensive and hypertensive conditions in carotid artery,” Journal of Advanced Research in Fluid Mechanics and Thermal Sciences 57, 69–85 (2019).
- [50]M. T. de Almeida Jansen Catanho, M. Sinha, and V. Vijayan, “Model of aortic blood flow using the windkessel effect,” (2012).
- [51]On coupling a lumped-parameter heart model with a three-dimensional finite element model of the aorta, ASME Summer Bioengineering Conference (2007).
- [52]M. Sudharsan and E. Cherry Kemmerling, “The effect of inlet and outlet boundary conditions in image-based cfd modeling of aortic flow,” BioMedical Engineering OnLine 17 (2018).
