OpenLB 1.8.1
Loading...
Searching...
No Matches
olb::LiangSinglePostProcessor Struct Reference

#include <phaseFieldCoupling.h>

+ Collaboration diagram for olb::LiangSinglePostProcessor:

Public Types

using parameters = meta::list<descriptors::INTERFACE_WIDTH>
 

Public Member Functions

int getPriority () const
 
template<typename CELL , typename PARAMETERS >
void apply (CELL &cell, PARAMETERS &parameters) any_platform
 

Static Public Attributes

static constexpr OperatorScope scope = OperatorScope::PerCellWithParameters
 

Detailed Description

Definition at line 451 of file phaseFieldCoupling.h.

Member Typedef Documentation

◆ parameters

Member Function Documentation

◆ apply()

template<typename CELL , typename PARAMETERS >
void olb::LiangSinglePostProcessor::apply ( CELL & cell,
PARAMETERS & parameters )
inline

Definition at line 460 of file phaseFieldCoupling.h.

461 {
462 using V = typename CELL::value_t;
463 using DESCRIPTOR = typename CELL::descriptor_t;
464
465 V phi = cell.template getFieldComponent<descriptors::STATISTIC>(0);
466 Vector<V,DESCRIPTOR::d> gradPhi{};
467 V laplacePhi = 0;
468
469 for (int iPop=0; iPop < DESCRIPTOR::q; ++iPop) {
470 const V phi_i = cell.neighbor(descriptors::c<DESCRIPTOR>(iPop)).template getFieldComponent<descriptors::STATISTIC>(0);
472 laplacePhi += 2*(phi_i - phi) * descriptors::t<V,DESCRIPTOR>(iPop) * descriptors::invCs2<V,DESCRIPTOR>();
473 }
474 auto w = parameters.template get<descriptors::INTERFACE_WIDTH>();
475
476 // Computation and storage of forces
477 Vector<V,DESCRIPTOR::d> forceAC{};
478 Vector<V,DESCRIPTOR::d> old_phiU{};
481 V u[DESCRIPTOR::d] {};
482 cell.computeU(u);
483 V gradPhiSqr = 0;
484 for (int iD=0; iD < DESCRIPTOR::d; ++iD) {
485 gradPhiSqr += gradPhi[iD]*gradPhi[iD];
486 phiU[iD] = phi*u[iD];
487 }
488 if (gradPhiSqr >= 1e-28) {
489 n += gradPhi/util::sqrt(gradPhiSqr);
490 }
491
492 old_phiU = cell.template getField<descriptors::OLD_PHIU>();
493 cell.template setField<descriptors::OLD_PHIU>(phiU);
494 V lambda = 4*phi*(1.-phi)/w;
495 forceAC += (phiU - old_phiU) + lambda*n/descriptors::invCs2<V,DESCRIPTOR>();
496 cell.template setField<descriptors::FORCE>(forceAC);
497 }
constexpr T invCs2() any_platform
Definition functions.h:107
constexpr T t(unsigned iPop, tag::CUM) any_platform
Definition cum.h:108
constexpr int c(unsigned iPop, unsigned iDim) any_platform
Definition functions.h:83
Expr sqrt(Expr x)
Definition expr.cpp:225
Vector(T &&t, Ts &&... ts) -> Vector< std::remove_cvref_t< T >, 1+sizeof...(Ts)>
meta::list< descriptors::INTERFACE_WIDTH > parameters

References olb::descriptors::c(), olb::descriptors::invCs2(), olb::util::sqrt(), and olb::descriptors::t().

+ Here is the call graph for this function:

◆ getPriority()

int olb::LiangSinglePostProcessor::getPriority ( ) const
inline

Definition at line 455 of file phaseFieldCoupling.h.

455 {
456 return 0;
457 }

Member Data Documentation

◆ scope

OperatorScope olb::LiangSinglePostProcessor::scope = OperatorScope::PerCellWithParameters
staticconstexpr

Definition at line 452 of file phaseFieldCoupling.h.


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