OpenLB 1.7
Loading...
Searching...
No Matches
Public Types | Public Member Functions | List of all members
olb::forcing::LinearVelocity::combined_collision< DESCRIPTOR, MOMENTA, EQUILIBRIUM, COLLISION > Struct Template Reference

#include <forcing.h>

+ Collaboration diagram for olb::forcing::LinearVelocity::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::LinearVelocity::combined_collision< DESCRIPTOR, MOMENTA, EQUILIBRIUM, COLLISION >

Definition at line 264 of file forcing.h.

Member Typedef Documentation

◆ CollisionO

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

Definition at line 266 of file forcing.h.

◆ MomentaF

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

Definition at line 265 of file forcing.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::LinearVelocity::combined_collision< DESCRIPTOR, MOMENTA, EQUILIBRIUM, COLLISION >::apply ( CELL & cell,
PARAMETERS & parameters )
inline

Definition at line 269 of file forcing.h.

269 {
270 V rho, u[DESCRIPTOR::d], pi[util::TensorVal<DESCRIPTOR >::n];
271 MomentaF().computeAllMomenta(cell, rho, u, pi);
272 auto force = cell.template getFieldPointer<descriptors::FORCE>();
273 int nDim = DESCRIPTOR::d;
274 V forceSave[nDim];
275 // adds a+Bu to force, where
276 // d=2: a1=v[0], a2=v[1], B11=v[2], B12=v[3], B21=v[4], B22=v[5]
277 // d=2: a1=v[0], a2=v[1], a3=v[2], B11=v[3], B12=v[4], B13=v[5], B21=v[6], B22=v[7], B23=v[8], B31=v[9], B32=v[10], B33=v[11]
278 auto v = cell.template getFieldPointer<descriptors::V12>();
279 for (int iDim=0; iDim<nDim; ++iDim) {
280 forceSave[iDim] = force[iDim];
281 force[iDim] += v[iDim];
282 for (int jDim=0; jDim<nDim; ++jDim) {
283 force[iDim] += v[jDim + iDim*nDim + nDim]*u[jDim];
284 }
285 }
286 for (int iVel=0; iVel<nDim; ++iVel) {
287 u[iVel] += force[iVel] / V{2.};
288 }
289
290 auto statistics = CollisionO().apply(cell, parameters);
291 V newOmega = parameters.template get<descriptors::OMEGA>();
292 lbm<DESCRIPTOR>::addExternalForce(cell, rho, u, newOmega, force);
293 // Writing back to froce fector
294 for (int iVel=0; iVel<nDim; ++iVel) {
295 force[iVel] = forceSave[iVel];
296 }
297 return statistics;
298 };
typename COLLISION::template type< DESCRIPTOR, MOMENTA, EQUILIBRIUM > CollisionO
Definition forcing.h:266
typename MOMENTA::template type< DESCRIPTOR > MomentaF
Definition forcing.h:265
static void addExternalForce(CELL &cell, const RHO &rho, const U &u, const OMEGA &omega, const FORCE &force) any_platform
Add a force term after BGK collision.
Definition lbm.h:463
static constexpr int n
result stored in n
Definition util.h:211

References olb::lbm< DESCRIPTOR >::addExternalForce().

+ Here is the call graph for this function:

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