IRockySPHElementScalars Struct Reference
Last update: 08.07.2024
IRockySPHElementScalars Struct Reference
#include <rocky_sph_element_scalars.hpp>
Inherits EntityScalars< rocky20::SPHParticleScalars >.
Public Member Functions | |
template<class _data_type = float> | |
ROCKY_FUNCTIONS _data_type | get_scalar (int scalar_index) const |
ROCKY_FUNCTIONS float | get_turbulent_viscosity () const |
ROCKY_FUNCTIONS float | get_temperature () const |
ROCKY_FUNCTIONS float | get_heat_transfer () const |
template<class _data_type = float> | |
ROCKY_FUNCTIONS void | set_scalar (int scalar_index, _data_type value) const |
ROCKY_FUNCTIONS void | set_turbulent_viscosity (const float value) |
ROCKY_FUNCTIONS void | set_temperature (const float value) |
ROCKY_FUNCTIONS void | set_heat_transfer (const float value) |
template<class _data_type = float> | |
ROCKY_FUNCTIONS void | add_scalar (int scalar_index, _data_type value) const |
ROCKY_FUNCTIONS void | add_turbulent_viscosity (const float value) |
ROCKY_FUNCTIONS void | add_temperature (const float value) |
ROCKY_FUNCTIONS void | add_heat_transfer (const float value) |
template<class _data_type = float> | |
ROCKY_FUNCTIONS void | max_scalar (int scalar_index, _data_type value) const |
Detailed Description
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.
Member Function Documentation
◆ add_heat_transfer()
ROCKY_FUNCTIONS void IRockySPHElementScalars::add_heat_transfer | ( | const float | value | ) |
- 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.
◆ add_scalar()
template<class _data_type = float>
ROCKY_FUNCTIONS void IRockySPHElementScalars::add_scalar | ( | int | scalar_index, |
_data_type | value | ||
) | const |
- 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.
◆ add_temperature()
ROCKY_FUNCTIONS void IRockySPHElementScalars::add_temperature | ( | const float | value | ) |
- This method sums a value to the current temperature of a SPH element.
- Parameters
-
value The value to be added to the temperature.
◆ add_turbulent_viscosity()
ROCKY_FUNCTIONS void IRockySPHElementScalars::add_turbulent_viscosity | ( | const float | value | ) |
- This method sums a value to the current turbulent viscosity stored for the SPH element.
- Parameters
-
value The value summed to the turbulent viscosity.
◆ get_heat_transfer()
ROCKY_FUNCTIONS float IRockySPHElementScalars::get_heat_transfer | ( | ) | const |
- 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.
◆ get_scalar()
template<class _data_type = float>
ROCKY_FUNCTIONS _data_type IRockySPHElementScalars::get_scalar | ( | int | scalar_index | ) | const |
- 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.
◆ get_temperature()
ROCKY_FUNCTIONS float IRockySPHElementScalars::get_temperature | ( | ) | const |
- 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.
◆ get_turbulent_viscosity()
ROCKY_FUNCTIONS float IRockySPHElementScalars::get_turbulent_viscosity | ( | ) | const |
- 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.
◆ max_scalar()
template<class _data_type = float>
ROCKY_FUNCTIONS void IRockySPHElementScalars::max_scalar | ( | int | scalar_index, |
_data_type | value | ||
) | const |
- 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.
◆ set_heat_transfer()
ROCKY_FUNCTIONS void IRockySPHElementScalars::set_heat_transfer | ( | const float | value | ) |
- 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.
◆ set_scalar()
template<class _data_type = float>
ROCKY_FUNCTIONS void IRockySPHElementScalars::set_scalar | ( | int | scalar_index, |
_data_type | value | ||
) | const |
- 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.
◆ set_temperature()
ROCKY_FUNCTIONS void IRockySPHElementScalars::set_temperature | ( | const float | value | ) |
- 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.
◆ set_turbulent_viscosity()
ROCKY_FUNCTIONS void IRockySPHElementScalars::set_turbulent_viscosity | ( | const float | value | ) |
- 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.