OpenLB 1.7
Loading...
Searching...
No Matches
Classes | Public Types | Public Member Functions | Static Public Attributes | List of all members
olb::DensityOutletCoupling2D Struct Reference

#include <freeEnergyCoupling2D.h>

+ Collaboration diagram for olb::DensityOutletCoupling2D:

Classes

struct  RHO
 

Public Types

using parameters = meta::list<RHO>
 

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

Definition at line 364 of file freeEnergyCoupling2D.h.

Member Typedef Documentation

◆ parameters

Definition at line 370 of file freeEnergyCoupling2D.h.

Member Function Documentation

◆ apply()

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

Definition at line 373 of file freeEnergyCoupling2D.h.

373 {
374
375 using V = typename CELLS::template value_t<names::A>::value_t;
376
377 auto outletRho = parameters.template get<RHO>();
378
379 // Get the cell of the first lattice
380 auto& cellA = cells.template get<names::A>();
381
382 // Get the cell of the second lattice
383 auto& cellB = cells.template get<names::B>();
384
385 V rho0, phi;
386 rho0 = cellA.computeRho();
387 phi = cellB.computeRho();
388
389 cellA.defineRho(outletRho);
390
391 V temp = phi * outletRho / rho0;
392 cellB.defineRho(temp);
393
394
395 // Get the cell of the third lattice, in case it exists
396 if constexpr (CELLS::map_t::keys_t::template contains<names::C>()){
397 auto& cellC = cells.template get<names::C>();
398
399 V psi = cellC.computeRho();
400 temp = psi * outletRho / rho0;
401 cellC.defineRho(temp);
402 }
403
404 }

Member Data Documentation

◆ scope

constexpr OperatorScope olb::DensityOutletCoupling2D::scope = OperatorScope::PerCellWithParameters
staticconstexpr

Definition at line 366 of file freeEnergyCoupling2D.h.


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