    

 ## On this page

  

 

 # IRockyParticleScalarsModel Struct Reference

 Last update: 16.07.2025 

`#include <<a class="el" href="rocky__particle__scalars_8hpp_source.xhtml">rocky_particle_scalars.hpp</a>>`

Inherits ScalarsModel&lt; rocky20::ParticleScalarsController &gt;.

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

void [enable\_mass\_increment](#a82310007a102c845cbb5e6163a8863b0) () void [enable\_volume\_increment](#ab60645cee4e4e0dc368f0f11bc9b75d9) () void [enable\_variable\_thermal\_conductivity](#aa415607030884508e190c512b1218856) () void [enable\_variable\_poisson\_ratio](#acd067b0a46a10fd2c931702257974e2b) () void [enable\_variable\_specific\_heat](#a7527c9be8d999b23208f43917f13a5a0) () int [find](#a2fe0d14a5fc4f803eb04374ec6d2a40f) (const char \*name) int [add](#a6c5d694427108fb05dbe32f418394f71) (const char \*name, const char \*unit, bool output=true) void [reset](#a4884be92519fd1d4d274d7558864b85f) (int scalar\_index) void [set\_dimension](#a40b74ee0226b8f635092a200a7be71b1) (int scalar\_index, double dimension\_factor) <a id="details" name="details"></a>## Detailed Description

An `<a class="el" href="structIRockyParticleScalarsModel.xhtml">IRockyParticleScalarsModel</a>` allows users to add new particle scalars, find particle scalars created in other modules or activate particle scalars known to Rocky, during the setup stage of a module. Particle scalars are special variables attached to particles, which are able to store values per particle that are preserved between time iterations during a simulation.



## Member Function Documentation

<a id="a6c5d694427108fb05dbe32f418394f71" name="a6c5d694427108fb05dbe32f418394f71"></a>## [◆ ](#a6c5d694427108fb05dbe32f418394f71)add()

 int IRockyParticleScalarsModel::add  ( const char \* *name*,    const char \* *unit*,    bool *output* = true )

This method creates a new scalar variable of type `double`for storing custom values during a simulation, preserving them between time iterations.Parameters nameThe name given to the scalar variable. The purpose of this name is twofold. First, it enables to find this scalar variable from other module, in order to share their values. Second, if the scalar variable can be displayed in a 3D window as a property, this name will identify it in the Rocky UI.unitA string specifying the unit in S.I. associated to the scalar variable.outputEnables/disables the storage in disk at output times, for the visualization and post-processing of the scalar values.ReturnsThe index that will uniquely identify the scalar variable during the execution of the simulation. 



<a id="a82310007a102c845cbb5e6163a8863b0" name="a82310007a102c845cbb5e6163a8863b0"></a>## [◆ ](#a82310007a102c845cbb5e6163a8863b0)enable\_mass\_increment()

 void IRockyParticleScalarsModel::enable\_mass\_increment  ( ) 

Enables a known-scalar that associates a mass increment value to each particle in a simulation.When this scalar is enabled, the instantaneous mass of a particle is equal to the original mass defined at the beginning of a simulation plus the value of that mass increment. 



<a id="acd067b0a46a10fd2c931702257974e2b" name="acd067b0a46a10fd2c931702257974e2b"></a>## [◆ ](#acd067b0a46a10fd2c931702257974e2b)enable\_variable\_poisson\_ratio()

 void IRockyParticleScalarsModel::enable\_variable\_poisson\_ratio  ( ) 

Enables a known-scalar defining Poisson's ratio value to each particle in a simulation.When this scalar is enabled, the instantaneous Poisson's ratio is defined as a variable property, with possibly a different value and used everywhere in the simulation, instead of the constant value of particle's material 



<a id="a7527c9be8d999b23208f43917f13a5a0" name="a7527c9be8d999b23208f43917f13a5a0"></a>## [◆ ](#a7527c9be8d999b23208f43917f13a5a0)enable\_variable\_specific\_heat()

 void IRockyParticleScalarsModel::enable\_variable\_specific\_heat  ( ) 

Enables a known-scalar defining specific heat value to each particle in a simulation.When this scalar is enabled, the instantaneous specific heat is defined as a variable property, with possibly a different value and used everywhere in the simulation, instead of the constant value of particle's material 



<a id="aa415607030884508e190c512b1218856" name="aa415607030884508e190c512b1218856"></a>## [◆ ](#aa415607030884508e190c512b1218856)enable\_variable\_thermal\_conductivity()

 void IRockyParticleScalarsModel::enable\_variable\_thermal\_conductivity  ( ) 

Enables a known-scalar that defines the thermal conductivity as a variable property between particles.When this scalar is enabled, a different value of thermal conductivity can be specified for each particle in a simulation, and this value will be used everywhere in the Rocky solver instead of the constant value specified for the particle's material in the Rocky UI. 



<a id="ab60645cee4e4e0dc368f0f11bc9b75d9" name="ab60645cee4e4e0dc368f0f11bc9b75d9"></a>## [◆ ](#ab60645cee4e4e0dc368f0f11bc9b75d9)enable\_volume\_increment()

 void IRockyParticleScalarsModel::enable\_volume\_increment  ( ) 

Enables a known-scalar that associates a volume increment value to each particle in a simulation.When this scalar is enabled, the instantaneous volume of a particle is equal to the original volume defined at the beginning of a simulation plus the value of that volume increment. 



<a id="a2fe0d14a5fc4f803eb04374ec6d2a40f" name="a2fe0d14a5fc4f803eb04374ec6d2a40f"></a>## [◆ ](#a2fe0d14a5fc4f803eb04374ec6d2a40f)find()

 int IRockyParticleScalarsModel::find  ( const char \* *name*) 

This method searches for a scalar variable already created by other modules,in order to allow access to its values, or store new values on it, during the execution of the simulation.Parameters nameThe name given to the scalar at the moment of its creation.ReturnsThe index that uniquely identifies the wanted scalar if it was actually found. It returns -1 otherwise. 



<a id="a4884be92519fd1d4d274d7558864b85f" name="a4884be92519fd1d4d274d7558864b85f"></a>## [◆ ](#a4884be92519fd1d4d274d7558864b85f)reset()

 void IRockyParticleScalarsModel::reset  ( int *scalar\_index*) 

This method resets to zero all values stored in a scalar variable.Parameters scalar\_indexThe index attributed to the scalar variable at the moment of its creation. 



<a id="a40b74ee0226b8f635092a200a7be71b1" name="a40b74ee0226b8f635092a200a7be71b1"></a>## [◆ ](#a40b74ee0226b8f635092a200a7be71b1)set\_dimension()

 void IRockyParticleScalarsModel::set\_dimension  ( int *scalar\_index*,    double *dimension\_factor* )

The purpose of this method is to associate a dimensional factorto a scalar variable. This factor will be used to nondimensionalize their values. For instance, if the scalar represents a force, a force dimensional factor must be associated through this method. Dimensional factors for the fundamental magnitudes are provided by functions of a `<a class="el" href="structIRockyModel.xhtml">IRockyModel</a>` object.Parameters scalar\_indexThe index attributed to the scalar variable at the moment of its creation.dimension\_factorThe appropriate dimensional factor for the scalar variable.