walberla::lbm::force_model::None_tag Struct Reference

Detailed Description

Force Model for the LBM

Every force model must implement the following concept:

  1. Every force model must have a "tag". See force_model::None_tag and class force_model::None. If you write your own force model and none of the existing tags fit, just define your own empty struct and use it as tag.
  2. Every force model must define a type "DirectionIndependentTerms_T" which must be returned by function "directionIndependentTerms" (see 9) and which is passed to function "forceTerm" (see 10) during the collision step. [If your force model does not have or does not need to calculate any common, direction-independent terms, you can use the empty struct force_model::NoDirectionIndependentTerms - see class force_model::None as an example]
  3. static const bool shiftMacVel: specifies whether or not during the evaluation of the macroscopic velocity there is a shift by F/2
  4. static const bool shiftEquVel: specifies whether or not during the evaluation of the equilibrium velocity there is a shift by F/2
  5. static const bool constant: true, if the body force density is constant for all cells throughout the entire simulation (false otherwise)
  6. void configure( IBlock & block, StructuredBlockStorage & sbs ): this function is called when a force density model instance is assigned to a block - can be used to scale stored values to a different grid level
  7. const Vector3<real_t> forceDensity() const: must return the body force density (this function must only exist if constant == true)
  8. const Vector3<real_t> forceDensity( const cell_idx_t x, const cell_idx_t y, const cell_idx_t z ) const: -> must return the force density for block local cell (x,y,z) - this function must also exist for constant force densities!
  9. "template< typename LatticeModel_T > DirectionIndependentTerms_T directionIndependentTerms( const cell_idx_t x, const cell_idx_t y, const cell_idx_t z, const Vector3<real_t> & velocity, const real_t rho, const real_t omega ) const": -> can be used to pre-calculate common, direction-independent terms that are needed for every lattice direction of cell (x,y,z) Parameters: (x,y,z) = the cell that is currently processed, velocity/rho = the velocity and density of the equilibrium distribution, omega = relaxation parameter that corresponds to the lattice viscosity
  10. "template< typename LatticeModel_T > real_t forceTerm( const cell_idx_t x, const cell_idx_t y, const cell_idx_t z, const Vector3<real_t> & velocity, const real_t rho, const DirectionIndependentTerms_T & commonTerms, const real_t w, const real_t cx, const real_t cy, const real_t cz, const real_t omega ) const": -> must evaluate the force term of the LBM collision step - called from the LB compute kernel for every lattice direction of cell (x,y,z) Parameters: (x,y,z) = the cell that is currently processed, velocity/rho = the velocity and density of the equilibrium distribution, commonTerms = direction-independent terms calculated by function "directionIndependentTerms" (see 9), w = lattice model weighting factor, (cx,cy,cz) = lattice direction, omega = relaxation parameter that corresponds to the lattice viscosity
  11. "bool setConstantBodyForceIfPossible( const Vector3<real_t> & forceDensity, const uint_t level = uint_t(0) )": -> Must return true if a constant force density can be set. In that case, the force density passed in must be set. 'level' is the grid level 'forceDensity' corresponds to.

ATTENTION: Both forceDensity functions (7+8) and the functions calculating common terms and the force density term (9+10) may be called in parallel by multiple threads and therefore must be thread-safe!

For an example see classes SimpleConstant or LuoField.

#include <ForceModel.h>


The documentation for this struct was generated from the following file: