OpenLB 1.7
Loading...
Searching...
No Matches
Classes | Public Types | Public Member Functions | Static Public Attributes | List of all members
olb::GranularCoupling< T > Struct Template Reference

granular flow More...

#include <navierStokesAdvectionDiffusionCoupling.h>

+ Collaboration diagram for olb::GranularCoupling< T >:

Classes

struct  FORCE_PREFACTOR
 
struct  FRICTION_ANGLE
 
struct  RHO0
 

Public Types

using parameters = meta::list<FRICTION_ANGLE,RHO0,FORCE_PREFACTOR>
 

Public Member Functions

template<typename CELLS , typename PARAMETERS >
void apply (CELLS &cells, PARAMETERS &parameters) any_platform
 

Static Public Attributes

static constexpr OperatorScope scope = OperatorScope::PerCellWithParameters
 

Detailed Description

template<typename T>
struct olb::GranularCoupling< T >

granular flow

Definition at line 465 of file navierStokesAdvectionDiffusionCoupling.h.

Member Typedef Documentation

◆ parameters

template<typename T >
using olb::GranularCoupling< T >::parameters = meta::list<FRICTION_ANGLE,RHO0,FORCE_PREFACTOR>

Definition at line 472 of file navierStokesAdvectionDiffusionCoupling.h.

Member Function Documentation

◆ apply()

template<typename T >
template<typename CELLS , typename PARAMETERS >
void olb::GranularCoupling< T >::apply ( CELLS & cells,
PARAMETERS & parameters )
inline

Definition at line 475 of file navierStokesAdvectionDiffusionCoupling.h.

476 {
477 using DESCRIPTOR = typename CELLS::template value_t<names::NavierStokes>::descriptor_t;
478 T rho, u[DESCRIPTOR::d], pi[util::TensorVal<DESCRIPTOR>::n] { };
479 cells.template get<names::NavierStokes>().computeAllMomenta(rho, u, pi);
480 // Stress tensor
481 T PiNeqNormSqr = pi[0]*pi[0] + 2.0*pi[1]*pi[1] + pi[2]*pi[2];
482 if constexpr (util::TensorVal<DESCRIPTOR>::n == 6) {
483 PiNeqNormSqr += pi[2]*pi[2] + pi[3]*pi[3] + 2*pi[4]*pi[4] +pi[5]*pi[5];
484 }
485 T PiNeqNorm = util::sqrt(PiNeqNormSqr);
486
487 if(PiNeqNorm != T{0.}){
488 auto omega = cells.template get<names::NavierStokes>().template getFieldPointer<descriptors::OMEGA>();
489 PiNeqNorm /= (-rho/omega[0]/descriptors::invCs2<T,DESCRIPTOR>());
490 T angle = parameters.template get<FRICTION_ANGLE>();
491 T ps = ( T{0.5}*omega[0] - T{1} ) * T{1./3.} * ( pi[0] + pi[3] + pi[5] );
492 T granularTau = ps/rho * util::sin(T{3.14}*angle/T{180}) / PiNeqNorm * descriptors::invCs2<T,DESCRIPTOR>() + T{0.5};
493 omega[0] = T{1} / granularTau;
494 }
495
496 // computation of the bousinessq force
497 auto force = cells.template get<names::NavierStokes>().template getFieldPointer<descriptors::FORCE>();
498 auto forcePrefactor = parameters.template get<FORCE_PREFACTOR>();
499 T densityDifference = (rho - parameters.template get<RHO0>()) / rho;
500 for (unsigned iD = 0; iD < DESCRIPTOR::d; ++iD) {
501 force[iD] = forcePrefactor[iD] * densityDifference;
502 }
503 }
cpu::simd::Pack< T > sqrt(cpu::simd::Pack< T > value)
Definition pack.h:100
ADf< T, DIM > sin(const ADf< T, DIM > &a)
Definition aDiff.h:569
meta::list< FRICTION_ANGLE, RHO0, FORCE_PREFACTOR > parameters
static constexpr int n
result stored in n
Definition util.h:211

References olb::util::sin(), and olb::util::sqrt().

+ Here is the call graph for this function:

Member Data Documentation

◆ scope

template<typename T >
constexpr OperatorScope olb::GranularCoupling< T >::scope = OperatorScope::PerCellWithParameters
staticconstexpr

Definition at line 466 of file navierStokesAdvectionDiffusionCoupling.h.


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