VirtualFluids 0.2.0
Parallel CFD LBM Solver
Loading...
Searching...
No Matches
vf::lbm Namespace Reference

Namespaces

namespace  ad
 
namespace  advection_diffusion
 
namespace  dir
 

Classes

struct  CollisionParameter
 
struct  InterpolationCoefficients
 
struct  MacroscopicValues
 
struct  MomentsOnSourceNode
 
class  MomentsOnSourceNodeSet
 
struct  TurbulentViscosity
 

Enumerations

enum class  TurbulenceModel {
  None , Smagorinsky , QR , AMD ,
  AMDStratified
}
 An enumeration for selecting a turbulence model. More...
 

Functions

constexpr void forwardChimeraWithInverseK (real &mfa, real &mfb, real &mfc, real vv, real v2, real inverseK, real K)
 forward chimera transformation forwardChimeraWithInverseK Transformation from distributions to central moments according to Eq. (6)-(14) in [ M. Geier et al. (2017), DOI:10.1016/j.jcp.2017.05.040 ] Modified for lower round-off errors.
 
constexpr void backwardChimeraWithInverseK (real &mfa, real &mfb, real &mfc, real vv, real v2, real inverseK, real K)
 backward chimera transformation backwardChimeraWithInverseK Transformation from central moments to distributions according to Eq. (57)-(65) in [ M. Geier et al. (2017), DOI:10.1016/j.jcp.2017.05.040 ] ] Modified for lower round-off errors.
 
constexpr void forwardChimera (real &mfa, real &mfb, real &mfc, real vv, real v2)
 forward chimera transformation forwardChimera Transformation from distributions to central moments according to Eq. (6)-(14) in [ M. Geier et al. (2017), DOI:10.1016/j.jcp.2017.05.040 ] for $ K_{abc}=0 $. This is to avoid unnecessary floating point operations. Modified for lower round-off errors.
 
constexpr void backwardChimera (real &mfa, real &mfb, real &mfc, real vv, real v2)
 backward chimera transformation backwardChimera Transformation from central moments to distributions according to Eq. (57)-(65) in [ M. Geier et al. (2017), DOI:10.1016/j.jcp.2017.05.040 ] for $ K_{abc}=0 $. This is to avoid unnessary floating point operations. Modified for lower round-off errors.
 
constexpr void forwardChimeraWithK (real &mfa, real &mfb, real &mfc, real vv, real v2, real K)
 
constexpr void backwardChimeraWithK (real &mfa, real &mfb, real &mfc, real vv, real v2, real K)
 
template<TurbulenceModel turbulenceModel>
constexpr void runK17CompressibleNavierStokes (CollisionParameter &parameter, MacroscopicValues &macroscopicValues, TurbulentViscosity &turbulentViscosity)
 Kernel for CumulantK17 including different turbulence models and options for local body forces and writing macroscopic variables.
 
__host__ __device__ real calcTurbulentViscositySmagorinsky (real SGSConstant, real dxux, real dyuy, real dzuz, real Dxy, real Dxz, real Dyz)
 
__host__ __device__ real calcTurbulentViscosityQR (real SGSConstant, real dxux, real dyuy, real dzuz, real Dxy, real Dxz, real Dyz)
 
constexpr real calcDenominatorAMD (real dvxdx, real dvxdy, real dvxdz, real dvydx, real dvydy, real dvydz, real dvzdx, real dvzdy, real dvzdz)
 
constexpr real calcNumeratorAMD (real dvxdx, real dvxdy, real dvxdz, real dvydx, real dvydy, real dvydz, real dvzdx, real dvzdy, real dvzdz)
 
constexpr real calcTurbulentViscosityAMD (real SGSConstant, real dvxdx, real dvxdy, real dvxdz, real dvydx, real dvydy, real dvydz, real dvzdx, real dvzdy, real dvzdz)
 
constexpr real calcTurbulentViscosityAMDStratified (real SGSConstant, real dvxdx, real dvxdy, real dvxdz, real dvydx, real dvydy, real dvydz, real dvzdx, real dvzdy, real dvzdz, real buoyancyParameter, real dthetadx, real dthetady, real dthetadz)
 
constexpr real calculateOmegaWithTurbulentViscosity (real omega, real turbulenceViscosity)
 
constexpr real getDensity (const real *const &f)
 
constexpr real getIncompressibleVelocityX1 (const real *const &f)
 
constexpr real getIncompressibleVelocityX2 (const real *const &f)
 
constexpr real getIncompressibleVelocityX3 (const real *const &f)
 
constexpr void getIncompressibleMacroscopicValues (const real *const &f, real &rho, real &vx1, real &vx2, real &vx3)
 
constexpr real getCompressibleVelocityX1 (const real *const &f27, const real &rho)
 
constexpr real getCompressibleVelocityX2 (const real *const &f27, const real &rho)
 
constexpr real getCompressibleVelocityX3 (const real *const &f27, const real &rho)
 
constexpr real getOneOverRho (real rho)
 
constexpr void getCompressibleMacroscopicValues (const real *const &f, real &drho, real &oneOverRho, real &vx1, real &vx2, real &vx3)
 
constexpr void getCompressibleMacroscopicValues (const real *const &f, real &drho, real &vx1, real &vx2, real &vx3)
 
constexpr real getPressure (const real *const &f27, const real &rho, const real &vx, const real &vy, const real &vz)
 
constexpr real computeRelaxationFrequency (real viscosity)
 
constexpr void interpolateCF (real *const f, const real &omegaF, const real &epsnew, const InterpolationCoefficients &coefficients, const real &x, const real &y, const real &z)
 
constexpr void interpolateFC (real *const f, const real epsnew, const real omegaC, const InterpolationCoefficients &coefficients)
 

Enumeration Type Documentation

◆ TurbulenceModel

An enumeration for selecting a turbulence model.

Enumerator
None 
  • No turbulence model
Smagorinsky 
  • Smagorinsky
QR 
  • QR model by Verstappen
AMD 
AMDStratified 

Computes diffusivity according to <M. Abkar and P. Moin, 2017 \DOI:10.1007/s10546-017-0288-4>

Definition at line 54 of file TurbulentViscosity.h.

Function Documentation

◆ backwardChimera()

constexpr void vf::lbm::backwardChimera ( real mfa,
real mfb,
real mfc,
real  vv,
real  v2 
)
constexpr

backward chimera transformation backwardChimera Transformation from central moments to distributions according to Eq. (57)-(65) in [ M. Geier et al. (2017), DOI:10.1016/j.jcp.2017.05.040 ] for $ K_{abc}=0 $. This is to avoid unnessary floating point operations. Modified for lower round-off errors.

Definition at line 108 of file ChimeraTransformation.h.

◆ backwardChimeraWithInverseK()

constexpr void vf::lbm::backwardChimeraWithInverseK ( real mfa,
real mfb,
real mfc,
real  vv,
real  v2,
real  inverseK,
real  K 
)
constexpr

backward chimera transformation backwardChimeraWithInverseK Transformation from central moments to distributions according to Eq. (57)-(65) in [ M. Geier et al. (2017), DOI:10.1016/j.jcp.2017.05.040 ] ] Modified for lower round-off errors.

Definition at line 70 of file ChimeraTransformation.h.

◆ backwardChimeraWithK()

constexpr void vf::lbm::backwardChimeraWithK ( real mfa,
real mfb,
real mfc,
real  vv,
real  v2,
real  K 
)
constexpr

Definition at line 136 of file ChimeraTransformation.h.

◆ calcDenominatorAMD()

constexpr real vf::lbm::calcDenominatorAMD ( real  dvxdx,
real  dvxdy,
real  dvxdz,
real  dvydx,
real  dvydy,
real  dvydz,
real  dvzdx,
real  dvzdy,
real  dvzdz 
)
constexpr

Definition at line 88 of file TurbulentViscosity.h.

◆ calcNumeratorAMD()

constexpr real vf::lbm::calcNumeratorAMD ( real  dvxdx,
real  dvxdy,
real  dvxdz,
real  dvydx,
real  dvydy,
real  dvydz,
real  dvzdx,
real  dvzdy,
real  dvzdz 
)
constexpr

Definition at line 95 of file TurbulentViscosity.h.

◆ calcTurbulentViscosityAMD()

constexpr real vf::lbm::calcTurbulentViscosityAMD ( real  SGSConstant,
real  dvxdx,
real  dvxdy,
real  dvxdz,
real  dvydx,
real  dvydy,
real  dvydz,
real  dvzdx,
real  dvzdy,
real  dvzdz 
)
constexpr

Definition at line 105 of file TurbulentViscosity.h.

◆ calcTurbulentViscosityAMDStratified()

constexpr real vf::lbm::calcTurbulentViscosityAMDStratified ( real  SGSConstant,
real  dvxdx,
real  dvxdy,
real  dvxdz,
real  dvydx,
real  dvydy,
real  dvydz,
real  dvzdx,
real  dvzdy,
real  dvzdz,
real  buoyancyParameter,
real  dthetadx,
real  dthetady,
real  dthetadz 
)
constexpr

Definition at line 117 of file TurbulentViscosity.h.

◆ calcTurbulentViscosityQR()

__host__ __device__ real vf::lbm::calcTurbulentViscosityQR ( real  SGSConstant,
real  dxux,
real  dyuy,
real  dzuz,
real  Dxy,
real  Dxz,
real  Dyz 
)
inline

Second invariant of the strain-rate tensor

Third invariant of the strain-rate tensor (determinant)

Definition at line 75 of file TurbulentViscosity.h.

◆ calcTurbulentViscositySmagorinsky()

__host__ __device__ real vf::lbm::calcTurbulentViscositySmagorinsky ( real  SGSConstant,
real  dxux,
real  dyuy,
real  dzuz,
real  Dxy,
real  Dxz,
real  Dyz 
)
inline

Definition at line 69 of file TurbulentViscosity.h.

◆ calculateOmegaWithTurbulentViscosity()

constexpr real vf::lbm::calculateOmegaWithTurbulentViscosity ( real  omega,
real  turbulenceViscosity 
)
constexpr

Definition at line 132 of file TurbulentViscosity.h.

◆ computeRelaxationFrequency()

constexpr real vf::lbm::computeRelaxationFrequency ( real  viscosity)
constexpr

Definition at line 138 of file MacroscopicQuantities.h.

◆ forwardChimera()

constexpr void vf::lbm::forwardChimera ( real mfa,
real mfb,
real mfc,
real  vv,
real  v2 
)
constexpr

forward chimera transformation forwardChimera Transformation from distributions to central moments according to Eq. (6)-(14) in [ M. Geier et al. (2017), DOI:10.1016/j.jcp.2017.05.040 ] for $ K_{abc}=0 $. This is to avoid unnecessary floating point operations. Modified for lower round-off errors.

Definition at line 89 of file ChimeraTransformation.h.

◆ forwardChimeraWithInverseK()

constexpr void vf::lbm::forwardChimeraWithInverseK ( real mfa,
real mfb,
real mfc,
real  vv,
real  v2,
real  inverseK,
real  K 
)
constexpr

forward chimera transformation forwardChimeraWithInverseK Transformation from distributions to central moments according to Eq. (6)-(14) in [ M. Geier et al. (2017), DOI:10.1016/j.jcp.2017.05.040 ] Modified for lower round-off errors.

Definition at line 49 of file ChimeraTransformation.h.

◆ forwardChimeraWithK()

constexpr void vf::lbm::forwardChimeraWithK ( real mfa,
real mfb,
real mfc,
real  vv,
real  v2,
real  K 
)
constexpr

Definition at line 120 of file ChimeraTransformation.h.

◆ getCompressibleMacroscopicValues() [1/2]

constexpr void vf::lbm::getCompressibleMacroscopicValues ( const real *const f,
real drho,
real oneOverRho,
real vx1,
real vx2,
real vx3 
)
constexpr

Definition at line 106 of file MacroscopicQuantities.h.

◆ getCompressibleMacroscopicValues() [2/2]

constexpr void vf::lbm::getCompressibleMacroscopicValues ( const real *const f,
real drho,
real vx1,
real vx2,
real vx3 
)
constexpr

Definition at line 118 of file MacroscopicQuantities.h.

◆ getCompressibleVelocityX1()

constexpr real vf::lbm::getCompressibleVelocityX1 ( const real *const f27,
const real rho 
)
constexpr

Definition at line 87 of file MacroscopicQuantities.h.

◆ getCompressibleVelocityX2()

constexpr real vf::lbm::getCompressibleVelocityX2 ( const real *const f27,
const real rho 
)
constexpr

Definition at line 92 of file MacroscopicQuantities.h.

◆ getCompressibleVelocityX3()

constexpr real vf::lbm::getCompressibleVelocityX3 ( const real *const f27,
const real rho 
)
constexpr

Definition at line 97 of file MacroscopicQuantities.h.

◆ getDensity()

constexpr real vf::lbm::getDensity ( const real *const f)
constexpr

Definition at line 48 of file MacroscopicQuantities.h.

◆ getIncompressibleMacroscopicValues()

constexpr void vf::lbm::getIncompressibleMacroscopicValues ( const real *const f,
real rho,
real vx1,
real vx2,
real vx3 
)
constexpr

Definition at line 78 of file MacroscopicQuantities.h.

◆ getIncompressibleVelocityX1()

constexpr real vf::lbm::getIncompressibleVelocityX1 ( const real *const f)
constexpr

Definition at line 60 of file MacroscopicQuantities.h.

◆ getIncompressibleVelocityX2()

constexpr real vf::lbm::getIncompressibleVelocityX2 ( const real *const f)
constexpr

Definition at line 66 of file MacroscopicQuantities.h.

◆ getIncompressibleVelocityX3()

constexpr real vf::lbm::getIncompressibleVelocityX3 ( const real *const f)
constexpr

Definition at line 72 of file MacroscopicQuantities.h.

◆ getOneOverRho()

constexpr real vf::lbm::getOneOverRho ( real  rho)
constexpr

Definition at line 102 of file MacroscopicQuantities.h.

◆ getPressure()

constexpr real vf::lbm::getPressure ( const real *const f27,
const real rho,
const real vx,
const real vy,
const real vz 
)
constexpr

Definition at line 125 of file MacroscopicQuantities.h.

◆ interpolateCF()

constexpr void vf::lbm::interpolateCF ( real *const  f,
const real omegaF,
const real epsnew,
const InterpolationCoefficients coefficients,
const real x,
const real y,
const real z 
)
constexpr
  • Set all moments to zero
  • Define aliases to use the same variable for the distributions (f's):
  • Set macroscopic values on destination node (zeroth and first order moments)
  • Set moments (second to sixth order) on destination node

Definition at line 48 of file InterpolationCF.h.

◆ interpolateFC()

constexpr void vf::lbm::interpolateFC ( real *const  f,
const real  epsnew,
const real  omegaC,
const InterpolationCoefficients coefficients 
)
constexpr
  • Set all moments to zero
  • Define aliases to use the same variable for the distributions (f's):
  • Set macroscopic values on destination node (zeroth and first order moments)
  • Set moments (second to sixth order) on destination node

Definition at line 46 of file InterpolationFC.h.

◆ runK17CompressibleNavierStokes()

template<TurbulenceModel turbulenceModel>
constexpr void vf::lbm::runK17CompressibleNavierStokes ( CollisionParameter parameter,
MacroscopicValues macroscopicValues,
TurbulentViscosity turbulentViscosity 
)
constexpr

Kernel for CumulantK17 including different turbulence models and options for local body forces and writing macroscopic variables.

CumulantK17 kernel using chimera transformations and quartic limiters as present in Geier et al. (2017). Additional options are three different eddy-viscosity turbulence models (Smagorinsky, AMD, QR) that can be set via the template parameter turbulenceModel (with default TurbulenceModel::None). The kernel is executed separately for each subset of fluid node indices with a different tag CollisionTemplate. For each subset, only the locally required options are switched on (

Parameters
writeMacroscopicVariablesand/or
applyBodyForce)in order to minimize memory accesses. The default refers to the plain cumlant kernel (CollisionTemplate::Default). Nodes are added to subsets (taggedFluidNodes) in Simulation::init using a corresponding tag with different values of CollisionTemplate. These subsets are provided by the utilized PostCollisionInteractiors depending on they specific requirements (e.g. writeMacroscopicVariables for probes).

The CumulantK17 Kernel is based on [ M. Geier et al. (2017), DOI:10.1016/j.jcp.2017.05.040 ] and [ M. Geier et al. (2017), DOI:10.1016/j.jcp.2017.07.004 ]

  • Define aliases to use the same variable for the moments (m's):
  • Setting relaxation rates for non-hydrodynamic cumulants (default values). Variable names and equations according to [ M. Geier et al. (2017), DOI:10.1016/j.jcp.2017.05.040 ] => [NAME IN PAPER]=[NAME IN CODE]=[DEFAULT VALUE].
    • Trace of second order cumulants $ C{200}+C{020}+C{002} $ used to adjust bulk viscosity: $\omega2=OxxPyyPzz=1.0 $.
    • Third order cumulants $ C{120}+C{102}, C{210}+C{012}, C{201}+C{021} $: $ \omega3=OxyyPxzz
 $ set according to Eq. (111) with simplifications assuming $ \omega2=1.0$.
    • Third order cumulants $ C{120}-C{102}, C{210}-C{012}, C{201}-C{021} $: $ \omega4 = OxyyMxzz
 $ set according to Eq. (112) with simplifications assuming $ \omega2 = 1.0$.
    • Third order cumulants $ C{111} $: $ \omega5 = Oxyz $ set according to Eq. (113) with simplifications assuming $ \omega2 = 1.0$ (modify for different bulk viscosity).
    • Fourth order cumulants $ C{220}, C{202}, C{022}, C{211}, C{121}, C{112} $: for simplification all set to the same default value $ \omega6=\omega7=\omega8=O4=1.0 $.
    • Fifth order cumulants $ C{221}, C{212}, C{122}$: $\omega9=O5=1.0$.
    • Sixth order cumulant $ C{222}$: $\omega{10}=O6=1.0$.
  • Calculate modified omega with turbulent viscosity
  • Compute linear combinations of second and third order cumulants
  • Compute inverse linear combinations of second and third order cumulants

Definition at line 80 of file K17CompressibleNavierStokes.h.