IRockySPHElement Struct Reference
Last update: 08.07.2024
IRockySPHElement Struct Reference
#include <rocky_sph_element_api.hpp>
Inherits IRockySPHElementImpl< SDeviceModel, SPHDeviceModel >.
Public Member Functions | |
ROCKY_FUNCTIONS IRockyParticle | get_linked_dem_particle () const |
ROCKY_FUNCTIONS void | add_force (const float3 &force) const |
ROCKY_FUNCTIONS void | add_acceleration (const float3 &acceleration) const |
ROCKY_FUNCTIONS void | set_frozen (bool frozen) |
ROCKY_FUNCTIONS bool | is_frozen () const |
ROCKY_FUNCTIONS bool | is_dem_coupled () const |
ROCKY_FUNCTIONS float | get_density () const |
ROCKY_FUNCTIONS float | get_pressure () const |
ROCKY_FUNCTIONS float | get_release_time () const |
ROCKY_FUNCTIONS float3 | get_position () const |
ROCKY_FUNCTIONS float3 | get_velocity () const |
ROCKY_FUNCTIONS float3 | get_normal () const |
ROCKY_FUNCTIONS float3 | get_force () const |
ROCKY_FUNCTIONS float3 | get_acceleration () const |
ROCKY_FUNCTIONS IRockySPHElementScalars | get_scalars () |
Detailed Description
IRockySPHElement
is the code representation of an individual SPH element, which is the basic unit for representing the fluid flow in a SPH model. It has several methods to access the values of physical properties carried by the SPH elements, as well as SPH element scalars, which are special variables that store custom property values per SPH element that are preserved between time iterations.
Member Function Documentation
◆ add_acceleration()
ROCKY_FUNCTIONS void IRockySPHElement::add_acceleration | ( | const float3 & | acceleration | ) | const |
- This method adds an acceleration component caused by an external force to the SPH element's
- acceleration internally calculated by Rocky.
- Parameters
-
acceleration The added acceleration vector, expressed in Cartesian coordinates.
◆ add_force()
ROCKY_FUNCTIONS void IRockySPHElement::add_force | ( | const float3 & | force | ) | const |
- This method adds a new force to the set of acting forces over the SPH element.
- Parameters
-
force The added force vector, expressed in Cartesian coordinates.
◆ get_acceleration()
ROCKY_FUNCTIONS float3 IRockySPHElement::get_acceleration | ( | ) | const |
- Returns
- The current acceleration resultant vector of the SPH element, expressed in Cartesian coordinates. If this method is called before the stage of force calculation, a zero vector will be returned.
◆ get_density()
ROCKY_FUNCTIONS float IRockySPHElement::get_density | ( | ) | const |
- Returns
- The current value of density calculated for the SPH element.
◆ get_force()
ROCKY_FUNCTIONS float3 IRockySPHElement::get_force | ( | ) | const |
- Returns
- The resultant of the forces currently acting over the SPH element, expressed in Cartesian coordinates. If this method is called before the stage of force calculation, a zero vector will be returned.
◆ get_linked_dem_particle()
ROCKY_FUNCTIONS IRockyParticle IRockySPHElement::get_linked_dem_particle | ( | ) | const |
- Returns
- An
IRockyParticle
object representing the DEM particle linked to the SPH particle, if the latter is actually a DEM-coupled SPH element.
◆ get_normal()
ROCKY_FUNCTIONS float3 IRockySPHElement::get_normal | ( | ) | const |
- Returns
- An approximation of the normal vector to a free surface, if the SPH element is located near one, for use on the implementation of custom surface tension models. This vector is obtained by using the standard continuum approximation of interfaces, which is based on the gradient of the so called color function. In this approximation, an interface has a finite thickness over which the color function varies smoothly between zero and one. Because of this, a normal vector is calculated for every SPH element in the solution domain. However, only elements located near a free surface will have a normal vector with length significantly different from zero. It is worth noting that this vector is not normalized, therefore, its length will vary from one element to another. Moreover, these normal vectors are calculated internally only if a surface tension model is active in the simulation, therefore, a runtime error will be generated if this method is used otherwise.
◆ get_position()
ROCKY_FUNCTIONS float3 IRockySPHElement::get_position | ( | ) | const |
- Returns
- The Cartesian coordinates of the point at which the SPH element is currently located.
◆ get_pressure()
ROCKY_FUNCTIONS float IRockySPHElement::get_pressure | ( | ) | const |
- Returns
- The current value of the pressure at the location coincident with the SPH element.
◆ get_release_time()
ROCKY_FUNCTIONS float IRockySPHElement::get_release_time | ( | ) | const |
- Returns
- The time at which the SPH element entered into the simulation.
◆ get_scalars()
ROCKY_FUNCTIONS IRockySPHElementScalars IRockySPHElement::get_scalars | ( | ) |
- Returns
- An
IRockySPHElementScalars
object that gives access to all SPH element scalars variables defined in the project.
◆ get_velocity()
ROCKY_FUNCTIONS float3 IRockySPHElement::get_velocity | ( | ) | const |
- Returns
- The velocity vector at which the SPH element is currently moving, expressed in Cartesian coordinates.
◆ is_dem_coupled()
ROCKY_FUNCTIONS bool IRockySPHElement::is_dem_coupled | ( | ) | const |
- Returns
- True, if the SPH element is placed inside a DEM particle in order to model the interaction between the fluid flow and the DEM particles. False, otherwise.
◆ is_frozen()
ROCKY_FUNCTIONS bool IRockySPHElement::is_frozen | ( | ) | const |
- Returns
- True if the SPH element is frozen. False, otherwise.
◆ set_frozen()
ROCKY_FUNCTIONS void IRockySPHElement::set_frozen | ( | bool | frozen | ) |
- This method sets the frozen state of a SPH element. When the frozen state of an element
- is set to
true
, the solution of the motion equations for it is skipped.
- Parameters
-
frozen True if the particle should be frozen. False, otherwise.