Skip to main content
#include <rocky_sph_element_scalars.hpp> When running a simulation, an IRockySPHElementScalars object gives access to all SPH element scalars defined in the project. These SPH element scalars can be built-in scalars defined within the Rocky solver, or custom SPH element scalars defined by the current module or other active modules. Inherits from:
  • EntityScalars< rocky20::SPHParticleScalars >

Members

Public functions

Function get_scalar

If a custom scalar variable was defined during the setup of the module,: the value currently stored can be accessed with this method. Parameters:
  • scalar_index: The integer index that was associated to the scalar variable during the setup of the module.
Returns: The value currently stored in the scalar variable. Parameters:
  • int scalar_index
Return type: ROCKY_FUNCTIONS _data_type

Function get_turbulent_viscosity

Returns: The value of the turbulent viscosity. Turbulent viscosity is a built-in SPH element scalar defined in the Rocky solver, whose values can be calculated either by a built-in model or by a custom module. Return type: ROCKY_FUNCTIONS float

Function get_temperature

Returns: The value of the temperature of the SPH element. Temperature is a built-in SPH element scalar defined by the Rocky solver, which is activated when a thermal model is enabled in a project. Return type: ROCKY_FUNCTIONS float

Function get_heat_transfer

Returns: The value of the total heat transfer rate towards/from the SPH element. Heat transfer rate is a built-in SPH element scalar defined by the Rocky solver, which is activated when a thermal model is enabled in a project. Return type: ROCKY_FUNCTIONS float

Function get_velocity_gradient_x

Returns: The gradient of the component of the SPH element velocity along the X-axis. Velocity gradients are built-in SPH element scalars defined by the Rocky solver, which is activated manually when a module calls IRockySPHElementScalarsModel::enable_gradient_velocity() at setup hook. Return type: ROCKY_FUNCTIONS float3

Function get_velocity_gradient_y

Returns: The gradient of the component of the SPH element velocity along the Y-axis. Velocity gradients are built-in SPH element scalars defined by the Rocky solver, which is activated manually when a module calls IRockySPHElementScalarsModel::enable_gradient_velocity() at setup hook. Return type: ROCKY_FUNCTIONS float3

Function get_velocity_gradient_z

Returns: The gradient of the component of the SPH element velocity along the Z-axis. Velocity gradients are built-in SPH element scalars defined by the Rocky solver, which is activated manually when a module calls IRockySPHElementScalarsModel::enable_gradient_velocity() at setup hook. Return type: ROCKY_FUNCTIONS float3

Function set_scalar

If a custom scalar variable was defined during the setup of the module,: this method can be used to store a value on it. Parameters:
  • scalar_index: The integer index that was associated to the scalar variable during the setup of the module.
  • value: The value that must be stored.
Parameters:
  • int scalar_index
  • _data_type value
Return type: ROCKY_FUNCTIONS void

Function set_turbulent_viscosity

This method can be used by a custom module implementing a turbulent model in order to: set the value of the turbulent viscosity for later use in the flow equations. Parameters:
  • value: The value of the turbulent viscosity.
Parameters:
  • const float value
Return type: ROCKY_FUNCTIONS void

Function set_temperature

This method can be used by a custom module implementing a thermal model in order to: set the value of the temperature of a SPH element. Parameters:
  • value: The value of the temperature to be set.
Parameters:
  • const float value
Return type: ROCKY_FUNCTIONS void

Function set_heat_transfer

This method can be used by a custom module implementing a thermal model in order to: set the calculated value of the total heat transfer towards/from a SPH element. Parameters:
  • value: The value of the heat transfer rate to be set.
Parameters:
  • const float value
Return type: ROCKY_FUNCTIONS void

Function add_scalar

If a custom scalar variable was defined during the setup of the module,: this method can be used to sum a value to the current one stored in it. Parameters:
  • scalar_index: The integer index that was associated to the scalar variable during the setup of the module.
  • value: The value that must be summed to the current stored value.
Parameters:
  • int scalar_index
  • _data_type value
Return type: ROCKY_FUNCTIONS void

Function add_turbulent_viscosity

This method sums a value to the current turbulent viscosity stored for the SPH element.: Parameters:
  • value: The value summed to the turbulent viscosity.
Parameters:
  • const float value
Return type: ROCKY_FUNCTIONS void

Function add_temperature

This method sums a value to the current temperature of a SPH element.: Parameters:
  • value: The value to be added to the temperature.
Parameters:
  • const float value
Return type: ROCKY_FUNCTIONS void

Function add_heat_transfer

This method can be used for accumulating the heat transfer rate values that a: SPH element interchanges with the surrounding SPH elements, DEM elements and geometries. Parameters:
  • value: The heat transfer rate value to be added.
Parameters:
  • const float value
Return type: ROCKY_FUNCTIONS void

Function max_scalar

If a custom scalar variable was defined during the setup of the module,: this method can be used to make the scalar store the maximum of a set of values. A common use of this method is, for instance, to find the maximum among a set of values associated to the contacts of a particle. Parameters:
  • scalar_index: The integer index that was associated to the scalar variable during the setup of the module.
  • value: A value that must be checked if it is greater than the current stored value.
Parameters:
  • int scalar_index
  • _data_type value
Return type: ROCKY_FUNCTIONS void