Skip to main content

Rocky Solver SDK 2026 R1

Structure IRockySPHModel

Last update: 09.03.2026

#include

IRockySPHModel includes some methods that provide basic information about the SPH model. The data associated to an IRockySPHModel object resides entirely on host memory, consequently, it can be accessed only within hooks executed host-side.

Members

Public functions

Function get_sph_element_scalars

![][const]

IRockySPHElementScalarsModel IRockySPHModel::get_sph_element_scalars() const

Returns:

An IRockySPHElementScalarsModel 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.

Return type: IRockySPHElementScalarsModel

Function get_number_of_sph_elements

![][const]

int IRockySPHModel::get_number_of_sph_elements() const

Returns:

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

Return type: int

Function get_number_of_active_sph_elements

![][const]

int IRockySPHModel::get_number_of_active_sph_elements() const

Returns:

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

Return type: int

Function get_number_of_active_free_sph_elements

![][const]

int IRockySPHModel::get_number_of_active_free_sph_elements() const

Returns:

The 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.

Return type: int

Function get_number_of_active_linked_sph_elements

![][const]

int IRockySPHModel::get_number_of_active_linked_sph_elements() const

Returns:

The 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.

Return type: int

Function get_initial_element_spacing

![][const]

float IRockySPHModel::get_initial_element_spacing() const

Returns:

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

Return type: float

Function get_smoothing_length

![][const]

float IRockySPHModel::get_smoothing_length() const

Returns:

The 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.

Return type: float

Function get_element_mass

![][const]

float IRockySPHModel::get_element_mass() const

Returns:

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

Return type: float

Function get_fluid_viscosity

![][const]

float IRockySPHModel::get_fluid_viscosity() const

Returns:

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

Return type: ROCKY_FUNCTIONS float

Function get_fluid_density

![][const]

float IRockySPHModel::get_fluid_density() const

Returns:

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

Return type: ROCKY_FUNCTIONS float

Function get_fluid_thermal_conductivity

![][const]

float IRockySPHModel::get_fluid_thermal_conductivity() const

Returns:

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

Return type: ROCKY_FUNCTIONS float

Function get_fluid_specific_heat

![][const]

float IRockySPHModel::get_fluid_specific_heat() const

Returns:

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

Return type: ROCKY_FUNCTIONS float

Function get_speed_of_sound

![][const]

float IRockySPHModel::get_speed_of_sound() const

Returns:

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

Return type: ROCKY_FUNCTIONS float

Function get_surface_tension

![][const]

float IRockySPHModel::get_surface_tension() const

Returns:

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

Return type: ROCKY_FUNCTIONS float

Function is_enabled

![][const]

bool IRockySPHModel::is_enabled() const

Returns:

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

Return type: bool

Function set_htc_distance_factor

![][const]

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 determines:

the distance from the triangle the SPH average properties (e.g. velocity, viscosity) will be ca calculated.

Parameters:

  • htc_distance_factor: the factor that will be multiplied by the SPH element size.

Parameters:

  • float htc_distance_factor

Return type: ROCKY_FUNCTIONS void

Function get_maximum_refinement_count

![][const]

int IRockySPHModel::get_maximum_refinement_count() const

Returns:

This function gets an returns the maximum number of refinement count which is how many of the finest elements can be generated from the coarsest element depending on the maximum number of refinement levels.

Return type: int

Function get_maximum_refinement_levels

![][const]

int IRockySPHModel::get_maximum_refinement_levels() const

Returns:

This function gets an returns the maximum number of refinement levels.

Return type: int

[const]: https://img.shields.io/badge/-const-lightblue (const)

Connect with Ansys