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

#include <phaseFieldCoupling.h>

+ Collaboration diagram for olb::ChemPotentialPhaseFieldProcessor:

Public Types

using parameters = meta::list<descriptors::SCALAR,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 666 of file phaseFieldCoupling.h.

Member Typedef Documentation

◆ parameters

Member Function Documentation

◆ apply()

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

Definition at line 675 of file phaseFieldCoupling.h.

676 {
677 using V = typename CELL::value_t;
678 using DESCRIPTOR = typename CELL::descriptor_t;
679
680 V phi = cell.template getFieldComponent<descriptors::STATISTIC>(0);
681 V laplacePhi = 0;
682 //TODO: use lattice gradient schemes here from Cahn-Hilliard implementation
683 for (int iPop=0; iPop < DESCRIPTOR::q; ++iPop) {
684 const V phi_i = cell.neighbor(descriptors::c<DESCRIPTOR>(iPop)).template getField<descriptors::PHIWETTING>();
685 laplacePhi += 2*(phi_i - phi) * descriptors::t<V,DESCRIPTOR>(iPop) * descriptors::invCs2<V,DESCRIPTOR>();
686 }
687
688 auto sigma = parameters.template get<descriptors::SCALAR>();
689 auto w = parameters.template get<descriptors::INTERFACE_WIDTH>();
690
691 // Computation and storage of chemical potential
692 V k = 1.5*sigma*w;
693 V beta = 12*sigma/w;
694 V mu = 4*beta*phi*(phi-1.)*(phi-0.5)+0.25*(phi<0)*phi-k*laplacePhi;
695 cell.template setField<descriptors::CHEM_POTENTIAL>(mu);
696 }
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
meta::list< descriptors::SCALAR, descriptors::INTERFACE_WIDTH > parameters

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

+ Here is the call graph for this function:

◆ getPriority()

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

Definition at line 670 of file phaseFieldCoupling.h.

670 {
671 return 0;
672 }

Member Data Documentation

◆ scope

OperatorScope olb::ChemPotentialPhaseFieldProcessor::scope = OperatorScope::PerCellWithParameters
staticconstexpr

Definition at line 667 of file phaseFieldCoupling.h.


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