    

 ## On this page

  

 

 # IRockySPHModel Struct Reference

 Last update: 16.07.2025 

`#include <<a class="el" href="rocky__sph__model__api_8hpp_source.xhtml">rocky_sph_model_api.hpp</a>>`

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

[IRockySPHElementScalarsModel](structIRockySPHElementScalarsModel.xhtml) [get\_sph\_element\_scalars](#a60758ee9b344fcc7c76b500c0ac8f1cc) () const int [get\_number\_of\_sph\_elements](#a5a3c1e8c7b54f79f6803fb25799cbd6d) () const int [get\_number\_of\_active\_sph\_elements](#a53aabea7b2fb880bf83924a036badac7) () const int [get\_number\_of\_active\_free\_sph\_elements](#a5f6419ca48c0e300e03e6820934a1718) () const int [get\_number\_of\_active\_linked\_sph\_elements](#a832524def72a3d2da3bd449d5fb74368) () const ESPHKernelType [get\_kernel\_type](#a513d780295b0089e4d2814cc660f5c78) () const float [get\_initial\_element\_spacing](#a212b6dd01fb2421258372058df86ccd6) () const float [get\_smoothing\_length](#a245fc38b2db35e544f3b78642f11aff7) () const float [get\_element\_mass](#afafa8461838c8fa9ca237437c074facd) () const ROCKY\_FUNCTIONS float [get\_fluid\_viscosity](#aa34cbdb0bbe713f76a24718369445b90) () const ROCKY\_FUNCTIONS float [get\_fluid\_density](#a053a3b3c9bd14e5051f38a0024ab4536) () const ROCKY\_FUNCTIONS float [get\_fluid\_thermal\_conductivity](#ab09538e62b2731ab25ee664d6eb08319) () const ROCKY\_FUNCTIONS float [get\_fluid\_specific\_heat](#acaf7cc9d7b268d36a2f739cfc3c3f7ca) () const ROCKY\_FUNCTIONS float [get\_speed\_of\_sound](#a223390925c0c7a8d4c0a8ceaef043fe4) () const ROCKY\_FUNCTIONS float [get\_surface\_tension](#adae7b4a0340c884eb80e14d54a1b22f5) () const bool [is\_enabled](#ab104c8f250896d3528cbe2eb045b4c69) () const ROCKY\_FUNCTIONS void [set\_htc\_distance\_factor](#a1627faf9bcd3eca660891efbf5d95981) (float htc\_distance\_factor) const <a id="details" name="details"></a>## Detailed Description

`<a class="el" href="structIRockySPHModel.xhtml">IRockySPHModel</a>` includes some methods that provide basic information about the SPH model. The data associated to an `<a class="el" href="structIRockySPHModel.xhtml">IRockySPHModel</a>` object resides entirely on host memory, consequently, it can be accessed only within hooks executed host-side.



## Member Function Documentation

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

 float IRockySPHModel::get\_element\_mass  ( )  const

ReturnsThe mass associated to each one of the SPH elements in the simulation. 



<a id="a053a3b3c9bd14e5051f38a0024ab4536" name="a053a3b3c9bd14e5051f38a0024ab4536"></a>## [◆ ](#a053a3b3c9bd14e5051f38a0024ab4536)get\_fluid\_density()

 float IRockySPHModel::get\_fluid\_density  ( )  const

ReturnsThe user-prescribed value of the fluid's density. 



<a id="acaf7cc9d7b268d36a2f739cfc3c3f7ca" name="acaf7cc9d7b268d36a2f739cfc3c3f7ca"></a>## [◆ ](#acaf7cc9d7b268d36a2f739cfc3c3f7ca)get\_fluid\_specific\_heat()

 float IRockySPHModel::get\_fluid\_specific\_heat  ( )  const

ReturnsThe user-prescribed value of the fluid's specific heat. 



<a id="ab09538e62b2731ab25ee664d6eb08319" name="ab09538e62b2731ab25ee664d6eb08319"></a>## [◆ ](#ab09538e62b2731ab25ee664d6eb08319)get\_fluid\_thermal\_conductivity()

 float IRockySPHModel::get\_fluid\_thermal\_conductivity  ( )  const

ReturnsThe user-prescribed value of the fluid's thermal conductivity. 



<a id="aa34cbdb0bbe713f76a24718369445b90" name="aa34cbdb0bbe713f76a24718369445b90"></a>## [◆ ](#aa34cbdb0bbe713f76a24718369445b90)get\_fluid\_viscosity()

 float IRockySPHModel::get\_fluid\_viscosity  ( )  const

ReturnsThe user-prescribed value of the fluid's dynamic viscosity. 



<a id="a212b6dd01fb2421258372058df86ccd6" name="a212b6dd01fb2421258372058df86ccd6"></a>## [◆ ](#a212b6dd01fb2421258372058df86ccd6)get\_initial\_element\_spacing()

 float IRockySPHModel::get\_initial\_element\_spacing  ( )  const

ReturnsThe spacing between SPH elements when they enter into the simulation. This is a characteristic length considered in several expressions in the SPH model. 



<a id="a513d780295b0089e4d2814cc660f5c78" name="a513d780295b0089e4d2814cc660f5c78"></a>## [◆ ](#a513d780295b0089e4d2814cc660f5c78)get\_kernel\_type()

 ESPHKernelType IRockySPHModel::get\_kernel\_type  ( )  const

ReturnsAn `ESPHKernelType` enum indicating the kernel type used in the SPH model. Currently there are 3 kernel types implemented in Rocky:  
`ktCubic = 0`  
`ktQuintic = 1`  
`ktWendland = 2`  




<a id="a5f6419ca48c0e300e03e6820934a1718" name="a5f6419ca48c0e300e03e6820934a1718"></a>## [◆ ](#a5f6419ca48c0e300e03e6820934a1718)get\_number\_of\_active\_free\_sph\_elements()

 int IRockySPHModel::get\_number\_of\_active\_free\_sph\_elements  ( )  const

ReturnsThe number of free SPH elements that are currently active in the simulation. Free SPH elements are the ones that represent the fluid in the simulation. 



<a id="a832524def72a3d2da3bd449d5fb74368" name="a832524def72a3d2da3bd449d5fb74368"></a>## [◆ ](#a832524def72a3d2da3bd449d5fb74368)get\_number\_of\_active\_linked\_sph\_elements()

 int IRockySPHModel::get\_number\_of\_active\_linked\_sph\_elements  ( )  const

ReturnsThe number of linked SPH elements that are currently active in the simulation. Linked or DEM-coupled SPH elements are the ones inside the DEM particles, used to model the interaction between fluid and DEM particles. 



<a id="a53aabea7b2fb880bf83924a036badac7" name="a53aabea7b2fb880bf83924a036badac7"></a>## [◆ ](#a53aabea7b2fb880bf83924a036badac7)get\_number\_of\_active\_sph\_elements()

 int IRockySPHModel::get\_number\_of\_active\_sph\_elements  ( )  const

ReturnsThe number of SPH elements that are currently active in the simulation. This number includes both free and DEM-coupled SPH elements. 



<a id="a5a3c1e8c7b54f79f6803fb25799cbd6d" name="a5a3c1e8c7b54f79f6803fb25799cbd6d"></a>## [◆ ](#a5a3c1e8c7b54f79f6803fb25799cbd6d)get\_number\_of\_sph\_elements()

 int IRockySPHModel::get\_number\_of\_sph\_elements  ( )  const

ReturnsThe total number of SPH elements generated during the preprocessing phase of the simulation. 



<a id="a245fc38b2db35e544f3b78642f11aff7" name="a245fc38b2db35e544f3b78642f11aff7"></a>## [◆ ](#a245fc38b2db35e544f3b78642f11aff7)get\_smoothing\_length()

 float IRockySPHModel::get\_smoothing\_length  ( )  const

ReturnsThe value of the smoothing length considered in the SPH discretization. The radius of the support region of the kernel function is normally an integer multiple of the smoothing length. 



<a id="a223390925c0c7a8d4c0a8ceaef043fe4" name="a223390925c0c7a8d4c0a8ceaef043fe4"></a>## [◆ ](#a223390925c0c7a8d4c0a8ceaef043fe4)get\_speed\_of\_sound()

 float IRockySPHModel::get\_speed\_of\_sound  ( )  const

ReturnsThe user-prescribed value of the speed of sound in the fluid. 



<a id="a60758ee9b344fcc7c76b500c0ac8f1cc" name="a60758ee9b344fcc7c76b500c0ac8f1cc"></a>## [◆ ](#a60758ee9b344fcc7c76b500c0ac8f1cc)get\_sph\_element\_scalars()

 [IRockySPHElementScalarsModel](structIRockySPHElementScalarsModel.xhtml) IRockySPHModel::get\_sph\_element\_scalars  ( )  const

ReturnsAn `<a class="el" href="structIRockySPHElementScalarsModel.xhtml">IRockySPHElementScalarsModel</a>` object, that allows users to add new SPH element scalars or activate SPH element scalars known to Rocky during the setup of a module. SPH element scalars are special variables attached to SPH elements that are able to store values per element that are preserved between time iterations. 



<a id="adae7b4a0340c884eb80e14d54a1b22f5" name="adae7b4a0340c884eb80e14d54a1b22f5"></a>## [◆ ](#adae7b4a0340c884eb80e14d54a1b22f5)get\_surface\_tension()

 float IRockySPHModel::get\_surface\_tension  ( )  const

ReturnsThe user-prescribed value of the surface tension at a free surface. 



<a id="ab104c8f250896d3528cbe2eb045b4c69" name="ab104c8f250896d3528cbe2eb045b4c69"></a>## [◆ ](#ab104c8f250896d3528cbe2eb045b4c69)is\_enabled()

 bool IRockySPHModel::is\_enabled  ( )  const

ReturnsA boolean value indicating whether the SPH model is enabled on the simulation or not. 



<a id="a1627faf9bcd3eca660891efbf5d95981" name="a1627faf9bcd3eca660891efbf5d95981"></a>## [◆ ](#a1627faf9bcd3eca660891efbf5d95981)set\_htc\_distance\_factor()

 ROCKY\_FUNCTIONS void IRockySPHModel::set\_htc\_distance\_factor  ( float *htc\_distance\_factor*)  const

This function sets a factor that will be multiplied by the SPH element size that determinesthe distance from the triangle the SPH average properties (e.g. velocity, viscosity) will be ca calculated.Parameters htc\_distance\_factorthe factor that will be multiplied by the SPH element size.