Skip to main content

Rocky Solver SDK 2024 R2

IRockyFluidScalars Struct Reference

Last update: 08.07.2024

#include <rocky_fluid_scalars.hpp>

Inherits EntityScalars< rocky20::FluidScalars >.

Public Member Functions

ROCKY_FUNCTIONS double get_scalar (int scalar_index) const
 
ROCKY_FUNCTIONS void set_scalar (int scalar_index, double value) const
 
ROCKY_FUNCTIONS void add_scalar (int scalar_index, double value) const
 
ROCKY_FUNCTIONS void max_scalar (int scalar_index, double value) const
 

Detailed Description

During the iterative process of a simulation, IRockyFluidScalars gives access to all fluid scalars defined in the project. These fluid scalars can be built-in scalars defined in the Rocky solver, or custom fluid scalars defined by the current module or other active modules.

Member Function Documentation

◆ add_scalar()

ROCKY_FUNCTIONS void IRockyFluidScalars::add_scalar ( int  scalar_index,
double  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.
In the case of fluid scalars that are marked as additional variables to be shared with Fluent,
the value refers to the particle's contribution to the fluid cell, since Rocky will convert it to the cell value automatically by dividing by the cell volume [m3] which the particle belongs to, and by the CFD timestep [s].
For example, when adding a mass source [kg] to the fluid, the value
will be converted to kg/m3.s before sending it to Fluent.
In the case of fluid scalars which are Fluent additional inputs,
Parameters
scalar_indexThe integer index that was associated to the scalar variable during the setup of the module.
valueThe value that must be summed to the current stored value.

◆ get_scalar()

ROCKY_FUNCTIONS double IRockyFluidScalars::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_indexThe integer index that was associated to the scalar variable during the setup of the module.
Returns
The value currently stored in the scalar variable.

◆ max_scalar()

ROCKY_FUNCTIONS void IRockyFluidScalars::max_scalar ( int  scalar_index,
double  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_indexThe integer index that was associated to the scalar variable during the setup of the module.
valueA value that must be checked if it is greater than the current stored value.

◆ set_scalar()

ROCKY_FUNCTIONS void IRockyFluidScalars::set_scalar ( int  scalar_index,
double  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.
In the case of fluid scalars that are marked as additional variables to be shared with Fluent,
the value refers to the particle's contribution to the fluid cell, since Rocky will convert it to the cell value automatically by dividing by the cell volume [m3] which the particle belongs to, and by the CFD timestep [s].
For example, when adding a mass source [kg] to the fluid, the value
will be converted to kg/m3.s before sending it to Fluent.
Parameters
scalar_indexThe integer index that was associated to the scalar variable during the setup of the module.
valueThe value that must be stored.