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

#include <lbrb.h>

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

Classes

struct  ConversionFactors
 
struct  Timers
 

Public Types

using CouplingLb = CouplingLB< nDim, nDist, SysEqn >
 
using CouplingRb = CouplingRigidBodies< nDim >
 
using LbSolver = LbSolverDxQy< nDim, nDist, SysEqn >
 
using RBodies = typename CouplingRb::RBodies
 
- Public Types inherited from CouplingLB< nDim, nDist, SysEqn >
using solverType = LbSolverDxQy< nDim, nDist, SysEqn >
 
using LbBndCnd = LbBndCndDxQy< nDim, nDist, SysEqn >
 
using MbCellCollector = maia::lb::collector::LbMbCellCollector< nDim >
 
- Public Types inherited from CouplingRigidBodies< nDim >
using RBodies = RigidBodies< nDim >
 

Public Member Functions

 LbRb (MInt couplingId, LbSolver *lb, RBodies *rb)
 C'tor for the lattice Boltzmann rigid bodies coupler. More...
 
 ~LbRb ()
 D'tor for the lattice Boltzmann rigid bodies coupler. More...
 
void init () override
 Initialize solver data needed for this coupling. More...
 
void finalizeSubCoupleInit (MInt) override
 
void finalizeCouplerInit () override
 
void preCouple (MInt) override
 
void subCouple (MInt, MInt, std::vector< MBool > &) override
 
void postCouple (MInt) override
 
void postAdaptation () override
 
void finalizeAdaptation (const MInt solverId) override
 Coupling between solver substeps. More...
 
void cleanUp () override
 
void reinitAfterBalance ()
 
void getDomainDecompositionInformation (std::vector< std::pair< MString, MInt > > &) override
 
void initializeSolidDomain ()
 Initialize cells which are inisde the solid domain or just entered the fluid domain. More...
 
void getBodyVelocity (const MInt body, MFloat *const velocity)
 Get body velocity converted to LB units. More...
 
void getBodyAngularVelocity (const MInt body, MFloat *const angularVelocity)
 Get angular body velocity converted to LB units. More...
 
void createBodyTree ()
 
void bc3060 (MInt)
 
void transferLevelSetFieldValues (MBool)
 
void computeGCellTimeStep ()
 
MInt returnNoActiveCorners (MInt)
 
void returnLevelSetSignForFluidCellCorners (MInt, MIntScratchSpace *levelSetCornerSigns, MInt set=0)
 
MInt noLevelSetFieldData ()
 
MInt returnLevelSetSignForFluidFaceCentroid (MInt, MInt, MInt set=0)
 
void constructGField ()
 Dispatch function for the body specific construction of the level set. More...
 
template<MInt bodyType>
void constructGField_ ()
 Constructs the level-set field after each time step. More...
 
template<MInt bodyType>
void descendLevelSetValue (const MInt cellId, const MInt *bodyId, const MInt bodyCnt)
 Descend the level set value to the cells children. More...
 
MInta_associatedBodyIdsMb (const MInt cellId, const MInt set, const MInt id=0)
 
MInt a_associatedBodyIdsMb (const MInt cellId, const MInt set, const MInt id=0) const
 
MFloat a_cellLengthAtLevel (MInt level, const MInt id=0)
 
MInt a_childId (const MInt cellId, const MInt child, const MInt id=0)
 
MFloat a_initTemperatureKelvin (const MInt id=0) const
 
MBool a_isActive (const MInt cellId, const MInt id=0) const
 
MInt a_isThermal (const MInt id=0) const
 
MFloata_levelSetFunctionMb (const MInt cellId, const MInt set, const MInt id=0)
 
MFloat a_levelSetFunctionMb (const MInt cellId, const MInt set, const MInt id=0) const
 
MFloat a_Ma (const MInt id=0) const
 
MbCellCollectora_mbCell (const MInt id=0)
 
MInt a_noCells (const MInt id=0) const
 
MInt a_noDistributions (const MInt id=0) const
 
MInt a_noEmbeddedBodiesLB (const MInt id=0) const
 
MInt a_noLbCells (const MInt id=0) const
 
MInt a_noLevelSetsMb (const MInt id=0) const
 
MInt a_noVariables (const MInt id=0) const
 
MFloata_oldVariable (const MInt cellId, const MInt varId, const MInt id=0)
 
MInt a_parentId (const MInt cellId, const MInt id=0)
 
MInt a_pvrho (const MInt id=0) const
 
MInt a_pvt (const MInt id=0) const
 
MInt a_pvu (const MInt id=0) const
 
MInt a_pvv (const MInt id=0) const
 
MInt a_pvw (const MInt id=0) const
 
MFloat a_Re (const MInt id=0) const
 
MFloata_variable (const MInt cellId, const MInt varId, const MInt id=0)
 
MBool a_wasActive (const MInt cellId, const MInt id=0) const
 
LbBndCndlbBndCnd (const MInt id=0)
 
solverTypelbSolver (const MInt solverId=0) const
 
MInt minCell (const MInt index, const MInt id=0) const
 
MInt noMinCells (const MInt id=0) const
 
MInt a_noCollectorBodies () const
 
RBodiesbodies () const
 
- Public Member Functions inherited from CouplingLB< nDim, nDist, SysEqn >
 CouplingLB (const MInt couplingId, Solver *solvers, const MInt noSolvers=1)
 
 CouplingLB (const MInt couplingId, std::vector< solverType * > solvers)
 
MFloat a_physicalTime () const
 
MFloat lsTimeStep () const
 
MInt a_RKStep () const
 
MInt a_noLbCells (const MInt id=0) const
 
MInt a_noLevelSetsMb (const MInt id=0) const
 
MFloat a_Ma (const MInt id=0) const
 
MFloat a_Re (const MInt id=0) const
 
MInt a_pvu (const MInt id=0) const
 
MInt a_pvv (const MInt id=0) const
 
MInt a_pvw (const MInt id=0) const
 
MInt a_pvrho (const MInt id=0) const
 
MInt a_pvt (const MInt id=0) const
 
MInt a_isThermal (const MInt id=0) const
 
MInt a_noDistributions (const MInt id=0) const
 
MFloat a_initTemperatureKelvin (const MInt id=0) const
 
MFloat a_time () const
 
MbCellCollectora_mbCell (const MInt id=0)
 
MInt a_boundaryCellMb (const MInt cellId, const MInt id=0)
 
MFloata_levelSetFunctionMb (const MInt cellId, const MInt set, const MInt id=0)
 
MFloat a_levelSetFunctionMb (const MInt cellId, const MInt set, const MInt id=0) const
 
MInta_associatedBodyIdsMb (const MInt cellId, const MInt set, const MInt id=0)
 
MInt a_associatedBodyIdsMb (const MInt cellId, const MInt set, const MInt id=0) const
 
MInt a_parentId (const MInt cellId, const MInt id=0)
 
MInt a_childId (const MInt cellId, const MInt child, const MInt id=0)
 
MInt minCell (const MInt index, const MInt id=0) const
 
MInt noMinCells (const MInt id=0) const
 
MInt a_noCells (const MInt id=0) const
 
MFloat a_cellLengthAtLevel (MInt level, const MInt id=0)
 
MInt a_noEmbeddedBodiesLB (const MInt id=0) const
 
MBool a_isActive (const MInt cellId, const MInt id=0) const
 
MBool a_wasActive (const MInt cellId, const MInt id=0) const
 
MInt a_noVariables (const MInt id=0) const
 
MFloata_variable (const MInt cellId, const MInt varId, const MInt id=0)
 
MFloata_oldVariable (const MInt cellId, const MInt varId, const MInt id=0)
 
MInt a_bndCellId (const MInt bndCell, const MInt id=0)
 
MInt a_noBndCells (const MInt id=0)
 
- Public Member Functions inherited from Coupling
 Coupling (const MInt couplingId)
 
virtual ~Coupling ()=default
 
 Coupling (const Coupling &)=delete
 
Couplingoperator= (const Coupling &)=delete
 
MInt couplerId () const
 
virtual void init ()=0
 
virtual void finalizeSubCoupleInit (MInt solverId)=0
 
virtual void finalizeCouplerInit ()=0
 
virtual void preCouple (MInt recipeStep)=0
 
virtual void subCouple (MInt recipeStep, MInt solverId, std::vector< MBool > &solverCompleted)=0
 
virtual void postCouple (MInt recipeStep)=0
 
virtual void cleanUp ()=0
 
virtual void balancePre ()
 Load balancing. More...
 
virtual void balancePost ()
 
virtual void reinitAfterBalance ()
 
virtual void prepareAdaptation ()
 
virtual void postAdaptation ()
 
virtual void finalizeAdaptation (const MInt)
 
virtual void writeRestartFile (const MInt)
 
virtual MInt noCellDataDlb () const
 Methods to inquire coupler data during balancing. More...
 
virtual MInt cellDataTypeDlb (const MInt NotUsed(dataId)) const
 
virtual MInt cellDataSizeDlb (const MInt NotUsed(dataId), const MInt NotUsed(cellId))
 
virtual void getCellDataDlb (const MInt NotUsed(dataId), const MInt NotUsed(oldNoCells), const MInt *const NotUsed(bufferIdToCellId), MInt *const NotUsed(data))
 
virtual void getCellDataDlb (const MInt NotUsed(dataId), const MInt NotUsed(oldNoCells), const MInt *const NotUsed(bufferIdToCellId), MLong *const NotUsed(data))
 
virtual void getCellDataDlb (const MInt NotUsed(dataId), const MInt NotUsed(oldNoCells), const MInt *const NotUsed(bufferIdToCellId), MFloat *const NotUsed(data))
 
virtual void setCellDataDlb (const MInt NotUsed(dataId), const MInt *const NotUsed(data))
 
virtual void setCellDataDlb (const MInt NotUsed(dataId), const MLong *const NotUsed(data))
 
virtual void setCellDataDlb (const MInt NotUsed(dataId), const MFloat *const NotUsed(data))
 
virtual void finalizeBalance (const MInt)
 
virtual MInt noCouplingTimers (const MBool NotUsed(allTimings)) const
 Number of coupling timers. More...
 
virtual void getCouplingTimings (std::vector< std::pair< MString, MFloat > > &NotUsed(timings), const MBool NotUsed(allTimings))
 Return coupling timings. More...
 
virtual void getDomainDecompositionInformation (std::vector< std::pair< MString, MInt > > &NotUsed(domainInfo))
 Return information on current domain decomposition (e.g. number of coupled cells/elements/...) More...
 
void setDlbTimer (const MInt timerId)
 
void startLoadTimer (const MString &name) const
 Start the load timer of the coupler. More...
 
void stopLoadTimer (const MString &name) const
 Stop the load timer of the coupler. More...
 
- Public Member Functions inherited from CouplingRigidBodies< nDim >
 CouplingRigidBodies (const MInt couplingId, RBodies *solver)
 
MInt a_noEmbeddedBodies () const
 
MInt a_noCollectorBodies () const
 

Public Attributes

MInt m_lbSolverId {}
 
MString m_timerType
 
maia::coupling::Mapping bndryToBodyMapping
 
maia::coupling::Mapping bodyToBndryMapping
 
MFloat ** forces = nullptr
 
MBool m_static_updateLevelSetFlowSolver_firstRun = true
 

Static Public Attributes

static constexpr MInt m_noCorners = (nDim == 2) ? 4 : 8
 
static constexpr MInt nRot = (nDim == 3) ? 3 : 1
 

Private Member Functions

void initData ()
 Initializes coupler specific data. More...
 
void initTimers ()
 Creates all timers and subtimers. More...
 
void averageTimer ()
 
void checkProperties ()
 Checks property-data which is read in by both ls-and Lb-Solver. More...
 
void readProperties ()
 Read all relevant properties. More...
 
void updateGeometry ()
 Updates the member-variables in the geometry-intersection class. More...
 

Private Attributes

ConversionFactors conversionRbLb
 
ConversionFactors conversionLbRb
 
std::array< MInt, Timers::_countm_timers
 

Additional Inherited Members

- Protected Member Functions inherited from CouplingLB< nDim, nDist, SysEqn >
MInt noSolvers () const
 
solverTypelbSolver (const MInt solverId=0) const
 
LbBndCndlbBndCnd (const MInt id=0)
 
- Protected Member Functions inherited from Coupling
MFloat returnLoadRecord () const
 
MFloat returnIdleRecord () const
 
- Protected Member Functions inherited from CouplingRigidBodies< nDim >
RBodiesbodies () const
 

Detailed Description

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

Definition at line 28 of file lbrb.h.

Member Typedef Documentation

◆ CouplingLb

template<MInt nDim, MInt nDist, class SysEqn >
using LbRb< nDim, nDist, SysEqn >::CouplingLb = CouplingLB<nDim, nDist, SysEqn>

Definition at line 31 of file lbrb.h.

◆ CouplingRb

template<MInt nDim, MInt nDist, class SysEqn >
using LbRb< nDim, nDist, SysEqn >::CouplingRb = CouplingRigidBodies<nDim>

Definition at line 32 of file lbrb.h.

◆ LbSolver

template<MInt nDim, MInt nDist, class SysEqn >
using LbRb< nDim, nDist, SysEqn >::LbSolver = LbSolverDxQy<nDim, nDist, SysEqn>

Definition at line 34 of file lbrb.h.

◆ RBodies

template<MInt nDim, MInt nDist, class SysEqn >
using LbRb< nDim, nDist, SysEqn >::RBodies = typename CouplingRb::RBodies

Definition at line 35 of file lbrb.h.

Constructor & Destructor Documentation

◆ LbRb()

template<MInt nDim, MInt nDist, class SysEqn >
LbRb< nDim, nDist, SysEqn >::LbRb ( MInt  couplingId,
LbSolver lb,
RBodies rb 
)
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
couplingId[in]Unique id to identify the couplre
lb[in]Pointer to the lattice Botzmann solver
rb[in]Pointer to the rigid bodies solver

Definition at line 30 of file lbrb.cpp.

31 : Coupling(couplingId), CouplingLb(couplingId, lb), CouplingRb(couplingId, rb) {
32 TRACE();
33
34 // Init timers as the first action
35 initTimers();
36
37 initData();
41
42 RECORD_TIMER_STOP(m_timers[Timers::Constructor]);
43}
void initTimers()
Creates all timers and subtimers.
Definition: lbrb.cpp:65
std::array< MInt, Timers::_count > m_timers
Definition: lbrb.h:126
void checkProperties()
Checks property-data which is read in by both ls-and Lb-Solver.
Definition: lbrb.cpp:152
void initData()
Initializes coupler specific data.
Definition: lbrb.cpp:105
void readProperties()
Read all relevant properties.
Definition: lbrb.cpp:165
CouplingRigidBodies< nDim > CouplingRb
Definition: lbrb.h:32
void updateGeometry()
Updates the member-variables in the geometry-intersection class.
Definition: lbrb.cpp:343
CouplingLB< nDim, nDist, SysEqn > CouplingLb
Definition: lbrb.h:31
@ Constructor
Definition: lbrb.h:105

◆ ~LbRb()

template<MInt nDim, MInt nDist, class SysEqn >
LbRb< nDim, nDist, SysEqn >::~LbRb
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

Definition at line 51 of file lbrb.cpp.

51 {
52 TRACE();
53
54 RECORD_TIMER_STOP(m_timers[Timers::Class]);
55
57}
void averageTimer()
Definition: lbrb.cpp:580

Member Function Documentation

◆ a_associatedBodyIdsMb() [1/2]

template<MInt nDim, MInt nDist, class SysEqn >
MInt & CouplingLB< nDim, nDist, SysEqn >::a_associatedBodyIdsMb ( const MInt  cellId,
const MInt  set,
const MInt  id = 0 
)
inline

Definition at line 498 of file coupling.h.

498 {
499 return lbSolver(id).a_associatedBodyIds(cellId, set);
500 }
solverType & lbSolver(const MInt solverId=0) const
Definition: coupling.h:454

◆ a_associatedBodyIdsMb() [2/2]

template<MInt nDim, MInt nDist, class SysEqn >
MInt CouplingLB< nDim, nDist, SysEqn >::a_associatedBodyIdsMb ( const MInt  cellId,
const MInt  set,
const MInt  id = 0 
) const
inline

Definition at line 502 of file coupling.h.

502 {
503 return lbSolver(id).a_associatedBodyIds(cellId, set);
504 }

◆ a_cellLengthAtLevel()

template<MInt nDim, MInt nDist, class SysEqn >
MFloat CouplingLB< nDim, nDist, SysEqn >::a_cellLengthAtLevel ( MInt  level,
const MInt  id = 0 
)
inline

Definition at line 518 of file coupling.h.

518{ return lbSolver(id).grid().cellLengthAtLevel(level); }

◆ a_childId()

template<MInt nDim, MInt nDist, class SysEqn >
MInt CouplingLB< nDim, nDist, SysEqn >::a_childId ( const MInt  cellId,
const MInt  child,
const MInt  id = 0 
)
inline

Definition at line 508 of file coupling.h.

508 {
509 return lbSolver(id).c_childId(cellId, child);
510 }

◆ a_initTemperatureKelvin()

template<MInt nDim, MInt nDist, class SysEqn >
MFloat CouplingLB< nDim, nDist, SysEqn >::a_initTemperatureKelvin ( const MInt  id = 0) const
inline

Definition at line 482 of file coupling.h.

482{ return lbSolver(id).m_initTemperatureKelvin; }

◆ a_isActive()

template<MInt nDim, MInt nDist, class SysEqn >
MBool CouplingLB< nDim, nDist, SysEqn >::a_isActive ( const MInt  cellId,
const MInt  id = 0 
) const
inline

Definition at line 522 of file coupling.h.

522{ return lbSolver(id).a_isActive(cellId); }

◆ a_isThermal()

template<MInt nDim, MInt nDist, class SysEqn >
MInt CouplingLB< nDim, nDist, SysEqn >::a_isThermal ( const MInt  id = 0) const
inline

Definition at line 479 of file coupling.h.

479{ return lbSolver(id).m_isThermal; }

◆ a_levelSetFunctionMb() [1/2]

template<MInt nDim, MInt nDist, class SysEqn >
MFloat & CouplingLB< nDim, nDist, SysEqn >::a_levelSetFunctionMb ( const MInt  cellId,
const MInt  set,
const MInt  id = 0 
)
inline

Definition at line 490 of file coupling.h.

490 {
491 return lbSolver(id).a_levelSetFunctionMB(cellId, set);
492 }

◆ a_levelSetFunctionMb() [2/2]

template<MInt nDim, MInt nDist, class SysEqn >
MFloat CouplingLB< nDim, nDist, SysEqn >::a_levelSetFunctionMb ( const MInt  cellId,
const MInt  set,
const MInt  id = 0 
) const
inline

Definition at line 494 of file coupling.h.

494 {
495 return lbSolver(id).a_levelSetFunctionMB(cellId, set);
496 }

◆ a_Ma()

template<MInt nDim, MInt nDist, class SysEqn >
MFloat CouplingLB< nDim, nDist, SysEqn >::a_Ma ( const MInt  id = 0) const
inline

Definition at line 472 of file coupling.h.

472{ return lbSolver(id).m_Ma; }

◆ a_mbCell()

template<MInt nDim, MInt nDist, class SysEqn >
MbCellCollector & CouplingLB< nDim, nDist, SysEqn >::a_mbCell ( const MInt  id = 0)
inline

Definition at line 486 of file coupling.h.

486{ return lbBndCnd(id).m_boundaryCellsMb; }
MbCellCollector m_boundaryCellsMb
Definition: lbbndcnd.h:57
LbBndCnd & lbBndCnd(const MInt id=0)
Definition: coupling.h:461

◆ a_noCells()

template<MInt nDim, MInt nDist, class SysEqn >
MInt CouplingLB< nDim, nDist, SysEqn >::a_noCells ( const MInt  id = 0) const
inline

Definition at line 516 of file coupling.h.

516{ return lbSolver(id).grid().noCells(); }

◆ a_noCollectorBodies()

template<MInt nDim, MInt nDist, class SysEqn >
MInt CouplingRigidBodies< nDim >::a_noCollectorBodies ( ) const
inline

Definition at line 591 of file coupling.h.

591{ return bodies().noCollectorBodies(); }
RBodies & bodies() const
Definition: coupling.h:594

◆ a_noDistributions()

template<MInt nDim, MInt nDist, class SysEqn >
MInt CouplingLB< nDim, nDist, SysEqn >::a_noDistributions ( const MInt  id = 0) const
inline

Definition at line 481 of file coupling.h.

481{ return lbSolver(id).m_noDistributions; }
static constexpr MInt m_noDistributions
Definition: lbsolverdxqy.h:180

◆ a_noEmbeddedBodiesLB()

template<MInt nDim, MInt nDist, class SysEqn >
MInt CouplingLB< nDim, nDist, SysEqn >::a_noEmbeddedBodiesLB ( const MInt  id = 0) const
inline

Definition at line 520 of file coupling.h.

520{ return lbSolver(id).m_noEmbeddedBodies; }

◆ a_noLbCells()

template<MInt nDim, MInt nDist, class SysEqn >
MInt CouplingLB< nDim, nDist, SysEqn >::a_noLbCells ( const MInt  id = 0) const
inline

Definition at line 470 of file coupling.h.

470{ return lbSolver(id).a_noCells(); }

◆ a_noLevelSetsMb()

template<MInt nDim, MInt nDist, class SysEqn >
MInt CouplingLB< nDim, nDist, SysEqn >::a_noLevelSetsMb ( const MInt  id = 0) const
inline

Definition at line 471 of file coupling.h.

471{ return lbSolver(id).m_noLevelSetsUsedForMb; }

◆ a_noVariables()

template<MInt nDim, MInt nDist, class SysEqn >
MInt CouplingLB< nDim, nDist, SysEqn >::a_noVariables ( const MInt  id = 0) const
inline

Definition at line 526 of file coupling.h.

526{ return lbSolver(id).noVariables(); }

◆ a_oldVariable()

template<MInt nDim, MInt nDist, class SysEqn >
MFloat & CouplingLB< nDim, nDist, SysEqn >::a_oldVariable ( const MInt  cellId,
const MInt  varId,
const MInt  id = 0 
)
inline

Definition at line 533 of file coupling.h.

533 {
534 return lbSolver(id).a_oldVariable(cellId, varId);
535 }

◆ a_parentId()

template<MInt nDim, MInt nDist, class SysEqn >
MInt CouplingLB< nDim, nDist, SysEqn >::a_parentId ( const MInt  cellId,
const MInt  id = 0 
)
inline

Definition at line 506 of file coupling.h.

506{ return lbSolver(id).c_parentId(cellId); }

◆ a_pvrho()

template<MInt nDim, MInt nDist, class SysEqn >
MInt CouplingLB< nDim, nDist, SysEqn >::a_pvrho ( const MInt  id = 0) const
inline

Definition at line 477 of file coupling.h.

477{ return lbSolver(id).PV->RHO; }

◆ a_pvt()

template<MInt nDim, MInt nDist, class SysEqn >
MInt CouplingLB< nDim, nDist, SysEqn >::a_pvt ( const MInt  id = 0) const
inline

Definition at line 478 of file coupling.h.

478{ return lbSolver(id).PV->T; }

◆ a_pvu()

template<MInt nDim, MInt nDist, class SysEqn >
MInt CouplingLB< nDim, nDist, SysEqn >::a_pvu ( const MInt  id = 0) const
inline

Definition at line 474 of file coupling.h.

474{ return lbSolver(id).PV->U; }

◆ a_pvv()

template<MInt nDim, MInt nDist, class SysEqn >
MInt CouplingLB< nDim, nDist, SysEqn >::a_pvv ( const MInt  id = 0) const
inline

Definition at line 475 of file coupling.h.

475{ return lbSolver(id).PV->V; }

◆ a_pvw()

template<MInt nDim, MInt nDist, class SysEqn >
MInt CouplingLB< nDim, nDist, SysEqn >::a_pvw ( const MInt  id = 0) const
inline

Definition at line 476 of file coupling.h.

476{ return lbSolver(id).PV->W; }

◆ a_Re()

template<MInt nDim, MInt nDist, class SysEqn >
MFloat CouplingLB< nDim, nDist, SysEqn >::a_Re ( const MInt  id = 0) const
inline

Definition at line 473 of file coupling.h.

473{ return lbSolver(id).m_Re; }

◆ a_variable()

template<MInt nDim, MInt nDist, class SysEqn >
MFloat & CouplingLB< nDim, nDist, SysEqn >::a_variable ( const MInt  cellId,
const MInt  varId,
const MInt  id = 0 
)
inline

Definition at line 528 of file coupling.h.

528 {
529 return lbSolver(id).a_variable(cellId, varId);
530 }

◆ a_wasActive()

template<MInt nDim, MInt nDist, class SysEqn >
MBool CouplingLB< nDim, nDist, SysEqn >::a_wasActive ( const MInt  cellId,
const MInt  id = 0 
) const
inline

Definition at line 524 of file coupling.h.

524{ return lbSolver(id).a_wasActive(cellId); }

◆ averageTimer()

template<MInt nDim, MInt nDist, class SysEqn >
void LbRb< nDim, nDist, SysEqn >::averageTimer
private

Definition at line 580 of file lbrb.cpp.

580 {
581 TRACE();
582 if(!lbSolver().grid().isActive()) return;
583
584 // Get timer operation
585 m_timerType = "max";
586 m_timerType = Context::getSolverProperty<MString>("timerType", lbSolver().solverId(), AT_, &m_timerType);
587
588 // 0) map timer ids for safety
589 const MInt noTimers = m_timers.size();
590
591 // 1) fill buffer with local timer values
592 std::vector<MFloat> timerValues_;
593 timerValues_.reserve(noTimers);
594 for(MInt i = 0; i < noTimers; i++) {
595 timerValues_.emplace_back(RETURN_TIMER_TIME(m_timers[i]));
596 }
597
598 // 2) collect values from all ranks
599 if(m_timerType == "average") {
600 MPI_Allreduce(MPI_IN_PLACE, timerValues_.data(), noTimers, maia::type_traits<MFloat>::mpiType(), MPI_SUM,
601 lbSolver().mpiComm(), AT_, "MPI_IN_PLACE", "timerValues_");
602 } else {
603 MPI_Allreduce(MPI_IN_PLACE, timerValues_.data(), noTimers, maia::type_traits<MFloat>::mpiType(), MPI_MAX,
604 lbSolver().mpiComm(), AT_, "MPI_IN_PLACE", "timerValues_");
605 }
606
607 // 3) perform averaging on timer and4) set new timer values
608 if(m_timerType == "average") {
609 const MInt noDomains_ = lbSolver().noDomains();
610 for(MInt i = 0; i < noTimers; i++) {
611 const MFloat meanValue = timerValues_[i] / noDomains_;
612 SET_RECORD(m_timers[i], meanValue);
613 }
614 } else {
615 for(MInt i = 0; i < noTimers; i++) {
616 SET_RECORD(m_timers[i], timerValues_[i]);
617 }
618 }
619}
MString m_timerType
Definition: lbrb.h:42
int32_t MInt
Definition: maiatypes.h:62
double MFloat
Definition: maiatypes.h:52
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

◆ bc3060()

template<MInt nDim, MInt nDist, class SysEqn >
void LbRb< nDim, nDist, SysEqn >::bc3060 ( MInt  )

◆ bodies()

template<MInt nDim, MInt nDist, class SysEqn >
RBodies & CouplingRigidBodies< nDim >::bodies ( ) const
inline

Definition at line 594 of file coupling.h.

594{ return *m_rigidBodies; }
RBodies * m_rigidBodies
Definition: coupling.h:597

◆ checkProperties()

template<MInt nDim, MInt nDist, class SysEqn >
void LbRb< nDim, nDist, SysEqn >::checkProperties
privatevirtual
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

Implements Coupling.

Definition at line 152 of file lbrb.cpp.

152 {
153 TRACE();
154
155 lbSolver().m_noLevelSetsUsedForMb = 1;
156 lbSolver().m_maxNoSets = 1;
157}

◆ cleanUp()

template<MInt nDim, MInt nDist, class SysEqn >
void LbRb< nDim, nDist, SysEqn >::cleanUp ( )
inlineoverridevirtual

Implements Coupling.

Definition at line 152 of file lbrb.h.

152{};

◆ computeGCellTimeStep()

template<MInt nDim, MInt nDist, class SysEqn >
void LbRb< nDim, nDist, SysEqn >::computeGCellTimeStep ( )

◆ constructGField()

template<MInt nDim, MInt nDist, class SysEqn >
void LbRb< nDim, nDist, SysEqn >::constructGField
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

Definition at line 442 of file lbrb.cpp.

442 {
443 if(bodies().a_bodyType() == 1)
444 constructGField_<1>();
445 else if(bodies().a_bodyType() == 2)
446 constructGField_<2>();
447 else if(bodies().a_bodyType() == 3)
448 constructGField_<3>();
449 else if(bodies().a_bodyType() == 4)
450 constructGField_<4>();
451 else if(bodies().a_bodyType() == 7)
452 constructGField_<7>();
453 else
454 mTerm(1, AT_, "Body type not implemented!");
455}
void mTerm(const MInt errorCode, const MString &location, const MString &message)
Definition: functions.cpp:29

◆ constructGField_()

template<MInt nDim, MInt nDist, class SysEqn >
template<MInt bodyType>
void LbRb< nDim, nDist, SysEqn >::constructGField_
Author
Lennart Schneiders, Julian Vorspohl j.vor.nosp@m.spoh.nosp@m.l@aia.nosp@m..rwt.nosp@m.h-aac.nosp@m.hen..nosp@m.de
Template Parameters
bodyTypeBody type for which the level set is constructed

Definition at line 466 of file lbrb.cpp.

466 {
467 TRACE();
468
469 RECORD_TIMER_START(m_timers[Timers::Preparation]);
470
471 /* bandwidth at "level" has the no. of cells at "level",
472 whose total width equates to all summed up bands up to "level" */
473 MInt level = lbSolver().maxUniformRefinementLevel() - 1;
474 MFloat m_bodyDistThreshold = 0.0;
475 if(lbSolver().m_adaptation) {
476 m_bodyDistThreshold = lbSolver().m_bandWidth[level] * a_cellLengthAtLevel(level);
477 // m_bodyDistThreshold = 4 * a_cellLengthAtLevel(lbSolver().maxLevel());
478 } else {
479 m_bodyDistThreshold = 2 * a_cellLengthAtLevel(lbSolver().maxLevel());
480 }
481
482 // To be changed later ~jv
483 const MInt m_noLevelSetsUsedForMb = 1;
484
485 // Reset all sets
486 for(MInt cellId = 0; cellId < a_noCells(); cellId++) {
487 for(MInt set = 0; set < m_noLevelSetsUsedForMb; set++) {
488 a_associatedBodyIdsMb(cellId, set) = -1;
489 a_levelSetFunctionMb(cellId, set) = m_bodyDistThreshold + 1e-14;
490 }
491 }
492
493 const MInt noRelevantBodies = a_noCollectorBodies();
494
495 if(noRelevantBodies == 0) {
496 RECORD_TIMER_STOP(m_timers[Timers::Preparation]);
497 return;
498 }
499
500 RECORD_TIMER_STOP(m_timers[Timers::Preparation]);
501
502 // construct vector with connecting Bodies
503 std::vector<MInt> collectorBodyIds(a_noCollectorBodies());
504 for(MInt i = 0; i < a_noCollectorBodies(); i++) {
505 collectorBodyIds[i] = i;
506 }
507
508 for(MInt i = 0; i < noMinCells(); i++) {
509 const MInt cellId = minCell(i);
510 const MFloat minDist = m_bodyDistThreshold + 1e-14;
511
512 for(MInt set = 0; set < m_noLevelSetsUsedForMb; set++) {
513 a_associatedBodyIdsMb(cellId, set) = -1;
514 a_levelSetFunctionMb(cellId, set) = minDist;
515 }
516
517 if(a_noCollectorBodies() > 0) {
518 descendLevelSetValue<bodyType>(cellId, collectorBodyIds.data(), noRelevantBodies);
519 }
520
521 MInt parentId = a_parentId(cellId);
522 while(parentId > -1) {
523 for(MInt set = 0; set < m_noLevelSetsUsedForMb; set++) {
524 a_levelSetFunctionMb(parentId, set) = a_levelSetFunctionMb(cellId, set);
525 a_associatedBodyIdsMb(parentId, set) = a_associatedBodyIdsMb(cellId, set);
526 }
527 parentId = a_parentId(parentId);
528 }
529 }
530}
MFloat a_cellLengthAtLevel(MInt level, const MInt id=0)
Definition: coupling.h:518
MInt & a_associatedBodyIdsMb(const MInt cellId, const MInt set, const MInt id=0)
Definition: coupling.h:498
MInt a_noCollectorBodies() const
Definition: coupling.h:591
MInt a_noCells(const MInt id=0) const
Definition: coupling.h:516
MInt noMinCells(const MInt id=0) const
Definition: coupling.h:514
MInt a_parentId(const MInt cellId, const MInt id=0)
Definition: coupling.h:506
MInt minCell(const MInt index, const MInt id=0) const
Definition: coupling.h:512
MFloat & a_levelSetFunctionMb(const MInt cellId, const MInt set, const MInt id=0)
Definition: coupling.h:490
void const MInt cellId
Definition: collector.h:239
@ Preparation
Definition: lbrb.h:110

◆ createBodyTree()

template<MInt nDim, MInt nDist, class SysEqn >
void LbRb< nDim, nDist, SysEqn >::createBodyTree ( )

◆ descendLevelSetValue()

template<MInt nDim, MInt nDist, class SysEqn >
template<MInt bodyType>
void LbRb< nDim, nDist, SysEqn >::descendLevelSetValue ( const MInt  cellId,
const MInt bodyId,
const MInt  bodyCnt 
)

This function is used recursively starting from the min level cells. The descend is skipped if the distance on the lower level is greater than a given threshold.

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 coarse cell
[in]bodyIdsList of all relevant body ids
[in]bodyCntNumber of bodies

Definition at line 546 of file lbrb.cpp.

546 {
547 const MFloat minLevelThreshold = a_cellLengthAtLevel(lbSolver().a_level(cellId));
548
549 MBool skipDescend = true;
550
551 for(MInt b = 0; b < bodyCnt; b++) {
552 const MInt k = bodyIds[b];
553 const MInt set = 0;
554
555 MFloat dist = bodies().template getDistance<bodyType>(&lbSolver().a_coordinate(cellId, 0), k);
556
557 if(dist < minLevelThreshold) {
558 skipDescend = false;
559 }
560
561 if(fabs(dist) < fabs(a_levelSetFunctionMb(cellId, set)) || (dist < F0)) {
562 a_levelSetFunctionMb(cellId, set) = dist;
563 a_associatedBodyIdsMb(cellId, set) = k;
564 }
565 }
566
567 if(skipDescend || !lbSolver().grid().tree().hasChildren(cellId)) {
568 return;
569 }
570
571 // Recursively descend via children
572 constexpr MInt maxNoChildren = nDim == 3 ? 8 : 4;
573 for(MInt child = 0; child < maxNoChildren; child++) {
574 if(a_childId(cellId, child) < 0) continue;
575 descendLevelSetValue<bodyType>(a_childId(cellId, child), bodyIds, bodyCnt);
576 }
577}
MInt a_childId(const MInt cellId, const MInt child, const MInt id=0)
Definition: coupling.h:508
bool MBool
Definition: maiatypes.h:58
MFloat dist(const Point< DIM > &p, const Point< DIM > &q)
Definition: pointbox.h:54

◆ finalizeAdaptation()

template<MInt nDim, MInt nDist, class SysEqn >
void LbRb< nDim, nDist, SysEqn >::finalizeAdaptation ( const MInt  solverId)
overridevirtual
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]rsCurrent recipe step
[in]sidCurrent solver id after which this function is called
[in]solverCompletedCurrent completion status of all solvers

Reimplemented from Coupling.

Definition at line 213 of file lbrb.cpp.

213 {
214 // LB bnd cnd is restarted after adaptation and needs to be initialized again
215 if(solverId == lbSolver().solverId()) {
216 lbSolver().initializeMovingBoundaries();
218 }
219}
virtual void initializeBndMovingBoundaries()
This function initializes the LbBndCnd for coupled simulations.
Definition: lbbndcnd.cpp:3498

◆ finalizeCouplerInit()

template<MInt nDim, MInt nDist, class SysEqn >
void LbRb< nDim, nDist, SysEqn >::finalizeCouplerInit ( )
inlineoverridevirtual

Implements Coupling.

Definition at line 143 of file lbrb.h.

143{};

◆ finalizeSubCoupleInit()

template<MInt nDim, MInt nDist, class SysEqn >
void LbRb< nDim, nDist, SysEqn >::finalizeSubCoupleInit ( MInt  )
inlineoverridevirtual

Implements Coupling.

Definition at line 142 of file lbrb.h.

142{};

◆ getBodyAngularVelocity()

template<MInt nDim, MInt nDist, class SysEqn >
void LbRb< nDim, nDist, SysEqn >::getBodyAngularVelocity ( const MInt  body,
MFloat *const  angularVelocity 
)
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]bodyBody id
[in]bodyVelocityAngular body velocity

Definition at line 331 of file lbrb.cpp.

331 {
332 for(MInt n = 0; n < nRot; n++) {
333 angularVelocity[n] = bodies().a_angularVelocity(body, n) / conversionRbLb.time;
334 }
335}
static constexpr MInt nRot
Definition: lbrb.h:49
ConversionFactors conversionRbLb
Definition: lbrb.h:97

◆ getBodyVelocity()

template<MInt nDim, MInt nDist, class SysEqn >
void LbRb< nDim, nDist, SysEqn >::getBodyVelocity ( const MInt  body,
MFloat *const  bodyVelocity 
)
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]bodyBody id
[in]bodyVelocityBody velocity

Definition at line 316 of file lbrb.cpp.

316 {
317 for(MInt n = 0; n < nDim; n++) {
318 bodyVelocity[n] = bodies().a_bodyVelocity(body, n) * conversionRbLb.velocity;
319 }
320}

◆ getDomainDecompositionInformation()

template<MInt nDim, MInt nDist, class SysEqn >
void LbRb< nDim, nDist, SysEqn >::getDomainDecompositionInformation ( std::vector< std::pair< MString, MInt > > &  )
inlineoverride

Definition at line 154 of file lbrb.h.

154{};

◆ init()

template<MInt nDim, MInt nDist, class SysEqn >
void LbRb< nDim, nDist, SysEqn >::init
overridevirtual
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

Implements Coupling.

Definition at line 173 of file lbrb.cpp.

173 {
174 TRACE();
175
176 // LB solver
177 lbSolver().initializeMovingBoundaries();
179
180 // RB solver
181 bodies().setTimestep(conversionLbRb.time);
182
183 // Construct level set for initial adaptation
184 RECORD_TIMER_START(m_timers[Timers::CouplePostRb]);
185 RECORD_TIMER_START(m_timers[Timers::ConstructGField]);
187 RECORD_TIMER_STOP(m_timers[Timers::ConstructGField]);
188 RECORD_TIMER_STOP(m_timers[Timers::CouplePostRb]);
189}
ConversionFactors conversionLbRb
Definition: lbrb.h:98
void constructGField()
Dispatch function for the body specific construction of the level set.
Definition: lbrb.cpp:442
@ ConstructGField
Definition: lbrb.h:109
@ CouplePostRb
Definition: lbrb.h:107

◆ initData()

template<MInt nDim, MInt nDist, class SysEqn >
void LbRb< nDim, nDist, SysEqn >::initData
private
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

Definition at line 105 of file lbrb.cpp.

105 {
106 TRACE();
107
108 // update RB grid meta data
109 bodies().updateMaxLevel(lbSolver().maxLevel());
110
111 // Conversion factors
112 const MFloat dx = a_cellLengthAtLevel(lbSolver().maxLevel());
113
116
117 conversionLbRb.velocity = sqrt(3) / a_Ma();
119
122
125
128
129 bodies().setTimestep(conversionLbRb.time);
130
131#ifndef NDEBUG
132 if(!lbSolver().domainId()) {
133 std::cout << "CONVERSION" << std::endl
134 << "LENGTH LB RB " << conversionLbRb.length << std::endl
135 << "LENGTH RB LB " << conversionRbLb.length << std::endl
136 << "VEL LB RB " << conversionLbRb.velocity << std::endl
137 << "VEL RB LB " << conversionRbLb.velocity << std::endl
138 << "TIME LB RB " << conversionLbRb.time << std::endl
139 << "TIME RB LB " << conversionRbLb.time << std::endl
140 << "FORCE LB RB " << conversionLbRb.force << std::endl
141 << "FORCE RB LB " << conversionRbLb.force << std::endl;
142 }
143#endif
144}
MFloat a_Ma(const MInt id=0) const
Definition: coupling.h:472
constexpr Real POW2(const Real x)
Definition: functions.h:119

◆ initializeSolidDomain()

template<MInt nDim, MInt nDist, class SysEqn >
void LbRb< nDim, nDist, SysEqn >::initializeSolidDomain
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

Definition at line 357 of file lbrb.cpp.

357 {
358 TRACE();
359
360 if(lbSolver().noNeighborDomains() > 0) {
361 lbSolver().exchangeOldDistributions();
362 }
363
364 MFloatScratchSpace bodyVelocities(a_noCollectorBodies(), nDim, AT_, "bodyVelocities");
365
366 // Get the body Velocity for each embedded body
367 for(MInt body = 0; body < a_noCollectorBodies(); body++) {
368 getBodyVelocity(body, &bodyVelocities(body, 0));
369 }
370
371 for(MInt i = 0; i < a_noCells(); i++) {
372 // Regular fluid cell
373 if(a_isActive(i) && a_wasActive(i)) {
374 continue;
375 }
376
377 // Regular Solid cell
378 if(!a_isActive(i)) {
379 if(!lbSolver().c_isLeafCell(i)) {
380 continue;
381 }
382
383 // determine the body to which the cell belongs, to set the right body velocity
384 MInt bodyId = -1;
385 MInt setOfBody = 0;
386 for(MInt set = lbSolver().m_levelSetId; set < lbSolver().m_maxNoSets; set++) {
387 if(a_associatedBodyIdsMb(i, set) >= 0) {
388 bodyId = a_associatedBodyIdsMb(i, set);
389 setOfBody = set;
390 break;
391 }
392 }
393
394 // if body was deleted, the halo cells that were occupied by the body in the previous timeStep, must be refilled
395 // now
396 if(bodyId == -1 && lbSolver().a_isHalo(i) && bodies().m_bodyWasDeleted) {
398 lbSolver().a_isActive(i) = 1;
399 continue;
400 }
401
402 ASSERT(bodyId > -1, "No valid bodyId for solid cell! (bodyId=" << bodyId << ") (" << lbSolver().a_coordinate(i, 0)
403 << " " << lbSolver().a_coordinate(i, 1) << ") ("
404 << i << " " << lbSolver().c_globalId(i) << ")"
405 << " isHalo " << lbSolver().a_isHalo(i));
406
407 // the Velocity of the deactivated cell is set to the body velocity
408 // the Density is set to 1.0
409 if((bodyId >= 0) && (bodyId < a_noCollectorBodies()) && (a_levelSetFunctionMb(i, setOfBody) < 0)) {
410 for(MInt j = 0; j < nDim; j++) {
411 a_variable(i, j) = bodyVelocities(bodyId, j);
412 a_oldVariable(i, j) = bodyVelocities(bodyId, j);
413 }
414 } else {
415 for(MInt j = 0; j < a_noVariables(); j++) {
416 a_variable(i, j) = F0;
417 a_oldVariable(i, j) = F0;
418 }
419 }
420 a_variable(i, a_pvrho()) = 1.0;
421 a_oldVariable(i, a_pvrho()) = 1.0;
422
423 if(a_isThermal()) {
425 }
426
427 // Distributions are not set since they are not used for solid nodes
428 } else {
429 // New fluid cell
431 }
432 }
433 bodies().m_bodyWasDeleted = false;
434}
void refillEmergedCell(const MInt)
MInt a_isThermal(const MInt id=0) const
Definition: coupling.h:479
MBool a_isActive(const MInt cellId, const MInt id=0) const
Definition: coupling.h:522
MFloat & a_oldVariable(const MInt cellId, const MInt varId, const MInt id=0)
Definition: coupling.h:533
MInt a_pvt(const MInt id=0) const
Definition: coupling.h:478
MInt a_pvrho(const MInt id=0) const
Definition: coupling.h:477
MBool a_wasActive(const MInt cellId, const MInt id=0) const
Definition: coupling.h:524
MFloat a_initTemperatureKelvin(const MInt id=0) const
Definition: coupling.h:482
MFloat & a_variable(const MInt cellId, const MInt varId, const MInt id=0)
Definition: coupling.h:528
void getBodyVelocity(const MInt body, MFloat *const velocity)
Get body velocity converted to LB units.
Definition: lbrb.cpp:316
MInt a_noVariables(const MInt id=0) const
Definition: coupling.h:526
This class is a ScratchSpace.
Definition: scratch.h:758

◆ initTimers()

template<MInt nDim, MInt nDist, class SysEqn >
void LbRb< nDim, nDist, SysEqn >::initTimers
private
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

Definition at line 65 of file lbrb.cpp.

65 {
66 TRACE();
67
68 // Create timer group and coupler timer, and start the timer
69 NEW_TIMER_GROUP_NOCREATE(m_timers[Timers::TimerGroup], "LbRb");
70 NEW_TIMER_NOCREATE(m_timers[Timers::Class], "Total object lifetime", m_timers[Timers::TimerGroup]);
71 RECORD_TIMER_START(m_timers[Timers::Class]);
72
73 // Create and start constructor timer
74 NEW_SUB_TIMER_NOCREATE(m_timers[Timers::Constructor], "Constructor", m_timers[Timers::Class]);
75 RECORD_TIMER_START(m_timers[Timers::Constructor]);
76
77 // Create Couple timers
78 NEW_SUB_TIMER_NOCREATE(m_timers[Timers::CouplePostRb], "Couple post RB", m_timers[Timers::Class]);
79 NEW_SUB_TIMER_NOCREATE(m_timers[Timers::ConstructGField], "ConstructGField", m_timers[Timers::CouplePostRb]);
80 NEW_SUB_TIMER_NOCREATE(m_timers[Timers::Preparation], "Prepare construct", m_timers[Timers::ConstructGField]);
81
82 NEW_SUB_TIMER_NOCREATE(m_timers[Timers::FindBoundaryCells], "FindBoundaryCells", m_timers[Timers::CouplePostRb]);
83
84 NEW_SUB_TIMER_NOCREATE(m_timers[Timers::PreCouple], "Pre Couple", m_timers[Timers::FindBoundaryCells]);
85 NEW_SUB_TIMER_NOCREATE(m_timers[Timers::FindBoundaryMapping], "Find Boundary Mapping",
87
88 NEW_SUB_TIMER_NOCREATE(m_timers[Timers::InitSolidDomain], "InitSolidDomain", m_timers[Timers::CouplePostRb]);
89 NEW_SUB_TIMER_NOCREATE(m_timers[Timers::SetBoundaryVelocity], "SetBoundaryVelocity", m_timers[Timers::CouplePostRb]);
90
91 NEW_SUB_TIMER_NOCREATE(m_timers[Timers::CouplePostLb], "Couple post LB", m_timers[Timers::Class]);
92
93 NEW_SUB_TIMER_NOCREATE(m_timers[Timers::CreateComm], "CreateComm", m_timers[Timers::CouplePostLb]);
94 NEW_SUB_TIMER_NOCREATE(m_timers[Timers::ApplyBC], "ApplyBC", m_timers[Timers::CouplePostLb]);
95 NEW_SUB_TIMER_NOCREATE(m_timers[Timers::ComputeBodyForces], "ComputeBodyForces", m_timers[Timers::CouplePostLb]);
96}
@ SetBoundaryVelocity
Definition: lbrb.h:114
@ CreateComm
Definition: lbrb.h:115
@ ComputeBodyForces
Definition: lbrb.h:117
@ FindBoundaryMapping
Definition: lbrb.h:120
@ PreCouple
Definition: lbrb.h:119
@ InitSolidDomain
Definition: lbrb.h:113
@ FindBoundaryCells
Definition: lbrb.h:112
@ ApplyBC
Definition: lbrb.h:116
@ CouplePostLb
Definition: lbrb.h:106
@ TimerGroup
Definition: lbrb.h:102

◆ lbBndCnd()

template<MInt nDim, MInt nDist, class SysEqn >
LbBndCnd & CouplingLB< nDim, nDist, SysEqn >::lbBndCnd ( const MInt  id = 0)
inline

Definition at line 461 of file coupling.h.

461{ return *lbSolver(id).m_bndCnd; }
LbBndCnd * m_bndCnd
Pointers for the Boundary Conditions, for flow solving.
Definition: lbsolverdxqy.h:332

◆ lbSolver()

template<MInt nDim, MInt nDist, class SysEqn >
solverType & CouplingLB< nDim, nDist, SysEqn >::lbSolver ( const MInt  solverId = 0) const
inline

Definition at line 454 of file coupling.h.

454 {
455 ASSERT(solverId < noSolvers(), "Invalid solverId " + std::to_string(solverId) + "/" + std::to_string(noSolvers()));
456 return *m_lbSolvers[solverId];
457 }
std::vector< solverType * > m_lbSolvers
Definition: coupling.h:464
MInt noSolvers() const
Definition: coupling.h:453

◆ minCell()

template<MInt nDim, MInt nDist, class SysEqn >
MInt CouplingLB< nDim, nDist, SysEqn >::minCell ( const MInt  index,
const MInt  id = 0 
) const
inline

Definition at line 512 of file coupling.h.

512{ return lbSolver(id).grid().minCell(index); }

◆ noLevelSetFieldData()

template<MInt nDim, MInt nDist, class SysEqn >
MInt LbRb< nDim, nDist, SysEqn >::noLevelSetFieldData ( )

◆ noMinCells()

template<MInt nDim, MInt nDist, class SysEqn >
MInt CouplingLB< nDim, nDist, SysEqn >::noMinCells ( const MInt  id = 0) const
inline

Definition at line 514 of file coupling.h.

514{ return lbSolver(id).grid().noMinCells(); }

◆ postAdaptation()

template<MInt nDim, MInt nDist, class SysEqn >
void LbRb< nDim, nDist, SysEqn >::postAdaptation
overridevirtual

Reimplemented from Coupling.

Definition at line 192 of file lbrb.cpp.

192 {
193 // Update conversion factors
194 initData();
195 // Construct level set to initialize newly refined cells
196 RECORD_TIMER_START(m_timers[Timers::CouplePostRb]);
197 RECORD_TIMER_START(m_timers[Timers::ConstructGField]);
199 RECORD_TIMER_STOP(m_timers[Timers::ConstructGField]);
200 RECORD_TIMER_STOP(m_timers[Timers::CouplePostRb]);
201}

◆ postCouple()

template<MInt nDim, MInt nDist, class SysEqn >
void LbRb< nDim, nDist, SysEqn >::postCouple ( MInt  )
inlineoverridevirtual

Implements Coupling.

Definition at line 147 of file lbrb.h.

147{};

◆ preCouple()

template<MInt nDim, MInt nDist, class SysEqn >
void LbRb< nDim, nDist, SysEqn >::preCouple ( MInt  )
inlineoverridevirtual

Implements Coupling.

Definition at line 145 of file lbrb.h.

145{};

◆ readProperties()

template<MInt nDim, MInt nDist, class SysEqn >
void LbRb< nDim, nDist, SysEqn >::readProperties
privatevirtual
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

Implements Coupling.

Definition at line 165 of file lbrb.cpp.

165{}

◆ reinitAfterBalance()

template<MInt nDim, MInt nDist, class SysEqn >
void LbRb< nDim, nDist, SysEqn >::reinitAfterBalance ( )
inlinevirtual

Reimplemented from Coupling.

Definition at line 153 of file lbrb.h.

153{};

◆ returnLevelSetSignForFluidCellCorners()

template<MInt nDim, MInt nDist, class SysEqn >
void LbRb< nDim, nDist, SysEqn >::returnLevelSetSignForFluidCellCorners ( MInt  ,
MIntScratchSpace levelSetCornerSigns,
MInt  set = 0 
)

◆ returnLevelSetSignForFluidFaceCentroid()

template<MInt nDim, MInt nDist, class SysEqn >
MInt LbRb< nDim, nDist, SysEqn >::returnLevelSetSignForFluidFaceCentroid ( MInt  ,
MInt  ,
MInt  set = 0 
)

◆ returnNoActiveCorners()

template<MInt nDim, MInt nDist, class SysEqn >
MInt LbRb< nDim, nDist, SysEqn >::returnNoActiveCorners ( MInt  )

◆ subCouple()

template<MInt nDim, MInt nDist, class SysEqn >
void LbRb< nDim, nDist, SysEqn >::subCouple ( MInt  ,
MInt  sid,
std::vector< MBool > &  solverCompleted 
)
overridevirtual

Implements Coupling.

Definition at line 222 of file lbrb.cpp.

222 {
223 // Do nothing if both solver already finished
224 if(solverCompleted[lbSolver().solverId()] && solverCompleted[bodies().solverId()]) {
225 return;
226 }
227
228 if(sid == bodies().solverId()) {
229 // POST RB
230 RECORD_TIMER_START(m_timers[Timers::CouplePostRb]);
231 RECORD_TIMER_START(m_timers[Timers::ConstructGField]);
233 RECORD_TIMER_STOP(m_timers[Timers::ConstructGField]);
234
235 std::vector<MInt> maxGCellLevels(lbSolver().m_maxNoSets);
236 for(MInt set = 0; set < lbSolver().m_maxNoSets; set++) {
237 maxGCellLevels[set] = lbSolver().maxLevel();
238 }
239
240 RECORD_TIMER_START(m_timers[Timers::FindBoundaryCells]);
241 RECORD_TIMER_START(m_timers[Timers::PreCouple]);
242 lbSolver().preCoupleLs(maxGCellLevels);
243 RECORD_TIMER_STOP(m_timers[Timers::PreCouple]);
244
245 RECORD_TIMER_START(m_timers[Timers::FindBoundaryMapping]);
246 lbSolver().createBndryToBodyMapping(bndryToBodyMapping, bodyToBndryMapping);
247 RECORD_TIMER_STOP(m_timers[Timers::FindBoundaryMapping]);
248 RECORD_TIMER_STOP(m_timers[Timers::FindBoundaryCells]);
249
250 RECORD_TIMER_START(m_timers[Timers::InitSolidDomain]);
252 RECORD_TIMER_STOP(m_timers[Timers::InitSolidDomain]);
253
254 RECORD_TIMER_START(m_timers[Timers::SetBoundaryVelocity]);
255
256 struct {
257 MFloat velocity;
258 MFloat angularVelocity;
259 MFloat length;
260 MFloat temperature;
261 } conversion{conversionRbLb.velocity, conversionLbRb.time, 1.0 / a_cellLengthAtLevel(lbSolver().maxLevel()), 1.0};
262
263 maia::coupling::setBoundaryVelocity<nDim>(bodies(), a_mbCell(), bodyToBndryMapping, conversion);
264
265 RECORD_TIMER_STOP(m_timers[Timers::SetBoundaryVelocity]);
266 RECORD_TIMER_STOP(m_timers[Timers::CouplePostRb]);
267
268 } else if(sid == lbSolver().solverId()) {
269 // POST LB
270 RECORD_TIMER_START(m_timers[Timers::CouplePostLb]);
271 RECORD_TIMER_START(m_timers[Timers::CreateComm]);
273 RECORD_TIMER_STOP(m_timers[Timers::CreateComm]);
274
275 RECORD_TIMER_START(m_timers[Timers::ApplyBC]);
277 RECORD_TIMER_STOP(m_timers[Timers::ApplyBC]);
278
279 RECORD_TIMER_START(m_timers[Timers::ComputeBodyForces]);
280
281 struct {
282 MFloat force;
283 MFloat length;
284 } const conversion{conversionLbRb.force, 1.0};
285
286 if(a_noCollectorBodies() > 0) {
287 maia::coupling::setBoundaryForceAndTorque<nDim>(a_mbCell(), bodies(), bndryToBodyMapping, conversion);
288 }
289
290#ifndef NDEBUG
291 for(MInt b = 0; b < a_noCollectorBodies(); b++) {
292 for(MInt n = 0; n < nDim; n++) {
293 if(std::isnan(bodies().a_bodyForce(b, n))) {
294 std::cout << "SUM FORCE IS NAN AFTER SETBOUNDANDFORCE AT TIMESETEP: " << lbSolver().getCurrentTimeStep()
295 << std::endl;
296 // TERMM(1, "SUM FORCE AFTER IS NAN");
297 }
298 }
299 }
300#endif
301
302 RECORD_TIMER_STOP(m_timers[Timers::ComputeBodyForces]);
303 RECORD_TIMER_STOP(m_timers[Timers::CouplePostLb]);
304 }
305}
virtual void createMBComm()
This function creates the communicator for calculating the wall forces of the level-set boundaries.
Definition: lbbndcnd.cpp:3416
virtual void postCouple()
This function does the sub coupling step called from the coupling class.
Definition: lbbndcnd.cpp:3538
maia::coupling::Mapping bodyToBndryMapping
Definition: lbrb.h:45
void initializeSolidDomain()
Initialize cells which are inisde the solid domain or just entered the fluid domain.
Definition: lbrb.cpp:357
MbCellCollector & a_mbCell(const MInt id=0)
Definition: coupling.h:486
maia::coupling::Mapping bndryToBodyMapping
Definition: lbrb.h:44

◆ transferLevelSetFieldValues()

template<MInt nDim, MInt nDist, class SysEqn >
void LbRb< nDim, nDist, SysEqn >::transferLevelSetFieldValues ( MBool  )

◆ updateGeometry()

template<MInt nDim, MInt nDist, class SysEqn >
void LbRb< nDim, nDist, SysEqn >::updateGeometry
private
Author
Tim Wegmann

Definition at line 343 of file lbrb.cpp.

343 {
344 TRACE();
345
346 lbSolver().m_noEmbeddedBodies = 1;
347 lbSolver().m_geometryIntersection->m_noLevelSetsUsedForMb = 1;
348 lbSolver().m_geometryIntersection->m_noEmbeddedBodies = bodies().size();
349}

Member Data Documentation

◆ bndryToBodyMapping

template<MInt nDim, MInt nDist, class SysEqn >
maia::coupling::Mapping LbRb< nDim, nDist, SysEqn >::bndryToBodyMapping

Definition at line 44 of file lbrb.h.

◆ bodyToBndryMapping

template<MInt nDim, MInt nDist, class SysEqn >
maia::coupling::Mapping LbRb< nDim, nDist, SysEqn >::bodyToBndryMapping

Definition at line 45 of file lbrb.h.

◆ conversionLbRb

template<MInt nDim, MInt nDist, class SysEqn >
ConversionFactors LbRb< nDim, nDist, SysEqn >::conversionLbRb
private

Definition at line 98 of file lbrb.h.

◆ conversionRbLb

template<MInt nDim, MInt nDist, class SysEqn >
ConversionFactors LbRb< nDim, nDist, SysEqn >::conversionRbLb
private

Definition at line 97 of file lbrb.h.

◆ forces

template<MInt nDim, MInt nDist, class SysEqn >
MFloat** LbRb< nDim, nDist, SysEqn >::forces = nullptr

Definition at line 46 of file lbrb.h.

◆ m_lbSolverId

template<MInt nDim, MInt nDist, class SysEqn >
MInt LbRb< nDim, nDist, SysEqn >::m_lbSolverId {}

Definition at line 41 of file lbrb.h.

◆ m_noCorners

template<MInt nDim, MInt nDist, class SysEqn >
constexpr MInt LbRb< nDim, nDist, SysEqn >::m_noCorners = (nDim == 2) ? 4 : 8
staticconstexpr

Definition at line 48 of file lbrb.h.

◆ m_static_updateLevelSetFlowSolver_firstRun

template<MInt nDim, MInt nDist, class SysEqn >
MBool LbRb< nDim, nDist, SysEqn >::m_static_updateLevelSetFlowSolver_firstRun = true

Definition at line 51 of file lbrb.h.

◆ m_timers

template<MInt nDim, MInt nDist, class SysEqn >
std::array<MInt, Timers::_count> LbRb< nDim, nDist, SysEqn >::m_timers
private

Definition at line 126 of file lbrb.h.

◆ m_timerType

template<MInt nDim, MInt nDist, class SysEqn >
MString LbRb< nDim, nDist, SysEqn >::m_timerType

Definition at line 42 of file lbrb.h.

◆ nRot

template<MInt nDim, MInt nDist, class SysEqn >
constexpr MInt LbRb< nDim, nDist, SysEqn >::nRot = (nDim == 3) ? 3 : 1
staticconstexpr

Definition at line 49 of file lbrb.h.


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