MAIA bb96820c
Multiphysics at AIA
Loading...
Searching...
No Matches
LbBndCndDxQy< nDim, nDist, SysEqn > Class Template Reference

#include <lbbndcnddxqy.h>

Inheritance diagram for LbBndCndDxQy< nDim, nDist, SysEqn >:
[legend]
Collaboration diagram for LbBndCndDxQy< nDim, nDist, SysEqn >:
[legend]

Public Types

using Cell = typename LbBndCnd< nDim >::Cell
 
using Ld = LbLatticeDescriptor< nDim, nDist >
 
- Public Types inherited from LbBndCnd< nDim >
using Cell = GridCell
 

Public Member Functions

 LbBndCndDxQy (LbSolver< nDim > *solver)
 
virtual ~LbBndCndDxQy ()
 Destructor for the nDim/nDist specific boundary condition. More...
 
constexpr SysEqn sysEqn () const
 
void extrapolateVelocitiesMb ()
 
void refillEmergedCell (const MInt)
 
void refillEmergedCellNormalExtrapolationLinear (const MInt)
 
void refillEmergedCellNormalExtrapolationQuadratic (const MInt)
 
MFloat getDistanceMb (const MInt cellId, const MInt mbCellId, const MInt distId)
 
- Public Member Functions inherited from LbBndCnd< nDim >
 LbBndCnd (LbSolver< nDim > *solver)
 
virtual ~LbBndCnd ()
 The destructor. More...
 
virtual void setBndCndHandler ()
 Sets the BndCndHandler objects at solver setup. More...
 
virtual void updateVariables ()
 Dereferences bndCndHandlerVariables. More...
 
virtual void updateRHS ()
 Dereferences bndCndHandlerRHS. More...
 
void initializeBcData ()
 Initialize BC data variables. More...
 
virtual void createMBComm ()
 This function creates the communicator for calculating the wall forces of the level-set boundaries. More...
 
virtual void postCouple ()
 This function does the sub coupling step called from the coupling class. More...
 
virtual void initializeBndMovingBoundaries ()
 This function initializes the LbBndCnd for coupled simulations. More...
 

Protected Member Functions

void calculateWallDistances ()
 calculates the intersection point between the boundary wall and the trajectories of the distribution functions. More...
 
void calculateWallDistances2D ()
 
void addWallDistanceFieldToOutputFile (ParallelIo &parallelIo, const MBool writeHeader, const MBool writeData) override
 
void initVortices (MInt)
 
void writeBoundaryVTK (MFloat **vertices, MInt num, MInt segmentId)
 Writes the rim of a boundary as VTP to file. More...
 
void parabolicInflow (MInt index)
 
MFloat ** allOwnersGetBoundaryVertices (MInt segmentId, MInt *num)
 Obtain all boundary vertices for a given segmentId. More...
 
void bc0 (MInt index)
 
void bc66666 (MInt set)
 
void bc66668 (MInt set)
 
void bc20000 (MInt index)
 
void bc20001 (MInt index)
 
void bc20002 (MInt index)
 
void bc20003 (MInt index)
 
void bc20004 (MInt index)
 
void bc20005 (MInt index)
 
void bc20020 (MInt index)
 
void bc20022 (MInt index)
 
void bc20023 (MInt index)
 
void bc20024 (MInt index)
 
void bc20025 (MInt index)
 
void bc20026 (MInt index)
 
void bc20027 (MInt index)
 
void bc20030 (MInt index)
 
template<MInt direction>
void slidingWall (MInt index)
 
void bc20050 (MInt index)
 
void bc20051 (MInt index)
 
void bc20052 (MInt index)
 
void bc20053 (MInt index)
 
void bc20054 (MInt index)
 
void bc20055 (MInt index)
 
void bc20220 (MInt index)
 
void bc20226 (MInt index)
 
void bc20227 (MInt index)
 
void bc20228 (MInt index)
 
void heatFluxBc (MInt index, MInt bcMode)
 
void bcIBBNeumannInit (MInt index)
 
void bc20230 (MInt index)
 
void bc20501 (MInt index)
 
void bc20501_init (MInt index)
 
void bc10000 (MInt index)
 
void bc10001 (MInt index)
 
void bc10002 (MInt index)
 
void bc10003 (MInt index)
 
void bc10004 (MInt index)
 
void bc10010 (MInt index)
 
void bc10020 (MInt index)
 
void bc10022 (MInt index)
 
void bc40000 (MInt index)
 
void bc40020 (MInt index)
 
void dnt (MInt index, MInt direction)
 
void bc40030 (MInt index)
 
void bc40130 (MInt index)
 
void bc10050 (MInt index)
 
void bc10060 (MInt index)
 
void bc10061 (MInt index)
 
void bc10090 (MInt index)
 
void bc10070 (MInt index)
 
void bc10080 (MInt index)
 
void bc10111 (MInt index)
 
void bc40070 (MInt index)
 
void bc40071 (MInt index)
 
void bc40072 (MInt index)
 
void recalcRho (MInt index)
 
void bc40073 (MInt index)
 
void bc40080 (MInt index)
 
void bc40081 (MInt index)
 
void bc40082 (MInt index)
 
void bc40072_40082_init (MInt index)
 
void bc40100 (MInt index)
 
void bc40110 (MInt index)
 
void bc40120 (MInt index)
 
void bc30000 (MInt index)
 
template<MUint type>
void calcCharValues (const MInt index, const MInt bndCellId, MFloat &rho_b, MFloat *u_b)
 
void calcCharValuesOnFace (const MInt index, const MInt direction, const MInt bndCellId, MFloat &rho_b, MFloat *u_b)
 
void charVelocity (MInt index, MInt direction)
 
void bc10040 (MInt index)
 
void bc10041 (MInt index)
 
void bc10042 (MInt index)
 
void bc10043 (MInt index)
 
void bc10044 (MInt index)
 
void bc10045 (MInt index)
 
void bc10046 (MInt index)
 
void charPressure (MInt index, MInt direction)
 
void bc40040 (MInt index)
 
void bc40041 (MInt index)
 
void bc40042 (MInt index)
 
void bc40043 (MInt index)
 
void bc40044 (MInt index)
 
void bc40045 (MInt index)
 
void bc40046 (MInt index)
 
void charPressure2 (MInt index, MInt direction)
 
void bc40050 (MInt index)
 
void bc40051 (MInt index)
 
void bc40052 (MInt index)
 
void bc40053 (MInt index)
 
void bc40054 (MInt index)
 
void bc40055 (MInt index)
 
template<MInt direction>
void outflow (MInt index)
 
void bc30010 (MInt index)
 
void bc30011 (MInt index)
 
void bc30012 (MInt index)
 
void bc30013 (MInt index)
 
void bc30014 (MInt index)
 
void bc30015 (MInt index)
 
template<MBool thermal>
void slipFlow (MInt index)
 
void bc30020 (MInt index)
 
void bc30021 (MInt)
 
void bc30022 (MInt)
 
void bc30023 (MInt)
 
void bc30024 (MInt)
 
void bc30025 (MInt)
 
template<MInt direction>
void outflowLinear (MInt index)
 
void bc30030 (MInt index)
 
void bc30031 (MInt index)
 
void bc30032 (MInt index)
 
void bc30033 (MInt index)
 
void bc30034 (MInt index)
 
void bc30035 (MInt index)
 
void bc30040 (MInt index)
 
void bc30041 (MInt)
 
void bc30042 (MInt)
 
void bc30043 (MInt)
 
void bc30044 (MInt)
 
void bc30045 (MInt)
 
void pab (MInt index)
 
void bc40060 (MInt index)
 
void writeBCOutput (MInt index)
 
void interpolatedBounceBackSingleSpecies (const MInt cellId, const MFloat *const uW)
 
void interpolatedBounceBackSingleSpeciesThermal (const MInt cellId, const MFloat *const wTPtr, const MFloat *const uW)
 
void interpolatedBounceBackSingleSpeciesThermal (const MInt cellId, const MFloat wT, const MFloat *const uW)
 
void interpolatedBounceBackSingleSpeciesTransport (const MInt cellId, const MFloat *const wCPtr, const MFloat *const uW)
 
void interpolatedBounceBackSingleSpeciesTransport (const MInt cellId, const MFloat wC, const MFloat *const uW)
 
void interpolatedBounceBackSingleSpeciesThermalFlux (const MInt cellId, const MFloat qT, MInt bcIndex)
 
void calculateEqDistsWallSingleSpecies (const MInt pCellId)
 
void calculateEqDistsWallSingleSpeciesThermal (const MInt pCellId, MFloat wT)
 
void calculateEqDistsWallSingleSpeciesTransport (const MInt pCellId, MFloat wC)
 
void calculateWallForces (MInt index)
 
void calculateWallForcesMb (MInt set)
 
void extrapolateVariable (const MInt index, const MInt pCellId, const MInt var, MFloat *const p_var)
 
void extrapolateVelocities (MInt index, const MInt pCellId, MFloat *l_uu)
 
void incrementForces (const MInt cellId, const MInt j, const MFloat *uW, MFloat *forces)
 
void incrementForces (const MInt cellId, const MInt mbCellId, const MInt j, const MFloat *uW)
 Calculates the forces exerted by a single distribution during bounce back. More...
 
void getBoundaryVelocityMb (const MInt cellId, MFloat *uW)
 Reads boundary velocity from the moving boundary cell collector. More...
 
void getBoundaryVelocity (const MInt index, MFloat *uW)
 Reads boundary velocity from properties. More...
 
MFloat getBoundaryTemperature (const MInt index)
 Reads boundary temperature from properties. More...
 
MFloat firstMomentSourceTerm (const MFloat *const uW, const MFloat rho, const MInt dist)
 Momentum source term used in bounce back schemes for moving boundaries. More...
 
template<MInt mode>
MFloat zerothMomentSourceTerm (const MInt pCellId, const MInt dist, const MFloat var, const MFloat *uW)
 
void calculateEqDistsTotalEnergy (const MInt pCellId, const MFloat l_rho, const MFloat squared_velocity, const MFloat l_uu[nDim], const MFloat l_t)
 
void calculateEqDistsTransport (const MInt pCellId, const MFloat l_rho, const MFloat squared_velocity, const MFloat l_uu[nDim], MFloat l_c)
 
void interpolatedBounceBackMb_Bouzidi_lin (const MInt cellIndex, const MInt set)
 Interpolated bounce back for moving walls using the linear BFL scheme. More...
 
void interpolatedBounceBackMb_Bouzidi_qua (const MInt cellIndex, const MInt set)
 Interpolated bounce back for moving walls using the quadratic BFL scheme. More...
 
void interpolatedBounceBackMb_Yu_qua (const MInt cellIndex, const MInt set)
 Interpolated bounce back for moving walls using the quadratic scheme by Yu et al. More...
 
void interpolatedBounceBackMb_Bouzidi_lin_thermal (const MInt cellIndex, const MInt set)
 
void interpolatedBounceBackMb_Bouzidi_lin_transport (const MInt cellIndex, const MInt set)
 
void interpolatedAntiBounceBackMb_Bouzidi_qua (const MInt cellIndex, const MInt set)
 
void calculateWallDistances ()
 
void calculateWallDistances ()
 
- Protected Member Functions inherited from LbBndCnd< nDim >
template<typename K , typename V >
GetWithDef (const std::map< K, V > &m, const K &key, const V &defval)
 
MInt a_boundaryCellMb (const MInt cellId)
 
virtual MInt findBndCnd (MInt index)
 This function returns the index in the array of the boundary conditions that are inflow/outflow conditions for a given index in all boundary cells. More...
 
virtual void solveBlasiusZ (MInt index)
 Solves the Blasius equation for f,f',f". More...
 
void sortBoundaryCells ()
 This function sorts the boundary cells according to the BC id. More...
 
virtual void calculateForces (MInt)
 
virtual void calculateWallDistances ()
 
virtual void addWallDistanceFieldToOutputFile (ParallelIo &parallelio, const MBool writeHeader, const MBool writeData)=0
 
virtual void createChannelBoundaries ()
 
virtual void bc0 (MInt)
 
virtual void bc10000 (MInt)
 
virtual void bc10001 (MInt)
 
virtual void bc10002 (MInt)
 
virtual void bc10004 (MInt)
 
virtual void bc10022 (MInt)
 
virtual void bc10010 (MInt)
 
virtual void bc10020 (MInt)
 
virtual void bc10040 (MInt)
 
virtual void bc10041 (MInt)
 
virtual void bc10042 (MInt)
 
virtual void bc10043 (MInt)
 
virtual void bc10044 (MInt)
 
virtual void bc10045 (MInt)
 
virtual void bc10046 (MInt)
 
virtual void bc10050 (MInt)
 
virtual void bc10060 (MInt)
 
virtual void bc10061 (MInt)
 
virtual void bc10090 (MInt)
 
virtual void bc10070 (MInt)
 
virtual void bc10080 (MInt)
 
virtual void bc20000 (MInt)
 
virtual void bc20001 (MInt)
 
virtual void bc20002 (MInt)
 
virtual void bc20003 (MInt)
 
virtual void bc20004 (MInt)
 
virtual void bc20005 (MInt)
 
virtual void bc20006 (MInt)
 
virtual void bc20010 (MInt)
 
virtual void bc20020 (MInt)
 
virtual void bc20220 (MInt)
 
virtual void bc20226 (MInt)
 
virtual void bc20227 (MInt)
 
virtual void bc20228 (MInt)
 
virtual void bc20501 (MInt)
 
virtual void bc20501_init (MInt)
 
virtual void bcIBBNeumannInit (MInt)
 
virtual void bc20022 (MInt)
 
virtual void bc20023 (MInt)
 
virtual void bc20024 (MInt)
 
virtual void bc20025 (MInt)
 
virtual void bc20026 (MInt)
 
virtual void bc20027 (MInt)
 
virtual void bc20030 (MInt)
 
virtual void bc20230 (MInt)
 
virtual void bc20050 (MInt)
 
virtual void bc20051 (MInt)
 
virtual void bc20052 (MInt)
 
virtual void bc20053 (MInt)
 
virtual void bc20054 (MInt)
 
virtual void bc20055 (MInt)
 
virtual void bc30000 (MInt)
 
virtual void bc30010 (MInt)
 
virtual void bc30011 (MInt)
 
virtual void bc30012 (MInt)
 
virtual void bc30013 (MInt)
 
virtual void bc30014 (MInt)
 
virtual void bc30015 (MInt)
 
virtual void bc30020 (MInt)
 
virtual void bc30021 (MInt)
 
virtual void bc30022 (MInt)
 
virtual void bc30023 (MInt)
 
virtual void bc30024 (MInt)
 
virtual void bc30025 (MInt)
 
virtual void bc30030 (MInt)
 
virtual void bc30031 (MInt)
 
virtual void bc30032 (MInt)
 
virtual void bc30033 (MInt)
 
virtual void bc30034 (MInt)
 
virtual void bc30035 (MInt)
 
virtual void bc30040 (MInt)
 
virtual void bc30041 (MInt)
 
virtual void bc30042 (MInt)
 
virtual void bc30043 (MInt)
 
virtual void bc30044 (MInt)
 
virtual void bc30045 (MInt)
 
virtual void bc30050 (MInt)
 
virtual void bc40000 (MInt)
 
virtual void bc40001 (MInt)
 
virtual void bc40010 (MInt)
 
virtual void bc40020 (MInt)
 
virtual void bc40030 (MInt)
 
virtual void bc40040 (MInt)
 
virtual void bc40041 (MInt)
 
virtual void bc40042 (MInt)
 
virtual void bc40043 (MInt)
 
virtual void bc40044 (MInt)
 
virtual void bc40045 (MInt)
 
virtual void bc40046 (MInt)
 
virtual void bc40060 (MInt)
 
virtual void bc40070 (MInt)
 
virtual void bc40071 (MInt)
 
virtual void bc40072 (MInt)
 
virtual void bc40073 (MInt)
 
virtual void bc40080 (MInt)
 
virtual void bc40081 (MInt)
 
virtual void bc40082 (MInt)
 
virtual void bc40072_40082_init (MInt)
 
virtual void bc40100 (MInt)
 
virtual void bc40110 (MInt)
 
virtual void bc40120 (MInt)
 
virtual void bc40130 (MInt)
 
virtual void bc10111 (MInt)
 
virtual void bc66666 (MInt)
 
virtual void bc66667 (MInt)
 
virtual void bc66668 (MInt)
 
virtual MInt checkForCommBC ()
 Checks if a BC exists that requires communication. More...
 
virtual MBool checkForCommForce ()
 Checks if a BC exists that requires communication. More...
 
virtual void setBCNeighborCommunicator ()
 Sets up a neighbor-communicator for certain BCs. More...
 
virtual void prepareBC (MInt index, MInt BCCounter, MInt segId)
 Prepares the BC 4070, 4071, 4072, 4080, 4081, and 4082. More...
 
virtual void prepareBC4073 (MInt BCCounter, MInt segId)
 
virtual void setBCWallNeighborCommunicator ()
 Sets up a neighbor-communicator for certain BCs. More...
 
virtual void prepareBC2000 ()
 Prepares the BC 4072. More...
 

Protected Attributes

LbSolverDxQy< nDim, nDist, SysEqn > * m_solver
 
- Protected Attributes inherited from LbBndCnd< nDim >
MbCellCollector m_boundaryCellsMb {}
 
LbSolver< nDim > * m_solver
 pointer to a member function data type More...
 
std::vector< BndCndHandlerbndCndHandlerVariables
 
std::vector< BndCndHandlerbndCndHandlerRHS
 
std::vector< BndCndHandlerbndCndInitiator
 
std::vector< BndCndHandlerbndCndHandlerVariables_MB
 
std::vector< BndCndHandler_MbbndCndHandlerRHS_MB
 
MInt m_noInternalCells
 
MInt m_initialNoCells [3] {}
 
std::map< MInt, MIntm_boundaryCellMappingMb
 
MInt m_noInOutSegments {}
 
MInt m_noPeriodicSegments
 
MInt m_noSegments {}
 
MFloat ** m_initialVelocityVecs = nullptr
 
MFloat ** m_bndNormals = nullptr
 
MIntm_inOutSegmentsIds = nullptr
 
MIntm_periodicSegmentsIds
 
MIntm_bndNormalDirection = nullptr
 
MInt m_lbNoMovingWalls
 
MIntm_segIdMovingWalls {}
 
MFloatm_lbWallVelocity {}
 
MBool m_calcWallForces
 
MInt m_calcWallForcesInterval
 
MInt m_lbNoHeatedWalls
 
MIntm_segIdHeatedWalls {}
 
MFloatm_lbWallTemperature {}
 
MFloatm_Fext
 
MInt m_maxNoG0CellsLb
 
MInt m_maxNoDistributionsInDim
 
MString m_initVelocityMethod
 
MString m_bndNormalMethod
 
MInt m_fastParallelGeomNormals {}
 
MString m_interpolationDistMethod
 
MBool m_outputWallDistanceField = false
 
MString m_multiBCTreatment
 
MFloatm_phi = nullptr
 
MFloatm_theta = nullptr
 
MInt ** m_exDirs = nullptr
 
MFloat ** m_exWeights = nullptr
 
MInt m_solverId
 index of the array where the boundary conditions are stored in More...
 
std::vector< LbGridBoundaryCell< nDim > > m_bndCells
 
MString m_gridCutTest
 
MPrimitiveVariables< nDim > * PV
 
MInt m_noDistributions
 
MInt m_methodId
 
MFloat m_omega {}
 physical non-dimensional reference length More...
 
MFloat m_Ma
 
MFloat m_Re {}
 
MFloat m_nu {}
 
MFloat m_gradient {}
 
MFloat m_referenceLength
 
MFloat m_domainLength
 
MInt m_densityFluctuations
 
MFloat m_rho1 {}
 
MFloat m_rho2 {}
 
MInt m_lbControlInflow {}
 
std::vector< MIntm_bndCndIds
 
std::vector< MIntm_bndCndOffsets
 
std::vector< MIntm_bndCndSegIds
 
std::vector< MIntm_mapSegIdsInOutCnd
 
std::vector< MIntm_mapBndCndSegId2Index
 
std::vector< MIntm_mapIndex2BndCndSegId
 
std::vector< MIntm_noBndCellsPerSegment
 
MFloat ** m_blasius {}
 
MFloat m_blasius_delta {}
 
MFloat m_pulsatileFrequency
 
MBool m_latentHeat = false
 
MBool m_calcSublayerDist = false
 
std::unordered_map< MInt, LbBndCndDatam_bndCndData {}
 Stores BC specific data mapped by boundary index. More...
 
std::vector< MIntm_segIdUseBcData {}
 hold number of domains using BC data for this segment More...
 
MFloat m_deltaRho {}
 
MFloat m_ReLast {}
 
MFloat m_rhoLast {}
 
MFloat m_lRho {}
 
MFloat m_maxDeltaRho {}
 
MInt m_currentTimeStep {}
 
MPI_Group * tmp_group {}
 
MPI_Group * BCGroup {}
 
MPI_Comm * m_BCComm {}
 
MIntm_mapBndCndIdSegId {}
 
MIntm_totalNoBcCells {}
 
MStringm_BCOutputFileName {}
 
MIntm_allBoundaryIds {}
 
MInt m_noAllBoundaryIds {}
 
MInt ** m_allDomainsHaveBC {}
 
MInt m_numberOfCommBCs = 0
 
MIntm_noBCNeighbors {}
 
std::vector< std::vector< MInt > > m_BCneighbors
 
MBool m_calcBcResidual
 
std::ofstream * m_BCResidualStream {}
 
MFloatm_localReCutPoint {}
 
MFloatm_localReCutNormal {}
 
MFloat m_localReCutDistance {}
 
MFloat m_localReCutRe {}
 
MFloat m_localReCutDiameter {}
 
MIntm_allDomainsCalcForceMB {}
 
MBool m_hasCommForce
 
MPI_Comm m_BCWallMBComm
 
MInt m_noBCWallMBNeighbors
 
std::unordered_map< MInt, maia::lb::CalcWallForceContainerm_mapWallForceContainer
 
MString m_forceFile
 
std::vector< MIntm_BCWallMBNeighbors
 
std::vector< MIntm_localReCutCells
 
MBool m_hasLocalReCut {}
 
MInt m_totalNoDomainsReCut {}
 
MInt m_localReCutInterval {}
 
MFloat m_localReCutAdpPerc {}
 
MInt m_localReCutReportInterval {}
 
MInt m_firstBCinComm {}
 
MInt m_noReactivatedCells
 

Private Member Functions

void calculateSublayerDistances (MInt index)
 
void calculateWallInterface (MInt cellId, MFloat *wallConc, MFloat *wallTemp)
 

Private Attributes

const SysEqn m_sysEqn {}
 
MInt bounceBackSchemeMb
 
void(LbBndCndDxQy< nDim, nDist, SysEqn >::* bounceBackFunctionMb )(const MInt cellIndex, const MInt set)
 
MFloat ** m_distances {}
 
MInt m_bounceBackFunctionMbCase = 0
 
MFloat m_zeroInflowVelocity
 
MInt m_refillMethodOrder
 
std::vector< MIntnoMissDistBnd
 
std::vector< std::vector< MFloat > > noMissDistBndWeighted
 
std::vector< MIntibbBndIds
 
struct {
   MFloat   T_o = F0
 
   MFloat   C_o = F0
 
   MFloat   mucosaThickness = F0
 
   MFloat   condRatio = F0
 
   MFloat   diffRatio = F0
 
   MFloat   refDx = F0
 
   MFloat   refT = F0
 
   MFloat   refC = F0
 
   MFloat   refDiff = F0
 
   MFloat   refCondF = F0
 
   MInt   plugFlow = 0
 
m_mucosaModel
 
MFloat ** m_oldWallTemp = nullptr
 
MInt ** m_distIntersectionElementId = nullptr
 
MFloat ** m_mucousDist = nullptr
 
MFloat ** m_fluidDist = nullptr
 

Friends

template<MInt nDim_, MInt nDist_, class SysEqn_ >
class LbSolverDxQy
 

Additional Inherited Members

- Protected Types inherited from LbBndCnd< nDim >
using MbCellCollector = maia::lb::collector::LbMbCellCollector< nDim >
 
typedef void(LbBndCnd::* BndCndHandler) (MInt set)
 
typedef void(LbBndCnd::* BndCndHandler_Mb) (MInt set)
 

Detailed Description

template<MInt nDim, MInt nDist, class SysEqn>
class LbBndCndDxQy< nDim, nDist, SysEqn >

Definition at line 19 of file lbbndcnddxqy.h.

Member Typedef Documentation

◆ Cell

template<MInt nDim, MInt nDist, class SysEqn >
using LbBndCndDxQy< nDim, nDist, SysEqn >::Cell = typename LbBndCnd<nDim>::Cell

Definition at line 98 of file lbbndcnddxqy.h.

◆ Ld

template<MInt nDim, MInt nDist, class SysEqn >
using LbBndCndDxQy< nDim, nDist, SysEqn >::Ld = LbLatticeDescriptor<nDim, nDist>

Definition at line 99 of file lbbndcnddxqy.h.

Constructor & Destructor Documentation

◆ LbBndCndDxQy()

template<MInt nDim, MInt nDist, class SysEqn >
LbBndCndDxQy< nDim, nDist, SysEqn >::LbBndCndDxQy ( LbSolver< nDim > *  solver)

◆ ~LbBndCndDxQy()

template<MInt nDim, MInt nDist, class SysEqn >
LbBndCndDxQy< nDim, nDist, SysEqn >::~LbBndCndDxQy
virtual

Definition at line 201 of file lbbndcnddxqy.cpp.

201 {
204 if(m_mucousDist != nullptr) mDeallocate(m_mucousDist);
205 if(m_fluidDist != nullptr) mDeallocate(m_fluidDist);
206}
MBool mDeallocate(T *&a)
deallocates the memory previously allocated for element 'a'
Definition: alloc.h:544
MFloat ** m_mucousDist
Definition: lbbndcnddxqy.h:135
MInt ** m_distIntersectionElementId
Definition: lbbndcnddxqy.h:134
MFloat ** m_oldWallTemp
Definition: lbbndcnddxqy.h:133
MFloat ** m_fluidDist
Definition: lbbndcnddxqy.h:136
MBool m_calcSublayerDist
Definition: lbbndcnd.h:174

Member Function Documentation

◆ addWallDistanceFieldToOutputFile()

template<MInt nDim, MInt nDist, class SysEqn >
void LbBndCndDxQy< nDim, nDist, SysEqn >::addWallDistanceFieldToOutputFile ( ParallelIo parallelIo,
const MBool  writeHeader,
const MBool  writeData 
)
overrideprotectedvirtual

Implements LbBndCnd< nDim >.

Definition at line 1093 of file lbbndcnddxqy.cpp.

1095 {
1096 // total #of cells in the grid == global cell index of the last cell in the last process:
1097 const MInt totalNoCells = m_solver->domainOffset(m_solver->noDomains());
1098 const MInt internalCells = m_solver->noInternalCells();
1099 if(writeHeader) {
1100 // write header
1101 {
1102 const MString varName = "isFluid";
1103 parallelIo.defineArray(maia::parallel_io::PIO_INT, varName, totalNoCells);
1104 parallelIo.setAttribute(varName, "name", varName);
1105 }
1106 for(MInt i = 0; i < nDist - 1; i++) {
1107 const MString varName = "distance_" + std::to_string(i);
1108 parallelIo.defineArray(maia::parallel_io::PIO_FLOAT, varName, totalNoCells);
1109 parallelIo.setAttribute(varName, "name", varName);
1110 }
1111 }
1112 if(writeData) {
1113 { // write isFluid data
1114 MIntScratchSpace tmp(internalCells, AT_, "tmp");
1115 const MString varName = "isFluid";
1116 for(MInt i = 0; i < internalCells; i++) {
1117 tmp[i] = -1;
1118 }
1119 for(auto& bndCell : m_bndCells) {
1120 if(m_solver->a_isHalo(bndCell.m_cellId)) continue;
1121 tmp[bndCell.m_cellId] = (bndCell.m_isFluid) ? 1 : 0;
1122 }
1123 parallelIo.writeArray(tmp.getPointer(), varName);
1124 }
1125 MFloatScratchSpace tmp(internalCells, AT_, "tmp");
1126 for(MInt j = 0; j < nDist - 1; j++) {
1127 const MString varName = "distance_" + std::to_string(j);
1128 for(MInt i = 0; i < internalCells; i++) {
1129 tmp[i] = -1.0;
1130 }
1131 for(auto& bndCell : m_bndCells) {
1132 if(m_solver->a_isHalo(bndCell.m_cellId)) continue;
1133 tmp[bndCell.m_cellId] = (bndCell.m_distances[j] < 2.0) ? bndCell.m_distances[j] : -1.0; // set -1.0 for no cut
1134 }
1135 parallelIo.writeArray(tmp.getPointer(), varName);
1136 }
1137 }
1138}
LbSolverDxQy< nDim, nDist, SysEqn > * m_solver
Definition: lbbndcnddxqy.h:330
std::vector< LbGridBoundaryCell< nDim > > m_bndCells
Definition: lbbndcnd.h:130
This class is a ScratchSpace.
Definition: scratch.h:758
int32_t MInt
Definition: maiatypes.h:62
std::basic_string< char > MString
Definition: maiatypes.h:55
const MInt PIO_INT
Definition: parallelio.h:48
const MInt PIO_FLOAT
Definition: parallelio.h:46

◆ allOwnersGetBoundaryVertices()

template<MInt nDim, MInt nDist, class SysEqn >
MFloat ** LbBndCndDxQy< nDim, nDist, SysEqn >::allOwnersGetBoundaryVertices ( MInt  segmentId,
MInt num 
)
protected
Parameters
[in]segmentIdSegment id for which the vertices are returned
[out]numNumber of vertices found for the given segment id

/returns Boundary vertices

Definition at line 1336 of file lbbndcnddxqy.cpp.

1336 {
1337 TRACE();
1338
1339 MInt own;
1340 MInt sumowners;
1341 MInt firstOwner;
1342 MIntScratchSpace owners(m_solver->noDomains(), AT_, "owners");
1343
1344 m_log << " * segment owned by: ";
1345 m_solver->m_geometry->determineSegmentOwnership(segmentId, &own, &sumowners, &firstOwner, owners.getPointer());
1346 for(MInt d = 0; d < m_solver->noDomains(); d++)
1347 if(owners[d] > 0) m_log << d << " ";
1348
1349 m_log << std::endl;
1350 m_log << " * sum of owners: " << sumowners << std::endl;
1351 m_log << " * root of communication: " << firstOwner << std::endl;
1352
1353
1354 // my domain owns the whole segment
1355 if(sumowners == 1)
1356 return m_solver->m_geometry->GetBoundaryVertices(segmentId, nullptr, nullptr, 0, num);
1357 else {
1358 // build communicator
1359 MPI_Comm charComm;
1360 m_solver->createMPIComm(owners.getPointer(), sumowners, &charComm);
1361
1362 if(own) {
1363 // collect the triangles for testing first
1364
1365 MInt offStart = 0;
1366 MInt offEnd = 0;
1367
1368 if(m_solver->m_geometry->m_parallelGeometry) {
1369 offStart = m_solver->m_geometry->m_segmentOffsets[segmentId];
1370 offEnd = m_solver->m_geometry->m_segmentOffsets[segmentId + 1];
1371 } else {
1372 offStart = m_solver->m_geometry->m_segmentOffsetsWithoutMB[segmentId];
1373 offEnd = m_solver->m_geometry->m_segmentOffsetsWithoutMB[segmentId + 1];
1374 }
1375 MInt numElements = offEnd - offStart;
1376
1377 m_log << " * number of local triangles: " << numElements << std::endl;
1378 m_log << " * segment offsets: " << offStart << " - " << offEnd << std::endl;
1379
1380 // (normals + vertices)
1381 MInt noTriInfo = nDim * nDim;
1382 MIntScratchSpace myOriginalIds(numElements, AT_, "myOriginalIds");
1383 MFloatScratchSpace segTriangles(noTriInfo * numElements, AT_, "segTriangles");
1384
1385 for(MInt t = offStart, i = 0, j = 0; t < offEnd; t++, i++) {
1386 myOriginalIds[i] = m_solver->m_geometry->elements[t].m_originalId;
1387 for(MInt v = 0; v < nDim; v++)
1388 for(MInt d = 0; d < nDim; d++, j++)
1389 segTriangles[j] = m_solver->m_geometry->elements[t].m_vertices[v][d];
1390 }
1391
1392 MIntScratchSpace numElemPerCPU(sumowners, AT_, "numElemPerCPU");
1393 MPI_Allgather(&numElements, 1, MPI_INT, numElemPerCPU.getPointer(), 1, MPI_INT, charComm, AT_, "numElements",
1394 "numElemPerCPU.getPointer()");
1395 MIntScratchSpace numTriInfoPerCPU(sumowners, AT_, "numTriInfoPerCPU");
1396
1397 m_log << " * triangles per domain: ";
1398 MInt sumallelem = 0;
1399 for(MInt i = 0; i < sumowners; i++) {
1400 m_log << numElemPerCPU[i] << " ";
1401 sumallelem += numElemPerCPU[i];
1402 numTriInfoPerCPU[i] = numElemPerCPU[i] * noTriInfo;
1403 }
1404 m_log << std::endl;
1405 m_log << " * sum of global triangles: " << sumallelem << std::endl;
1406
1407 MIntScratchSpace displOrig(sumowners, AT_, "displOrig");
1408 MIntScratchSpace displTris(sumowners, AT_, "displTris");
1409 displOrig[0] = 0;
1410 displTris[0] = 0;
1411 for(MInt d = 1; d < sumowners; d++) {
1412 displOrig[d] = displOrig[d - 1] + numElemPerCPU[d - 1];
1413 displTris[d] = displTris[d - 1] + numTriInfoPerCPU[d - 1];
1414 }
1415
1416 MIntScratchSpace allOriginalIds(sumallelem, AT_, "allOriginalIds");
1417 MPI_Allgatherv(myOriginalIds.getPointer(), numElements, MPI_INT, allOriginalIds.getPointer(),
1418 numElemPerCPU.getPointer(), displOrig.getPointer(), MPI_INT, charComm, AT_,
1419 "myOriginalIds.getPointer()", "allOriginalIds.getPointer()");
1420
1421 MFloatScratchSpace allSegTriangles(noTriInfo * sumallelem, AT_, "allSegTriangles");
1422 MPI_Allgatherv(segTriangles.getPointer(), noTriInfo * numElements, MPI_DOUBLE, allSegTriangles.getPointer(),
1423 numTriInfoPerCPU.getPointer(), displTris.getPointer(), MPI_DOUBLE, charComm, AT_,
1424 "segTriangles.getPointer()", "allSegTriangles.getPointer()");
1425
1426 std::set<MInt> uniqueTriangles;
1427 for(MInt i = 0; i < sumallelem; i++)
1428 uniqueTriangles.insert(allOriginalIds[i]);
1429
1430 MInt noUniqueTris = uniqueTriangles.size();
1431 m_log << " * sum of unique triangles: " << noUniqueTris << std::endl;
1432
1433 MIntScratchSpace dbl(noUniqueTris, AT_, "dbl");
1434 for(MInt i = 0; i < noUniqueTris; i++)
1435 dbl[i] = 0;
1436
1437 // this contains the offsets in the list of triangles which we want to use for the calculation
1438 MIntScratchSpace keepOffsets(noUniqueTris, AT_, "keepOffsets");
1439 for(MInt i = 0, j = 0; i < sumallelem; i++) {
1440 MInt dist = distance(uniqueTriangles.begin(), uniqueTriangles.find(allOriginalIds[i]));
1441 if(dist != noUniqueTris && dbl[dist] == 0) {
1442 keepOffsets[j] = i * noTriInfo;
1443 dbl[dist] = 1;
1444 j++;
1445 }
1446 }
1447
1448 return m_solver->m_geometry->GetBoundaryVertices(segmentId, allSegTriangles.getPointer(),
1449 keepOffsets.getPointer(), noUniqueTris, num);
1450 } else
1451 return nullptr;
1452 }
1453}
InfoOutFile m_log
int MPI_Allgatherv(const void *sendbuf, int sendcount, MPI_Datatype sendtype, void *recvbuf, const int recvcounts[], const int displs[], MPI_Datatype recvtype, MPI_Comm comm, const MString &name, const MString &sndvarname, const MString &rcvvarname)
same as MPI_Allgatherv
int MPI_Allgather(const void *sendbuf, int sendcount, MPI_Datatype sendtype, void *recvbuf, int recvcount, MPI_Datatype recvtype, MPI_Comm comm, const MString &name, const MString &sndvarname, const MString &rcvvarname)
same as MPI_Allgather
MFloat distance(const MFloat *a, const MFloat *b)
Definition: maiamath.h:249
MFloat dist(const Point< DIM > &p, const Point< DIM > &q)
Definition: pointbox.h:54

◆ bc0()

template<MInt nDim, MInt nDist, class SysEqn >
void LbBndCndDxQy< nDim, nDist, SysEqn >::bc0 ( MInt  index)
protectedvirtual

Reimplemented from LbBndCnd< nDim >.

Definition at line 213 of file lbbndcnddxqy.cpp.

213{}

◆ bc10000()

template<MInt nDim, MInt nDist, class SysEqn >
void LbBndCndDxQy< nDim, nDist, SysEqn >::bc10000 ( MInt  index)
protectedvirtual

Reimplemented from LbBndCnd< nDim >.

◆ bc10001()

template<MInt nDim, MInt nDist, class SysEqn >
void LbBndCndDxQy< nDim, nDist, SysEqn >::bc10001 ( MInt  index)
protectedvirtual

Reimplemented from LbBndCnd< nDim >.

◆ bc10002()

template<MInt nDim, MInt nDist, class SysEqn >
void LbBndCndDxQy< nDim, nDist, SysEqn >::bc10002 ( MInt  index)
protectedvirtual

Reimplemented from LbBndCnd< nDim >.

◆ bc10003()

template<MInt nDim, MInt nDist, class SysEqn >
void LbBndCndDxQy< nDim, nDist, SysEqn >::bc10003 ( MInt  index)
protected

◆ bc10004()

template<MInt nDim, MInt nDist, class SysEqn >
void LbBndCndDxQy< nDim, nDist, SysEqn >::bc10004 ( MInt  index)
protectedvirtual

Reimplemented from LbBndCnd< nDim >.

◆ bc10010()

template<MInt nDim, MInt nDist, class SysEqn >
void LbBndCndDxQy< nDim, nDist, SysEqn >::bc10010 ( MInt  index)
protectedvirtual

Reimplemented from LbBndCnd< nDim >.

◆ bc10020()

template<MInt nDim, MInt nDist, class SysEqn >
void LbBndCndDxQy< nDim, nDist, SysEqn >::bc10020 ( MInt  index)
protectedvirtual

Reimplemented from LbBndCnd< nDim >.

◆ bc10022()

template<MInt nDim, MInt nDist, class SysEqn >
void LbBndCndDxQy< nDim, nDist, SysEqn >::bc10022 ( MInt  index)
protectedvirtual

Reimplemented from LbBndCnd< nDim >.

◆ bc10040()

template<MInt nDim, MInt nDist, class SysEqn >
void LbBndCndDxQy< nDim, nDist, SysEqn >::bc10040 ( MInt  index)
inlineprotectedvirtual

Reimplemented from LbBndCnd< nDim >.

Definition at line 242 of file lbbndcnddxqy.h.

242{ charVelocity(index, 0); };
void charVelocity(MInt index, MInt direction)

◆ bc10041()

template<MInt nDim, MInt nDist, class SysEqn >
void LbBndCndDxQy< nDim, nDist, SysEqn >::bc10041 ( MInt  index)
inlineprotectedvirtual

Reimplemented from LbBndCnd< nDim >.

Definition at line 243 of file lbbndcnddxqy.h.

243{ charVelocity(index, 1); };

◆ bc10042()

template<MInt nDim, MInt nDist, class SysEqn >
void LbBndCndDxQy< nDim, nDist, SysEqn >::bc10042 ( MInt  index)
inlineprotectedvirtual

Reimplemented from LbBndCnd< nDim >.

Definition at line 244 of file lbbndcnddxqy.h.

244{ charVelocity(index, 2); };

◆ bc10043()

template<MInt nDim, MInt nDist, class SysEqn >
void LbBndCndDxQy< nDim, nDist, SysEqn >::bc10043 ( MInt  index)
inlineprotectedvirtual

Reimplemented from LbBndCnd< nDim >.

Definition at line 245 of file lbbndcnddxqy.h.

245{ charVelocity(index, 3); };

◆ bc10044()

template<MInt nDim, MInt nDist, class SysEqn >
void LbBndCndDxQy< nDim, nDist, SysEqn >::bc10044 ( MInt  index)
inlineprotectedvirtual

Reimplemented from LbBndCnd< nDim >.

Definition at line 246 of file lbbndcnddxqy.h.

246{ charVelocity(index, 4); };

◆ bc10045()

template<MInt nDim, MInt nDist, class SysEqn >
void LbBndCndDxQy< nDim, nDist, SysEqn >::bc10045 ( MInt  index)
inlineprotectedvirtual

Reimplemented from LbBndCnd< nDim >.

Definition at line 247 of file lbbndcnddxqy.h.

247{ charVelocity(index, 5); };

◆ bc10046()

template<MInt nDim, MInt nDist, class SysEqn >
void LbBndCndDxQy< nDim, nDist, SysEqn >::bc10046 ( MInt  index)
protectedvirtual

Reimplemented from LbBndCnd< nDim >.

◆ bc10050()

template<MInt nDim, MInt nDist, class SysEqn >
void LbBndCndDxQy< nDim, nDist, SysEqn >::bc10050 ( MInt  index)
protectedvirtual

Reimplemented from LbBndCnd< nDim >.

◆ bc10060()

template<MInt nDim, MInt nDist, class SysEqn >
void LbBndCndDxQy< nDim, nDist, SysEqn >::bc10060 ( MInt  index)
protectedvirtual

Reimplemented from LbBndCnd< nDim >.

◆ bc10061()

template<MInt nDim, MInt nDist, class SysEqn >
void LbBndCndDxQy< nDim, nDist, SysEqn >::bc10061 ( MInt  index)
protectedvirtual

Reimplemented from LbBndCnd< nDim >.

◆ bc10070()

template<MInt nDim, MInt nDist, class SysEqn >
void LbBndCndDxQy< nDim, nDist, SysEqn >::bc10070 ( MInt  index)
protectedvirtual

Reimplemented from LbBndCnd< nDim >.

◆ bc10080()

template<MInt nDim, MInt nDist, class SysEqn >
void LbBndCndDxQy< nDim, nDist, SysEqn >::bc10080 ( MInt  index)
protectedvirtual

Reimplemented from LbBndCnd< nDim >.

◆ bc10090()

template<MInt nDim, MInt nDist, class SysEqn >
void LbBndCndDxQy< nDim, nDist, SysEqn >::bc10090 ( MInt  index)
protectedvirtual

Reimplemented from LbBndCnd< nDim >.

◆ bc10111()

template<MInt nDim, MInt nDist, class SysEqn >
void LbBndCndDxQy< nDim, nDist, SysEqn >::bc10111 ( MInt  index)
protectedvirtual

Reimplemented from LbBndCnd< nDim >.

◆ bc20000()

template<MInt nDim, MInt nDist, class SysEqn >
void LbBndCndDxQy< nDim, nDist, SysEqn >::bc20000 ( MInt  index)
protectedvirtual

Reimplemented from LbBndCnd< nDim >.

◆ bc20001()

template<MInt nDim, MInt nDist, class SysEqn >
void LbBndCndDxQy< nDim, nDist, SysEqn >::bc20001 ( MInt  index)
protectedvirtual

Reimplemented from LbBndCnd< nDim >.

◆ bc20002()

template<MInt nDim, MInt nDist, class SysEqn >
void LbBndCndDxQy< nDim, nDist, SysEqn >::bc20002 ( MInt  index)
protectedvirtual

Reimplemented from LbBndCnd< nDim >.

◆ bc20003()

template<MInt nDim, MInt nDist, class SysEqn >
void LbBndCndDxQy< nDim, nDist, SysEqn >::bc20003 ( MInt  index)
protectedvirtual

Reimplemented from LbBndCnd< nDim >.

◆ bc20004()

template<MInt nDim, MInt nDist, class SysEqn >
void LbBndCndDxQy< nDim, nDist, SysEqn >::bc20004 ( MInt  index)
protectedvirtual

Reimplemented from LbBndCnd< nDim >.

◆ bc20005()

template<MInt nDim, MInt nDist, class SysEqn >
void LbBndCndDxQy< nDim, nDist, SysEqn >::bc20005 ( MInt  index)
protectedvirtual

Reimplemented from LbBndCnd< nDim >.

◆ bc20020()

template<MInt nDim, MInt nDist, class SysEqn >
void LbBndCndDxQy< nDim, nDist, SysEqn >::bc20020 ( MInt  index)
protectedvirtual

Reimplemented from LbBndCnd< nDim >.

◆ bc20022()

template<MInt nDim, MInt nDist, class SysEqn >
void LbBndCndDxQy< nDim, nDist, SysEqn >::bc20022 ( MInt  index)
protectedvirtual

Reimplemented from LbBndCnd< nDim >.

◆ bc20023()

template<MInt nDim, MInt nDist, class SysEqn >
void LbBndCndDxQy< nDim, nDist, SysEqn >::bc20023 ( MInt  index)
protectedvirtual

Reimplemented from LbBndCnd< nDim >.

◆ bc20024()

template<MInt nDim, MInt nDist, class SysEqn >
void LbBndCndDxQy< nDim, nDist, SysEqn >::bc20024 ( MInt  index)
protectedvirtual

Reimplemented from LbBndCnd< nDim >.

◆ bc20025()

template<MInt nDim, MInt nDist, class SysEqn >
void LbBndCndDxQy< nDim, nDist, SysEqn >::bc20025 ( MInt  index)
protectedvirtual

Reimplemented from LbBndCnd< nDim >.

◆ bc20026()

template<MInt nDim, MInt nDist, class SysEqn >
void LbBndCndDxQy< nDim, nDist, SysEqn >::bc20026 ( MInt  index)
protectedvirtual

Reimplemented from LbBndCnd< nDim >.

◆ bc20027()

template<MInt nDim, MInt nDist, class SysEqn >
void LbBndCndDxQy< nDim, nDist, SysEqn >::bc20027 ( MInt  index)
protectedvirtual

Reimplemented from LbBndCnd< nDim >.

◆ bc20030()

template<MInt nDim, MInt nDist, class SysEqn >
void LbBndCndDxQy< nDim, nDist, SysEqn >::bc20030 ( MInt  index)
protectedvirtual

Reimplemented from LbBndCnd< nDim >.

◆ bc20050()

template<MInt nDim, MInt nDist, class SysEqn >
void LbBndCndDxQy< nDim, nDist, SysEqn >::bc20050 ( MInt  index)
inlineprotectedvirtual

Reimplemented from LbBndCnd< nDim >.

Definition at line 178 of file lbbndcnddxqy.h.

178{ slidingWall<0>(index); };

◆ bc20051()

template<MInt nDim, MInt nDist, class SysEqn >
void LbBndCndDxQy< nDim, nDist, SysEqn >::bc20051 ( MInt  index)
inlineprotectedvirtual

Reimplemented from LbBndCnd< nDim >.

Definition at line 179 of file lbbndcnddxqy.h.

179{ slidingWall<1>(index); };

◆ bc20052()

template<MInt nDim, MInt nDist, class SysEqn >
void LbBndCndDxQy< nDim, nDist, SysEqn >::bc20052 ( MInt  index)
inlineprotectedvirtual

Reimplemented from LbBndCnd< nDim >.

Definition at line 180 of file lbbndcnddxqy.h.

180{ slidingWall<2>(index); };

◆ bc20053()

template<MInt nDim, MInt nDist, class SysEqn >
void LbBndCndDxQy< nDim, nDist, SysEqn >::bc20053 ( MInt  index)
inlineprotectedvirtual

Reimplemented from LbBndCnd< nDim >.

Definition at line 181 of file lbbndcnddxqy.h.

181{ slidingWall<3>(index); };

◆ bc20054()

template<MInt nDim, MInt nDist, class SysEqn >
void LbBndCndDxQy< nDim, nDist, SysEqn >::bc20054 ( MInt  index)
inlineprotectedvirtual

Reimplemented from LbBndCnd< nDim >.

Definition at line 182 of file lbbndcnddxqy.h.

182{ slidingWall<4>(index); };

◆ bc20055()

template<MInt nDim, MInt nDist, class SysEqn >
void LbBndCndDxQy< nDim, nDist, SysEqn >::bc20055 ( MInt  index)
inlineprotectedvirtual

Reimplemented from LbBndCnd< nDim >.

Definition at line 183 of file lbbndcnddxqy.h.

183{ slidingWall<5>(index); };

◆ bc20220()

template<MInt nDim, MInt nDist, class SysEqn >
void LbBndCndDxQy< nDim, nDist, SysEqn >::bc20220 ( MInt  index)
protectedvirtual

Reimplemented from LbBndCnd< nDim >.

◆ bc20226()

template<MInt nDim, MInt nDist, class SysEqn >
void LbBndCndDxQy< nDim, nDist, SysEqn >::bc20226 ( MInt  index)
inlineprotectedvirtual

Reimplemented from LbBndCnd< nDim >.

Definition at line 187 of file lbbndcnddxqy.h.

187{ heatFluxBc(index, 0); };
void heatFluxBc(MInt index, MInt bcMode)

◆ bc20227()

template<MInt nDim, MInt nDist, class SysEqn >
void LbBndCndDxQy< nDim, nDist, SysEqn >::bc20227 ( MInt  index)
inlineprotectedvirtual

Reimplemented from LbBndCnd< nDim >.

Definition at line 188 of file lbbndcnddxqy.h.

188{ heatFluxBc(index, 1); };

◆ bc20228()

template<MInt nDim, MInt nDist, class SysEqn >
void LbBndCndDxQy< nDim, nDist, SysEqn >::bc20228 ( MInt  index)
inlineprotectedvirtual

Reimplemented from LbBndCnd< nDim >.

Definition at line 189 of file lbbndcnddxqy.h.

189{ heatFluxBc(index, 2); };

◆ bc20230()

template<MInt nDim, MInt nDist, class SysEqn >
void LbBndCndDxQy< nDim, nDist, SysEqn >::bc20230 ( MInt  index)
protectedvirtual

Reimplemented from LbBndCnd< nDim >.

◆ bc20501()

template<MInt nDim, MInt nDist, class SysEqn >
void LbBndCndDxQy< nDim, nDist, SysEqn >::bc20501 ( MInt  index)
protectedvirtual

Reimplemented from LbBndCnd< nDim >.

◆ bc20501_init()

template<MInt nDim, MInt nDist, class SysEqn >
void LbBndCndDxQy< nDim, nDist, SysEqn >::bc20501_init ( MInt  index)
protectedvirtual

Reimplemented from LbBndCnd< nDim >.

◆ bc30000()

template<MInt nDim, MInt nDist, class SysEqn >
void LbBndCndDxQy< nDim, nDist, SysEqn >::bc30000 ( MInt  index)
protectedvirtual

Reimplemented from LbBndCnd< nDim >.

◆ bc30010()

template<MInt nDim, MInt nDist, class SysEqn >
void LbBndCndDxQy< nDim, nDist, SysEqn >::bc30010 ( MInt  index)
inlineprotectedvirtual

Reimplemented from LbBndCnd< nDim >.

Definition at line 269 of file lbbndcnddxqy.h.

269{ outflow<0>(index); };

◆ bc30011()

template<MInt nDim, MInt nDist, class SysEqn >
void LbBndCndDxQy< nDim, nDist, SysEqn >::bc30011 ( MInt  index)
inlineprotectedvirtual

Reimplemented from LbBndCnd< nDim >.

Definition at line 270 of file lbbndcnddxqy.h.

270{ outflow<1>(index); };

◆ bc30012()

template<MInt nDim, MInt nDist, class SysEqn >
void LbBndCndDxQy< nDim, nDist, SysEqn >::bc30012 ( MInt  index)
inlineprotectedvirtual

Reimplemented from LbBndCnd< nDim >.

Definition at line 271 of file lbbndcnddxqy.h.

271{ outflow<2>(index); };

◆ bc30013()

template<MInt nDim, MInt nDist, class SysEqn >
void LbBndCndDxQy< nDim, nDist, SysEqn >::bc30013 ( MInt  index)
inlineprotectedvirtual

Reimplemented from LbBndCnd< nDim >.

Definition at line 272 of file lbbndcnddxqy.h.

272{ outflow<3>(index); };

◆ bc30014()

template<MInt nDim, MInt nDist, class SysEqn >
void LbBndCndDxQy< nDim, nDist, SysEqn >::bc30014 ( MInt  index)
inlineprotectedvirtual

Reimplemented from LbBndCnd< nDim >.

Definition at line 273 of file lbbndcnddxqy.h.

273{ outflow<4>(index); };

◆ bc30015()

template<MInt nDim, MInt nDist, class SysEqn >
void LbBndCndDxQy< nDim, nDist, SysEqn >::bc30015 ( MInt  index)
inlineprotectedvirtual

Reimplemented from LbBndCnd< nDim >.

Definition at line 274 of file lbbndcnddxqy.h.

274{ outflow<5>(index); };

◆ bc30020()

template<MInt nDim, MInt nDist, class SysEqn >
void LbBndCndDxQy< nDim, nDist, SysEqn >::bc30020 ( MInt  index)
inlineprotectedvirtual

Reimplemented from LbBndCnd< nDim >.

Definition at line 278 of file lbbndcnddxqy.h.

278{ slipFlow<false>(index); };

◆ bc30021()

template<MInt nDim, MInt nDist, class SysEqn >
void LbBndCndDxQy< nDim, nDist, SysEqn >::bc30021 ( MInt  )
inlineprotectedvirtual

Reimplemented from LbBndCnd< nDim >.

Definition at line 279 of file lbbndcnddxqy.h.

279{ TERMM(1, "Only use 3020 BC, not 3021"); };

◆ bc30022()

template<MInt nDim, MInt nDist, class SysEqn >
void LbBndCndDxQy< nDim, nDist, SysEqn >::bc30022 ( MInt  )
inlineprotectedvirtual

Reimplemented from LbBndCnd< nDim >.

Definition at line 280 of file lbbndcnddxqy.h.

280{ TERMM(1, "Only use 3020 BC, not 3022"); };

◆ bc30023()

template<MInt nDim, MInt nDist, class SysEqn >
void LbBndCndDxQy< nDim, nDist, SysEqn >::bc30023 ( MInt  )
inlineprotectedvirtual

Reimplemented from LbBndCnd< nDim >.

Definition at line 281 of file lbbndcnddxqy.h.

281{ TERMM(1, "Only use 3020 BC, not 3023"); };

◆ bc30024()

template<MInt nDim, MInt nDist, class SysEqn >
void LbBndCndDxQy< nDim, nDist, SysEqn >::bc30024 ( MInt  )
inlineprotectedvirtual

Reimplemented from LbBndCnd< nDim >.

Definition at line 282 of file lbbndcnddxqy.h.

282{ TERMM(1, "Only use 3020 BC, not 3024"); };

◆ bc30025()

template<MInt nDim, MInt nDist, class SysEqn >
void LbBndCndDxQy< nDim, nDist, SysEqn >::bc30025 ( MInt  )
inlineprotectedvirtual

Reimplemented from LbBndCnd< nDim >.

Definition at line 283 of file lbbndcnddxqy.h.

283{ TERMM(1, "Only use 3020 BC, not 3025"); };

◆ bc30030()

template<MInt nDim, MInt nDist, class SysEqn >
void LbBndCndDxQy< nDim, nDist, SysEqn >::bc30030 ( MInt  index)
inlineprotectedvirtual

Reimplemented from LbBndCnd< nDim >.

Definition at line 287 of file lbbndcnddxqy.h.

287{ outflowLinear<0>(index); };

◆ bc30031()

template<MInt nDim, MInt nDist, class SysEqn >
void LbBndCndDxQy< nDim, nDist, SysEqn >::bc30031 ( MInt  index)
inlineprotectedvirtual

Reimplemented from LbBndCnd< nDim >.

Definition at line 288 of file lbbndcnddxqy.h.

288{ outflowLinear<1>(index); };

◆ bc30032()

template<MInt nDim, MInt nDist, class SysEqn >
void LbBndCndDxQy< nDim, nDist, SysEqn >::bc30032 ( MInt  index)
inlineprotectedvirtual

Reimplemented from LbBndCnd< nDim >.

Definition at line 289 of file lbbndcnddxqy.h.

289{ outflowLinear<2>(index); };

◆ bc30033()

template<MInt nDim, MInt nDist, class SysEqn >
void LbBndCndDxQy< nDim, nDist, SysEqn >::bc30033 ( MInt  index)
inlineprotectedvirtual

Reimplemented from LbBndCnd< nDim >.

Definition at line 290 of file lbbndcnddxqy.h.

290{ outflowLinear<3>(index); };

◆ bc30034()

template<MInt nDim, MInt nDist, class SysEqn >
void LbBndCndDxQy< nDim, nDist, SysEqn >::bc30034 ( MInt  index)
inlineprotectedvirtual

Reimplemented from LbBndCnd< nDim >.

Definition at line 291 of file lbbndcnddxqy.h.

291{ outflowLinear<4>(index); };

◆ bc30035()

template<MInt nDim, MInt nDist, class SysEqn >
void LbBndCndDxQy< nDim, nDist, SysEqn >::bc30035 ( MInt  index)
inlineprotectedvirtual

Reimplemented from LbBndCnd< nDim >.

Definition at line 292 of file lbbndcnddxqy.h.

292{ outflowLinear<5>(index); };

◆ bc30040()

template<MInt nDim, MInt nDist, class SysEqn >
void LbBndCndDxQy< nDim, nDist, SysEqn >::bc30040 ( MInt  index)
inlineprotectedvirtual

Reimplemented from LbBndCnd< nDim >.

Definition at line 294 of file lbbndcnddxqy.h.

294{ slipFlow<true>(index); };

◆ bc30041()

template<MInt nDim, MInt nDist, class SysEqn >
void LbBndCndDxQy< nDim, nDist, SysEqn >::bc30041 ( MInt  )
inlineprotectedvirtual

Reimplemented from LbBndCnd< nDim >.

Definition at line 295 of file lbbndcnddxqy.h.

295{ TERMM(1, "Only use 3040 BC, not 3041"); };

◆ bc30042()

template<MInt nDim, MInt nDist, class SysEqn >
void LbBndCndDxQy< nDim, nDist, SysEqn >::bc30042 ( MInt  )
inlineprotectedvirtual

Reimplemented from LbBndCnd< nDim >.

Definition at line 296 of file lbbndcnddxqy.h.

296{ TERMM(1, "Only use 3040 BC, not 3042"); };

◆ bc30043()

template<MInt nDim, MInt nDist, class SysEqn >
void LbBndCndDxQy< nDim, nDist, SysEqn >::bc30043 ( MInt  )
inlineprotectedvirtual

Reimplemented from LbBndCnd< nDim >.

Definition at line 297 of file lbbndcnddxqy.h.

297{ TERMM(1, "Only use 3040 BC, not 3043"); };

◆ bc30044()

template<MInt nDim, MInt nDist, class SysEqn >
void LbBndCndDxQy< nDim, nDist, SysEqn >::bc30044 ( MInt  )
inlineprotectedvirtual

Reimplemented from LbBndCnd< nDim >.

Definition at line 298 of file lbbndcnddxqy.h.

298{ TERMM(1, "Only use 3040 BC, not 3044"); };

◆ bc30045()

template<MInt nDim, MInt nDist, class SysEqn >
void LbBndCndDxQy< nDim, nDist, SysEqn >::bc30045 ( MInt  )
inlineprotectedvirtual

Reimplemented from LbBndCnd< nDim >.

Definition at line 299 of file lbbndcnddxqy.h.

299{ TERMM(1, "Only use 3040 BC, not 3045"); };

◆ bc40000()

template<MInt nDim, MInt nDist, class SysEqn >
void LbBndCndDxQy< nDim, nDist, SysEqn >::bc40000 ( MInt  index)
protectedvirtual

Reimplemented from LbBndCnd< nDim >.

◆ bc40020()

template<MInt nDim, MInt nDist, class SysEqn >
void LbBndCndDxQy< nDim, nDist, SysEqn >::bc40020 ( MInt  index)
protectedvirtual

Reimplemented from LbBndCnd< nDim >.

◆ bc40030()

template<MInt nDim, MInt nDist, class SysEqn >
void LbBndCndDxQy< nDim, nDist, SysEqn >::bc40030 ( MInt  index)
protectedvirtual

Reimplemented from LbBndCnd< nDim >.

◆ bc40040()

template<MInt nDim, MInt nDist, class SysEqn >
void LbBndCndDxQy< nDim, nDist, SysEqn >::bc40040 ( MInt  index)
inlineprotectedvirtual

Reimplemented from LbBndCnd< nDim >.

Definition at line 251 of file lbbndcnddxqy.h.

251{ charPressure(index, 0); };
void charPressure(MInt index, MInt direction)

◆ bc40041()

template<MInt nDim, MInt nDist, class SysEqn >
void LbBndCndDxQy< nDim, nDist, SysEqn >::bc40041 ( MInt  index)
inlineprotectedvirtual

Reimplemented from LbBndCnd< nDim >.

Definition at line 252 of file lbbndcnddxqy.h.

252{ charPressure(index, 1); };

◆ bc40042()

template<MInt nDim, MInt nDist, class SysEqn >
void LbBndCndDxQy< nDim, nDist, SysEqn >::bc40042 ( MInt  index)
inlineprotectedvirtual

Reimplemented from LbBndCnd< nDim >.

Definition at line 253 of file lbbndcnddxqy.h.

253{ charPressure(index, 2); };

◆ bc40043()

template<MInt nDim, MInt nDist, class SysEqn >
void LbBndCndDxQy< nDim, nDist, SysEqn >::bc40043 ( MInt  index)
inlineprotectedvirtual

Reimplemented from LbBndCnd< nDim >.

Definition at line 254 of file lbbndcnddxqy.h.

254{ charPressure(index, 3); };

◆ bc40044()

template<MInt nDim, MInt nDist, class SysEqn >
void LbBndCndDxQy< nDim, nDist, SysEqn >::bc40044 ( MInt  index)
inlineprotectedvirtual

Reimplemented from LbBndCnd< nDim >.

Definition at line 255 of file lbbndcnddxqy.h.

255{ charPressure(index, 4); };

◆ bc40045()

template<MInt nDim, MInt nDist, class SysEqn >
void LbBndCndDxQy< nDim, nDist, SysEqn >::bc40045 ( MInt  index)
inlineprotectedvirtual

Reimplemented from LbBndCnd< nDim >.

Definition at line 256 of file lbbndcnddxqy.h.

256{ charPressure(index, 5); };

◆ bc40046()

template<MInt nDim, MInt nDist, class SysEqn >
void LbBndCndDxQy< nDim, nDist, SysEqn >::bc40046 ( MInt  index)
protectedvirtual

Reimplemented from LbBndCnd< nDim >.

◆ bc40050()

template<MInt nDim, MInt nDist, class SysEqn >
void LbBndCndDxQy< nDim, nDist, SysEqn >::bc40050 ( MInt  index)
inlineprotected

Definition at line 260 of file lbbndcnddxqy.h.

260{ charPressure2(index, 0); };
void charPressure2(MInt index, MInt direction)

◆ bc40051()

template<MInt nDim, MInt nDist, class SysEqn >
void LbBndCndDxQy< nDim, nDist, SysEqn >::bc40051 ( MInt  index)
inlineprotected

Definition at line 261 of file lbbndcnddxqy.h.

261{ charPressure2(index, 1); };

◆ bc40052()

template<MInt nDim, MInt nDist, class SysEqn >
void LbBndCndDxQy< nDim, nDist, SysEqn >::bc40052 ( MInt  index)
inlineprotected

Definition at line 262 of file lbbndcnddxqy.h.

262{ charPressure2(index, 2); };

◆ bc40053()

template<MInt nDim, MInt nDist, class SysEqn >
void LbBndCndDxQy< nDim, nDist, SysEqn >::bc40053 ( MInt  index)
inlineprotected

Definition at line 263 of file lbbndcnddxqy.h.

263{ charPressure2(index, 3); };

◆ bc40054()

template<MInt nDim, MInt nDist, class SysEqn >
void LbBndCndDxQy< nDim, nDist, SysEqn >::bc40054 ( MInt  index)
inlineprotected

Definition at line 264 of file lbbndcnddxqy.h.

264{ charPressure2(index, 4); };

◆ bc40055()

template<MInt nDim, MInt nDist, class SysEqn >
void LbBndCndDxQy< nDim, nDist, SysEqn >::bc40055 ( MInt  index)
inlineprotected

Definition at line 265 of file lbbndcnddxqy.h.

265{ charPressure2(index, 5); };

◆ bc40060()

template<MInt nDim, MInt nDist, class SysEqn >
void LbBndCndDxQy< nDim, nDist, SysEqn >::bc40060 ( MInt  index)
inlineprotectedvirtual

Reimplemented from LbBndCnd< nDim >.

Definition at line 302 of file lbbndcnddxqy.h.

302{ pab(index); };
void pab(MInt index)

◆ bc40070()

template<MInt nDim, MInt nDist, class SysEqn >
void LbBndCndDxQy< nDim, nDist, SysEqn >::bc40070 ( MInt  index)
protectedvirtual

Reimplemented from LbBndCnd< nDim >.

◆ bc40071()

template<MInt nDim, MInt nDist, class SysEqn >
void LbBndCndDxQy< nDim, nDist, SysEqn >::bc40071 ( MInt  index)
protectedvirtual

Reimplemented from LbBndCnd< nDim >.

◆ bc40072()

template<MInt nDim, MInt nDist, class SysEqn >
void LbBndCndDxQy< nDim, nDist, SysEqn >::bc40072 ( MInt  index)
protectedvirtual

Reimplemented from LbBndCnd< nDim >.

◆ bc40072_40082_init()

template<MInt nDim, MInt nDist, class SysEqn >
void LbBndCndDxQy< nDim, nDist, SysEqn >::bc40072_40082_init ( MInt  index)
protectedvirtual

Reimplemented from LbBndCnd< nDim >.

◆ bc40073()

template<MInt nDim, MInt nDist, class SysEqn >
void LbBndCndDxQy< nDim, nDist, SysEqn >::bc40073 ( MInt  index)
protectedvirtual

Reimplemented from LbBndCnd< nDim >.

◆ bc40080()

template<MInt nDim, MInt nDist, class SysEqn >
void LbBndCndDxQy< nDim, nDist, SysEqn >::bc40080 ( MInt  index)
protectedvirtual

Reimplemented from LbBndCnd< nDim >.

◆ bc40081()

template<MInt nDim, MInt nDist, class SysEqn >
void LbBndCndDxQy< nDim, nDist, SysEqn >::bc40081 ( MInt  index)
protectedvirtual

Reimplemented from LbBndCnd< nDim >.

◆ bc40082()

template<MInt nDim, MInt nDist, class SysEqn >
void LbBndCndDxQy< nDim, nDist, SysEqn >::bc40082 ( MInt  index)
protectedvirtual

Reimplemented from LbBndCnd< nDim >.

◆ bc40100()

template<MInt nDim, MInt nDist, class SysEqn >
void LbBndCndDxQy< nDim, nDist, SysEqn >::bc40100 ( MInt  index)
protectedvirtual

Reimplemented from LbBndCnd< nDim >.

◆ bc40110()

template<MInt nDim, MInt nDist, class SysEqn >
void LbBndCndDxQy< nDim, nDist, SysEqn >::bc40110 ( MInt  index)
protectedvirtual

Reimplemented from LbBndCnd< nDim >.

◆ bc40120()

template<MInt nDim, MInt nDist, class SysEqn >
void LbBndCndDxQy< nDim, nDist, SysEqn >::bc40120 ( MInt  index)
protectedvirtual

Reimplemented from LbBndCnd< nDim >.

◆ bc40130()

template<MInt nDim, MInt nDist, class SysEqn >
void LbBndCndDxQy< nDim, nDist, SysEqn >::bc40130 ( MInt  index)
protectedvirtual

Reimplemented from LbBndCnd< nDim >.

◆ bc66666()

template<MInt nDim, MInt nDist, class SysEqn >
void LbBndCndDxQy< nDim, nDist, SysEqn >::bc66666 ( MInt  set)
protectedvirtual

Reimplemented from LbBndCnd< nDim >.

Definition at line 1962 of file lbbndcnddxqy.cpp.

1962 {
1963 TRACE();
1964
1965 const MInt noMbCells = m_boundaryCellsMb.size();
1966
1967#ifdef WAR_NVHPC_PSTL
1968 mAlloc(m_distances, noMbCells, nDist - 1, "distances", F1, AT_);
1969 for(MInt i = 0; i < noMbCells; i++) {
1970 const MInt pCellId = m_solver->m_G0CellList[i];
1971 for(MInt d = 0; d < nDist - 1; d++) {
1972 m_distances[i][d] = getDistanceMb(pCellId, i, d);
1973 }
1974 }
1975#endif
1976
1977 maia::parallelFor<true>(0, noMbCells, [=](MInt mbId) {
1978
1979#ifdef WAR_NVHPC_PSTL
1980 // Perform bounce back set by properties
1983 } else if(m_bounceBackFunctionMbCase == 1) {
1985 } else {
1987 }
1988#else
1989 // Perform bounce back set by properties
1990 (this->*bounceBackFunctionMb)(mbId, set);
1991#endif
1992
1993 if(m_solver->m_isThermal) {
1995 }
1996 if(m_solver->m_isTransport) {
1998 }
1999 });
2000
2001#ifdef WAR_NVHPC_PSTL
2003#endif
2004 if(m_calcWallForces && m_solver->m_currentNoG0Cells > 0) {
2006 }
2007}
void mAlloc(T *&a, const MLong N, const MString &objectName, MString function)
allocates memory for one-dimensional array 'a' of size N
Definition: alloc.h:173
void calculateWallForcesMb(MInt set)
void interpolatedBounceBackMb_Bouzidi_qua(const MInt cellIndex, const MInt set)
Interpolated bounce back for moving walls using the quadratic BFL scheme.
void interpolatedBounceBackMb_Bouzidi_lin_thermal(const MInt cellIndex, const MInt set)
void(LbBndCndDxQy< nDim, nDist, SysEqn >::* bounceBackFunctionMb)(const MInt cellIndex, const MInt set)
Definition: lbbndcnddxqy.h:106
MFloat getDistanceMb(const MInt cellId, const MInt mbCellId, const MInt distId)
Definition: lbbndcnddxqy.h:359
void interpolatedBounceBackMb_Yu_qua(const MInt cellIndex, const MInt set)
Interpolated bounce back for moving walls using the quadratic scheme by Yu et al.
void interpolatedBounceBackMb_Bouzidi_lin_transport(const MInt cellIndex, const MInt set)
MFloat ** m_distances
Definition: lbbndcnddxqy.h:109
void interpolatedBounceBackMb_Bouzidi_lin(const MInt cellIndex, const MInt set)
Interpolated bounce back for moving walls using the linear BFL scheme.
MInt m_bounceBackFunctionMbCase
Definition: lbbndcnddxqy.h:110
MBool m_calcWallForces
Definition: lbbndcnd.h:97
MbCellCollector m_boundaryCellsMb
Definition: lbbndcnd.h:57
constexpr MInt size() const
Return size (i.e., currently used number of nodes)
Definition: container.h:89

◆ bc66668()

template<MInt nDim, MInt nDist, class SysEqn >
void LbBndCndDxQy< nDim, nDist, SysEqn >::bc66668 ( MInt  set)
protectedvirtual

Reimplemented from LbBndCnd< nDim >.

Definition at line 2023 of file lbbndcnddxqy.cpp.

2023 {
2024 TRACE();
2025
2026 MInt noMbCells = m_boundaryCellsMb.size();
2027 if(m_solver->noDomains() > 1) {
2028 MPI_Allreduce(&noMbCells, &noMbCells, 1, MPI_INT, MPI_SUM, m_solver->mpiComm(), AT_, "noMbCells", "noMbCells");
2029 }
2030 if(!m_solver->domainId()) {
2031 std::cout << "Apply free surface bc to " << noMbCells << " no mbCells" << std::endl;
2032 }
2033
2034 for(MInt mbCellId = 0; mbCellId < m_boundaryCellsMb.size(); mbCellId++) {
2035 const MInt pCellId = m_boundaryCellsMb.cellId(mbCellId);
2036
2037 ASSERT(m_solver->a_isG0CandidateOfSet(pCellId, (set - m_solver->m_levelSetId)), "Inconsistent collector!");
2038
2040 }
2041}
void interpolatedAntiBounceBackMb_Bouzidi_qua(const MInt cellIndex, const MInt set)
MInt & cellId(const MInt id)
Accessor for cellId.
int MPI_Allreduce(const void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype, MPI_Op op, MPI_Comm comm, const MString &name, const MString &sndvarname, const MString &rcvvarname)
same as MPI_Allreduce

◆ bcIBBNeumannInit()

template<MInt nDim, MInt nDist, class SysEqn >
void LbBndCndDxQy< nDim, nDist, SysEqn >::bcIBBNeumannInit ( MInt  index)
protectedvirtual

Reimplemented from LbBndCnd< nDim >.

◆ calcCharValues()

template<MInt nDim, MInt nDist, class SysEqn >
template<MUint type>
void LbBndCndDxQy< nDim, nDist, SysEqn >::calcCharValues ( const MInt  index,
const MInt  bndCellId,
MFloat rho_b,
MFloat u_b 
)
inlineprotected

◆ calcCharValuesOnFace()

template<MInt nDim, MInt nDist, class SysEqn >
void LbBndCndDxQy< nDim, nDist, SysEqn >::calcCharValuesOnFace ( const MInt  index,
const MInt  direction,
const MInt  bndCellId,
MFloat rho_b,
MFloat u_b 
)
inlineprotected

◆ calculateEqDistsTotalEnergy()

template<MInt nDim, MInt nDist, class SysEqn >
void LbBndCndDxQy< nDim, nDist, SysEqn >::calculateEqDistsTotalEnergy ( const MInt  pCellId,
const MFloat  l_rho,
const MFloat  squared_velocity,
const MFloat  l_uu[nDim],
const MFloat  l_t 
)
inlineprotected

◆ calculateEqDistsTransport()

template<MInt nDim, MInt nDist, class SysEqn >
void LbBndCndDxQy< nDim, nDist, SysEqn >::calculateEqDistsTransport ( const MInt  pCellId,
const MFloat  l_rho,
const MFloat  squared_velocity,
const MFloat  l_uu[nDim],
MFloat  l_c 
)
inlineprotected

◆ calculateEqDistsWallSingleSpecies()

template<MInt nDim, MInt nDist, class SysEqn >
void LbBndCndDxQy< nDim, nDist, SysEqn >::calculateEqDistsWallSingleSpecies ( const MInt  pCellId)
inlineprotected

◆ calculateEqDistsWallSingleSpeciesThermal()

template<MInt nDim, MInt nDist, class SysEqn >
void LbBndCndDxQy< nDim, nDist, SysEqn >::calculateEqDistsWallSingleSpeciesThermal ( const MInt  pCellId,
MFloat  wT 
)
inlineprotected

◆ calculateEqDistsWallSingleSpeciesTransport()

template<MInt nDim, MInt nDist, class SysEqn >
void LbBndCndDxQy< nDim, nDist, SysEqn >::calculateEqDistsWallSingleSpeciesTransport ( const MInt  pCellId,
MFloat  wC 
)
inlineprotected

◆ calculateSublayerDistances()

template<MInt nDim, MInt nDist, class SysEqn >
void LbBndCndDxQy< nDim, nDist, SysEqn >::calculateSublayerDistances ( MInt  index)
private

◆ calculateWallDistances() [1/3]

void LbBndCndDxQy< 2, 9, maia::lb::LbSysEqnCompressible< 2, 9 > >::calculateWallDistances ( )
inlineprotectedvirtual

Reimplemented from LbBndCnd< nDim >.

Definition at line 1083 of file lbbndcnddxqy.cpp.

1083 {
1085}
void calculateWallDistances2D()

◆ calculateWallDistances() [2/3]

void LbBndCndDxQy< 2, 9, maia::lb::LbSysEqnIncompressible< 2, 9 > >::calculateWallDistances ( )
inlineprotectedvirtual

Reimplemented from LbBndCnd< nDim >.

Definition at line 1088 of file lbbndcnddxqy.cpp.

1088 {
1090}

◆ calculateWallDistances() [3/3]

template<MInt nDim, MInt nDist, class SysEqn >
void LbBndCndDxQy< nDim, nDist, SysEqn >::calculateWallDistances
inlineprotectedvirtual

This function is essential for the implementation of an improved bounce back scheme which can deal with arbitrary boundaries (i.e. the wall needn't be located halfway between the cell centers as with simple bounce back rule)

Reimplemented from LbBndCnd< nDim >.

Definition at line 311 of file lbbndcnddxqy.cpp.

311 {
312 TRACE();
313
314 m_log << " + Calculating wall distances..." << std::endl;
315 m_log << " - method: " << m_interpolationDistMethod << std::endl;
316 m_log << " - grid cut method: " << m_gridCutTest << std::endl;
317
318 // init the volumes
319 for(auto& i : m_bndCells) {
320 i.m_isFluid = false;
321 }
322
323 if(m_interpolationDistMethod == "sphere" || m_interpolationDistMethod == "circle") {
324 const MInt nDim_ = (m_interpolationDistMethod == "sphere") ? 3 : 2;
325 for(MInt i = 0; i < (MInt)m_bndCells.size(); i++) {
326 const MInt currentId = m_bndCells[i].m_cellId;
327
328 const MFloat cellHalfLength = m_solver->c_cellLengthAtLevel(m_solver->a_level(currentId) + 1);
329 const MFloat cellRadiusSq =
330 std::inner_product(&m_solver->a_coordinate(currentId, 0), &m_solver->a_coordinate(currentId, nDim_),
331 &m_solver->a_coordinate(currentId, 0), .0);
332
333 //--Determine whether cell center is inside of fluid or not---------------
334 // const MFloat radius = 0.5;
335 const MFloat radiusSq = 0.25;
336 m_bndCells[i].m_isFluid = (cellRadiusSq > radiusSq);
337
338 //--Calculate distance for each distribution------------------------------
339 // init distances
340 m_bndCells[i].m_distances.clear();
341 m_bndCells[i].m_distances.resize(IPOW3[nDim] - 1, 0.0);
342 for(MInt dist = 0; dist < nDist - 1; dist++) {
343 const MFloat dxSq = Ld::distType(dist) * 4.0 * cellHalfLength * cellHalfLength;
344
345 // Set distance to a large value...
346 m_bndCells[i].m_distances[dist] = std::numeric_limits<MFloat>::max();
347
348 // solve quadratic equation for q: R^2 = (x_cell + q*c_dist)^2
349 // if cell belongs to the wall q>1/2
350 // otherwise q<=1/2
351
352 MFloat qValue = 0.0; // normalized wall distance: q = distance between cell center and wall / dx
353 for(MInt j = 0; j < nDim_; j++) {
354 qValue -=
355 m_solver->a_coordinate(currentId, j) * ((MFloat)Ld::idFld(dist, j) - 1.0) * 2.0 * cellHalfLength / dxSq;
356 }
357
358 const MFloat tmpQValue = sqrt(qValue * qValue + (radiusSq - cellRadiusSq) / dxSq);
359
360 if(qValue + tmpQValue >= 0.0 && fabs(qValue + tmpQValue) <= 0.5) {
361 qValue += tmpQValue;
362 m_bndCells[i].m_distances[dist] = qValue;
363 }
364 if(qValue - tmpQValue >= 0.0 && fabs(qValue - tmpQValue) <= 0.5) {
365 qValue -= tmpQValue;
366 m_bndCells[i].m_distances[dist] = qValue;
367 }
368 }
369 }
370 }
371
372 else if(m_interpolationDistMethod == "perpOp" || m_interpolationDistMethod == "cylinder") {
373 // TODO labels:LB This method differs from the 2D and all other 3D variants, such
374 // that all inOutSegments boundaries are completely set to m_isFluid = false.
375 // In the other cases this is calculated, too, which may lead to confusion!
376
377 // find ids of non-periodic and non-inOutSegments (until now this is wall)
378 std::vector<MInt> wallIds;
379 for(MInt i = 0; i < (MInt)(m_bndCndSegIds.size()); i++) {
380 MBool is_periodic = false;
381 if(m_noPeriodicSegments != 0)
382 for(MInt j = 0; j < m_noPeriodicSegments; j++)
384 is_periodic = true;
385 break;
386 }
387
388 MBool is_inout = false;
389 for(MInt j = 0; j < m_noInOutSegments; j++)
391 is_inout = true;
392 break;
393 }
394
395 if(!is_periodic & !is_inout) wallIds.push_back(i);
396 }
397
398 if(wallIds.size() > 0) {
399 std::unordered_set<MInt> reconsider;
400
401 for(auto wallId : wallIds) {
402 m_log << " - BC " << m_bndCndIds[wallId] << std::endl;
403 m_log << " * number or cells: " << (m_bndCndOffsets[wallId + 1] - m_bndCndOffsets[wallId]) << std::endl;
404 m_log << " * segment id: " << m_bndCndSegIds[wallId] << std::endl;
405
406 for(MInt i = m_bndCndOffsets[wallId]; i < m_bndCndOffsets[wallId + 1]; i++) {
407 const MInt currentId = m_bndCells[i].m_cellId;
408
409 //--Calculate distance for each distribution--------------------------
410 const MFloat cellHalfLength = m_solver->c_cellLengthAtLevel(m_solver->a_level(currentId) + 1);
411
412 MFloat d[nDim], e[nDim];
413 MFloat target[2 * nDim];
414 for(MInt j = 0; j < nDim; j++) {
415 target[j] = m_solver->a_coordinate(currentId, j) - cellHalfLength;
416 target[j + nDim] = m_solver->a_coordinate(currentId, j) + cellHalfLength;
417
418 // Take cell center as first point of discrete velocity trajectories
419 d[j] = m_solver->a_coordinate(currentId, j);
420 }
421
422 // get all triangles in currentCell (target)
423 std::vector<MInt> nodeList;
424 m_solver->m_geometry->getIntersectionElements(target, nodeList, cellHalfLength,
425 &m_solver->a_coordinate(currentId, 0));
426
427 // init distances
428 m_bndCells[i].m_distances.clear();
429 m_bndCells[i].m_distances.resize(IPOW3[nDim] - 1, 0.0);
430
431 // run over all distributions and calculate distances
432 for(MInt dist = 0; dist < IPOW3[nDim] - 1; dist++) {
433 const MFloat dx = F2 * SQRT[Ld::distType(dist)] * cellHalfLength;
434
435 // Set distance to a large value...
436 m_bndCells[i].m_distances[dist] = std::numeric_limits<MFloat>::max();
437
438 // Construct second point of discrete velocity trajectories
439 for(MInt j = 0; j < nDim; j++)
440 e[j] = d[j] + ((MFloat)Ld::idFld(dist, j) - 1.0) * cellHalfLength;
441
442 MFloat targetsmall[2 * nDim];
443 for(MInt k = 0; k < nDim; k++) {
444 targetsmall[k] = d[k];
445 targetsmall[k + nDim] = e[k];
446 }
447
448 MFloat min_dist;
449 MBool has_cut = m_solver->m_geometry->getClosestLineIntersectionLength(m_bndCndIds[wallId], nodeList,
450 targetsmall, &min_dist);
451 if(has_cut)
452 m_bndCells[i].m_distances[dist] =
453 min_dist / dx; // normalized wall distance: q = distance between cell center and wall / dx
454 else
455 m_bndCells[i].m_distances[dist] = 1.0;
456 }
457
458 //--Determine whether cell center is inside of fluid or not-----------
459 // In the following the state (fluid/solid) of each boundary cell is
460 // detected based on the state of the neighboring cells being located
461 // in direction of a cut.
462 m_bndCells[i].m_isFluid = false;
463 MBool hasBndryCutNghbr = false;
464 MBool hasNoCutNghbr = false;
465 MBool hasFluidCutNghbr = false;
466 for(MInt dist = 0; dist < IPOW3[nDim] - 1; dist++) {
467 if(m_bndCells[i].m_distances[dist] < 1.0) {
468 if(m_solver->a_hasNeighbor(currentId, dist)) {
469 const MInt nghId = m_solver->c_neighborId(currentId, dist);
470 if(m_solver->a_isBndryCell(nghId)) {
471 hasBndryCutNghbr = true;
472 } else {
473 // In case of any non-boundary cut neighbor, the state is
474 // directly definable (it is non-fluid) -> break
475 hasFluidCutNghbr = true;
476 break;
477 }
478 } else {
479 // Having no cut neighbor does not directly specify the state.
480 // In case of intersecting boundaries a neighbor can be missing
481 // for fluid as well as for non-fluid state.
482 hasNoCutNghbr = true;
483 }
484 }
485 }
486 if(hasFluidCutNghbr)
487 m_bndCells[i].m_isFluid = false;
488 else if(hasBndryCutNghbr)
489 reconsider.insert(i);
490 else if(hasNoCutNghbr)
491 m_bndCells[i].m_isFluid = true;
492 // else :
493 // In this case something must have gone wrong previously. A cut with
494 // an existing nghbr, which is neither a boundary nor simple fluid
495 // cells is new to my knowledge.
496 }
497 }
498 // Boundary cells that only have cut-neighbors which are boundary cells,
499 // too, need to be reconsidered. This might has to be done multiple times
500 // until the state of at least one neighbor is known for each reconsidered
501 // cell.
502 MUint reconsiderSize = 0;
503 while(reconsiderSize != reconsider.size()) {
504 reconsiderSize = reconsider.size();
505 m_log << " - number of cells to reconsider: " << reconsiderSize << std::endl;
506 auto r = reconsider.begin();
507 while(r != reconsider.end()) {
508 const MInt cellId = m_bndCells[*r].m_cellId;
509 MBool chk = false;
510 for(MInt dist = 0; dist < IPOW3[nDim] - 1; dist++) {
511 if(m_bndCells[*r].m_distances[dist] < 1.0 && m_solver->a_hasNeighbor(cellId, dist)) {
512 const MInt nghId = m_solver->c_neighborId(cellId, dist);
513 if(m_solver->a_isBndryCell(nghId)) {
514 const MInt bndIdNeigh = m_solver->a_bndId(nghId);
515 if(reconsider.find(bndIdNeigh) == reconsider.end()) {
516 // only one cut between cellId and nghId
517 if(approx(m_bndCells[bndIdNeigh].m_distances[Ld::oppositeDist(dist)], 1.0, MFloatEps)) {
518 m_bndCells[*r].m_isFluid = !m_bndCells[bndIdNeigh].m_isFluid; // cellId has opposite state of nghId
519 chk = true;
520 break;
521 }
522 }
523 }
524 }
525 }
526 if(chk)
527 reconsider.erase(r++);
528 else
529 r++;
530 }
531 }
532 }
533
534 // analytical correction of wall distance for unit cylinder aligned with origin z-axis
535 if(m_interpolationDistMethod == "cylinder") {
536 // get correct ID
537 const MInt cylinderBcId = Context::getSolverProperty<MInt>("cylinderBcId", m_solverId, AT_);
538 MInt cylinderId = -1;
539 for(MInt i = 0; i < (MInt)(m_bndCndIds.size()); i++) {
540 if(m_bndCndIds[i] == cylinderBcId) {
541 cylinderId = i;
542 break;
543 }
544 }
545 if(cylinderId != -1) {
546 const MFloat radius = 0.5;
547 const MFloat radiusSqr = radius * radius;
548
549 for(MInt i = m_bndCndOffsets[cylinderId]; i < m_bndCndOffsets[cylinderId + 1]; i++) {
550 const MInt currentId = m_bndCells[i].m_cellId;
551
552 const MFloat cellHalfLength = m_solver->c_cellLengthAtLevel(m_solver->a_level(currentId) + 1);
553
554 const MFloat cellRadiusSq = m_solver->a_coordinate(currentId, 0) * m_solver->a_coordinate(currentId, 0)
555 + m_solver->a_coordinate(currentId, 1) * m_solver->a_coordinate(currentId, 1);
556
557 //--Determine whether cell center is inside of fluid or not---------------
558 m_bndCells[i].m_isFluid = cellRadiusSq > radiusSqr;
559
560 //--Calculate distance for each distribution------------------------------
561 // init distances
562 m_bndCells[i].m_distances.clear();
563 m_bndCells[i].m_distances.resize(IPOW3[nDim] - 1, 0.0);
564 for(MInt dist = 0; dist < nDist - 1; dist++) {
565 MFloat dx;
566 if(dist < 6)
567 dx = F2 * cellHalfLength;
568 else if(dist < 18)
569 dx = SQRT2 * F2 * cellHalfLength;
570 else
571 dx = SQRT3 * F2 * cellHalfLength;
572 const MFloat dxSqr = dx * dx;
573
574 // Set distance to a large value...
575 m_bndCells[i].m_distances[dist] = std::numeric_limits<MFloat>::max();
576
577 // solve quadratic equation for q: R^2 = (x_cell + q*c_dist)^2
578 // if cell belongs to the wall q>1/2
579 // otherwise q<=1/2
580
581 MFloat qValue = 0.0; // normalized wall distance: q = distance between cell center and wall / dx
582 const MInt nDim_cyl = 2; // only consider x and y coordinates
583 for(MInt j = 0; j < nDim_cyl; j++) {
584 qValue -= m_solver->a_coordinate(currentId, j) * ((MFloat)Ld::idFld(dist, j) - 1.0) * 2.0 * cellHalfLength
585 / dxSqr;
586 }
587
588 const MFloat tmpQValue = sqrt(qValue * qValue - (cellRadiusSq - radiusSqr) / dxSqr);
589
590 if(qValue + tmpQValue >= 0.0 && fabs(qValue + tmpQValue) <= 0.5) {
591 m_bndCells[i].m_distances[dist] = qValue + tmpQValue;
592 } else if(qValue - tmpQValue >= 0.0 && fabs(qValue - tmpQValue) <= 0.5) {
593 m_bndCells[i].m_distances[dist] = qValue - tmpQValue;
594 }
595 }
596 }
597 }
598 }
599 }
600
601 // distance determination for x-oriented pipe
602 else if(m_interpolationDistMethod == "pipe") {
603 }
604
605 else if(m_interpolationDistMethod == "STD") {
606 //--I./II. find cut distance in bounding box of 2*dx---------------------------
607 constexpr MFloat relEps = 1e-16;
608 const MFloat eps = relEps * m_solver->c_cellLengthAtLevel(m_solver->maxLevel());
609 auto getInsideOutsideAndDistances = [&](const MInt i, const MInt index) {
610 auto& bndCell = m_bndCells[i];
611 const MInt currentId = bndCell.m_cellId;
612 //--I. in-/outside check--------------------------------------------------
613 bndCell.m_isFluid = !(m_solver->m_geometry->pointIsInside2(&m_solver->a_coordinate(currentId, 0)));
614 //--determine distances for each bndry cell's distribution--------------
615 // get all triangles that intersect currentId
616 const MFloat cellLength = m_solver->c_cellLengthAtLevel(m_solver->a_level(currentId));
617 // A fluid cell searches for the closest cut, whereas a solid one searches
618 // largest cut distance.
619 // This assures that in case of multiple cuts between solid-fluid bndCells
620 // both find the same cut closest to the fluid region. If q > 0.5 for the
621 // fluid cell and a nghbr solid cell is existing, the cut from the fluid
622 // is removed to avoid multiple execution.
623 // In case of multiple cuts between solid-solid bndCells (p.e.thin gap)
624 // this results in q > 0.5 for both cells.
625 const MFloat bbHalfLenght = cellLength;
626 MFloat target[2 * nDim]; // bounding box of the currentId
627 MFloat d[nDim]; // starting point of each ray
628 for(MInt j = 0; j < nDim; j++) {
629 target[j] = m_solver->a_coordinate(currentId, j) - bbHalfLenght;
630 target[j + nDim] = m_solver->a_coordinate(currentId, j) + bbHalfLenght;
631 d[j] = m_solver->a_coordinate(currentId, j);
632 }
633 std::vector<MInt> nodeList;
634 if(m_gridCutTest == "SAT")
635 m_solver->m_geometry->getIntersectionElements(target, nodeList, bbHalfLenght,
636 &m_solver->a_coordinate(currentId, 0));
637 else
638 m_solver->m_geometry->getIntersectionElements(target, nodeList);
639 // init distances
640 bndCell.m_distances.clear();
641 bndCell.m_distances.resize(IPOW3[nDim] - 1, 0.0);
642 // Loop over each distribution
643 for(MInt dist = 0; dist < nDist - 1; dist++) {
644 // smallest cut distance:
645 MFloat e[nDim]; // end point of current ray
646 for(MInt j = 0; j < nDim; j++) {
647 e[j] = d[j] + ((MFloat)Ld::idFld(dist, j) - 1.0) * bbHalfLenght;
648 }
649 MFloat trgDistance =
650 (bndCell.m_isFluid) ? std::numeric_limits<MFloat>::max() : std::numeric_limits<MFloat>::lowest();
651 MInt trgNodeId = -1;
652 for(MInt n = 0; n < (signed)nodeList.size(); n++) {
653 MFloat distance = 0.0;
654 MFloat** const v = m_solver->m_geometry->elements[nodeList[n]].m_vertices;
655 // TODO labels:LB D2Qx: use getLineTriangleIntersectionSimpleDistance
656 // alternativ that is working for 2D.
657 const MBool hasCut =
658 m_solver->m_geometry->getLineTriangleIntersectionSimpleDistance(d, e, v[0], v[1], v[2], &distance);
659 if(hasCut) {
660 distance = (distance < 0.0) ? 0.0 : distance;
661 // With the following it shall be assured, that the closest
662 // distance is found. Within a tolerance eps the bndry Id
663 // belonging to the currentId is preferred.
664 if(fabs(distance - trgDistance) < eps) {
665 if(m_solver->m_geometry->elements[nodeList[n]].m_bndCndId == m_bndCndIds[index]) {
666 trgDistance = distance;
667 trgNodeId = n;
668 }
669 } else if((bndCell.m_isFluid && distance < trgDistance) || // Choose smallest distance for fluid cell
670 (!bndCell.m_isFluid && distance > trgDistance) // Choose largest distance for solid cell
671 ) {
672 trgDistance = distance;
673 trgNodeId = n;
674 }
675 }
676 }
677 if(trgNodeId > -1 && m_solver->m_geometry->elements[nodeList[trgNodeId]].m_bndCndId == m_bndCndIds[index]) {
678 const MFloat dx = SQRT[Ld::distType(dist)] * cellLength;
679 bndCell.m_distances[dist] = trgDistance / dx;
681 m_distIntersectionElementId[currentId][dist] = nodeList[trgNodeId];
682 }
683 } else {
684 bndCell.m_distances[dist] = std::numeric_limits<MFloat>::max();
685 }
686 }
687 // // << DBG
688 // std::stringstream ss;
689 // constexpr MInt dbgGlobalId = 132150;
690 // //constexpr MInt dbgGlobalId2 = 131454; // in dir 22
691 // constexpr MInt dbgGlobalId2 = 37446; // in dir 21
692 // if( m_solver->c_globalId(currentId) == dbgGlobalId ||
693 // m_solver->c_globalId(currentId) == dbgGlobalId2
694 // ) {
695 // MInt dbgId = currentId;
696 // ss << "DBG: " << m_solver->c_globalId(dbgId) << ", " << bndCell.m_isFluid << ", "
697 // << m_solver->a_isHalo(dbgId) << std::endl;
698 // ss << "DBG: nghbrStates:" << std::endl;
699 // for(MInt z = 0; z < nDist; z++) {
700 // ss << " " << z << " : ";
701 // ss << bndCell.m_distances[z] << ", ";
702 // const MBool chk = m_solver->a_hasNeighbor(dbgId, z);
703 // const MInt nghbrId = chk ? m_solver->c_neighborId(dbgId, z) : -1;
704 // ss << m_solver->c_globalId(nghbrId) << ", ";
705 // if(chk)
706 // ss << m_solver->a_isBndryCell(nghbrId) << ", " << m_solver->a_isHalo(nghbrId);
707 // else
708 // ss << "nan"
709 // << " nan";
710 // ss << std::endl;
711 // }
712 // std::cout << ss.str();
713 // }
714 // // DBG >>
715 };
716
717 for(MInt index = 0; index < (MInt)m_bndCndSegIds.size(); index++) {
718 for(MInt i = m_bndCndOffsets[index]; i < m_bndCndOffsets[index + 1]; i++) {
719 getInsideOutsideAndDistances(i, index);
720 }
721 }
722 //--III. check for fluid split cells: appending new m_bndCells--------------
723 const MInt oldNumberOfBndCells = m_bndCells.size();
724 MBool needResorting = false;
725 for(MInt i = 0; i < oldNumberOfBndCells; i++) {
726 if(m_bndCells[i].m_isFluid) {
727 const MInt currentId = m_bndCells[i].m_cellId;
728 for(MInt j = 0; j < nDist - 1; j++) {
729 if(m_bndCells[i].m_distances[j] > 0.5) continue;
730 if(!m_solver->a_hasNeighbor(currentId, j)) continue;
731 const MInt nghbrId = m_solver->c_neighborId(currentId, j);
732 // TODO labels:LB miro: halo cell is inactive
733 if(m_solver->a_isBndryCell(nghbrId) || !m_solver->a_isActive(nghbrId) || m_solver->a_isHalo(nghbrId))
734 continue;
735 // add new boundary cell
736 needResorting = true;
737 m_bndCells.emplace_back();
738 auto& newBndCell = m_bndCells.back();
739 newBndCell.m_cellId = nghbrId;
740 newBndCell.m_isFluid = true;
741 newBndCell.m_segmentId.push_back(m_bndCells[i].m_segmentId[0]);
742 newBndCell.m_bndCndId.push_back(m_bndCells[i].m_bndCndId[0]);
743 m_solver->a_isBndryCell(nghbrId) = true;
744 // Determine in-/outside and cuts for new cells (All cuts will be
745 // q > 0.5, but at least some will be q < 1.0 )
746 const MInt index = this->m_mapBndCndSegId2Index[m_bndCells[i].m_segmentId[0]];
747 const MInt newBndCellId = m_bndCells.size() - 1;
748 getInsideOutsideAndDistances(newBndCellId, index);
749 // Remove cuts if neighbor is solid boundary cell to avoid double execution
750 for(MInt dist = 0; dist < nDist - 1; dist++) {
751 if(newBndCell.m_distances[dist] < 1.0) {
752 if(m_solver->a_hasNeighbor(nghbrId, dist)) {
753 const MInt nghbrId2 = m_solver->c_neighborId(nghbrId, dist);
754 if(m_solver->a_isBndryCell(nghbrId2)) {
755 const MInt nghbrBndId2 = m_solver->a_bndId(nghbrId2);
756 if(m_bndCells[nghbrBndId2].m_isFluid == false) {
757 newBndCell.m_distances[dist] = std::numeric_limits<MFloat>::max();
758 }
759 }
760 }
761 }
762 }
763 }
764 }
765 }
766 //--IV. sort boundary cells if split cells are found------------------------
767 if(needResorting) {
768 m_log << " ## redoing sortBoundaryCells" << std::endl;
769 this->sortBoundaryCells();
770 m_log << " redoing sortBoundaryCells ## " << std::endl;
771 }
772 //--V. Correct double execution by solid-fluid------------------------------
773 const MInt newNumberOfBndCells = m_bndCells.size();
774 maia::parallelFor(0, newNumberOfBndCells, [&](MInt i) {
775 auto& bndCell = m_bndCells[i];
776 const MInt currentId = bndCell.m_cellId;
777 if(bndCell.m_isFluid) { // fluid
778 for(MInt j = 0; j < nDist - 1; j++) {
779 const MInt opp = Ld::oppositeDist(j);
780 const MBool cutj = bndCell.m_distances[j] < 1.0;
781 const MBool cutopp = bndCell.m_distances[opp] < 1.0;
782 // j
783 if(cutj) {
784 // perform simple bounce back if cut in opposite directions
785 if(bndCell.m_distances[j] <= 0.5) {
786 if(cutopp) bndCell.m_distances[j] = 0.5;
787 }
788 // remove cut, if solid neighbor to avoid multiple execution
789 else { // 0.5 < q < 1.0
790 if(m_solver->a_hasNeighbor(currentId, j)) {
791 const MInt nghbrId = m_solver->c_neighborId(currentId, j);
792 if(m_solver->a_isBndryCell(nghbrId)) {
793 if(m_bndCells[m_solver->a_bndId(nghbrId)].m_isFluid == false) {
794 bndCell.m_distances[j] = std::numeric_limits<MFloat>::max();
795 }
796 }
797 }
798 }
799 }
800 // opp
801 if(cutopp) {
802 // perform simple bounce back if cut in opposite directions
803 if(bndCell.m_distances[opp] <= 0.5) {
804 if(cutj) bndCell.m_distances[opp] = 0.5;
805 }
806 // remove cut, if solid neighbor to avoid multiple execution
807 else { // 0.5 < q < 1.0
808 if(m_solver->a_hasNeighbor(currentId, opp)) {
809 const MInt nghbrId = m_solver->c_neighborId(currentId, opp);
810 if(m_solver->a_isBndryCell(nghbrId)) {
811 if(m_bndCells[m_solver->a_bndId(nghbrId)].m_isFluid == false) {
812 bndCell.m_distances[opp] = std::numeric_limits<MFloat>::max();
813 }
814 }
815 }
816 }
817 }
818 }
819 } else { // solid
820 // remove cuts in direction of other solid boundary cell
821 for(MInt j = 0; j < nDist - 1; j++) {
822 if(bndCell.m_distances[j] < 0.5) {
823 if(m_solver->a_hasNeighbor(currentId, j)) {
824 const MInt nghbrId = m_solver->c_neighborId(currentId, j);
825 if(m_solver->a_isBndryCell(nghbrId)) {
826 if(m_bndCells[m_solver->a_bndId(nghbrId)].m_isFluid == false) {
827 bndCell.m_distances[j] = std::numeric_limits<MFloat>::max();
828 }
829 }
830 }
831 }
832 }
833 }
834 });
835 }
836 // Dump out distance field and inside outside state
838 std::stringstream fileName;
839 fileName << m_solver->restartDir() << "lbDistanceField" << m_solver->getIdentifier() << ParallelIo::fileExt();
840 ParallelIo parallelIo(fileName.str(), maia::parallel_io::PIO_REPLACE, m_solver->mpiComm());
841 //--define global attributes
842 parallelIo.setAttribute(m_solver->solverId(), "solverId");
843 parallelIo.setAttribute(m_solver->gridInputFileName(), "gridFile", "");
844 //--define arrays
845 const MPI_Offset firstGlobalId = m_solver->domainOffset(m_solver->domainId());
846 const MPI_Offset localNoCells = m_solver->noInternalCells();
847 parallelIo.setOffset(localNoCells, firstGlobalId);
848 addWallDistanceFieldToOutputFile(parallelIo, true, false);
849 addWallDistanceFieldToOutputFile(parallelIo, false, true);
851 }
852}
void addWallDistanceFieldToOutputFile(ParallelIo &parallelIo, const MBool writeHeader, const MBool writeData) override
MInt * m_inOutSegmentsIds
Definition: lbbndcnd.h:91
MInt m_noPeriodicSegments
Definition: lbbndcnd.h:87
std::vector< MInt > m_bndCndIds
Definition: lbbndcnd.h:158
MString m_gridCutTest
Definition: lbbndcnd.h:132
MInt m_noInOutSegments
Definition: lbbndcnd.h:86
std::vector< MInt > m_bndCndSegIds
Definition: lbbndcnd.h:160
MBool m_outputWallDistanceField
Definition: lbbndcnd.h:114
std::vector< MInt > m_mapBndCndSegId2Index
Definition: lbbndcnd.h:162
void sortBoundaryCells()
This function sorts the boundary cells according to the BC id.
Definition: lbbndcnd.cpp:1702
std::vector< MInt > m_bndCndOffsets
Definition: lbbndcnd.h:159
MInt m_solverId
index of the array where the boundary conditions are stored in
Definition: lbbndcnd.h:129
MInt * m_periodicSegmentsIds
Definition: lbbndcnd.h:92
MString m_interpolationDistMethod
Definition: lbbndcnd.h:113
MBool approx(const T &, const U &, const T)
Definition: functions.h:272
uint32_t MUint
Definition: maiatypes.h:63
double MFloat
Definition: maiatypes.h:52
bool MBool
Definition: maiatypes.h:58
void const MInt cellId
Definition: collector.h:239
IdType index(const FloatType *const x, const IdType level)
Return Hilbert index for given location and level in 2D or 3D.
Definition: hilbert.h:165
const MInt PIO_REPLACE
Definition: parallelio.h:36
void parallelFor(MInt begin, MInt end, UnaryFunction &&f)
Wrapper function for parallel for loop.
Definition: parallelfor.h:147
PARALLELIO_DEFAULT_BACKEND ParallelIo
Definition: parallelio.h:292
static constexpr MInt idFld(MInt i, MInt j)
static constexpr MInt oppositeDist(MInt i)
static constexpr MInt distType(MInt i)
Type of the distribution (0:rest, 1:face, 2:edge, 3:corner)

◆ calculateWallDistances2D()

template<MInt nDim_, MInt nDist_, class SysEqn >
void LbBndCndDxQy< nDim_, nDist_, SysEqn >::calculateWallDistances2D
inlineprotected

Definition at line 857 of file lbbndcnddxqy.cpp.

857 {
858 TRACE();
859
860 constexpr MInt nDim = 2;
861 constexpr MInt nDist = 9;
862 // init the volumes
863 for(MInt i = 0; i < (MInt)m_bndCells.size(); i++) {
864 m_bndCells[i].m_isFluid = false;
865 }
866
867 if(m_interpolationDistMethod == "perpOp") {
868 MBool triangleIntersection;
869 MFloat target[6] = {0, 0, 0, 2, 2, 4};
870 MFloat cellHalfLength = 0.0;
871 MFloat currentDistance = 0;
872 // MFloat dxB2;
873
874 MFloat a[2]; // point in plane
875 MFloat b[2]; // point in plane
876 MFloat c[2]; // start of piercing edge
877 MFloat d[2]; // end of piercing edge
878 MFloat s2, gamma; // s1; For pierce point calculation
879 // MFloat pP[2]; uncomment for piercePoint calculation
880
881 // find ids of non-periodic and non-inOutSegments (until now this is wall)
882 std::vector<MInt> wallIds;
883 for(MInt i = 0; i < (MInt)(m_bndCndSegIds.size()); i++) {
884 MBool is_periodic = false;
885 if(m_noPeriodicSegments != 0)
886 for(MInt j = 0; j < m_noPeriodicSegments; j++)
888 is_periodic = true;
889 break;
890 }
891
892 MBool is_inout = false;
893 for(MInt j = 0; j < m_noInOutSegments; j++)
895 is_inout = true;
896 break;
897 }
898
899 if(!is_periodic & !is_inout) wallIds.push_back(i);
900 }
901
902 for(auto wallId : wallIds) {
903 for(MInt i = m_bndCndOffsets[wallId]; i < m_bndCndOffsets[wallId + 1]; i++) {
904 const MInt currentId = m_bndCells[i].m_cellId;
905
906 //--Determine whether cell center is inside of fluid or not-------------
907 // TODO labels:LB,toenhance dxqy: this does not conform with 3D yet ! Should be adapted
908 if(m_solver->m_geometry->pointIsInside(&m_solver->a_coordinate(currentId, 0))) {
909 // m_log << " BndCell " << i << " [" << currentId << "] is inside geometry. " << std::endl;
910 m_bndCells[i].m_isFluid = false;
911 } else {
912 // m_log << " BndCell " << i << " [" << currentId << "] is outside geometry. " << std::endl;
913 m_bndCells[i].m_isFluid = true;
914 }
915
916 //--Calculate distance for each distribution---------------------------
917 // init distances
918 m_bndCells[i].m_distances.clear();
919 m_bndCells[i].m_distances.resize(IPOW3[nDim] - 1, 0.0);
920
921 // Define corners of current cell in target
922 for(MInt j = 0; j < nDim; j++) {
923 cellHalfLength = m_solver->c_cellLengthAtLevel(m_solver->a_level(currentId) + 1);
924 target[j] = m_solver->a_coordinate(currentId, j) - cellHalfLength;
925 target[j + nDim] = m_solver->a_coordinate(currentId, j) + cellHalfLength;
926
927 // Take cell center as first point of discrete velocity trajectories
928 c[j] = m_solver->a_coordinate(currentId, j);
929 }
930
931 // get all triangles in currentCell (target)
932 std::vector<MInt> nodeList;
933 if(m_gridCutTest == "SAT")
934 m_solver->m_geometry->getIntersectionElements(target, nodeList, cellHalfLength,
935 &m_solver->a_coordinate(currentId, 0));
936 else
937 m_solver->m_geometry->getIntersectionElements(target, nodeList);
938
939 triangleIntersection = false;
940 for(MInt dist = 0; dist < 8; dist++) {
941 // Set distance to a large value...
942 m_bndCells[i].m_distances[dist] = m_solver->c_cellLengthAtLevel(0);
943 // if(dist < 4)
944 // dxB2 = cellHalfLength;
945 // else
946 // dxB2 = SQRT2 * cellHalfLength;
947
948 // Construct second point of discrete velocity trajectories
949 for(MInt j = 0; j < nDim; j++) {
950 d[j] = c[j] + ((MFloat)Ld::idFld(dist, j) - 1.0) * cellHalfLength;
951 }
952 currentDistance = 1;
953 m_bndCells[i].m_distances[dist] = currentDistance;
954 // Check for intersection with discrete velocity trajectories
955 for(MInt n = 0; n < (signed)nodeList.size(); n++) {
956 if(m_solver->m_geometry->elements[nodeList[n]].m_bndCndId != m_bndCndIds[wallId]) continue;
957 if(m_solver->m_geometry->edgeTriangleIntersection(m_solver->m_geometry->elements[nodeList[n]].m_vertices[0],
958 m_solver->m_geometry->elements[nodeList[n]].m_vertices[1],
959 0, c, d)) {
960 triangleIntersection = true;
961 // Calculate Distance
962 for(MInt k = 0; k < nDim; k++) {
963 a[k] = m_solver->m_geometry->elements[nodeList[n]].m_vertices[0][k];
964 b[k] = m_solver->m_geometry->elements[nodeList[n]].m_vertices[1][k];
965 // d and e are already set
966 }
967 gamma = (b[0] - a[0]) * (c[1] - d[1]) - (c[0] - d[0]) * (b[1] - a[1]);
968
969 // s1 = ((c[0]-d[0]) * (a[1]-c[1]) - (c[1]-d[1])*(a[0]-c[0])) / gamma;
970
971
972 s2 = ((b[0] - a[0]) * (c[1] - a[1]) - (c[0] - a[0]) * (b[1] - a[1])) / gamma;
973
974 // 1. b Pierce point pP in plane j:
975 /*for (MInt k = 0; k < nDim; k++){
976 if(s1*s1 < s2*s2)
977 pP[k] = c[k] + s2 * ( d[k] - c[k] );
978 else
979 pP[k] = a[k] + s1 * ( b[k] - a[k] );
980 }*/
981 // Take only the magnitude !
982 if(s2 < 0.0) s2 = -s2;
983
984 if(s2 > 1.0) continue;
985
986 currentDistance = s2 * F1B2;
987 // Take shortest distance
988 m_bndCells[i].m_distances[dist] = (currentDistance < m_bndCells[i].m_distances[dist])
989 ? currentDistance
991
992 // see pierce point calculation in geometry.cpp
993 }
994 }
995 }
996 if(!triangleIntersection) {
997 m_log << " BndCell[" << i << "] has no triangle intersection!" << std::endl;
998 }
999 }
1000 }
1001 }
1002
1003 else if(m_interpolationDistMethod == "circle") {
1004 MFloat radius = 0.5;
1005 MFloat x = 0.0;
1006 MFloat y = 0.0;
1007 std::cout << "Prescribe analytic circle with radius: " << radius << ", x:" << x << ", y:" << y << std::endl;
1008
1009 MFloat cellHalfLength, cellRadiusSq, dxB2, dxSq;
1010 MInt currentId;
1011
1012 // Loop over m_bndCells
1013 for(MInt i = 0; i < (MInt)m_bndCells.size(); i++) {
1014 currentId = m_bndCells[i].m_cellId;
1015 cellHalfLength = m_solver->grid().cellLengthAtLevel(m_solver->a_level(currentId) + 1);
1016 cellRadiusSq = (m_solver->a_coordinate(currentId, 0) - x) * (m_solver->a_coordinate(currentId, 0) - x)
1017 + (m_solver->a_coordinate(currentId, 1) - y) * (m_solver->a_coordinate(currentId, 1) - y);
1018
1019 // Mark cells as in- or outside the wall.
1020 if(cellRadiusSq <= radius * radius) {
1021 m_bndCells[i].m_isFluid = false; // cell is not inside fluid
1022 } else {
1023 m_bndCells[i].m_isFluid = true; // cell belongs to fluid
1024 }
1025
1026 // Prescribe distance to wall for every PPDF
1027 m_bndCells[i].m_distances.clear();
1028 m_bndCells[i].m_distances.resize(IPOW3[nDim] - 1, 0.0);
1029 for(MInt dist = 0; dist < nDist - 1; dist++) {
1030 // Set distance to a large valule
1031 m_bndCells[i].m_distances[dist] = m_solver->grid().cellLengthAtLevel(0);
1032
1033 // Compute squared length and length for each direction
1034 if(dist < 4) {
1035 dxSq = 4.0 * cellHalfLength * cellHalfLength;
1036 dxB2 = cellHalfLength;
1037 } else {
1038 dxSq = 2.0 * 2.0 * cellHalfLength * cellHalfLength; // Diagonal directions
1039 dxB2 = SQRT2 * cellHalfLength;
1040 }
1041
1042 // Intersection circle directions delivers quadratic equation:
1043 // d: lenght cell center -- cut
1044 // a: x-component of d
1045 // b: y-component of d
1046 // cx: x-coord of cell center
1047 // cy: y-coord of cell center
1048 // rc: radius of cell center
1049 // 3 cases: 1) diagonal: a=b 2) horizontal a=d,b=0 3) vertikal: b=d,a=0
1050 // E.g. for diagonal case
1051 // d = 1/sqrt(2)(cx+cy)+-sqrt((1/sqrt(2)(cx+cy))^2-rc^2+r^2)
1052 // with p1 = 1/sqrt(2)(cx+cy) this can be generalized for all 3 cases
1053 // d = p1+-sqrt(p1^2+r^2-rc^2) = p1+-p2 e.g. p=cx for dir 0.
1054 // Finally, d is computed normalized as q=d/cellLength_of_direction
1055 MFloat p1 = 0;
1056 MFloat p2 = 0;
1057 for(MInt j = 0; j < nDim; j++) {
1058 p1 -= m_solver->a_coordinate(currentId, j) * (Ld::idFld(dist, j) - 1.0) * 2.0 * cellHalfLength / dxSq;
1059 }
1060 p2 = sqrt(p1 * p1 + (radius * radius - cellRadiusSq) / dxSq);
1061
1062 // Quadratic equation has two solutions. Either q>1/2 or q<=1/2 is correct.
1063 if(p1 + p2 >= 0.0 && fabs(p1 + p2) <= 0.5) {
1064 // In d2q9, the not normalized wall distance is stored
1065 m_bndCells[i].m_distances[dist] = (p1 + p2) * 2.0 * dxB2;
1066 }
1067 if(p1 - p2 >= 0.0 && fabs(p1 - p2) <= 0.5) {
1068 m_bndCells[i].m_distances[dist] = (p1 - p2) * 2.0 * dxB2;
1069 }
1070 }
1071 }
1072 }
1073
1074 else {
1075 std::stringstream ss;
1076 ss << "ERROR: Unknown interpolationDistMethod: " << m_interpolationDistMethod << std::endl;
1077 m_log << ss.str();
1078 TERMM(1, ss.str());
1079 }
1080}
Definition: contexttypes.h:19
define array structures

◆ calculateWallForces()

template<MInt nDim, MInt nDist, class SysEqn >
void LbBndCndDxQy< nDim, nDist, SysEqn >::calculateWallForces ( MInt  index)
protected

◆ calculateWallForcesMb()

template<MInt nDim, MInt nDist, class SysEqn >
void LbBndCndDxQy< nDim, nDist, SysEqn >::calculateWallForcesMb ( MInt  set)
protected

◆ calculateWallInterface()

template<MInt nDim, MInt nDist, class SysEqn >
void LbBndCndDxQy< nDim, nDist, SysEqn >::calculateWallInterface ( MInt  cellId,
MFloat wallConc,
MFloat wallTemp 
)
inlineprivate

◆ charPressure()

template<MInt nDim, MInt nDist, class SysEqn >
void LbBndCndDxQy< nDim, nDist, SysEqn >::charPressure ( MInt  index,
MInt  direction 
)
protected

◆ charPressure2()

template<MInt nDim, MInt nDist, class SysEqn >
void LbBndCndDxQy< nDim, nDist, SysEqn >::charPressure2 ( MInt  index,
MInt  direction 
)
protected

◆ charVelocity()

template<MInt nDim, MInt nDist, class SysEqn >
void LbBndCndDxQy< nDim, nDist, SysEqn >::charVelocity ( MInt  index,
MInt  direction 
)
protected

◆ dnt()

template<MInt nDim, MInt nDist, class SysEqn >
void LbBndCndDxQy< nDim, nDist, SysEqn >::dnt ( MInt  index,
MInt  direction 
)
protected

◆ extrapolateVariable()

template<MInt nDim, MInt nDist, class SysEqn >
void LbBndCndDxQy< nDim, nDist, SysEqn >::extrapolateVariable ( const MInt  index,
const MInt  pCellId,
const MInt  var,
MFloat *const  p_var 
)
inlineprotected

◆ extrapolateVelocities()

template<MInt nDim, MInt nDist, class SysEqn >
void LbBndCndDxQy< nDim, nDist, SysEqn >::extrapolateVelocities ( MInt  index,
const MInt  pCellId,
MFloat l_uu 
)
inlineprotected

◆ extrapolateVelocitiesMb()

template<MInt nDim, MInt nDist, class SysEqn >
void LbBndCndDxQy< nDim, nDist, SysEqn >::extrapolateVelocitiesMb ( )

◆ firstMomentSourceTerm()

template<MInt nDim, MInt nDist, class SysEqn >
MFloat LbBndCndDxQy< nDim, nDist, SysEqn >::firstMomentSourceTerm ( const MFloat *const  uW,
const MFloat  rho,
const MInt  dist 
)
inlineprotected

Attention: This term corresponds to the 'compressible' formulation of the equilibirum distribution

Author
Julian Vorspohl j.vor.nosp@m.spoh.nosp@m.l@aia.nosp@m..rwt.nosp@m.h-aac.nosp@m.hen..nosp@m.de
Parameters
[in]uWBoundary velocity
[in]rhoFluid density at boundary
[in]distDistribution to be set by the bounce back scheme

/returns Momentum source term

Definition at line 1931 of file lbbndcnddxqy.cpp.

1932 {
1933#ifdef WAR_NVHPC_PSTL
1934 MFloat ppdfDir[nDim] = {F0};
1935 for(MInt d = 0; d < nDim; d++) {
1936 ppdfDir[d] = m_solver->m_ppdfDir[dist * nDim + d];
1937 }
1938 const MFloat scalarProduct = std::inner_product(uW, uW + nDim, &ppdfDir[0], .0);
1939 const MFloat weight = m_solver->m_tp[m_solver->m_distType[dist]];
1940#else
1941 const MFloat scalarProduct = std::inner_product(uW, uW + nDim, lbDescriptor::ppdfDir<nDim>[dist], .0);
1942 const MFloat weight = Ld::tp(Ld::distType(dist));
1943#endif
1944
1945 return 2.0 * F1BCSsq * weight * rho * scalarProduct;
1946}
constexpr MFloat ppdfDir[POWX(3, D)][D]
Direction of motion of each PPDF, needed for bounce-back schemes.
MFloat scalarProduct(const MFloat *a, const MFloat *b, const MInt length)
Definition: lptlib.h:149
static constexpr MFloat tp(MInt i)

◆ getBoundaryTemperature()

template<MInt nDim, MInt nDist, class SysEqn >
MFloat LbBndCndDxQy< nDim, nDist, SysEqn >::getBoundaryTemperature ( const MInt  index)
inlineprotected
Author
Julian Vorspohl j.vor.nosp@m.spoh.nosp@m.l@aia.nosp@m..rwt.nosp@m.h-aac.nosp@m.hen..nosp@m.de
Parameters
[in]mbCellIdMoving boundary cell id
[out]uWBoundary velocity

Definition at line 1906 of file lbbndcnddxqy.cpp.

1906 {
1907 MFloat wT = m_solver->m_initTemperatureKelvin;
1908 for(MInt i = 0; i < m_lbNoHeatedWalls; i++) {
1909 if(m_segIdHeatedWalls[i] == m_bndCndSegIds[index]) {
1910 wT = m_lbWallTemperature[i];
1911 break;
1912 }
1913 }
1914 return wT;
1915}
MInt * m_segIdHeatedWalls
Definition: lbbndcnd.h:100
MInt m_lbNoHeatedWalls
Definition: lbbndcnd.h:99
MFloat * m_lbWallTemperature
Definition: lbbndcnd.h:101

◆ getBoundaryVelocity()

template<MInt nDim, MInt nDist, class SysEqn >
void LbBndCndDxQy< nDim, nDist, SysEqn >::getBoundaryVelocity ( const MInt  index,
MFloat uW 
)
inlineprotected
Author
Julian Vorspohl j.vor.nosp@m.spoh.nosp@m.l@aia.nosp@m..rwt.nosp@m.h-aac.nosp@m.hen..nosp@m.de
Parameters
[in]mbCellIdMoving boundary cell id
[out]uWBoundary velocity

Definition at line 1884 of file lbbndcnddxqy.cpp.

1884 {
1885 for(MInt d = 0; d < nDim; d++)
1886 uW[d] = F0;
1887 for(MInt i = 0; i < m_lbNoMovingWalls; i++) {
1888 if(m_segIdMovingWalls[i] == m_bndCndSegIds[index]) {
1889 for(MInt d = 0; d < nDim; d++) {
1890 uW[d] = m_lbWallVelocity[i * nDim + d];
1891 }
1892 break;
1893 }
1894 }
1895}
MInt m_lbNoMovingWalls
Definition: lbbndcnd.h:94
MFloat * m_lbWallVelocity
Definition: lbbndcnd.h:96
MInt * m_segIdMovingWalls
Definition: lbbndcnd.h:95

◆ getBoundaryVelocityMb()

template<MInt nDim, MInt nDist, class SysEqn >
void LbBndCndDxQy< nDim, nDist, SysEqn >::getBoundaryVelocityMb ( const MInt  mbCellId,
MFloat uW 
)
inlineprotected
Author
Julian Vorspohl j.vor.nosp@m.spoh.nosp@m.l@aia.nosp@m..rwt.nosp@m.h-aac.nosp@m.hen..nosp@m.de
Parameters
[in]mbCellIdMoving boundary cell id
[out]uWBoundary velocity

Definition at line 1869 of file lbbndcnddxqy.cpp.

1869 {
1870 for(MInt n = 0; n < nDim; n++) {
1871 uW[n] = m_boundaryCellsMb.velocity(mbCellId, n);
1872 }
1873}
MFloat & velocity(const MInt id, const MInt dim)
Accessor for velocities.

◆ getDistanceMb()

template<MInt nDim, MInt nDist, class SysEqn >
MFloat LbBndCndDxQy< nDim, nDist, SysEqn >::getDistanceMb ( const MInt  cellId,
const MInt  mbCellId,
const MInt  distId 
)
inline

Definition at line 359 of file lbbndcnddxqy.h.

359 {
360 const MFloat cellLength = m_solver->c_cellLengthAtLevel(m_solver->a_level(cellId));
361
362 MFloat q;
363 if(distId < Ld::distFld(0)) {
364 q = m_boundaryCellsMb.distance(mbCellId, distId) / cellLength;
365 } else if(distId < (Ld::distFld(0) + Ld::distFld(1))) {
366 q = m_boundaryCellsMb.distance(mbCellId, distId) / (SQRT2 * cellLength);
367 } else {
368 q = m_boundaryCellsMb.distance(mbCellId, distId) / (SQRT3 * cellLength);
369 }
370 return q;
371 }
MFloat & distance(const MInt id, const MInt did)
Accessor for distances.
static constexpr MInt distFld(MInt i)

◆ heatFluxBc()

template<MInt nDim, MInt nDist, class SysEqn >
void LbBndCndDxQy< nDim, nDist, SysEqn >::heatFluxBc ( MInt  index,
MInt  bcMode 
)
protected

◆ incrementForces() [1/2]

template<MInt nDim, MInt nDist, class SysEqn >
void LbBndCndDxQy< nDim, nDist, SysEqn >::incrementForces ( const MInt  cellId,
const MInt  j,
const MFloat uW,
MFloat forces 
)
inlineprotected

◆ incrementForces() [2/2]

template<MInt nDim, MInt nDist, class SysEqn >
void LbBndCndDxQy< nDim, nDist, SysEqn >::incrementForces ( const MInt  cellId,
const MInt  mbCellId,
const MInt  j,
const MFloat uW 
)
inlineprotected

The force is calculated by the momentum exchange method (MEA) in its Galilei invariant formulation by Caiazzo et al. The result is stored per distribution for each boundary cell. This allows a more accurate torque calculation later on. For reference see https://doi.org/10.1016/j.camwa.2007.08.004

Author
Julian Vorspohl j.vor.nosp@m.spoh.nosp@m.l@aia.nosp@m..rwt.nosp@m.h-aac.nosp@m.hen..nosp@m.de
Parameters
[in]cellIdCell id of the boundary cell
[in]mbCellIdMoving boundary cell id
[in]jDistribution which is intersecting the boundary
[in]uWBoundary velocity

Definition at line 1843 of file lbbndcnddxqy.cpp.

1844 {
1845 const MInt opposite = Ld::oppositeDist(j);
1846
1847 const MFloat& Fin = m_solver->a_distribution(cellId, j);
1848 const MFloat& Fout = m_solver->a_oldDistribution(cellId, opposite);
1849
1850 // Galilei invariant momentum exchange method
1851 for(MInt d = 0; d < nDim; d++) {
1852 const MFloat Vin = Ld::ppdfDir(j, d) - uW[d];
1853 const MFloat Vout = Ld::ppdfDir(opposite, d) - uW[d];
1854
1855 m_boundaryCellsMb.force(mbCellId, j, d) = (Fin * Vin - Fout * Vout);
1856 }
1857}
MFloat & force(const MInt id, const MInt did, const MInt dim)
Accessor for forces.
static constexpr MFloat ppdfDir(MInt i, MInt j)

◆ initVortices()

template<MInt nDim, MInt nDist, class SysEqn >
void LbBndCndDxQy< nDim, nDist, SysEqn >::initVortices ( MInt  )
inlineprotected

Definition at line 152 of file lbbndcnddxqy.h.

152{};

◆ interpolatedAntiBounceBackMb_Bouzidi_qua()

template<MInt nDim, MInt nDist, class SysEqn >
void LbBndCndDxQy< nDim, nDist, SysEqn >::interpolatedAntiBounceBackMb_Bouzidi_qua ( const MInt  cellIndex,
const MInt  set 
)
inlineprotected

◆ interpolatedBounceBackMb_Bouzidi_lin()

template<MInt nDim, MInt nDist, class SysEqn >
void LbBndCndDxQy< nDim, nDist, SysEqn >::interpolatedBounceBackMb_Bouzidi_lin ( const MInt  cellIndex,
const MInt  set 
)
inlineprotected

Performs a bounce back for a single boundary cell using the linear Bouzidi-Firdaouss-Lallemand (BFL) scheme. If the boundary cell is inside, it is updated. If the boundary cell is outside, its inside neighbours are updated. For reference see https://doi.org/10.1063/1.1399290

Author
Moritz Waldmann, Julian Vorspohl j.vor.nosp@m.spoh.nosp@m.l@aia.nosp@m..rwt.nosp@m.h-aac.nosp@m.hen..nosp@m.de
Parameters
[in]cellIndexBoundary cell id from where the bounce back is performed.
[in]setLevel set for which the bounce back is performed

Definition at line 1468 of file lbbndcnddxqy.cpp.

1468 {
1469 TRACE();
1470
1471 const MInt pCellId = m_solver->m_G0CellList[cellIndex];
1472 MFloat rho = m_solver->a_variable(pCellId, PV->RHO);
1473 std::array<MFloat, nDim> uW{};
1474 getBoundaryVelocityMb(cellIndex, uW.data());
1475
1476 // case 1: boundary cell is inside fluid
1477 if(m_solver->a_levelSetFunctionMB(pCellId, set) > 0) {
1478 for(MInt j = 0; j < nDist - 1; j++) {
1479#ifdef WAR_NVHPC_PSTL
1480 const MFloat q = m_distances[cellIndex][j];
1481 const MInt opposite = m_solver->m_oppositeDist[j];
1482#else
1483 const MFloat q = getDistanceMb(pCellId, cellIndex, j);
1484 const MInt opposite = Ld::oppositeDist(j);
1485#endif
1486
1487 if(m_solver->a_hasProperty(pCellId, Cell::IsHalo)) continue;
1488
1489 // if q <= 0.5, perform bounce back
1490 if(q <= 0.5) {
1491 if(m_solver->a_hasNeighbor(pCellId, opposite) != 0) {
1492 const MFloat F2q = F2 * q;
1493 m_solver->a_oldDistribution(pCellId, opposite) = (F2q * m_solver->a_distribution(pCellId, j))
1494 + ((F1 - F2q) * m_solver->a_oldDistribution(pCellId, j))
1495 + firstMomentSourceTerm(uW.data(), rho, opposite);
1496#ifndef WAR_NVHPC_PSTL
1497 incrementForces(pCellId, cellIndex, j, uW.data());
1498#endif
1499 }
1500 // this is the case in which we have no neighbor in the direction we want to set (strange case)
1501 // can in my opinion only appear if neighbors were set wrong or at an interface
1502 else {
1503 m_solver->a_oldDistribution(pCellId, opposite) =
1504 m_solver->a_distribution(pCellId, j) + firstMomentSourceTerm(uW.data(), rho, opposite);
1505 }
1506 }
1507
1508 // this is the case in which we do not have a neighbor and no cut, do simple bounce back (strange case)
1509 // can in my opinoin only appear if something has gone wrong either with the grid or with the distance calculation
1510 // else if(m_bndCells[cellId].m_distances[j] > 0.5 && m_solver->a_hasNeighbor(pCellId, j) == 0)
1511 // else if( m_wallBoundaryCellList[cellId].m_distances[j] > 0.5 && m_solver->a_hasNeighbor(pCellId, j) == 0)
1512 else if(q > 0.5 && m_solver->a_hasNeighbor(pCellId, j) == 0) {
1513 m_solver->a_oldDistribution(pCellId, opposite) =
1514 m_solver->a_distribution(pCellId, j) + firstMomentSourceTerm(uW.data(), rho, opposite);
1515 }
1516 }
1517 }
1518 // case 2: boundary cell is outside fluid
1519 else {
1520 for(MInt j = 0; j < nDist - 1; j++) {
1521#ifdef WAR_NVHPC_PSTL
1522 const MFloat q = m_distances[cellIndex][j];
1523 const MInt opposite = m_solver->m_oppositeDist[j];
1524#else
1525 const MFloat q = getDistanceMb(pCellId, cellIndex, j);
1526 const MInt opposite = Ld::oppositeDist(j);
1527#endif
1528 // do we have a neighbor at all?
1529 if(m_solver->a_hasNeighbor(pCellId, j)) {
1530 // make sure that the neighbor is not a halo cell
1531 const MInt neighborId = m_solver->c_neighborId(pCellId, j);
1532 rho = m_solver->a_variable(neighborId, PV->RHO);
1533 if(!m_solver->a_hasProperty(neighborId, Cell::IsHalo)) {
1534 const MBool nbndid = m_solver->a_isG0CandidateOfSet(neighborId, (set - m_solver->m_levelSetId));
1535
1536 // if q < 0.5, perform bounce back (this is meant from the outer cell, the inner cell then has q >= 0.5)
1537 if(q < 0.5) {
1538 const MFloat F2q = F2 * (F1 - q);
1539
1540 // check if my neighbor is an inside cell or a boundary cell with the cell center inside
1541 if(!nbndid || m_solver->a_levelSetFunctionMB(neighborId, set) > 0) {
1542 m_solver->a_oldDistribution(neighborId, j) =
1543 (m_solver->a_distribution(neighborId, opposite) / F2q)
1544 + (m_solver->a_distribution(neighborId, j) * (F2q - F1) / F2q)
1545 + (F1 / F2q) * firstMomentSourceTerm(uW.data(), rho, j);
1546
1547#ifndef WAR_NVHPC_PSTL
1548 incrementForces(neighborId, cellIndex, opposite, uW.data());
1549#endif
1550 }
1551 }
1552 }
1553 }
1554 } // end of the loop over all PPDF directions in case 2
1555 // The outer cell does not belong to the flow field, thus its incoming distributions are overwritten.
1556 // It is possible that there are cells without any cutting velocity! These are considered too.
1557 m_solver->setEqDists(pCellId, F1, uW.data());
1558 }
1559}
MFloat firstMomentSourceTerm(const MFloat *const uW, const MFloat rho, const MInt dist)
Momentum source term used in bounce back schemes for moving boundaries.
void getBoundaryVelocityMb(const MInt cellId, MFloat *uW)
Reads boundary velocity from the moving boundary cell collector.
void incrementForces(const MInt cellId, const MInt j, const MFloat *uW, MFloat *forces)
MPrimitiveVariables< nDim > * PV
Definition: lbbndcnd.h:134

◆ interpolatedBounceBackMb_Bouzidi_lin_thermal()

template<MInt nDim, MInt nDist, class SysEqn >
void LbBndCndDxQy< nDim, nDist, SysEqn >::interpolatedBounceBackMb_Bouzidi_lin_thermal ( const MInt  cellIndex,
const MInt  set 
)
inlineprotected

◆ interpolatedBounceBackMb_Bouzidi_lin_transport()

template<MInt nDim, MInt nDist, class SysEqn >
void LbBndCndDxQy< nDim, nDist, SysEqn >::interpolatedBounceBackMb_Bouzidi_lin_transport ( const MInt  cellIndex,
const MInt  set 
)
inlineprotected

◆ interpolatedBounceBackMb_Bouzidi_qua()

template<MInt nDim, MInt nDist, class SysEqn >
void LbBndCndDxQy< nDim, nDist, SysEqn >::interpolatedBounceBackMb_Bouzidi_qua ( const MInt  cellIndex,
const MInt  set 
)
inlineprotected

Performs a bounce back for a single boundary cell using the quadratic Bouzidi-Firdaouss-Lallemand (BFL) scheme. If the boundary cell is inside, it is updated. If the boundary cell is outside, its inside neighbours are updated. For reference see https://doi.org/10.1063/1.1399290

Author
Moritz Waldmann, Julian Vorspohl j.vor.nosp@m.spoh.nosp@m.l@aia.nosp@m..rwt.nosp@m.h-aac.nosp@m.hen..nosp@m.de
Parameters
[in]cellIndexBoundary cell id from where the bounce back is performed.
[in]setLevel set for which the bounce back is performed

Definition at line 1575 of file lbbndcnddxqy.cpp.

1575 {
1576 TRACE();
1577
1578 const MInt pCellId = m_solver->m_G0CellList[cellIndex];
1579 MFloat rho = m_solver->a_variable(pCellId, PV->RHO);
1580 std::array<MFloat, nDim> uW{};
1581 getBoundaryVelocityMb(cellIndex, uW.data());
1582
1583 // case 1: boundary cell is inside fluid
1584 if(m_solver->a_levelSetFunctionMB(pCellId, set) > 0) {
1585 for(MInt j = 0; j < nDist - 1; j++) {
1586#ifdef WAR_NVHPC_PSTL
1587 const MFloat q = m_distances[cellIndex][j];
1588 const MInt opposite = m_solver->m_oppositeDist[j];
1589#else
1590 const MFloat q = getDistanceMb(pCellId, cellIndex, j);
1591 const MInt opposite = Ld::oppositeDist(j);
1592#endif
1593
1594 if(m_solver->a_hasProperty(pCellId, Cell::IsHalo)) continue;
1595
1596 // if q <= 0.5, perform bounce back
1597 if(q <= 0.5) {
1598 if(m_solver->a_hasNeighbor(pCellId, opposite)) {
1599 const MInt neighborId = m_solver->c_neighborId(pCellId, opposite);
1600 // const MInt nneighborId = m_solver->c_neighborId(neighborId, opposite);
1601 // std::cout << "nn" << nneighborId << std::endl;
1602 const MFloat F2q = F2 * q;
1603 const MFloat Fq = q;
1604
1605 MFloat quadratic = Fq * (F2q + 1) * m_solver->a_distribution(pCellId, j)
1606 + (1 + F2q) * (1 - F2q) * m_solver->a_distribution(neighborId, j)
1607 - Fq * (1 - F2q) * m_solver->a_oldDistribution(neighborId, j)
1608 + firstMomentSourceTerm(uW.data(), rho, opposite);
1609
1610 m_solver->a_oldDistribution(pCellId, opposite) = quadratic;
1611#ifndef WAR_NVHPC_PSTL
1612 incrementForces(pCellId, cellIndex, j, uW.data());
1613#endif
1614 }
1615 // this is the case in which we have no neighbor in the direction we want to set (strange case)
1616 // can in my opinion only appear if neighbors were set wrong or at an interface
1617 else {
1618 m_solver->a_oldDistribution(pCellId, opposite) =
1619 m_solver->a_distribution(pCellId, j) + firstMomentSourceTerm(uW.data(), rho, opposite);
1620 }
1621 }
1622
1623 // this is the case in which we do not have a neighbor and no cut, do simple bounce back (strange case)
1624 // can in my opinoin only appear if something has gone wrong either with the grid or with the distance calculation
1625 else if(q > 0.5 && m_solver->a_hasNeighbor(pCellId, j) == 0) {
1626 m_solver->a_oldDistribution(pCellId, opposite) =
1627 m_solver->a_distribution(pCellId, j) + firstMomentSourceTerm(uW.data(), rho, opposite);
1628 }
1629 }
1630 }
1631 // case 2: boundary cell is outside fluid
1632 else {
1633 for(MInt j = 0; j < nDist - 1; j++) {
1634#ifdef WAR_NVHPC_PSTL
1635 const MFloat q = m_distances[cellIndex][j];
1636 const MInt opposite = m_solver->m_oppositeDist[j];
1637#else
1638 const MFloat q = getDistanceMb(pCellId, cellIndex, j);
1639 const MInt opposite = Ld::oppositeDist(j);
1640#endif
1641
1642 // do we have a neighbor at all?
1643 if(m_solver->a_hasNeighbor(pCellId, j)) {
1644 // make sure that the neighbor is not a halo cell
1645 const MInt neighborId = m_solver->c_neighborId(pCellId, j);
1646 rho = m_solver->a_variable(neighborId, PV->RHO);
1647 if(!m_solver->a_hasProperty(neighborId, Cell::IsHalo)) {
1648 const MBool nbndid = m_solver->a_isG0CandidateOfSet(neighborId, (set - m_solver->m_levelSetId));
1649
1650 // if q < 0.5, perform bounce back (this is meant from the outer cell, the inner cell then has q >= 0.5)
1651 if(q < 0.5) {
1652 const MFloat F2q = F2 * (F1 - q);
1653 const MFloat Fq = (1 - q);
1654
1655 // check if my neighbor is an inside cell or a boundary cell with the cell center inside
1656 if(!nbndid || m_solver->a_levelSetFunctionMB(neighborId, set) > 0) {
1657 if(m_solver->a_hasNeighbor(neighborId, j)) {
1658 const MInt nneighborId = m_solver->c_neighborId(neighborId, j);
1659
1660 MFloat quadratic =
1661 1 / Fq / (F2q + 1)
1662 * (m_solver->a_distribution(neighborId, opposite) + firstMomentSourceTerm(uW.data(), rho, j))
1663 + (F2q - 1) / Fq * m_solver->a_distribution(neighborId, j)
1664 - (F2q - 1) / (F2q + 1) * m_solver->a_distribution(nneighborId, j);
1665
1666 m_solver->a_oldDistribution(neighborId, j) = quadratic;
1667 } else {
1668 // Linear fallback for confined direction
1669 MFloat linear = (m_solver->a_distribution(neighborId, opposite) / F2q)
1670 + (m_solver->a_distribution(neighborId, j) * (F2q - F1) / F2q)
1671 + (F1 / F2q) * firstMomentSourceTerm(uW.data(), rho, j);
1672
1673 m_solver->a_oldDistribution(neighborId, j) = linear;
1674 }
1675#ifndef WAR_NVHPC_PSTL
1676 incrementForces(neighborId, cellIndex, opposite, uW.data());
1677#endif
1678 }
1679 }
1680 }
1681 }
1682 } // end of the loop over all PPDF directions in case 2
1683 // The outer cell does not belong to the flow field, thus its incoming distributions are overwritten.
1684 // It is possible that there are cells without any cutting velocity! These are considered too.
1685 m_solver->setEqDists(pCellId, F1, uW.data());
1686 }
1687}
T linear(const T a, const T b, const T x)
Linear slope filter.
Definition: filter.h:83

◆ interpolatedBounceBackMb_Yu_qua()

template<MInt nDim, MInt nDist, class SysEqn >
void LbBndCndDxQy< nDim, nDist, SysEqn >::interpolatedBounceBackMb_Yu_qua ( const MInt  cellIndex,
const MInt  set 
)
inlineprotected

Performs a bounce back for a single boundary cell using the quadratic scheme by Yu et al. If the boundary cell is inside, it is updated. If the boundary cell is outside, its inside neighbours are updated. For reference see https://doi.org/10.1016/S0376-0421(03)00003-4

Author
Moritz Waldmann, Julian Vorspohl j.vor.nosp@m.spoh.nosp@m.l@aia.nosp@m..rwt.nosp@m.h-aac.nosp@m.hen..nosp@m.de
Parameters
[in]cellIndexBoundary cell id from where the bounce back is performed.
[in]setLevel set for which the bounce back is performed

Definition at line 1703 of file lbbndcnddxqy.cpp.

1703 {
1704 TRACE();
1705
1706 const MInt pCellId = m_solver->m_G0CellList[cellIndex];
1707 MFloat rho = m_solver->a_variable(pCellId, PV->RHO);
1708 std::array<MFloat, nDim> uW{};
1709 getBoundaryVelocityMb(cellIndex, uW.data());
1710
1711 // case 1: boundary cell is inside fluid
1712 if(m_solver->a_levelSetFunctionMB(pCellId, set) > 0) {
1713 for(MInt j = 0; j < nDist - 1; j++) {
1714#ifdef WAR_NVHPC_PSTL
1715 const MFloat q = m_distances[cellIndex][j];
1716 const MInt opposite = m_solver->m_oppositeDist[j];
1717#else
1718 const MFloat q = getDistanceMb(pCellId, cellIndex, j);
1719 const MInt opposite = Ld::oppositeDist(j);
1720#endif
1721
1722 if(m_solver->a_hasProperty(pCellId, Cell::IsHalo)) continue;
1723
1724 // if q <= 0.5, perform bounce back
1725 if(q <= 0.5) {
1726 if(m_solver->a_hasNeighbor(pCellId, opposite) != 0) {
1727 const MInt neighborId = m_solver->c_neighborId(pCellId, opposite);
1728 const MInt nneighborId = m_solver->c_neighborId(neighborId, opposite);
1729
1730 const MFloat F2q = F2 * q;
1731 const MFloat Fq = q;
1732
1733 // Calculate temporary distribution at position which will propagrate exactly to the wall
1734 const MFloat wall = Fq * (Fq + 1) / 2 * m_solver->a_distribution(pCellId, j)
1735 + (1 - Fq) * (1 + Fq) * m_solver->a_distribution(neighborId, j)
1736 - Fq * (1 - Fq) / 2 * m_solver->a_distribution(nneighborId, j);
1737
1738 // Instantaneous bounce-back at the wall
1739 const MFloat wall_bb = wall + firstMomentSourceTerm(uW.data(), rho, opposite);
1740
1741 // Interpolate bounce-back value
1742 const MFloat interp = 2 / (1 + Fq) / (2 + Fq) * wall_bb
1743 + F2q / (1 + Fq) * m_solver->a_distribution(pCellId, opposite)
1744 - Fq / (2 + Fq) * m_solver->a_distribution(neighborId, opposite);
1745
1746 m_solver->a_oldDistribution(pCellId, opposite) = interp;
1747#ifndef WAR_NVHPC_PSTL
1748 incrementForces(pCellId, cellIndex, j, uW.data());
1749#endif
1750 }
1751 // this is the case in which we have no neighbor in the direction we want to set (strange case)
1752 // can in my opinion only appear if neighbors were set wrong or at an interface
1753 else {
1754 m_solver->a_oldDistribution(pCellId, opposite) =
1755 m_solver->a_distribution(pCellId, j) + firstMomentSourceTerm(uW.data(), rho, opposite);
1756 }
1757 }
1758
1759 // this is the case in which we do not have a neighbor and no cut, do simple bounce back (strange case)
1760 // can in my opinoin only appear if something has gone wrong either with the grid or with the distance calculation
1761 else if(q > 0.5 && m_solver->a_hasNeighbor(pCellId, j) == 0) {
1762 m_solver->a_oldDistribution(pCellId, opposite) =
1763 m_solver->a_distribution(pCellId, j) + firstMomentSourceTerm(uW.data(), rho, opposite);
1764 }
1765 }
1766 }
1767 // case 2: boundary cell is outside fluid
1768 else {
1769 for(MInt j = 0; j < nDist - 1; j++) {
1770#ifdef WAR_NVHPC_PSTL
1771 const MFloat q = m_distances[cellIndex][j];
1772 const MInt opposite = m_solver->m_oppositeDist[j];
1773#else
1774 const MFloat q = getDistanceMb(pCellId, cellIndex, j);
1775 const MInt opposite = Ld::oppositeDist(j);
1776#endif
1777
1778 // do we have a neighbor at all?
1779 if(m_solver->a_hasNeighbor(pCellId, j)) {
1780 // make sure that the neighbor is not a halo cell
1781 const MInt neighborId = m_solver->c_neighborId(pCellId, j);
1782 rho = m_solver->a_variable(neighborId, PV->RHO);
1783 if(!m_solver->a_hasProperty(neighborId, Cell::IsHalo)) {
1784 const MBool nbndid = m_solver->a_isG0CandidateOfSet(neighborId, (set - m_solver->m_levelSetId));
1785
1786 // if q < 0.5, perform bounce back (this is meant from the outer cell, the inner cell then has q >= 0.5)
1787 if(q < 0.5) {
1788 const MFloat F2q = F2 * (F1 - q);
1789 const MFloat Fq = (1 - q);
1790
1791 // check if my neighbor is an inside cell or a boundary cell with the cell center inside
1792 if(!nbndid || m_solver->a_levelSetFunctionMB(neighborId, set) > 0) {
1793 const MInt nneighborId = m_solver->c_neighborId(neighborId, j);
1794 const MInt nnneighborId = m_solver->c_neighborId(nneighborId, j);
1795
1796 // Calculate temporary distribution at position which will propagrate exactly to the wall
1797 const MFloat wall = Fq * (Fq + 1) / 2 * m_solver->a_distribution(neighborId, opposite)
1798 + (1 - Fq) * (1 + Fq) * m_solver->a_distribution(nneighborId, opposite)
1799 - Fq * (1 - Fq) / 2 * m_solver->a_distribution(nnneighborId, opposite);
1800
1801 // Instantaneous bounce-back at the wall
1802 const MFloat wall_bb = wall + firstMomentSourceTerm(uW.data(), rho, j);
1803
1804
1805 // Interpolate bounce-back value
1806 const MFloat interp = 2 / (1 + Fq) / (2 + Fq) * wall_bb
1807 + F2q / (1 + Fq) * m_solver->a_distribution(neighborId, j)
1808 - Fq / (2 + Fq) * m_solver->a_distribution(nneighborId, j);
1809
1810
1811 m_solver->a_oldDistribution(neighborId, j) = interp;
1812#ifndef WAR_NVHPC_PSTL
1813 incrementForces(neighborId, cellIndex, opposite, uW.data());
1814#endif
1815 }
1816 }
1817 }
1818 }
1819 } // end of the loop over all PPDF directions in case 2
1820 // The outer cell does not belong to the flow field, thus its incoming distributions are overwritten.
1821 // It is possible that there are cells without any cutting velocity! These are considered too.
1822 m_solver->setEqDists(pCellId, F1, uW.data());
1823 }
1824}

◆ interpolatedBounceBackSingleSpecies()

template<MInt nDim, MInt nDist, class SysEqn >
void LbBndCndDxQy< nDim, nDist, SysEqn >::interpolatedBounceBackSingleSpecies ( const MInt  cellId,
const MFloat *const  uW 
)
protected

◆ interpolatedBounceBackSingleSpeciesThermal() [1/2]

template<MInt nDim, MInt nDist, class SysEqn >
void LbBndCndDxQy< nDim, nDist, SysEqn >::interpolatedBounceBackSingleSpeciesThermal ( const MInt  cellId,
const MFloat *const  wTPtr,
const MFloat *const  uW 
)
protected

◆ interpolatedBounceBackSingleSpeciesThermal() [2/2]

template<MInt nDim, MInt nDist, class SysEqn >
void LbBndCndDxQy< nDim, nDist, SysEqn >::interpolatedBounceBackSingleSpeciesThermal ( const MInt  cellId,
const MFloat  wT,
const MFloat *const  uW 
)
inlineprotected

Definition at line 308 of file lbbndcnddxqy.h.

308 {
309 std::array<MFloat, nDist> wTPtr{};
310 for(MInt d = 0; d < nDist; d++) {
311 wTPtr[d] = wT;
312 }
313 interpolatedBounceBackSingleSpeciesThermal(cellId, wTPtr.data(), uW);
314 };
void interpolatedBounceBackSingleSpeciesThermal(const MInt cellId, const MFloat *const wTPtr, const MFloat *const uW)

◆ interpolatedBounceBackSingleSpeciesThermalFlux()

template<MInt nDim, MInt nDist, class SysEqn >
void LbBndCndDxQy< nDim, nDist, SysEqn >::interpolatedBounceBackSingleSpeciesThermalFlux ( const MInt  cellId,
const MFloat  qT,
MInt  bcIndex 
)
protected

◆ interpolatedBounceBackSingleSpeciesTransport() [1/2]

template<MInt nDim, MInt nDist, class SysEqn >
void LbBndCndDxQy< nDim, nDist, SysEqn >::interpolatedBounceBackSingleSpeciesTransport ( const MInt  cellId,
const MFloat *const  wCPtr,
const MFloat *const  uW 
)
protected

◆ interpolatedBounceBackSingleSpeciesTransport() [2/2]

template<MInt nDim, MInt nDist, class SysEqn >
void LbBndCndDxQy< nDim, nDist, SysEqn >::interpolatedBounceBackSingleSpeciesTransport ( const MInt  cellId,
const MFloat  wC,
const MFloat *const  uW 
)
inlineprotected

Definition at line 317 of file lbbndcnddxqy.h.

317 {
318 std::array<MFloat, nDist> wCPtr{};
319 for(MInt d = 0; d < nDist; d++) {
320 wCPtr[d] = wC;
321 }
322 interpolatedBounceBackSingleSpeciesTransport(cellId, wCPtr.data(), uW);
323 };
void interpolatedBounceBackSingleSpeciesTransport(const MInt cellId, const MFloat *const wCPtr, const MFloat *const uW)

◆ outflow()

template<MInt nDim, MInt nDist, class SysEqn >
template<MInt direction>
void LbBndCndDxQy< nDim, nDist, SysEqn >::outflow ( MInt  index)
protected

◆ outflowLinear()

template<MInt nDim, MInt nDist, class SysEqn >
template<MInt direction>
void LbBndCndDxQy< nDim, nDist, SysEqn >::outflowLinear ( MInt  index)
protected

◆ pab()

template<MInt nDim, MInt nDist, class SysEqn >
void LbBndCndDxQy< nDim, nDist, SysEqn >::pab ( MInt  index)
protected

◆ parabolicInflow()

template<MInt nDim, MInt nDist, class SysEqn >
void LbBndCndDxQy< nDim, nDist, SysEqn >::parabolicInflow ( MInt  index)
protected

◆ recalcRho()

template<MInt nDim, MInt nDist, class SysEqn >
void LbBndCndDxQy< nDim, nDist, SysEqn >::recalcRho ( MInt  index)
protected

◆ refillEmergedCell()

template<MInt nDim, MInt nDist, class SysEqn >
void LbBndCndDxQy< nDim, nDist, SysEqn >::refillEmergedCell ( const  MInt)

◆ refillEmergedCellNormalExtrapolationLinear()

template<MInt nDim, MInt nDist, class SysEqn >
void LbBndCndDxQy< nDim, nDist, SysEqn >::refillEmergedCellNormalExtrapolationLinear ( const  MInt)

◆ refillEmergedCellNormalExtrapolationQuadratic()

template<MInt nDim, MInt nDist, class SysEqn >
void LbBndCndDxQy< nDim, nDist, SysEqn >::refillEmergedCellNormalExtrapolationQuadratic ( const  MInt)

◆ slidingWall()

template<MInt nDim, MInt nDist, class SysEqn >
template<MInt direction>
void LbBndCndDxQy< nDim, nDist, SysEqn >::slidingWall ( MInt  index)
protected

◆ slipFlow()

template<MInt nDim, MInt nDist, class SysEqn >
template<MBool thermal>
void LbBndCndDxQy< nDim, nDist, SysEqn >::slipFlow ( MInt  index)
protected

◆ sysEqn()

template<MInt nDim, MInt nDist, class SysEqn >
constexpr SysEqn LbBndCndDxQy< nDim, nDist, SysEqn >::sysEqn ( ) const
inlineconstexpr

Definition at line 145 of file lbbndcnddxqy.h.

145{ return m_sysEqn; }
const SysEqn m_sysEqn
Definition: lbbndcnddxqy.h:20

◆ writeBCOutput()

template<MInt nDim, MInt nDist, class SysEqn >
void LbBndCndDxQy< nDim, nDist, SysEqn >::writeBCOutput ( MInt  index)
protected

◆ writeBoundaryVTK()

template<MInt nDim, MInt nDist, class SysEqn >
void LbBndCndDxQy< nDim, nDist, SysEqn >::writeBoundaryVTK ( MFloat **  vertices,
MInt  num,
MInt  segmentId 
)
protected
Author
Andreas Lintermann
Date
21.01.2013

The file rim_domainId.vtp, where domainId is the current MPI-rank is written per domain participating in a segment with id segmentId.

Parameters
[in]verticesthe vertices as pointer to a pointer
[in]numthe number of vertices
[in]segmentIdthe id of the segment

Definition at line 229 of file lbbndcnddxqy.cpp.

229 {
230 TRACE();
231
232 std::ofstream ofl;
233 std::stringstream fname;
234 fname << "rim_s" << segmentId << "_" << m_solver->domainId() << ".vtp";
235 ofl.open(fname.str().c_str());
236
237 //================== VTKFile =================
238 ofl << "<?xml version=\"1.0\"?>" << std::endl;
239 ofl << "<VTKFile type=\"PolyData\" version=\"0.1\" byte_order=\"LittleEndian\">" << std::endl;
240 ofl << "<PolyData>" << std::endl;
241 ofl << "<Piece NumberOfPoints=\"" << num << "\" NumberOfVerts=\"" << num << "\" NumberOfLines=\"" << 1 << "\">"
242 << std::endl;
243
244 ofl << "<PointData TCoords=\"Texture Coordinates\">" << std::endl;
245 ofl << "<DataArray type=\"Float32\" Name=\"Array_Position\" NumberOfComponents=\"1\" format=\"ascii\">" << std::endl;
246 for(MInt i = 0; i < num; i++)
247 ofl << i << " ";
248 ofl << std::endl;
249 ofl << "</DataArray>" << std::endl;
250 ofl << "</PointData>" << std::endl;
251
252 //================== Points =================
253 ofl << "<Points>" << std::endl;
254 ofl << "<DataArray type=\"Float32\" NumberOfComponents=\"3\" format=\"ascii\">" << std::endl;
255 for(MInt i = 0; i < num; i++) {
256 for(MInt d = 0; d < nDim; d++) {
257 ofl << vertices[i][d] << " ";
258 }
259 }
260 ofl << std::endl;
261 ofl << "</DataArray>" << std::endl;
262 ofl << "</Points>" << std::endl;
263 //================== /Points =================
264
265 /*
266 //================== Verts ===================
267 ofl << "<Verts>" << std::endl;
268 ofl << "<DataArray type=\"Int64\" Name=\"connectivity\" format=\"ascii\">" << std::endl;
269 for(MInt i = 0; i < num; i++)
270 ofl << i << " ";
271 ofl << "0" << std::endl;
272 ofl << "</DataArray>" << std::endl;
273 ofl << "<DataArray type=\"Int64\" Name=\"offsets\" format=\"ascii\">" << std::endl;
274 for(MInt i = 1; i <= num; i++)
275 ofl << i << " ";
276 ofl << num+1 << std::endl;
277 ofl << "</DataArray>" << std::endl;
278 ofl << "</Verts>" << std::endl;
279 //================== /Verts ==================
280 */
281 //================== Lines ===================
282 ofl << "<Lines>" << std::endl;
283 ofl << "<DataArray type=\"Int64\" Name=\"connectivity\" format=\"ascii\">" << std::endl;
284 for(MInt i = 0; i < num; i++)
285 ofl << i << " ";
286 ofl << "0" << std::endl;
287 ofl << "</DataArray>" << std::endl;
288 ofl << "<DataArray type=\"Int64\" Name=\"offsets\" format=\"ascii\">" << std::endl;
289 // for(MInt i = 1; i <= num; i++)
290 // ofl << i << " ";
291 ofl << num + 1 << std::endl;
292 ofl << "</DataArray>" << std::endl;
293 ofl << "</Lines>" << std::endl;
294 //================== /Lines ==================
295
296 ofl << "</Piece>" << std::endl;
297 ofl << "</PolyData>" << std::endl;
298 ofl << "</VTKFile>" << std::endl;
299 ofl.close();
300}

◆ zerothMomentSourceTerm()

template<MInt nDim, MInt nDist, class SysEqn >
template<MInt mode>
MFloat LbBndCndDxQy< nDim, nDist, SysEqn >::zerothMomentSourceTerm ( const MInt  pCellId,
const MInt  dist,
const MFloat  var,
const MFloat uW 
)
protected

Friends And Related Function Documentation

◆ LbSolverDxQy

template<MInt nDim, MInt nDist, class SysEqn >
template<MInt nDim_, MInt nDist_, class SysEqn_ >
friend class LbSolverDxQy
friend

Definition at line 102 of file lbbndcnddxqy.h.

Member Data Documentation

◆ bounceBackFunctionMb

template<MInt nDim, MInt nDist, class SysEqn >
void(LbBndCndDxQy< nDim, nDist, SysEqn >::* LbBndCndDxQy< nDim, nDist, SysEqn >::bounceBackFunctionMb) (const MInt cellIndex, const MInt set)
private

Definition at line 106 of file lbbndcnddxqy.h.

◆ bounceBackSchemeMb

template<MInt nDim, MInt nDist, class SysEqn >
MInt LbBndCndDxQy< nDim, nDist, SysEqn >::bounceBackSchemeMb
private

Definition at line 105 of file lbbndcnddxqy.h.

◆ C_o

template<MInt nDim, MInt nDist, class SysEqn >
MFloat LbBndCndDxQy< nDim, nDist, SysEqn >::C_o = F0

Definition at line 121 of file lbbndcnddxqy.h.

◆ condRatio

template<MInt nDim, MInt nDist, class SysEqn >
MFloat LbBndCndDxQy< nDim, nDist, SysEqn >::condRatio = F0

Definition at line 123 of file lbbndcnddxqy.h.

◆ diffRatio

template<MInt nDim, MInt nDist, class SysEqn >
MFloat LbBndCndDxQy< nDim, nDist, SysEqn >::diffRatio = F0

Definition at line 124 of file lbbndcnddxqy.h.

◆ ibbBndIds

template<MInt nDim, MInt nDist, class SysEqn >
std::vector<MInt> LbBndCndDxQy< nDim, nDist, SysEqn >::ibbBndIds
private

Definition at line 116 of file lbbndcnddxqy.h.

◆ m_bounceBackFunctionMbCase

template<MInt nDim, MInt nDist, class SysEqn >
MInt LbBndCndDxQy< nDim, nDist, SysEqn >::m_bounceBackFunctionMbCase = 0
private

Definition at line 110 of file lbbndcnddxqy.h.

◆ m_distances

template<MInt nDim, MInt nDist, class SysEqn >
MFloat** LbBndCndDxQy< nDim, nDist, SysEqn >::m_distances {}
private

Definition at line 109 of file lbbndcnddxqy.h.

◆ m_distIntersectionElementId

template<MInt nDim, MInt nDist, class SysEqn >
MInt** LbBndCndDxQy< nDim, nDist, SysEqn >::m_distIntersectionElementId = nullptr
private

Definition at line 134 of file lbbndcnddxqy.h.

◆ m_fluidDist

template<MInt nDim, MInt nDist, class SysEqn >
MFloat** LbBndCndDxQy< nDim, nDist, SysEqn >::m_fluidDist = nullptr
private

Definition at line 136 of file lbbndcnddxqy.h.

◆ 

struct { ... } LbBndCndDxQy< nDim, nDist, SysEqn >::m_mucosaModel

◆ m_mucousDist

template<MInt nDim, MInt nDist, class SysEqn >
MFloat** LbBndCndDxQy< nDim, nDist, SysEqn >::m_mucousDist = nullptr
private

Definition at line 135 of file lbbndcnddxqy.h.

◆ m_oldWallTemp

template<MInt nDim, MInt nDist, class SysEqn >
MFloat** LbBndCndDxQy< nDim, nDist, SysEqn >::m_oldWallTemp = nullptr
private

Definition at line 133 of file lbbndcnddxqy.h.

◆ m_refillMethodOrder

template<MInt nDim, MInt nDist, class SysEqn >
MInt LbBndCndDxQy< nDim, nDist, SysEqn >::m_refillMethodOrder
private

Definition at line 113 of file lbbndcnddxqy.h.

◆ m_solver

template<MInt nDim, MInt nDist, class SysEqn >
LbSolverDxQy<nDim, nDist, SysEqn>* LbBndCndDxQy< nDim, nDist, SysEqn >::m_solver
protected

Definition at line 330 of file lbbndcnddxqy.h.

◆ m_sysEqn

template<MInt nDim, MInt nDist, class SysEqn >
const SysEqn LbBndCndDxQy< nDim, nDist, SysEqn >::m_sysEqn {}
private

Definition at line 20 of file lbbndcnddxqy.h.

◆ m_zeroInflowVelocity

template<MInt nDim, MInt nDist, class SysEqn >
MFloat LbBndCndDxQy< nDim, nDist, SysEqn >::m_zeroInflowVelocity
private

Definition at line 112 of file lbbndcnddxqy.h.

◆ mucosaThickness

template<MInt nDim, MInt nDist, class SysEqn >
MFloat LbBndCndDxQy< nDim, nDist, SysEqn >::mucosaThickness = F0

Definition at line 122 of file lbbndcnddxqy.h.

◆ noMissDistBnd

template<MInt nDim, MInt nDist, class SysEqn >
std::vector<MInt> LbBndCndDxQy< nDim, nDist, SysEqn >::noMissDistBnd
private

Definition at line 114 of file lbbndcnddxqy.h.

◆ noMissDistBndWeighted

template<MInt nDim, MInt nDist, class SysEqn >
std::vector<std::vector<MFloat> > LbBndCndDxQy< nDim, nDist, SysEqn >::noMissDistBndWeighted
private

Definition at line 115 of file lbbndcnddxqy.h.

◆ plugFlow

template<MInt nDim, MInt nDist, class SysEqn >
MInt LbBndCndDxQy< nDim, nDist, SysEqn >::plugFlow = 0

Definition at line 130 of file lbbndcnddxqy.h.

◆ refC

template<MInt nDim, MInt nDist, class SysEqn >
MFloat LbBndCndDxQy< nDim, nDist, SysEqn >::refC = F0

Definition at line 127 of file lbbndcnddxqy.h.

◆ refCondF

template<MInt nDim, MInt nDist, class SysEqn >
MFloat LbBndCndDxQy< nDim, nDist, SysEqn >::refCondF = F0

Definition at line 129 of file lbbndcnddxqy.h.

◆ refDiff

template<MInt nDim, MInt nDist, class SysEqn >
MFloat LbBndCndDxQy< nDim, nDist, SysEqn >::refDiff = F0

Definition at line 128 of file lbbndcnddxqy.h.

◆ refDx

template<MInt nDim, MInt nDist, class SysEqn >
MFloat LbBndCndDxQy< nDim, nDist, SysEqn >::refDx = F0

Definition at line 125 of file lbbndcnddxqy.h.

◆ refT

template<MInt nDim, MInt nDist, class SysEqn >
MFloat LbBndCndDxQy< nDim, nDist, SysEqn >::refT = F0

Definition at line 126 of file lbbndcnddxqy.h.

◆ T_o

template<MInt nDim, MInt nDist, class SysEqn >
MFloat LbBndCndDxQy< nDim, nDist, SysEqn >::T_o = F0

Definition at line 120 of file lbbndcnddxqy.h.


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