flow
Kokkos cut-cell IBM incompressible Navier-Stokes solver + pnm pore extraction
Loading...
Searching...
No Matches
peclet::flow::Solver< Grid > Class Template Reference

#include <flow_ibm.hpp>

Public Types

using FV = Kokkos::View< float *, CCMem >
 

Public Member Functions

 Solver (int nx, int ny, int nz)
 
void allocateBlock (int nx, int ny, int nz)
 
void setRho (double r)
 
void setMu (double m)
 
void setDt (double d)
 
void setBodyForce (double fx, double fy, double fz)
 
void setVelocityIterations (int it)
 
void setPressureIterations (int it)
 
void setAdvection (bool on)
 
void setAdvectionScheme (int s)
 
void setImplicitAdvection (bool on)
 
void setOuterIterations (int iters)
 
void setOuterTolerance (double tol)
 
long lastOuterIterations () const
 
void setVelocityMultigrid (bool on, int levels, int vcycles)
 
void setPressureGraphAmg (bool on)
 
void setPressureLevels (int levels)
 
void setBackflowStab (double beta)
 
void setDeferredCorrection (bool on)
 
void setPressureChebyshev (bool on, int maxit, double rtol)
 
void setPressurePcg (bool, int maxit, double rtol)
 
void setIncrementalPressure (bool on)
 
void setPressureWarmstart (bool on)
 
void setFaceInterp (int mode)
 
void setFvRelax (double w)
 
void setVelocityStreams (bool)
 
void uploadVelocity (const std::vector< double > &uu, const std::vector< double > &vv, const std::vector< double > &ww)
 
void setDomainBc (int face, int type, double vx, double vy, double vz)
 
void setDomainBcProfile (int face, const std::vector< double > &prof, int nb, int nc)
 
void setPressureGeometry (const std::vector< double > &sdfInner)
 
void setSolid (const std::vector< double > &sdfInner, bool cutcellPressure)
 
void step ()
 
std::vector< double > getVelocity (int c)
 
std::vector< double > getFaceVelocity (int c)
 
std::vector< double > getOpenness (int c)
 
std::vector< double > getPressure ()
 
double maxOpenDivergence ()
 
double maxPorousResidual ()
 
long lastPressureIterations () const
 
int nx () const
 
int ny () const
 
int nz () const
 
bool implicitAdv () const
 
bool bcStencilPath () const
 
void fillPropGhosts (CCField f)
 
void fillMuGhosts ()
 
long strideOf (int c) const
 
VarFaceProps makeFaceProps (int c)
 
void rebuildStencils ()
 
void copyInner (CCField dst, C3 de, int dg, CCConst src, C3 se, int sg)
 
void copyBlockShifted (CCField dst, C3 de, CCConst src, C3 se, int off)
 
void fillGhosts (CCField f)
 
void fillGhostsFaces (CCField f)
 
void fillAxis (CCField f, int axis)
 
void buildRhs (int c)
 
void buildRhsForced (int c)
 
void buildRhsVar (int c)
 
void buildAdvStencil (int c)
 
void buildAdvStencilVar (int c)
 
void applyBackflowStab (int c)
 
double maxAbsDiffInner (CCConst a, CCConst b)
 
void smoothComp (int c)
 
void pressureBcGhost ()
 
void fillVelGhosts (int comp, int fold)
 
void applyVelocityBcComp (int comp, int fold, bool doOutflow)
 
void fillVelGhostsTo (CCField f, int comp, int fold)
 
void applyVelocityBcCompTo (CCField f, int comp, int fold, bool doOutflow)
 
void setupBcDiffusion ()
 
void project ()
 
void maskVelocity (int c)
 
double minMuInner ()
 
double reduceMaxAbsInner (CCConst f)
 
std::vector< double > gatherInner (CCField fld)
 
void scatterInner (CCField fld, const std::vector< double > &in)
 
CCField addField (const std::string &name)
 
bool hasField (const std::string &name) const
 
CCField fieldView (const std::string &name)
 
std::vector< std::string > fieldNames () const
 
void exchangeField (const std::string &name)
 
void exchangeFieldAdd (const std::string &name)
 
std::vector< double > getField (const std::string &name)
 
void setField (const std::string &name, const std::vector< double > &v)
 
std::array< int, 3 > blockShape () const
 
int ghostWidth () const
 
std::array< int, 3 > globalResolution () const
 
std::array< int, 3 > blockOrigin () const
 
void addScalar (const std::string &name, double D, int scheme, int iters)
 
bool hasScalar (const std::string &name) const
 
void setScalarBc (const std::string &name, int face, int type, double value)
 
void advanceScalars ()
 
void setPropertyModel (const std::string &target, ClosureKind kind, const std::string &in0, const std::string &in1, const std::vector< double > &params)
 
void setDensityMode (bool variable)
 
void setPorousContinuity (bool on)
 
void syncPorousPrev ()
 
void setPorousDepsDt (bool on)
 
void setPressureUnderRelax (double w)
 
void setPropertyMode (bool variable, bool harmonic)
 
void setVariableRotational (int mode, double chi)
 
void setPropertyTable (const std::string &target, const std::string &in0, const std::vector< double > &xs, const std::vector< double > &ys)
 
void updateProperties ()
 
void enableCellForce ()
 
void enableDrag ()
 
void configurePorousDragSolver ()
 
void addDragDiagonal (int c)
 
void patchScalarDirichletFace (CCField AC, CCField band, double D, int a, int side)
 
void applyScalarBcFace (CCField c, int a, int side, int type, double val)
 

Static Public Attributes

static constexpr int G = 2
 

Detailed Description

template<class Grid>
class peclet::flow::Solver< Grid >

Definition at line 48 of file flow_ibm.hpp.

Member Typedef Documentation

◆ FV

template<class Grid >
using peclet::flow::Solver< Grid >::FV = Kokkos::View<float*, CCMem>

Definition at line 50 of file flow_ibm.hpp.

Constructor & Destructor Documentation

◆ Solver()

template<class Grid >
peclet::flow::Solver< Grid >::Solver ( int  nx,
int  ny,
int  nz 
)
inline

Member Function Documentation

◆ allocateBlock()

◆ setRho()

template<class Grid >
void peclet::flow::Solver< Grid >::setRho ( double  r)
inline

Definition at line 136 of file flow_ibm.hpp.

Referenced by configure().

◆ setMu()

template<class Grid >
void peclet::flow::Solver< Grid >::setMu ( double  m)
inline

Definition at line 137 of file flow_ibm.hpp.

Referenced by configure().

◆ setDt()

template<class Grid >
void peclet::flow::Solver< Grid >::setDt ( double  d)
inline

Definition at line 138 of file flow_ibm.hpp.

Referenced by configure().

◆ setBodyForce()

template<class Grid >
void peclet::flow::Solver< Grid >::setBodyForce ( double  fx,
double  fy,
double  fz 
)
inline

Definition at line 139 of file flow_ibm.hpp.

Referenced by configure().

◆ setVelocityIterations()

template<class Grid >
void peclet::flow::Solver< Grid >::setVelocityIterations ( int  it)
inline

Definition at line 140 of file flow_ibm.hpp.

Referenced by configure().

◆ setPressureIterations()

template<class Grid >
void peclet::flow::Solver< Grid >::setPressureIterations ( int  it)
inline

Definition at line 141 of file flow_ibm.hpp.

◆ setAdvection()

template<class Grid >
void peclet::flow::Solver< Grid >::setAdvection ( bool  on)
inline

Definition at line 142 of file flow_ibm.hpp.

Referenced by configure().

◆ setAdvectionScheme()

template<class Grid >
void peclet::flow::Solver< Grid >::setAdvectionScheme ( int  s)
inline

Definition at line 147 of file flow_ibm.hpp.

◆ setImplicitAdvection()

template<class Grid >
void peclet::flow::Solver< Grid >::setImplicitAdvection ( bool  on)
inline

Definition at line 153 of file flow_ibm.hpp.

◆ setOuterIterations()

template<class Grid >
void peclet::flow::Solver< Grid >::setOuterIterations ( int  iters)
inline

Definition at line 157 of file flow_ibm.hpp.

◆ setOuterTolerance()

template<class Grid >
void peclet::flow::Solver< Grid >::setOuterTolerance ( double  tol)
inline

Definition at line 158 of file flow_ibm.hpp.

◆ lastOuterIterations()

template<class Grid >
long peclet::flow::Solver< Grid >::lastOuterIterations ( ) const
inline

Definition at line 159 of file flow_ibm.hpp.

◆ setVelocityMultigrid()

template<class Grid >
void peclet::flow::Solver< Grid >::setVelocityMultigrid ( bool  on,
int  levels,
int  vcycles 
)
inline

Definition at line 163 of file flow_ibm.hpp.

◆ setPressureGraphAmg()

template<class Grid >
void peclet::flow::Solver< Grid >::setPressureGraphAmg ( bool  on)
inline

Definition at line 173 of file flow_ibm.hpp.

References peclet::flow::CutcellMG::setGraphAmgBottom().

◆ setPressureLevels()

template<class Grid >
void peclet::flow::Solver< Grid >::setPressureLevels ( int  levels)
inline

Definition at line 179 of file flow_ibm.hpp.

Referenced by configure().

◆ setBackflowStab()

template<class Grid >
void peclet::flow::Solver< Grid >::setBackflowStab ( double  beta)
inline

Definition at line 184 of file flow_ibm.hpp.

◆ setDeferredCorrection()

template<class Grid >
void peclet::flow::Solver< Grid >::setDeferredCorrection ( bool  on)
inline

Definition at line 190 of file flow_ibm.hpp.

◆ setPressureChebyshev()

template<class Grid >
void peclet::flow::Solver< Grid >::setPressureChebyshev ( bool  on,
int  maxit,
double  rtol 
)
inline

Definition at line 195 of file flow_ibm.hpp.

◆ setPressurePcg()

template<class Grid >
void peclet::flow::Solver< Grid >::setPressurePcg ( bool  ,
int  maxit,
double  rtol 
)
inline

Definition at line 204 of file flow_ibm.hpp.

Referenced by configure().

◆ setIncrementalPressure()

template<class Grid >
void peclet::flow::Solver< Grid >::setIncrementalPressure ( bool  on)
inline

Definition at line 212 of file flow_ibm.hpp.

◆ setPressureWarmstart()

template<class Grid >
void peclet::flow::Solver< Grid >::setPressureWarmstart ( bool  on)
inline

Definition at line 217 of file flow_ibm.hpp.

◆ setFaceInterp()

template<class Grid >
void peclet::flow::Solver< Grid >::setFaceInterp ( int  mode)
inline

Definition at line 244 of file flow_ibm.hpp.

◆ setFvRelax()

template<class Grid >
void peclet::flow::Solver< Grid >::setFvRelax ( double  w)
inline

Definition at line 247 of file flow_ibm.hpp.

◆ setVelocityStreams()

template<class Grid >
void peclet::flow::Solver< Grid >::setVelocityStreams ( bool  )
inline

Definition at line 251 of file flow_ibm.hpp.

◆ uploadVelocity()

template<class Grid >
void peclet::flow::Solver< Grid >::uploadVelocity ( const std::vector< double > &  uu,
const std::vector< double > &  vv,
const std::vector< double > &  ww 
)
inline

◆ setDomainBc()

template<class Grid >
void peclet::flow::Solver< Grid >::setDomainBc ( int  face,
int  type,
double  vx,
double  vy,
double  vz 
)
inline

Definition at line 390 of file flow_ibm.hpp.

◆ setDomainBcProfile()

template<class Grid >
void peclet::flow::Solver< Grid >::setDomainBcProfile ( int  face,
const std::vector< double > &  prof,
int  nb,
int  nc 
)
inline

◆ setPressureGeometry()

template<class Grid >
void peclet::flow::Solver< Grid >::setPressureGeometry ( const std::vector< double > &  sdfInner)
inline

Definition at line 430 of file flow_ibm.hpp.

References peclet::flow::Solver< Grid >::setSolid().

◆ setSolid()

◆ step()

◆ getVelocity()

template<class Grid >
std::vector< double > peclet::flow::Solver< Grid >::getVelocity ( int  c)
inline

Definition at line 652 of file flow_ibm.hpp.

References peclet::flow::Solver< Grid >::gatherInner().

Referenced by localUSum().

◆ getFaceVelocity()

template<class Grid >
std::vector< double > peclet::flow::Solver< Grid >::getFaceVelocity ( int  c)
inline

Definition at line 657 of file flow_ibm.hpp.

References peclet::flow::Solver< Grid >::gatherInner().

◆ getOpenness()

template<class Grid >
std::vector< double > peclet::flow::Solver< Grid >::getOpenness ( int  c)
inline

Definition at line 669 of file flow_ibm.hpp.

References peclet::flow::Solver< Grid >::gatherInner().

◆ getPressure()

template<class Grid >
std::vector< double > peclet::flow::Solver< Grid >::getPressure ( )
inline

Definition at line 673 of file flow_ibm.hpp.

References peclet::flow::Solver< Grid >::gatherInner().

◆ maxOpenDivergence()

◆ maxPorousResidual()

◆ lastPressureIterations()

template<class Grid >
long peclet::flow::Solver< Grid >::lastPressureIterations ( ) const
inline

Definition at line 755 of file flow_ibm.hpp.

◆ nx()

◆ ny()

◆ nz()

◆ implicitAdv()

◆ bcStencilPath()

◆ fillPropGhosts()

◆ fillMuGhosts()

template<class Grid >
void peclet::flow::Solver< Grid >::fillMuGhosts ( )
inline

◆ strideOf()

◆ makeFaceProps()

◆ rebuildStencils()

◆ copyInner()

template<class Grid >
void peclet::flow::Solver< Grid >::copyInner ( CCField  dst,
C3  de,
int  dg,
CCConst  src,
C3  se,
int  sg 
)
inline

◆ copyBlockShifted()

template<class Grid >
void peclet::flow::Solver< Grid >::copyBlockShifted ( CCField  dst,
C3  de,
CCConst  src,
C3  se,
int  off 
)
inline

◆ fillGhosts()

◆ fillGhostsFaces()

template<class Grid >
void peclet::flow::Solver< Grid >::fillGhostsFaces ( CCField  f)
inline

Definition at line 899 of file flow_ibm.hpp.

References peclet::flow::Solver< Grid >::G.

Referenced by peclet::flow::Solver< Grid >::smoothComp().

◆ fillAxis()

template<class Grid >
void peclet::flow::Solver< Grid >::fillAxis ( CCField  f,
int  axis 
)
inline

◆ buildRhs()

◆ buildRhsForced()

◆ buildRhsVar()

◆ buildAdvStencil()

◆ buildAdvStencilVar()

◆ applyBackflowStab()

template<class Grid >
void peclet::flow::Solver< Grid >::applyBackflowStab ( int  c)
inline

Definition at line 1234 of file flow_ibm.hpp.

References AC, and peclet::flow::Solver< Grid >::G.

Referenced by peclet::flow::Solver< Grid >::step().

◆ maxAbsDiffInner()

template<class Grid >
double peclet::flow::Solver< Grid >::maxAbsDiffInner ( CCConst  a,
CCConst  b 
)
inline

Definition at line 1267 of file flow_ibm.hpp.

References peclet::flow::Solver< Grid >::G.

Referenced by peclet::flow::Solver< Grid >::step().

◆ smoothComp()

◆ pressureBcGhost()

template<class Grid >
void peclet::flow::Solver< Grid >::pressureBcGhost ( )
inline

Definition at line 1388 of file flow_ibm.hpp.

References peclet::flow::Solver< Grid >::G.

Referenced by peclet::flow::Solver< Grid >::step().

◆ fillVelGhosts()

◆ applyVelocityBcComp()

template<class Grid >
void peclet::flow::Solver< Grid >::applyVelocityBcComp ( int  comp,
int  fold,
bool  doOutflow 
)
inline

◆ fillVelGhostsTo()

template<class Grid >
void peclet::flow::Solver< Grid >::fillVelGhostsTo ( CCField  f,
int  comp,
int  fold 
)
inline

◆ applyVelocityBcCompTo()

◆ setupBcDiffusion()

template<class Grid >
void peclet::flow::Solver< Grid >::setupBcDiffusion ( )
inline

◆ project()

◆ maskVelocity()

template<class Grid >
void peclet::flow::Solver< Grid >::maskVelocity ( int  c)
inline

◆ minMuInner()

template<class Grid >
double peclet::flow::Solver< Grid >::minMuInner ( )
inline

Definition at line 1757 of file flow_ibm.hpp.

References peclet::flow::Solver< Grid >::G.

Referenced by peclet::flow::Solver< Grid >::project().

◆ reduceMaxAbsInner()

template<class Grid >
double peclet::flow::Solver< Grid >::reduceMaxAbsInner ( CCConst  f)
inline

◆ gatherInner()

◆ scatterInner()

template<class Grid >
void peclet::flow::Solver< Grid >::scatterInner ( CCField  fld,
const std::vector< double > &  in 
)
inline

◆ addField()

◆ hasField()

template<class Grid >
bool peclet::flow::Solver< Grid >::hasField ( const std::string &  name) const
inline

Definition at line 1832 of file flow_ibm.hpp.

◆ fieldView()

template<class Grid >
CCField peclet::flow::Solver< Grid >::fieldView ( const std::string &  name)
inline

Definition at line 1833 of file flow_ibm.hpp.

◆ fieldNames()

template<class Grid >
std::vector< std::string > peclet::flow::Solver< Grid >::fieldNames ( ) const
inline

Definition at line 1834 of file flow_ibm.hpp.

◆ exchangeField()

template<class Grid >
void peclet::flow::Solver< Grid >::exchangeField ( const std::string &  name)
inline

Definition at line 1836 of file flow_ibm.hpp.

References peclet::flow::Solver< Grid >::fillGhosts().

◆ exchangeFieldAdd()

template<class Grid >
void peclet::flow::Solver< Grid >::exchangeFieldAdd ( const std::string &  name)
inline

Definition at line 1842 of file flow_ibm.hpp.

◆ getField()

template<class Grid >
std::vector< double > peclet::flow::Solver< Grid >::getField ( const std::string &  name)
inline

Definition at line 1858 of file flow_ibm.hpp.

References peclet::flow::Solver< Grid >::gatherInner().

◆ setField()

template<class Grid >
void peclet::flow::Solver< Grid >::setField ( const std::string &  name,
const std::vector< double > &  v 
)
inline

Definition at line 1861 of file flow_ibm.hpp.

References peclet::flow::Solver< Grid >::scatterInner().

◆ blockShape()

template<class Grid >
std::array< int, 3 > peclet::flow::Solver< Grid >::blockShape ( ) const
inline

Definition at line 1866 of file flow_ibm.hpp.

References peclet::flow::C3::x, peclet::flow::C3::y, and peclet::flow::C3::z.

◆ ghostWidth()

template<class Grid >
int peclet::flow::Solver< Grid >::ghostWidth ( ) const
inline

Definition at line 1867 of file flow_ibm.hpp.

References peclet::flow::Solver< Grid >::G.

◆ globalResolution()

template<class Grid >
std::array< int, 3 > peclet::flow::Solver< Grid >::globalResolution ( ) const
inline

Definition at line 1869 of file flow_ibm.hpp.

◆ blockOrigin()

template<class Grid >
std::array< int, 3 > peclet::flow::Solver< Grid >::blockOrigin ( ) const
inline

Definition at line 1878 of file flow_ibm.hpp.

References peclet::flow::C3::x, peclet::flow::C3::y, and peclet::flow::C3::z.

◆ addScalar()

◆ hasScalar()

template<class Grid >
bool peclet::flow::Solver< Grid >::hasScalar ( const std::string &  name) const
inline

Definition at line 1903 of file flow_ibm.hpp.

◆ setScalarBc()

template<class Grid >
void peclet::flow::Solver< Grid >::setScalarBc ( const std::string &  name,
int  face,
int  type,
double  value 
)
inline

Definition at line 1911 of file flow_ibm.hpp.

◆ advanceScalars()

◆ setPropertyModel()

template<class Grid >
void peclet::flow::Solver< Grid >::setPropertyModel ( const std::string &  target,
ClosureKind  kind,
const std::string &  in0,
const std::string &  in1,
const std::vector< double > &  params 
)
inline

◆ setDensityMode()

template<class Grid >
void peclet::flow::Solver< Grid >::setDensityMode ( bool  variable)
inline

◆ setPorousContinuity()

template<class Grid >
void peclet::flow::Solver< Grid >::setPorousContinuity ( bool  on)
inline

◆ syncPorousPrev()

template<class Grid >
void peclet::flow::Solver< Grid >::syncPorousPrev ( )
inline

Definition at line 2069 of file flow_ibm.hpp.

◆ setPorousDepsDt()

template<class Grid >
void peclet::flow::Solver< Grid >::setPorousDepsDt ( bool  on)
inline

Definition at line 2076 of file flow_ibm.hpp.

◆ setPressureUnderRelax()

template<class Grid >
void peclet::flow::Solver< Grid >::setPressureUnderRelax ( double  w)
inline

Definition at line 2078 of file flow_ibm.hpp.

◆ setPropertyMode()

template<class Grid >
void peclet::flow::Solver< Grid >::setPropertyMode ( bool  variable,
bool  harmonic 
)
inline

◆ setVariableRotational()

template<class Grid >
void peclet::flow::Solver< Grid >::setVariableRotational ( int  mode,
double  chi 
)
inline

Definition at line 2116 of file flow_ibm.hpp.

◆ setPropertyTable()

template<class Grid >
void peclet::flow::Solver< Grid >::setPropertyTable ( const std::string &  target,
const std::string &  in0,
const std::vector< double > &  xs,
const std::vector< double > &  ys 
)
inline

◆ updateProperties()

template<class Grid >
void peclet::flow::Solver< Grid >::updateProperties ( )
inline

◆ enableCellForce()

template<class Grid >
void peclet::flow::Solver< Grid >::enableCellForce ( )
inline

Definition at line 2149 of file flow_ibm.hpp.

◆ enableDrag()

template<class Grid >
void peclet::flow::Solver< Grid >::enableDrag ( )
inline

◆ configurePorousDragSolver()

template<class Grid >
void peclet::flow::Solver< Grid >::configurePorousDragSolver ( )
inline

◆ addDragDiagonal()

◆ patchScalarDirichletFace()

template<class Grid >
void peclet::flow::Solver< Grid >::patchScalarDirichletFace ( CCField  AC,
CCField  band,
double  D,
int  a,
int  side 
)
inline

◆ applyScalarBcFace()

template<class Grid >
void peclet::flow::Solver< Grid >::applyScalarBcFace ( CCField  c,
int  a,
int  side,
int  type,
double  val 
)
inline

Member Data Documentation

◆ G

template<class Grid >
constexpr int peclet::flow::Solver< Grid >::G = 2
staticconstexpr

Definition at line 51 of file flow_ibm.hpp.

Referenced by peclet::flow::Solver< Grid >::addDragDiagonal(), peclet::flow::Solver< Grid >::addField(), peclet::flow::Solver< Grid >::advanceScalars(), peclet::flow::Solver< Grid >::allocateBlock(), peclet::flow::Solver< Grid >::applyBackflowStab(), peclet::flow::Solver< Grid >::applyScalarBcFace(), peclet::flow::Solver< Grid >::applyVelocityBcCompTo(), peclet::flow::Solver< Grid >::buildAdvStencil(), peclet::flow::Solver< Grid >::buildAdvStencilVar(), peclet::flow::Solver< Grid >::buildRhs(), peclet::flow::Solver< Grid >::buildRhsForced(), peclet::flow::Solver< Grid >::buildRhsVar(), peclet::flow::Solver< Grid >::fillAxis(), peclet::flow::Solver< Grid >::fillGhostsFaces(), peclet::flow::Solver< Grid >::gatherInner(), peclet::flow::Solver< Grid >::ghostWidth(), peclet::flow::Solver< Grid >::maxAbsDiffInner(), peclet::flow::Solver< Grid >::maxOpenDivergence(), peclet::flow::Solver< Grid >::maxPorousResidual(), peclet::flow::Solver< Grid >::minMuInner(), peclet::flow::Solver< Grid >::patchScalarDirichletFace(), peclet::flow::Solver< Grid >::pressureBcGhost(), peclet::flow::Solver< Grid >::project(), peclet::flow::Solver< Grid >::rebuildStencils(), peclet::flow::Solver< Grid >::reduceMaxAbsInner(), peclet::flow::Solver< Grid >::scatterInner(), peclet::flow::Solver< Grid >::setDomainBcProfile(), peclet::flow::Solver< Grid >::setSolid(), peclet::flow::Solver< Grid >::setupBcDiffusion(), peclet::flow::Solver< Grid >::smoothComp(), peclet::flow::Solver< Grid >::updateProperties(), and peclet::flow::Solver< Grid >::uploadVelocity().


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