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

#include <phaseFieldCoupling.h>

+ Collaboration diagram for olb::initialPsi:

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 41 of file phaseFieldCoupling.h.

Member Typedef Documentation

◆ parameters

Member Function Documentation

◆ apply()

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

Definition at line 50 of file phaseFieldCoupling.h.

51 {
52 using V = typename CELL::value_t;
53 auto w = parameters.template get<descriptors::INTERFACE_WIDTH>();
54 V phi = cell.template getFieldComponent<descriptors::STATISTIC>(0);
55 V psi = 0;
56 if (phi > (0.99)) {
57 psi += -4.595120;
58 }
59 else if (phi < (0.01)) {
60 psi += 4.595120;
61 }
62 else {
63 psi += util::log(1/phi-1);
64 }
65 psi *= -w/4.;
66 cell.template setField<descriptors::SCALAR>(psi/util::sqrt(psi*psi+1.));
67 cell.template setField<descriptors::PSI>(psi);
68 cell.template setField<descriptors::PSI0>(psi);
69 }
Expr sqrt(Expr x)
Definition expr.cpp:225
ADf< T, DIM > log(const ADf< T, DIM > &a)
Definition aDiff.h:475
meta::list< descriptors::INTERFACE_WIDTH > parameters

References olb::util::log(), and olb::util::sqrt().

+ Here is the call graph for this function:

◆ getPriority()

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

Definition at line 45 of file phaseFieldCoupling.h.

45 {
46 return 1;
47 }

Member Data Documentation

◆ scope

OperatorScope olb::initialPsi::scope = OperatorScope::PerCellWithParameters
staticconstexpr

Definition at line 42 of file phaseFieldCoupling.h.


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