OpenLB 1.8.1
Loading...
Searching...
No Matches
olb::IsoPhaseFieldCurvedWallProcessor2D< T, DESCRIPTOR, xNormal, yNormal > Struct Template Reference

#include <phaseFieldCoupling.h>

+ Collaboration diagram for olb::IsoPhaseFieldCurvedWallProcessor2D< T, DESCRIPTOR, xNormal, yNormal >:

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

template<typename T, typename DESCRIPTOR, int xNormal, int yNormal>
struct olb::IsoPhaseFieldCurvedWallProcessor2D< T, DESCRIPTOR, xNormal, yNormal >

Definition at line 816 of file phaseFieldCoupling.h.

Member Typedef Documentation

◆ parameters

template<typename T , typename DESCRIPTOR , int xNormal, int yNormal>
using olb::IsoPhaseFieldCurvedWallProcessor2D< T, DESCRIPTOR, xNormal, yNormal >::parameters = meta::list<descriptors::INTERFACE_WIDTH>

Definition at line 818 of file phaseFieldCoupling.h.

Member Function Documentation

◆ apply()

template<typename T , typename DESCRIPTOR , int xNormal, int yNormal>
template<typename CELL , typename PARAMETERS >
void olb::IsoPhaseFieldCurvedWallProcessor2D< T, DESCRIPTOR, xNormal, yNormal >::apply ( CELL & cell,
PARAMETERS & parameters )
inline

Definition at line 825 of file phaseFieldCoupling.h.

826 {
827 auto phi_s = cell.template getField<descriptors::STATISTIC>();
828 auto phi_b = cell.neighbor({-xNormal,-yNormal}).template getFieldComponent<descriptors::STATISTIC>(0);
829 if (phi_b >= 0.995) {
830 phi_s[0] = 1.;
831 }
832 else if (phi_b <= 0.005) {
833 phi_s[0] = 0.;
834 }
835 else {
836 auto theta = cell.template getField<descriptors::THETA>();
837 auto w = parameters.template get<descriptors::INTERFACE_WIDTH>();
838 T z_z0 = w/2.*util::atanh(2.*phi_b-1.);
839 T cx = util::cos(-theta)*xNormal-util::sin(-theta)*yNormal;
840 T cy = util::sin(-theta)*xNormal+util::cos(-theta)*yNormal;
841 Vector<T,DESCRIPTOR::d> c{cx,cy};
842 Vector<T,DESCRIPTOR::d> n{T(xNormal),T(yNormal)};
843 c = util::normalize(c);
844 T d = c[0]*n[0]+c[1]*n[1];
845 phi_s[0] = 0.5*(1+util::tanh(2.*(z_z0+d)/w));
846 }
847 cell.template setField<descriptors::STATISTIC>(phi_s);
848 }
platform_constant int c[Q][D]
Definition functions.h:57
constexpr int d() any_platform
Definition functions.h:127
ADf< T, DIM > sin(const ADf< T, DIM > &a)
Definition aDiff.h:569
Vector< T, D > normalize(const Vector< T, D > &a)
ADf< T, DIM > tanh(const ADf< T, DIM > &a)
Definition aDiff.h:663
ADf< T, DIM > atanh(const ADf< T, DIM > &a)
Definition aDiff.h:689
ADf< T, DIM > cos(const ADf< T, DIM > &a)
Definition aDiff.h:578
meta::list< descriptors::INTERFACE_WIDTH > parameters

References olb::util::atanh(), olb::util::cos(), olb::util::normalize(), olb::util::sin(), and olb::util::tanh().

+ Here is the call graph for this function:

◆ getPriority()

template<typename T , typename DESCRIPTOR , int xNormal, int yNormal>
int olb::IsoPhaseFieldCurvedWallProcessor2D< T, DESCRIPTOR, xNormal, yNormal >::getPriority ( ) const
inline

Definition at line 820 of file phaseFieldCoupling.h.

820 {
821 return 1;
822 }

Member Data Documentation

◆ scope

template<typename T , typename DESCRIPTOR , int xNormal, int yNormal>
OperatorScope olb::IsoPhaseFieldCurvedWallProcessor2D< T, DESCRIPTOR, xNormal, yNormal >::scope = OperatorScope::PerCellWithParameters
staticconstexpr

Definition at line 817 of file phaseFieldCoupling.h.


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