MAIA bb96820c
Multiphysics at AIA
Loading...
Searching...
No Matches
CouplerLbFv< nDim, nDist, SysEqnLb, SysEqnFv > Class Template Reference

#include <couplerlbfv.h>

Inheritance diagram for CouplerLbFv< nDim, nDist, SysEqnLb, SysEqnFv >:
[legend]
Collaboration diagram for CouplerLbFv< nDim, nDist, SysEqnLb, SysEqnFv >:
[legend]

Classes

struct  ConversionFactors
 

Public Types

using LbSolver = LbSolverDxQy< nDim, nDist, SysEqnLb >
 
using FvCartesianSolver = FvCartesianSolverXD< nDim, SysEqnFv >
 
using BaseLb = CouplingLB< nDim, nDist, SysEqnLb >
 
using BaseFv = CouplingFv< nDim, SysEqnFv >
 
using Cell = typename maia::grid::tree::Tree< nDim >::Cell
 
- Public Types inherited from CouplingFv< nDim, SysEqnFv >
using solverType = FvCartesianSolverXD< nDim, SysEqnFv >
 
- Public Types inherited from CouplingLB< nDim, nDist, SysEqnLb >
using solverType = LbSolverDxQy< nDim, nDist, SysEqnLb >
 
using LbBndCnd = LbBndCndDxQy< nDim, nDist, SysEqnLb >
 
using MbCellCollector = maia::lb::collector::LbMbCellCollector< nDim >
 

Public Member Functions

 CouplerLbFv (const MInt couplingId, LbSolver *lb, FvCartesianSolver *fv)
 
virtual void init ()
 
virtual void initConversionFactors ()
 
void postCouple (MInt)
 
virtual void finalizeCouplerInit ()
 
virtual void finalizeSubCoupleInit (MInt)
 
virtual void subCouple (MInt, MInt, std::vector< MBool > &)
 
virtual void checkProperties ()
 
virtual void readProperties ()
 
MInt fv2lbId (const MInt fvId) const
 
MInt lb2fvId (const MInt lbId) const
 
void testCoupling ()
 
MInt a_fvSolverId () const
 
MInt a_lbSolverId () const
 
- Public Member Functions inherited from CouplingFv< nDim, SysEqnFv >
 CouplingFv (const MInt couplingId, std::vector< FvCartesianSolverXD< nDim, SysEqnFv > * > fvSolvers, const MInt noSolvers)
 
 CouplingFv (const MInt couplingId, Solver *solvers)
 
 CouplingFv (const CouplingFv &)=delete
 
 ~CouplingFv () override=default
 
CouplingFvoperator= (const CouplingFv &)=delete
 
- 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 CouplingLB< nDim, nDist, SysEqnLb >
 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 Attributes

ConversionFactors conversionLbFv
 
ConversionFactors conversionFvLb
 

Private Member Functions

void initData ()
 
void cleanUp () override
 

Private Attributes

MInt m_lbSolverId {}
 
MInt m_fvSolverId {}
 
MFloat m_cfl {}
 
MFloat m_maxVelocity {}
 
MInt m_timeStepMethod {}
 
MString m_solverMethod
 

Friends

class LbSolverDxQy< nDim, nDist, SysEqnLb >
 
class LbBndCndDxQy< nDim, nDist, SysEqnLb >
 
class FvCartesianSolverXD< nDim, SysEqnFv >
 

Additional Inherited Members

- Protected Member Functions inherited from CouplingFv< nDim, SysEqnFv >
MInt noSolvers () const
 
solverTypefvSolver (const MInt solverId=0) const
 
MInt a_noFvCells () const
 
MInt a_noFvGridCells () const
 
- Protected Member Functions inherited from Coupling
MFloat returnLoadRecord () const
 
MFloat returnIdleRecord () const
 
- Protected Member Functions inherited from CouplingLB< nDim, nDist, SysEqnLb >
MInt noSolvers () const
 
solverTypelbSolver (const MInt solverId=0) const
 
LbBndCndlbBndCnd (const MInt id=0)
 
- Protected Attributes inherited from CouplingFv< nDim, SysEqnFv >
std::vector< solverType * > m_fvSolvers
 

Detailed Description

template<MInt nDim, MInt nDist, class SysEqnLb, class SysEqnFv>
class CouplerLbFv< nDim, nDist, SysEqnLb, SysEqnFv >

Definition at line 43 of file couplerlbfv.h.

Member Typedef Documentation

◆ BaseFv

template<MInt nDim, MInt nDist, class SysEqnLb , class SysEqnFv >
using CouplerLbFv< nDim, nDist, SysEqnLb, SysEqnFv >::BaseFv = CouplingFv<nDim, SysEqnFv>

Definition at line 55 of file couplerlbfv.h.

◆ BaseLb

template<MInt nDim, MInt nDist, class SysEqnLb , class SysEqnFv >
using CouplerLbFv< nDim, nDist, SysEqnLb, SysEqnFv >::BaseLb = CouplingLB<nDim, nDist, SysEqnLb>

Definition at line 54 of file couplerlbfv.h.

◆ Cell

template<MInt nDim, MInt nDist, class SysEqnLb , class SysEqnFv >
using CouplerLbFv< nDim, nDist, SysEqnLb, SysEqnFv >::Cell = typename maia::grid::tree::Tree<nDim>::Cell

Definition at line 59 of file couplerlbfv.h.

◆ FvCartesianSolver

template<MInt nDim, MInt nDist, class SysEqnLb , class SysEqnFv >
using CouplerLbFv< nDim, nDist, SysEqnLb, SysEqnFv >::FvCartesianSolver = FvCartesianSolverXD<nDim, SysEqnFv>

Definition at line 52 of file couplerlbfv.h.

◆ LbSolver

template<MInt nDim, MInt nDist, class SysEqnLb , class SysEqnFv >
using CouplerLbFv< nDim, nDist, SysEqnLb, SysEqnFv >::LbSolver = LbSolverDxQy<nDim, nDist, SysEqnLb>

Definition at line 51 of file couplerlbfv.h.

Constructor & Destructor Documentation

◆ CouplerLbFv()

template<MInt nDim, MInt nDist, class SysEqnLb , class SysEqnFv >
CouplerLbFv< nDim, nDist, SysEqnLb, SysEqnFv >::CouplerLbFv ( const MInt  couplingId,
LbSolver lb,
FvCartesianSolver fv 
)

Definition at line 11 of file couplerlbfv.cpp.

12 : Coupling(couplingId),
13 CouplingFv<nDim, SysEqnFv>(couplingId, fv),
14 CouplingLB<nDim, nDist, SysEqnLb>(couplingId, lb) {
15 initData();
17
18 // calculation of cfl to sync the timesteps of the FV to the LB
19 const MFloat newCFL = (1.0 + fvSolver().a_Ma()) / sqrt(3.0);
20 fvSolver().a_cfl() = newCFL;
21
22 if(fvSolver().domainId() == 0) {
23 std::cerr << "CFL number calculated and set to: " << newCFL << std::endl;
24 m_log << "CFL number calculated and set to: " << newCFL << std::endl;
25 }
26
28}
virtual void initConversionFactors()
Definition: couplerlbfv.cpp:31
void initData()
Definition: couplerlbfv.cpp:63
virtual void readProperties()
Definition: couplerlbfv.cpp:72
solverType & fvSolver(const MInt solverId=0) const
Definition: coupling.h:386
InfoOutFile m_log
double MFloat
Definition: maiatypes.h:52

Member Function Documentation

◆ a_fvSolverId()

template<MInt nDim, MInt nDist, class SysEqnLb , class SysEqnFv >
MInt CouplerLbFv< nDim, nDist, SysEqnLb, SysEqnFv >::a_fvSolverId ( ) const
inline

Definition at line 120 of file couplerlbfv.h.

120{ return m_fvSolverId; }
MInt m_fvSolverId
Definition: couplerlbfv.h:66

◆ a_lbSolverId()

template<MInt nDim, MInt nDist, class SysEqnLb , class SysEqnFv >
MInt CouplerLbFv< nDim, nDist, SysEqnLb, SysEqnFv >::a_lbSolverId ( ) const
inline

Definition at line 121 of file couplerlbfv.h.

121{ return m_lbSolverId; }
MInt m_lbSolverId
Definition: couplerlbfv.h:65

◆ checkProperties()

template<MInt nDim, MInt nDist, class SysEqnLb , class SysEqnFv >
void CouplerLbFv< nDim, nDist, SysEqnLb, SysEqnFv >::checkProperties
virtual

Implements Coupling.

Definition at line 69 of file couplerlbfv.cpp.

69{}

◆ cleanUp()

template<MInt nDim, MInt nDist, class SysEqnLb , class SysEqnFv >
void CouplerLbFv< nDim, nDist, SysEqnLb, SysEqnFv >::cleanUp ( )
inlineoverrideprivatevirtual

Implements Coupling.

Reimplemented in CouplerLbFvEEMultiphase< nDim, nDist, SysEqnLb, SysEqnFv >.

Definition at line 91 of file couplerlbfv.h.

91{};

◆ finalizeCouplerInit()

template<MInt nDim, MInt nDist, class SysEqnLb , class SysEqnFv >
virtual void CouplerLbFv< nDim, nDist, SysEqnLb, SysEqnFv >::finalizeCouplerInit ( )
inlinevirtual

Implements Coupling.

Reimplemented in CouplerLbFvEEMultiphase< nDim, nDist, SysEqnLb, SysEqnFv >.

Definition at line 109 of file couplerlbfv.h.

109{};

◆ finalizeSubCoupleInit()

template<MInt nDim, MInt nDist, class SysEqnLb , class SysEqnFv >
virtual void CouplerLbFv< nDim, nDist, SysEqnLb, SysEqnFv >::finalizeSubCoupleInit ( MInt  )
inlinevirtual

Implements Coupling.

Reimplemented in CouplerLbFvEEMultiphase< nDim, nDist, SysEqnLb, SysEqnFv >.

Definition at line 110 of file couplerlbfv.h.

110{};

◆ fv2lbId()

template<MInt nDim, MInt nDist, class SysEqnLb , class SysEqnFv >
MInt CouplerLbFv< nDim, nDist, SysEqnLb, SysEqnFv >::fv2lbId ( const MInt  fvId) const
inline

Definition at line 115 of file couplerlbfv.h.

115{ return convertId(fvSolver(), lbSolver(), fvId); };
solverType & lbSolver(const MInt solverId=0) const
Definition: coupling.h:454
MInt convertId(SolverA &solverA, SolverB &solverB, const MInt solverAId)
Conversion from solverA id to the solverB id on the same-level only!
Definition: couplingutils.h:21

◆ init()

template<MInt nDim, MInt nDist, class SysEqnLb , class SysEqnFv >
virtual void CouplerLbFv< nDim, nDist, SysEqnLb, SysEqnFv >::init ( )
inlinevirtual

Implements Coupling.

Reimplemented in CouplerLbFvEEMultiphase< nDim, nDist, SysEqnLb, SysEqnFv >.

Definition at line 106 of file couplerlbfv.h.

106{};

◆ initConversionFactors()

template<MInt nDim, MInt nDist, class SysEqnLb , class SysEqnFv >
void CouplerLbFv< nDim, nDist, SysEqnLb, SysEqnFv >::initConversionFactors
virtual

Definition at line 31 of file couplerlbfv.cpp.

31 {
32 const MFloat lbL2FvL = fvSolver().m_referenceLength / fvSolver().c_cellLengthAtLevel(fvSolver().maxLevel());
33 conversionLbFv.length = lbL2FvL;
34 conversionFvLb.length = 1.0 / lbL2FvL;
35
36 const MFloat lbU2FvU = sqrt(3.0 / (1.0 + (fvSolver().m_gamma - 1.0) / 2.0 * fvSolver().a_Ma() * fvSolver().a_Ma()));
37 conversionLbFv.velocity = lbU2FvU;
38 conversionFvLb.velocity = 1.0 / lbU2FvU;
39
40 MFloat lbP2FvP = pow(fvSolver().m_TInfinity, fvSolver().m_gamma / (fvSolver().m_gamma - 1.0));
41 if(std::isnan(lbP2FvP)) {
42 const MFloat TInf = fvSolver().m_initialCondition == 465 || fvSolver().m_initialCondition == 9465
43 ? 1.0
44 : 1.0 / (1.0 + 0.5 * (fvSolver().m_gamma - 1.0) * POW2(fvSolver().m_Ma));
45 lbP2FvP = pow(TInf, fvSolver().m_gamma / (fvSolver().m_gamma - 1.0));
46 }
47 conversionLbFv.pressure = lbP2FvP;
48 conversionFvLb.pressure = 1.0 / lbP2FvP;
49
50 MFloat lbNu2FvNu = fvSolver().c_cellLengthAtLevel(fvSolver().maxLevel()) * sqrt(fvSolver().m_TInfinity * 3.0)
51 * fvSolver().sysEqn().m_Re0;
52 if(std::isnan(lbNu2FvNu)) {
53 const MFloat TInf = fvSolver().m_initialCondition == 465 || fvSolver().m_initialCondition == 9465
54 ? 1.0
55 : 1.0 / (1.0 + 0.5 * (fvSolver().m_gamma - 1.0) * POW2(fvSolver().m_Ma));
56 lbNu2FvNu = fvSolver().c_cellLengthAtLevel(fvSolver().maxLevel()) * sqrt(TInf * 3.0) * fvSolver().sysEqn().m_Re0;
57 }
58 conversionLbFv.viscosity = lbNu2FvNu;
59 conversionFvLb.viscosity = 1.0 / lbNu2FvNu;
60}
ConversionFactors conversionLbFv
Definition: couplerlbfv.h:103
ConversionFactors conversionFvLb
Definition: couplerlbfv.h:104
MFloat a_Ma(const MInt id=0) const
Definition: coupling.h:472
constexpr SysEqn sysEqn() const
Definition: lbsolverdxqy.h:194
constexpr Real POW2(const Real x)
Definition: functions.h:119

◆ initData()

template<MInt nDim, MInt nDist, class SysEqnLb , class SysEqnFv >
void CouplerLbFv< nDim, nDist, SysEqnLb, SysEqnFv >::initData
private

Definition at line 63 of file couplerlbfv.cpp.

63 {
64 m_fvSolverId = fvSolver().solverId();
65 m_lbSolverId = lbSolver().solverId();
66}

◆ lb2fvId()

template<MInt nDim, MInt nDist, class SysEqnLb , class SysEqnFv >
MInt CouplerLbFv< nDim, nDist, SysEqnLb, SysEqnFv >::lb2fvId ( const MInt  lbId) const
inline

Definition at line 116 of file couplerlbfv.h.

116{ return convertId(lbSolver(), fvSolver(), lbId); };

◆ postCouple()

template<MInt nDim, MInt nDist, class SysEqnLb , class SysEqnFv >
void CouplerLbFv< nDim, nDist, SysEqnLb, SysEqnFv >::postCouple ( MInt  )
inlinevirtual

Implements Coupling.

Definition at line 108 of file couplerlbfv.h.

108{};

◆ readProperties()

template<MInt nDim, MInt nDist, class SysEqnLb , class SysEqnFv >
void CouplerLbFv< nDim, nDist, SysEqnLb, SysEqnFv >::readProperties
virtual

Implements Coupling.

Reimplemented in CouplerLbFvEEMultiphase< nDim, nDist, SysEqnLb, SysEqnFv >.

Definition at line 72 of file couplerlbfv.cpp.

72{}

◆ subCouple()

template<MInt nDim, MInt nDist, class SysEqnLb , class SysEqnFv >
virtual void CouplerLbFv< nDim, nDist, SysEqnLb, SysEqnFv >::subCouple ( MInt  ,
MInt  ,
std::vector< MBool > &   
)
inlinevirtual

Implements Coupling.

Reimplemented in CouplerLbFvEEMultiphase< nDim, nDist, SysEqnLb, SysEqnFv >.

Definition at line 111 of file couplerlbfv.h.

111{};

◆ testCoupling()

template<MInt nDim, MInt nDist, class SysEqnLb , class SysEqnFv >
void CouplerLbFv< nDim, nDist, SysEqnLb, SysEqnFv >::testCoupling ( )

Friends And Related Function Documentation

◆ FvCartesianSolverXD< nDim, SysEqnFv >

template<MInt nDim, MInt nDist, class SysEqnLb , class SysEqnFv >
friend class FvCartesianSolverXD< nDim, SysEqnFv >
friend

Definition at line 1 of file couplerlbfv.h.

◆ LbBndCndDxQy< nDim, nDist, SysEqnLb >

template<MInt nDim, MInt nDist, class SysEqnLb , class SysEqnFv >
friend class LbBndCndDxQy< nDim, nDist, SysEqnLb >
friend

Definition at line 1 of file couplerlbfv.h.

◆ LbSolverDxQy< nDim, nDist, SysEqnLb >

template<MInt nDim, MInt nDist, class SysEqnLb , class SysEqnFv >
friend class LbSolverDxQy< nDim, nDist, SysEqnLb >
friend

Definition at line 1 of file couplerlbfv.h.

Member Data Documentation

◆ conversionFvLb

template<MInt nDim, MInt nDist, class SysEqnLb , class SysEqnFv >
ConversionFactors CouplerLbFv< nDim, nDist, SysEqnLb, SysEqnFv >::conversionFvLb

Definition at line 104 of file couplerlbfv.h.

◆ conversionLbFv

template<MInt nDim, MInt nDist, class SysEqnLb , class SysEqnFv >
ConversionFactors CouplerLbFv< nDim, nDist, SysEqnLb, SysEqnFv >::conversionLbFv

Definition at line 103 of file couplerlbfv.h.

◆ m_cfl

template<MInt nDim, MInt nDist, class SysEqnLb , class SysEqnFv >
MFloat CouplerLbFv< nDim, nDist, SysEqnLb, SysEqnFv >::m_cfl {}
private

Definition at line 68 of file couplerlbfv.h.

◆ m_fvSolverId

template<MInt nDim, MInt nDist, class SysEqnLb , class SysEqnFv >
MInt CouplerLbFv< nDim, nDist, SysEqnLb, SysEqnFv >::m_fvSolverId {}
private

Definition at line 66 of file couplerlbfv.h.

◆ m_lbSolverId

template<MInt nDim, MInt nDist, class SysEqnLb , class SysEqnFv >
MInt CouplerLbFv< nDim, nDist, SysEqnLb, SysEqnFv >::m_lbSolverId {}
private

Definition at line 65 of file couplerlbfv.h.

◆ m_maxVelocity

template<MInt nDim, MInt nDist, class SysEqnLb , class SysEqnFv >
MFloat CouplerLbFv< nDim, nDist, SysEqnLb, SysEqnFv >::m_maxVelocity {}
private

Definition at line 69 of file couplerlbfv.h.

◆ m_solverMethod

template<MInt nDim, MInt nDist, class SysEqnLb , class SysEqnFv >
MString CouplerLbFv< nDim, nDist, SysEqnLb, SysEqnFv >::m_solverMethod
private

Definition at line 71 of file couplerlbfv.h.

◆ m_timeStepMethod

template<MInt nDim, MInt nDist, class SysEqnLb , class SysEqnFv >
MInt CouplerLbFv< nDim, nDist, SysEqnLb, SysEqnFv >::m_timeStepMethod {}
private

Definition at line 70 of file couplerlbfv.h.


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