OpenLB 1.8.1
Loading...
Searching...
No Matches
olb::forcing::FreeSurfaceLaddVerberg::combined_collision< DESCRIPTOR, MOMENTA, EQUILIBRIUM, COLLISION > Struct Template Reference

#include <freeSurfaceHelpers.h>

+ Collaboration diagram for olb::forcing::FreeSurfaceLaddVerberg::combined_collision< DESCRIPTOR, MOMENTA, EQUILIBRIUM, COLLISION >:

Public Types

using MomentaF = typename MOMENTA::template type<DESCRIPTOR>
 
using CollisionO = typename COLLISION::template type<DESCRIPTOR,MOMENTA,EQUILIBRIUM>
 

Public Member Functions

template<typename CELL , typename PARAMETERS , typename V = typename CELL::value_t>
CellStatistic< V > apply (CELL &cell, PARAMETERS &parameters)
 

Detailed Description

template<typename DESCRIPTOR, typename MOMENTA, typename EQUILIBRIUM, typename COLLISION>
struct olb::forcing::FreeSurfaceLaddVerberg::combined_collision< DESCRIPTOR, MOMENTA, EQUILIBRIUM, COLLISION >

Definition at line 241 of file freeSurfaceHelpers.h.

Member Typedef Documentation

◆ CollisionO

template<typename DESCRIPTOR , typename MOMENTA , typename EQUILIBRIUM , typename COLLISION >
using olb::forcing::FreeSurfaceLaddVerberg::combined_collision< DESCRIPTOR, MOMENTA, EQUILIBRIUM, COLLISION >::CollisionO = typename COLLISION::template type<DESCRIPTOR,MOMENTA,EQUILIBRIUM>

Definition at line 243 of file freeSurfaceHelpers.h.

◆ MomentaF

template<typename DESCRIPTOR , typename MOMENTA , typename EQUILIBRIUM , typename COLLISION >
using olb::forcing::FreeSurfaceLaddVerberg::combined_collision< DESCRIPTOR, MOMENTA, EQUILIBRIUM, COLLISION >::MomentaF = typename MOMENTA::template type<DESCRIPTOR>

Definition at line 242 of file freeSurfaceHelpers.h.

Member Function Documentation

◆ apply()

template<typename DESCRIPTOR , typename MOMENTA , typename EQUILIBRIUM , typename COLLISION >
template<typename CELL , typename PARAMETERS , typename V = typename CELL::value_t>
CellStatistic< V > olb::forcing::FreeSurfaceLaddVerberg::combined_collision< DESCRIPTOR, MOMENTA, EQUILIBRIUM, COLLISION >::apply ( CELL & cell,
PARAMETERS & parameters )
inline

Definition at line 246 of file freeSurfaceHelpers.h.

246 {
247 V rho, u[DESCRIPTOR::d];
248 MomentaF().computeRhoU(cell, rho, u);
249 const auto statistic = CollisionO().apply(cell, parameters);
250 const V omega = parameters.template get<descriptors::OMEGA>();
251 // While this duplication can be resolved using CSE it should be extracted into a helper
252 V rt[DESCRIPTOR::q] { }; // relaxation times vector.
253 for (int iPop=0; iPop < DESCRIPTOR::q; ++iPop) {
254 rt[iPop] = descriptors::s<V,DESCRIPTOR>(iPop);
255 }
256 for (int iPop=0; iPop < descriptors::shearIndexes<DESCRIPTOR>(); ++iPop) {
258 }
259 V invM_S[DESCRIPTOR::q][DESCRIPTOR::q]; // relaxation times matrix
260 for (int iPop = 0; iPop < DESCRIPTOR::q; ++iPop) {
261 for (int jPop = 0; jPop < DESCRIPTOR::q; ++jPop) {
262 invM_S[iPop][jPop] = V{};
263 for (int kPop = 0; kPop < DESCRIPTOR::q; ++kPop) {
264 if (kPop == jPop) {
265 invM_S[iPop][jPop] += descriptors::invM<V,DESCRIPTOR>(iPop,kPop) * rt[kPop];
266 }
267 }
268 }
269 }
270 const V epsilon = FreeSurface::getClampedEpsilon(cell);
271 const auto force = epsilon * cell.template getField<descriptors::FORCE>();
272 mrt<DESCRIPTOR>::addExternalForce(cell, rho, u, invM_S, force);
273 return statistic;
274 };
constexpr T s(unsigned iPop, tag::MRT)
Definition mrt.h:410
constexpr int shearViscIndexes(unsigned iPop, tag::MRT)
Definition mrt.h:446
constexpr T invM(unsigned iPop, unsigned jPop, tag::MRT)
Definition mrt.h:398
typename COLLISION::template type< DESCRIPTOR, MOMENTA, EQUILIBRIUM > CollisionO
typename MOMENTA::template type< DESCRIPTOR > MomentaF
static void addExternalForce(CELL &cell, const RHO &rho, const U &u, const INVM_S &invM_S, const FORCE &force)
Ladd-Verberg-I body force model for MRT A.Ladd, R.
Definition mrt.h:138

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