    

 ## On this page

  

 

 # IRockySPHTriangleInteraction Struct Reference

 Last update: 16.07.2025 

`#include <<a class="el" href="rocky__sph__interaction__api_8hpp_source.xhtml">rocky_sph_interaction_api.hpp</a>>`

## <a id="pub-methods" name="pub-methods"></a>Public Member Functions

ROCKY\_FUNCTIONS [IRockySPHElement](structIRockySPHElement.xhtml) [get\_home\_element](#ae83d8750e222b2a46e6f901fd20b80d5) () const ROCKY\_FUNCTIONS [IRockyGeometryTriangle](structIRockyGeometryTriangle.xhtml) [get\_near\_triangle](#a469b4ac53234c9e707fee62725b0470a) () const ROCKY\_FUNCTIONS float [calculate\_element\_triangle\_distance](#a6bfc347dab63cdbb89a8045f878ba16f) () const ROCKY\_FUNCTIONS float3 [get\_orthogonal\_projection](#a665a945d4045772b3a4759b76daf697b) () const ROCKY\_FUNCTIONS float3 [get\_unit\_vector](#a23aa813897c50610e3989dc625f1993a) () const ROCKY\_FUNCTIONS float3 [get\_home\_element\_velocity](#afc2786e2e46e3b025371c17290a88f45) () const ROCKY\_FUNCTIONS float3 [get\_boundary\_velocity](#ab240320819db1ece083e25b69f305e12) () const ROCKY\_FUNCTIONS real\_sph [get\_normal\_relative\_velocity](#a9df83c2a83bd932798eba6a099398ce4) () const ROCKY\_FUNCTIONS real\_sph [get\_tangential\_relative\_velocity](#a5ff11979743a9bd389afbc153b7124d9) () const ROCKY\_FUNCTIONS float [get\_wall\_turbulent\_thermal\_conductance](#aaae7a8fe9a92cdcd25f7f4d84a21a9f8) (const float &amp;v\_tang, const float &amp;dst\_wall) const ROCKY\_FUNCTIONS void [add\_force](#a749ae0224b1bd279d33404b3d0b84010) (float3 force) ROCKY\_FUNCTIONS void [add\_acceleration](#a1578dfd6da083096eb169fe24913dd5b) (float3 acceleration) <a id="details" name="details"></a>## Detailed Description

`<a class="el" href="structIRockySPHTriangleInteraction.xhtml">IRockySPHTriangleInteraction</a>` is a code representation of a pair of neighbor SPH element / geometry triangle with a force interaction. Within Rocky, this pair is usually called *SPH triangle interaction*.



## Member Function Documentation

<a id="a1578dfd6da083096eb169fe24913dd5b" name="a1578dfd6da083096eb169fe24913dd5b"></a>## [◆ ](#a1578dfd6da083096eb169fe24913dd5b)add\_acceleration()

 ROCKY\_FUNCTIONS void IRockySPHTriangleInteraction::add\_acceleration  ( float3 *acceleration*) 

By using this method, a SPH module can pass custom calculated accelerations to the Rockysolver, so they are added to the SPH element and the geometry triangle in the referred *SPH triangle interaction*.Parameters accelerationThe acceleration to be added to the SPH element in the *SPH triangle interaction*, and its triangle counterpart, expressed in Cartesian coordinates. 



<a id="a749ae0224b1bd279d33404b3d0b84010" name="a749ae0224b1bd279d33404b3d0b84010"></a>## [◆ ](#a749ae0224b1bd279d33404b3d0b84010)add\_force()

 ROCKY\_FUNCTIONS void IRockySPHTriangleInteraction::add\_force  ( float3 *force*) 

By using this method, a SPH module can pass custom calculated forces to the Rocky solver,so they are applied to the SPH element and the geometry triangle in the referred *SPH triangle interaction*.Parameters forceThe force to be applied to the SPH element in the *SPH triangle interaction*, and its triangle counterpart, expressed in Cartesian coordinates. 



<a id="a6bfc347dab63cdbb89a8045f878ba16f" name="a6bfc347dab63cdbb89a8045f878ba16f"></a>## [◆ ](#a6bfc347dab63cdbb89a8045f878ba16f)calculate\_element\_triangle\_distance()

 ROCKY\_FUNCTIONS float IRockySPHTriangleInteraction::calculate\_element\_triangle\_distance  ( )  const

ReturnsThe distance between the SPH element and the near geometry triangle, measured in the normal direction to the triangle's plane. 



<a id="ab240320819db1ece083e25b69f305e12" name="ab240320819db1ece083e25b69f305e12"></a>## [◆ ](#ab240320819db1ece083e25b69f305e12)get\_boundary\_velocity()

 ROCKY\_FUNCTIONS float3 IRockySPHTriangleInteraction::get\_boundary\_velocity  ( )  const

ReturnsThe instantaneous velocity of the point that coincides with the orthogonal projection of the SPH element position onto the near geometry triangle, expressed in Cartesian coordinates. 



<a id="ae83d8750e222b2a46e6f901fd20b80d5" name="ae83d8750e222b2a46e6f901fd20b80d5"></a>## [◆ ](#ae83d8750e222b2a46e6f901fd20b80d5)get\_home\_element()

 ROCKY\_FUNCTIONS [IRockySPHElement](structIRockySPHElement.xhtml) IRockySPHTriangleInteraction::get\_home\_element  ( )  const

ReturnsAn `<a class="el" href="structIRockySPHElement.xhtml">IRockySPHElement</a>` object representing the SPH element labeled as *home* in the *SPH interaction*. 



<a id="afc2786e2e46e3b025371c17290a88f45" name="afc2786e2e46e3b025371c17290a88f45"></a>## [◆ ](#afc2786e2e46e3b025371c17290a88f45)get\_home\_element\_velocity()

 ROCKY\_FUNCTIONS float3 IRockySPHTriangleInteraction::get\_home\_element\_velocity  ( )  const

ReturnsThe velocity vector of the SPH element labeled as *home* in the SPH interaction. 



<a id="a469b4ac53234c9e707fee62725b0470a" name="a469b4ac53234c9e707fee62725b0470a"></a>## [◆ ](#a469b4ac53234c9e707fee62725b0470a)get\_near\_triangle()

 ROCKY\_FUNCTIONS [IRockyGeometryTriangle](structIRockyGeometryTriangle.xhtml) IRockySPHTriangleInteraction::get\_near\_triangle  ( )  const

ReturnsAn `<a class="el" href="structIRockyGeometryTriangle.xhtml">IRockyGeometryTriangle</a>` object representing the geometry triangle labeled as *near* in the *SPH triangle interaction*. 



<a id="a9df83c2a83bd932798eba6a099398ce4" name="a9df83c2a83bd932798eba6a099398ce4"></a>## [◆ ](#a9df83c2a83bd932798eba6a099398ce4)get\_normal\_relative\_velocity()

 ROCKY\_FUNCTIONS real\_sph IRockySPHTriangleInteraction::get\_normal\_relative\_velocity  ( )  const

ReturnsThe normal component of the SPH element's velocity relative to the the velocity of the nearest point on that triangle. 



<a id="a665a945d4045772b3a4759b76daf697b" name="a665a945d4045772b3a4759b76daf697b"></a>## [◆ ](#a665a945d4045772b3a4759b76daf697b)get\_orthogonal\_projection()

 ROCKY\_FUNCTIONS float3 IRockySPHTriangleInteraction::get\_orthogonal\_projection  ( )  const

ReturnsThe Cartesian coordinates of the orthogonal projection of the home SPH element position onto the near geometry triangle. 



<a id="a5ff11979743a9bd389afbc153b7124d9" name="a5ff11979743a9bd389afbc153b7124d9"></a>## [◆ ](#a5ff11979743a9bd389afbc153b7124d9)get\_tangential\_relative\_velocity()

 ROCKY\_FUNCTIONS real\_sph IRockySPHTriangleInteraction::get\_tangential\_relative\_velocity  ( )  const

ReturnsThe tangential component of the SPH element's velocity relative to the the velocity of the nearest point on that triangle. 



<a id="a23aa813897c50610e3989dc625f1993a" name="a23aa813897c50610e3989dc625f1993a"></a>## [◆ ](#a23aa813897c50610e3989dc625f1993a)get\_unit\_vector()

 ROCKY\_FUNCTIONS float3 IRockySPHTriangleInteraction::get\_unit\_vector  ( )  const

ReturnsThe unit vector normal to the near geometry triangle. This vector always points to the position of the home SPH element. 



<a id="aaae7a8fe9a92cdcd25f7f4d84a21a9f8" name="aaae7a8fe9a92cdcd25f7f4d84a21a9f8"></a>## [◆ ](#aaae7a8fe9a92cdcd25f7f4d84a21a9f8)get\_wall\_turbulent\_thermal\_conductance()

 ROCKY\_FUNCTIONS float IRockySPHTriangleInteraction::get\_wall\_turbulent\_thermal\_conductance  ( const float &amp; *v\_tang*,    const float &amp; *dst\_wall* ) const

ReturnsThe thermal conductance between a SPH element and a geometry triangle, calculated using the thermal turbulent wall function. The corresponding heat transfer rate can be obtained by multiplying the thermal conductance by the temperature difference between the SPH element and the geometry triangle.Parameters velocityThe tangential component of the velocity of the SPH element relative to the nearest point on the geometry triangle. distanceThe distance of the SPH element to the nearest point on the geometry triangle.