@@ -38,6 +38,9 @@ is achieved:
3838\frac{\rho_i(t + \Delta t) - \rho_i(t)}{\Delta t} = \sum_j m_j \bm{v}_{ij}(t+\Delta t) \nabla W_{ij}.
3939```
4040
41+ Note that the linear system is only solved for fluid particles, so `` i `` always represents
42+ a fluid particle, and `` j `` represents all neighboring particles of `` i `` .
43+
4144The right-hand side contains the unknown velocities `` \bm{v}_{ij}(t + \Delta t) `` at the
4245next time step, making it an implicit formulation.
4346
@@ -54,7 +57,7 @@ Note that the IISPH is an incompressible method, which means that the density of
5457fluid remain constant over time. By assuming a fixed reference density `` \rho_0 `` for all
5558fluid particle over the whole time of the simulation, the density value at the next time
5659step `` \rho_i(t + \Delta t) `` also has to be this rest density. So `` \rho_0 `` can be plugged in
57- for `` \rho_i(t + \Delta t) `` in the formula above.
60+ for `` \rho_i(t + \Delta t) `` in the equation above.
5861
5962The goal is to compute the pressure values required to obtain the pressure acceleration that
6063ensures each particle reaches the rest density in the next time step. At the moment these
@@ -169,6 +172,10 @@ the smoothing length, each particle's pressure ``p_i`` depends only on its own v
169172nearby particles.
170173Consequently, the matrix `` A `` is sparse (most entries are zero).
171174
175+ Note that this expression is not completely correct yet, since `` j `` represents all neighboring
176+ particles of `` i `` and some values like `` d_{jj} `` are not defined for boundary particles.
177+ The boundary handling is being explained in more detail later.
178+
172179The diagonal elements `` a_{ii} `` get computed and stored at the beginning of the simulation step
173180and remain unchanged throughout the relaxed Jacobi iterations. The same applies for the
174181`` d_{ii} `` . The coefficients `` d_{ij} `` are computed, but not stored, as part of the calculation
@@ -201,19 +208,19 @@ as only isolated or almost isolated particles are affected.
201208
202209## Boundary Handling
203210
204- The previously introduced formulation only considered interactions between fluid particles
205- and neglected interactions between fluid and boundary particles. To account for boundary
206- interactions, a few modifications to the previous equations are required.
211+ The previously introduced formulation did not distinguish between fluid and boundary
212+ particles. To account boundary interactions correctly, a few modifications to the previous
213+ equations are required.
207214
208215First, the discretized form of the continuity equation must be adapted for the case in which
209216a neighboring particle is a boundary particle. From now on, we distinguish between
210- neighboring fluid particles (indexed by `` j `` ) and neighboring boundary particles (indexed by
211- `` b `` ).
217+ neighboring fluid particles (indexed by `` f `` ) and neighboring boundary particles (indexed by
218+ `` b `` ). We continue to use the index `` j `` if we want to refer to all neighboring particles.
212219
213220The updated discretized continuity equation becomes:
214221
215222``` math
216- \frac{\rho_i(t + \Delta t) - \rho_i(t)}{\Delta t} = \sum_j m_j \bm{v}_{ij }(t+\Delta t) \nabla W_{ij } + \sum_b m_b \bm{v}_{ib}(t+\Delta t) \nabla W_{ib}.
223+ \frac{\rho_i(t + \Delta t) - \rho_i(t)}{\Delta t} = \sum_f m_f \bm{v}_{if }(t+\Delta t) \nabla W_{if } + \sum_b m_b \bm{v}_{ib}(t+\Delta t) \nabla W_{ib}.
217224```
218225
219226Since boundary particles have zero velocity, the difference between the fluid
@@ -222,21 +229,22 @@ particle's velocity ``\bm{v}_{ib}(t+\Delta t) = \bm{v}_{i}(t+\Delta t)``.
222229Accordingly, the predicted density `` \rho^{\text{adv}} `` becomes:
223230
224231``` math
225- \rho_i^{\text{adv}} = \rho_i (t) + \Delta t \sum_j m_j \bm{v}_{ij }^{\text{adv}} \nabla W_{ij }(t) + \Delta t \sum_b m_b \bm{v}_{i}^{\text{adv}} \nabla W_{ib}(t).
232+ \rho_i^{\text{adv}} = \rho_i (t) + \Delta t \sum_f m_f \bm{v}_{if }^{\text{adv}} \nabla W_{if }(t) + \Delta t \sum_b m_b \bm{v}_{i}^{\text{adv}} \nabla W_{ib}(t).
226233```
227234
228235This leads to the following updated formulation of the linear system:
229236
230237``` math
231- \Delta t^2 \sum_j m_j \left( \frac{\bm{F}_i^p(t)}{m_i} - \frac{\bm{F}_j ^p(t)}{m_j } \right) \nabla W_{ij } + \Delta t^2 \sum_b m_b \frac{\bm{F}_i^p(t)}{m_i} \nabla W_{ib} = \rho_0 - \rho_i^{\text{adv}}.
238+ \Delta t^2 \sum_f m_f \left( \frac{\bm{F}_i^p(t)}{m_i} - \frac{\bm{F}_f ^p(t)}{m_f } \right) \nabla W_{if } + \Delta t^2 \sum_b m_b \frac{\bm{F}_i^p(t)}{m_i} \nabla W_{ib} = \rho_0 - \rho_i^{\text{adv}}.
232239```
233240
234- Note that, since boundary particles are fixed, the force `` F_b^p `` is zero and does not appear in this equation.
241+ Note that, since boundary particles are fixed, the force `` F_b^p `` is zero and does not appear
242+ in this equation.
235243
236244The pressure force acting on a fluid particle is computed as:
237245
238246``` math
239- \bm{F}_i^p(t) = -\sum_j m_j \left( \frac{p_i(t)}{\rho_i^2(t)} + \frac{p_j (t)}{\rho_j ^2(t)} \right) \nabla W_{ij }(t) - \sum_b m_b \left( \frac{p_i(t)}{\rho_i^2(t)} + \frac{p_b(t)}{\rho_b^2(t)} \right) \nabla W_{ib}(t).
247+ \bm{F}_i^p(t) = -\sum_f m_f \left( \frac{p_i(t)}{\rho_i^2(t)} + \frac{p_f (t)}{\rho_f ^2(t)} \right) \nabla W_{if }(t) - \sum_b m_b \left( \frac{p_i(t)}{\rho_i^2(t)} + \frac{p_b(t)}{\rho_b^2(t)} \right) \nabla W_{ib}(t).
240248```
241249
242250This also leads to an updated version of the equation for the diagonal elements:
@@ -259,16 +267,16 @@ pressure value ``p_i`` must also include contributions from boundary particle
259267the equation for calculating the coefficient `` d_{ii} `` must be adjusted as follows:
260268
261269``` math
262- d_{ii} = -\Delta t^2 \sum_j \frac{m_j }{\rho_i^2} \nabla W_{ij } - \Delta t^2 \sum_b \frac{m_b}{\rho_i^2} \nabla W_{ib}.
270+ d_{ii} = -\Delta t^2 \sum_f \frac{m_f }{\rho_i^2} \nabla W_{if } - \Delta t^2 \sum_b \frac{m_b}{\rho_i^2} \nabla W_{ib}.
263271```
264272
265273The corresponding relaxed Jacobi iteration for pressure mirroring then becomes:
266274
267275``` math
268276\begin{align*}
269277p_i^{l+1} = (1 - \omega) p_i^l + \omega \frac{1}{a_{ii}} &\left( \rho_0 - \rho_i^{\text{adv}}
270- - \sum_j m_j \left( \sum_k d_{ik} p_k^l - d_{jj}p_j ^l - \sum_{k \neq i} d_{jk } p_k^l \right) \nabla W_{ij } \right. \\
271- & \quad - \left. \sum_b m_b \sum_j d_{ij} p_j ^l \nabla W_{ib} \right).
278+ - \sum_f m_f \left( \sum_k d_{ik} p_k^l - d_{ff}p_f ^l - \sum_{k \neq i} d_{fk } p_k^l \right) \nabla W_{if } \right. \\
279+ & \quad - \left. \sum_b m_b \sum_f d_{if} p_f ^l \nabla W_{ib} \right).
272280\end{align*}
273281```
274282
@@ -279,7 +287,7 @@ forces acting on fluid particles.
279287In this case, the computation of the coefficient `` d_{ii} `` remains unchanged and is given by:
280288
281289``` math
282- d_{ii} = -\Delta t^2 \sum_j \frac{m_j }{\rho_i^2} \nabla W_{ij }.
290+ d_{ii} = -\Delta t^2 \sum_f \frac{m_f }{\rho_i^2} \nabla W_{if }.
283291```
284292
285293The equation for the relaxed Jacobi iteration remains the same as in the pressure mirroring
@@ -289,7 +297,97 @@ pressure:
289297``` math
290298\begin{align*}
291299p_i^{l+1} = (1 - \omega) p_i^l + \omega \frac{1}{a_{ii}} &\left( \rho_0 - \rho_i^{\text{adv}}
292- - \sum_j m_j \left( \sum_k d_{ik} p_k^l - d_{jj}p_j ^l - \sum_{k \neq i} d_{jk } p_k^l \right) \nabla W_{ij } \right. \\
293- & \quad - \left. \sum_b m_b \sum_j d_{ij} p_j ^l \nabla W_{ib} \right).
300+ - \sum_f m_f \left( \sum_k d_{ik} p_k^l - d_{ff}p_f ^l - \sum_{k \neq i} d_{fk } p_k^l \right) \nabla W_{if } \right. \\
301+ & \quad - \left. \sum_b m_b \sum_j d_{if} p_f ^l \nabla W_{ib} \right).
294302\end{align*}
303+ ```
304+
305+ ### Pressure Extrapolation
306+ The density calculators [ ` AdamiPressureExtrapolation ` ] ( @ref ) and [ ` BernoulliPressureExtrapolation ` ] ( @ref )
307+ can also be used with IISPH.
308+ When using one of these pressure extrapolation methods the calculation of the PPE is exactly
309+ the same as when using pressure zeroing.
310+ So within the linear systems the pressure values are equal to zero (`` p_b=0 `` ) and therefore
311+ are not considered in the calculations. Only in the pressure acceleration, the extrapolated
312+ pressure values are used for the boundary particles. For more information on these two methods,
313+ refer to the docs for the [ boundary models] (@ref boundary_models).
314+
315+ ### Pressure Boundaries
316+ The [ ` PressureBoundaries ` ] ( @ref ) density calculator was introduced by
317+ [ Band et al. (2008)] (@cite Band2018b) specifically for IISPH fluid systems and can therefore
318+ only be used with IISPH.
319+ In the standard IISPH method the PPE is solved only for fluid particles. The
320+ pressure values for the boundary particles are then approximated, for example by using
321+ pressure mirroing.
322+ With ` PressureBoundaries ` , however, the linear system is extended to
323+ include the boundary particles as well. This means that the pressure values of both the fluid
324+ and the boundary particles are computed directly by solving the PPE.
325+ The main advantage of this method is that boundary pressures emerge naturally from the
326+ solution of the PPE, leading to a consistent pressure distribution across fluid and boundary
327+ domains. This avoids artificial constraints such as forcing `` p_{b}=0 `` or `` p_{b}=p_{f} `` ,
328+ and results in more accurate handling of fluid-boundary interactions.
329+
330+ The key difference is that the pressure values of the boundary particles now have their own
331+ PPE within the linear system. In other words, the boundary particle pressure `` p_b `` is
332+ also solved as part of the linear system.
333+ This leads to the following condition for the boundary particles `` b `` :
334+
335+ ``` math
336+ \Delta t^2 \sum_f m_f \left( \frac{\bm{F}_i^p(t)}{m_i} - \frac{\bm{F}_f^p(t)}{m_f} \right) \nabla W_{if} + \Delta t^2 \sum_b m_b \left( \frac{\bm{F}_i^p(t)}{m_i} - \frac{\bm{F}_b^p(t)}{m_b} \right) \nabla W_{ib} = \rho_0 - \rho_i^{\text{adv}}.
337+ ```
338+
339+ Note that in this case `` i `` is a boundary particle,`` f `` are its fluid neighbors, and `` b ``
340+ its boundary neighbors.
341+
342+ Since the pressure force for boundary particles is zero (as mentioned before), and because
343+ in this case `` i `` and `` b `` are both boundary particles, the PPE simplifies to
344+
345+ ``` math
346+ \Delta t^2 \sum_f m_f - \frac{\bm{F}_f^p(t)}{m_f} \nabla W_{if} = \rho_0 - \rho_i^{\text{adv}}.
347+ ```
348+ If we substitute the definition of the pressure force from above, we obtain
349+
350+ ``` math
351+ \Delta t^2 \sum_f m_f \left( \sum_k m_k \left( \frac{p_f(t)}{\rho_j^2(t)} + \frac{p_k(t)}{\rho_k^2(t)} \right) \nabla W_{fk}\right) \nabla W_{if} = \rho_0 - \rho_i^{\text{adv}}.
352+ ```
353+
354+ where `` k `` represents all neighboring particles (fluid and boundary) of fluid particle `` f `` .
355+
356+ Because the boundary particles do not directly contribute to their own pressure force (only
357+ indirectly as neighbors of fluid particles), their `` d_{ii} `` values are zero. Therefore the
358+ diagonal elements simplify to
359+
360+ ``` math
361+ a_{ii} = \sum_f \left( -d_{fi}\right) \nabla W_{if}.
362+ ```
363+
364+ The off-diagonal term `` \sum_{j \neq i} a_{ij} p_j `` in the relaxed Jacobi iteration for boundary
365+ particles takes the following form
366+
367+ ``` math
368+ \sum_{j \neq i} a_{ij} p_j = \sum_f m_f \left( d_{ff} - \sum_{f_j} d_{ff_j}p_{f_j}\right) \nabla W_{if}.
369+ ```
370+
371+ But not only the addition of the boundary particles to the linear system changes when using
372+ pressure boundaries, also the PPE for the fluid particles is changing slightly.
373+
374+ Since the boundary particles have now their own pressure values, `` p_b `` is no longer
375+ eliminated (as in pressure zeroing or pressure extrapolation with `` p_b=0 `` ) nor simply
376+ replaced by the fluid particle's pressure (as in pressure mirroring with `` p_b=p_i `` ).
377+ Instead, `` p_b `` remains part of the PPE.
378+
379+ This has no effect on the diagonal elements `` a_{ii} `` , which are identical to those of the
380+ other density calculators. The `` d_{ii} `` values are also computed in the same way as for
381+ pressure zeroing or pressure extrapolation.
382+ However, the off-diagonal term `` \sum_{j \neq i} a_{ij} p_j `` in the relaxed Jacobi iteration
383+ changes slightly.
384+ For pressure boundaries it takes the form
385+ ``` math
386+ \sum_{j \neq i} a_{ij} p_j = \sum_f m_f \left( \sum_k d_{ik} p_k - d_{ff} p_f - \sum_{k \neq f} d_{fk} p_k \right) \nabla W_{if} \\
387+ + \sum_b m_b \left( \sum_k d_{ik} p_k \right) \nabla W_{ib},
388+ ```
389+ where `` k `` represents all neighboring particles of `` i `` (both fluid and boundary).
390+
391+ ``` @docs
392+ PressureBoundaries
295393```
0 commit comments