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

#include <lblpt.h>

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

Public Types

using BaseLb = CouplingLB< nDim, nDist, SysEqn >
 
using LbSolver = typename BaseLb::solverType
 
using BaseLpt = CouplingParticle< nDim >
 
using BaseLptX = CouplingLpt< nDim, CouplingLB< nDim, nDist, SysEqn > >
 
using LptSolver = typename BaseLpt::solverType
 
- Public Types inherited from CouplingLpt< nDim, CouplingLB< nDim, nDist, SysEqn > >
using FlowSolver = typename CouplingFlowSolver::solverType
 
using Lpt = typename CouplingParticle< nDim >::solverType
 
- Public Types inherited from CouplingParticle< nDim >
using solverType = LPT< nDim >
 
- 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 Member Functions

 LbLpt (const MInt couplingId, LPT< nDim > *particle, LbSolver *lb)
 
void init () override
 Init coupling class. More...
 
void finalizeCouplerInit () override
 Finalize coupler initialization, coupler is ready after this. More...
 
void finalizeSubCoupleInit (MInt) override
 
void preCouple (MInt) override
 Coupling before each solver. More...
 
void postCouple (MInt) override
 Coupling after each solver. More...
 
void finalizeBalance (const MInt) override
 postCouple: exchange source terms after the LPT timeStep More...
 
void balancePre () override
 Load balancing. More...
 
void cleanUp () override
 
MFloat a_lbVariable (const MInt lptCellId, const MInt varId, const MInt mode)
 
MFloat a_lbCellCoordinate (const MInt lptCellId, const MInt dir)
 
- Public Member Functions inherited from CouplingLpt< nDim, CouplingLB< nDim, nDist, SysEqn > >
 CouplingLpt (const MInt couplingId, Lpt *particle, FlowSolver *flowSolver)
 
virtual ~CouplingLpt ()=default
 
- Public Member Functions inherited from CouplingParticle< nDim >
 CouplingParticle (const MInt couplingId, LPT< nDim > *solver)
 
- 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, 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)
 

Protected Member Functions

LPT< nDim > & lpt () const override
 
MInt a_bndCellId (const MInt bndCell, const MInt id=0)
 
MFloat a_cellLengthAtLevel (MInt level, const MInt id=0)
 
MFloat a_Ma (const MInt id=0) const
 
MInt a_noBndCells (const MInt id=0)
 
MInt a_noCells (const MInt id=0) const
 
LbBndCndlbBndCnd (const MInt id=0)
 
solverTypelbSolver (const MInt solverId=0) const
 
virtual LPT< nDim > & lpt () const
 
- Protected Member Functions inherited from Coupling
MFloat returnLoadRecord () const
 
MFloat returnIdleRecord () const
 
- Protected Member Functions inherited from CouplingLB< nDim, nDist, SysEqn >
MInt noSolvers () const
 
solverTypelbSolver (const MInt solverId=0) const
 
LbBndCndlbBndCnd (const MInt id=0)
 

Protected Attributes

ConversionFactor & conversionLbLpt = BaseLptX::conversionFlowLpt
 
ConversionFactor & conversionLptLb = BaseLptX::conversionLptFlow
 

Private Member Functions

void checkProperties () override
 Check coupler properties for validity. More...
 
void readProperties ()
 
void initData ()
 
void initConversion ()
 
void calculateGridBoundaries ()
 calculate Boundaries of box-shaped Grid for calculation of boundaryCellData More...
 
void initParticleVelocity ()
 Sets the initial particle velocity based on the flow field velocity in that cell. NOTE: This can not be done in the LPT initialCondition, as the FV flow field has not been transfered before, its set in the Lb initialCondition. More...
 
void updateLbSolver ()
 Transfer all relevant data from LPT to LB solver. More...
 
void updateLPTBndry ()
 Transfer all relevant bndryCell-data from LB to LPT. More...
 
void transferFlowField ()
 Transfer the momentum source (forcing) from LPT to LB. More...
 
void transferCellStatus ()
 set the isValid status for LPT cells based on the FV-solver cell properties More...
 
void transferTimeStep ()
 transfer/enforce Fv timeStep onto LPT solver More...
 
void computeParticleInterphaseExchangeRate ()
 
MInt lpt2lbId (const MInt lptId)
 
MInt lpt2lbIdParent (const MInt lptId)
 
MInt lb2lptId (const MInt lbId)
 
MInt lb2lptIdParent (const MInt lbId)
 

Private Attributes

LPT< nDim > * m_particle = nullptr
 
LbSolverm_lbSolver = nullptr
 
MInt m_lptSolverId {}
 
MInt m_lbSolverId {}
 
MInt m_lptSolverOrder {}
 
MInt m_noSolverSteps {}
 
std::array< MFloat, 2 *nDim > m_gridBoundaries {}
 
MBool m_lptlbInterpolation = false
 
MBool m_forceLbTimeStep = true
 
MBool m_CalcSurface = false
 

Additional Inherited Members

- Public Attributes inherited from CouplingLpt< nDim, CouplingLB< nDim, nDist, SysEqn > >
ConversionFactor conversionFlowLpt
 
ConversionFactor conversionLptFlow
 

Detailed Description

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

Definition at line 30 of file lblpt.h.

Member Typedef Documentation

◆ BaseLb

template<MInt nDim, MInt nDist, class SysEqn >
using LbLpt< nDim, nDist, SysEqn >::BaseLb = CouplingLB<nDim, nDist, SysEqn>

Definition at line 32 of file lblpt.h.

◆ BaseLpt

template<MInt nDim, MInt nDist, class SysEqn >
using LbLpt< nDim, nDist, SysEqn >::BaseLpt = CouplingParticle<nDim>

Definition at line 35 of file lblpt.h.

◆ BaseLptX

template<MInt nDim, MInt nDist, class SysEqn >
using LbLpt< nDim, nDist, SysEqn >::BaseLptX = CouplingLpt<nDim, CouplingLB<nDim, nDist, SysEqn> >

Definition at line 36 of file lblpt.h.

◆ LbSolver

template<MInt nDim, MInt nDist, class SysEqn >
using LbLpt< nDim, nDist, SysEqn >::LbSolver = typename BaseLb::solverType

Definition at line 33 of file lblpt.h.

◆ LptSolver

template<MInt nDim, MInt nDist, class SysEqn >
using LbLpt< nDim, nDist, SysEqn >::LptSolver = typename BaseLpt::solverType

Definition at line 37 of file lblpt.h.

Constructor & Destructor Documentation

◆ LbLpt()

template<MInt nDim, MInt nDist, class SysEqn >
LbLpt< nDim, nDist, SysEqn >::LbLpt ( const MInt  couplingId,
LPT< nDim > *  particle,
LbSolver lb 
)

Definition at line 15 of file lblpt.cpp.

16 : Coupling(couplingId), CouplingLpt<nDim, CouplingLB<nDim, nDist, SysEqn>>(couplingId, particle, lb) {
17 TRACE();
18
19 m_particle = particle;
20 m_lbSolver = lb;
21
22 // get LPT-solver order
24 m_noSolverSteps = Context::getBasicProperty<MInt>("recipeMaxNoSteps", AT_, &m_noSolverSteps);
25 const MString propName = "solverOrder_" + std::to_string(lpt().solverId());
26 for(MInt step = 0; step < m_noSolverSteps; step++) {
27 if(Context::getBasicProperty<MInt>(propName, AT_, step) > 0) {
28 m_lptSolverOrder = step;
29 break;
30 }
31 }
32}
LPT< nDim > & lpt() const override
Definition: lblpt.h:43
LbSolver * m_lbSolver
Definition: lblpt.h:114
MInt m_lptSolverOrder
Definition: lblpt.h:118
LPT< nDim > * m_particle
Definition: lblpt.h:113
MInt m_noSolverSteps
Definition: lblpt.h:119
int32_t MInt
Definition: maiatypes.h:62
std::basic_string< char > MString
Definition: maiatypes.h:55

Member Function Documentation

◆ a_bndCellId()

template<MInt nDim, MInt nDist, class SysEqn >
MInt CouplingLB< nDim, nDist, SysEqn >::a_bndCellId ( const MInt  bndCell,
const MInt  id = 0 
)
inlineprotected

Definition at line 537 of file coupling.h.

537{ return lbBndCnd(id).m_bndCells[bndCell].m_cellId; }
std::vector< LbGridBoundaryCell< nDim > > m_bndCells
Definition: lbbndcnd.h:130
LbBndCnd & lbBndCnd(const MInt id=0)
Definition: coupling.h:461

◆ a_cellLengthAtLevel()

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

Definition at line 518 of file coupling.h.

518{ return lbSolver(id).grid().cellLengthAtLevel(level); }
solverType & lbSolver(const MInt solverId=0) const
Definition: coupling.h:454

◆ a_lbCellCoordinate()

template<MInt nDim, MInt nDist, class SysEqn >
MFloat LbLpt< nDim, nDist, SysEqn >::a_lbCellCoordinate ( const MInt  lptCellId,
const MInt  dir 
)
inline

Definition at line 83 of file lblpt.h.

83 {
84 MInt lbCellId = lpt2lbIdParent(lptCellId);
85 if(lbCellId < 0 || lbCellId > lbSolver().a_noCells()) return -99;
86 return lbSolver().a_coordinate(lbCellId, dir);
87 }
MInt a_noCells(const MInt id=0) const
Definition: coupling.h:516
MInt lpt2lbIdParent(const MInt lptId)
Definition: lblpt.h:109

◆ a_lbVariable()

template<MInt nDim, MInt nDist, class SysEqn >
MFloat LbLpt< nDim, nDist, SysEqn >::a_lbVariable ( const MInt  lptCellId,
const MInt  varId,
const MInt  mode 
)
inline

Definition at line 73 of file lblpt.h.

73 {
74 MInt lbCellId = lpt2lbIdParent(lptCellId);
75 if(lbCellId < 0 || lbCellId > lbSolver().a_noCells()) return -99;
76 if(mode == 0) {
77 return lbSolver().a_variable(lbCellId, varId);
78 } else {
79 return lbSolver().a_oldVariable(lbCellId, varId);
80 }
81 }

◆ a_Ma()

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

Definition at line 472 of file coupling.h.

472{ return lbSolver(id).m_Ma; }

◆ a_noBndCells()

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

Definition at line 539 of file coupling.h.

539{ return lbBndCnd(id).m_bndCells.size(); }

◆ a_noCells()

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

Definition at line 516 of file coupling.h.

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

◆ balancePre()

template<MInt nDim, MInt nDist, class SysEqn >
void LbLpt< nDim, nDist, SysEqn >::balancePre ( )
inlineoverridevirtual

Reimplemented from Coupling.

Definition at line 67 of file lblpt.h.

67{};

◆ calculateGridBoundaries()

template<MInt nDim, MInt nDist, class SysEqn >
void LbLpt< nDim, nDist, SysEqn >::calculateGridBoundaries
private
Author
Johannes

Definition at line 158 of file lblpt.cpp.

158 {
159 TRACE();
160
161 MFloat halfCellWidth = 0.0;
162 for(MInt cellId = 0; cellId < a_noCells(); cellId++) {
163 if(!lbSolver().c_isLeafCell(cellId)) continue;
164 halfCellWidth = F1B2 * lbSolver().grid().cellLengthAtCell(cellId);
165 for(MInt i = 0; i < nDim; i++) {
166 m_gridBoundaries[2 * i] = mMin(m_gridBoundaries[2 * i], lbSolver().a_coordinate(cellId, i) - halfCellWidth);
167 m_gridBoundaries[2 * i + 1] =
168 mMax(m_gridBoundaries[2 * i + 1], lbSolver().a_coordinate(cellId, i) + halfCellWidth);
169 }
170 }
171
172 for(MInt i = 0; i < nDim; i++) {
173 MPI_Allreduce(MPI_IN_PLACE, &m_gridBoundaries[2 * i], 1, maia::type_traits<MFloat>::mpiType(), MPI_MIN,
174 lbSolver().mpiComm(), AT_, "MPI_IN_PLACE", "m_domainBoundaryMin");
175 MPI_Allreduce(MPI_IN_PLACE, &m_gridBoundaries[2 * i + 1], 1, maia::type_traits<MFloat>::mpiType(), MPI_MAX,
176 lbSolver().mpiComm(), AT_, "MPI_IN_PLACE", "m_domainBoundaryMax");
177 }
178}
std::array< MFloat, 2 *nDim > m_gridBoundaries
Definition: lblpt.h:120
constexpr T mMin(const T &x, const T &y)
Definition: functions.h:90
constexpr T mMax(const T &x, const T &y)
Definition: functions.h:94
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
void const MInt cellId
Definition: collector.h:239

◆ checkProperties()

template<MInt nDim, MInt nDist, class SysEqn >
void LbLpt< nDim, nDist, SysEqn >::checkProperties
overrideprivatevirtual
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
Date
May 2021

Reimplemented from CouplingParticle< nDim >.

Definition at line 275 of file lblpt.cpp.

275 {
276 TRACE();
277
278 cout << "in lblpt.cpp: m_Re = " << lpt().m_Re << " m_Re= " << lpt().m_Re << " m_Ma = " << lpt().m_Ma << "\n";
279 const MFloat lptRe = Context::getSolverProperty<MFloat>("Re", lpt().solverId(), AT_);
280
281 cout << "in lblpt.cpp lptRe = " << lptRe << "\n";
282
283 // ASSERT(fabs(lptRe - lbSolver().m_Re) < MFloatEps, "LPT: " << lptRe << " LB " << lbSolver().m_Re);
284 if(fabs(lptRe - lbSolver().m_Re) > MFloatEps) {
285 cerr << "Warning: Re0 differs between lb- and LPT-solver!"
286 << " lb " << lbSolver().m_Re << " LPT " << lptRe << endl;
287 }
288
289 // TODO:
290 // ASSERT(lpt().a_timeStepComputationInterval() == fvSolver().a_timeStepComputationInterval(), "");
291}

◆ cleanUp()

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

Reimplemented from CouplingParticle< nDim >.

Definition at line 69 of file lblpt.h.

69{};

◆ computeParticleInterphaseExchangeRate()

template<MInt nDim, MInt nDist, class SysEqn >
void LbLpt< nDim, nDist, SysEqn >::computeParticleInterphaseExchangeRate ( )
private

◆ finalizeBalance()

template<MInt nDim, MInt nDist, class SysEqn >
void LbLpt< nDim, nDist, SysEqn >::finalizeBalance ( const MInt  id)
overridevirtual
Author
Tim Wegmann

Reimplemented from Coupling.

Definition at line 381 of file lblpt.cpp.

381 {
382 TRACE();
383
384 std::cout << "in finalize Balance" << std::endl;
385 // post LPT solver
386 if(id == lpt().solverId()) {
387 lbSolver().resetExternalSources();
388 if(globalTimeStep < 0) {
389 // prepareAdaptation();
390 }
391
392 } else if(id == lbSolver().solverId()) {
395
397 }
398}
void transferCellStatus()
set the isValid status for LPT cells based on the FV-solver cell properties
Definition: lblpt.cpp:828
void transferFlowField()
Transfer the momentum source (forcing) from LPT to LB.
Definition: lblpt.cpp:571
void updateLPTBndry()
Transfer all relevant bndryCell-data from LB to LPT.
Definition: lblpt.cpp:614
MInt globalTimeStep

◆ finalizeCouplerInit()

template<MInt nDim, MInt nDist, class SysEqn >
void LbLpt< nDim, nDist, SysEqn >::finalizeCouplerInit
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
Date
May 2021

Reimplemented from CouplingParticle< nDim >.

Definition at line 212 of file lblpt.cpp.

212 {
213 TRACE();
214
215 // Transfer the flow field after the intial condition for LB has been applied
218
220
221 // TODO: check
222 if(!lpt().m_restartFile && lbSolver().m_restartFile) {
223 if(lpt().domainId() == 0) {
224 cerr << "Restart without LPT restartFile -> setting time from Lb-time!" << endl;
225 }
226 const MFloat conversionTime = conversionLbLpt.length / conversionLbLpt.velocity;
227 const MFloat LbTime = lbSolver().m_time;
228 lpt().m_time = LbTime * conversionTime;
229 }
230
231 // set the timeStep in the LPT solver
232 // at this point the timeStep must be enforced by the lb-solver
234}
void initParticleVelocity()
Sets the initial particle velocity based on the flow field velocity in that cell. NOTE: This can not ...
Definition: lblpt.cpp:186
ConversionFactor & conversionLbLpt
Definition: lblpt.h:55
void transferTimeStep()
transfer/enforce Fv timeStep onto LPT solver
Definition: lblpt.cpp:817

◆ finalizeSubCoupleInit()

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

Reimplemented from CouplingParticle< nDim >.

Definition at line 61 of file lblpt.h.

61{};

◆ init()

template<MInt nDim, MInt nDist, class SysEqn >
void LbLpt< 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
Date
May 2021

Implements Coupling.

Definition at line 40 of file lblpt.cpp.

40 {
41 TRACE();
42
43 m_lbSolverId = lbSolver().solverId();
44 m_lptSolverId = lpt().solverId();
45
47
49
51
53}
void checkProperties() override
Check coupler properties for validity.
Definition: lblpt.cpp:275
void readProperties()
MInt m_lbSolverId
Definition: lblpt.h:117
MInt m_lptSolverId
Definition: lblpt.h:116
void initConversion()
void calculateGridBoundaries()
calculate Boundaries of box-shaped Grid for calculation of boundaryCellData
Definition: lblpt.cpp:158

◆ initConversion()

template<MInt nDim, MInt nDist, class SysEqn >
void LbLpt< nDim, nDist, SysEqn >::initConversion ( )
private

◆ initData()

template<MInt nDim, MInt nDist, class SysEqn >
void LbLpt< nDim, nDist, SysEqn >::initData ( )
private

◆ initParticleVelocity()

template<MInt nDim, MInt nDist, class SysEqn >
void LbLpt< nDim, nDist, SysEqn >::initParticleVelocity
private
Author
Tim Wegmann

Definition at line 186 of file lblpt.cpp.

186 {
187 TRACE();
188
189 // TODO: inital velocity for ellipsoids
190 /* if(!lpt().m_restart) {
191 for(MInt i = 0; i < (MInt)lpt().m_partListEllipsoid.size(); i++) {
192 const MInt lptCellId = lpt().m_partListEllipsoid[i].m_cellId;
193 const MInt fvCellId = lpt2fvIdParent(lptCellId);
194 for(MInt j = 0; j < nDim; j++) {
195 lpt().m_partListEllipsoid[i].m_velocity[j] =
196 lpt().m_partListEllipsoid[i].m_velocity[j] + fvSolver().a_pvariable(fvCellId, j);
197 }
198 } */
199
200 // init fluid density and velocity, after the values have been transferred to the LPT solver!
201 for(MInt i = 0; i < lpt().a_noParticles(); i++) {
202 lpt().m_partList[i].initVelocityAndDensity();
203 }
204}

◆ lb2lptId()

template<MInt nDim, MInt nDist, class SysEqn >
MInt LbLpt< nDim, nDist, SysEqn >::lb2lptId ( const MInt  lbId)
inlineprivate

Definition at line 110 of file lblpt.h.

110{ return convertId(lbSolver(), lpt(), lbId); };
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

◆ lb2lptIdParent()

template<MInt nDim, MInt nDist, class SysEqn >
MInt LbLpt< nDim, nDist, SysEqn >::lb2lptIdParent ( const MInt  lbId)
inlineprivate

Definition at line 111 of file lblpt.h.

111{ return convertIdParent(lbSolver(), lpt(), lbId); };
MInt convertIdParent(SolverA &solverA, SolverB &solverB, const MInt solverAId)
Conversion from solverA id to the solverB id If no cell on the same level is found,...
Definition: couplingutils.h:46

◆ lbBndCnd()

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

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
inlineprotected

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

◆ lpt()

template<MInt nDim, MInt nDist, class SysEqn >
LPT< nDim > & LbLpt< nDim, nDist, SysEqn >::lpt ( ) const
inlineoverrideprotectedvirtual

Reimplemented from CouplingParticle< nDim >.

Definition at line 43 of file lblpt.h.

43{ return *m_particle; }

◆ lpt2lbId()

template<MInt nDim, MInt nDist, class SysEqn >
MInt LbLpt< nDim, nDist, SysEqn >::lpt2lbId ( const MInt  lptId)
inlineprivate

Definition at line 108 of file lblpt.h.

108{ return convertId(lpt(), lbSolver(), lptId); };

◆ lpt2lbIdParent()

template<MInt nDim, MInt nDist, class SysEqn >
MInt LbLpt< nDim, nDist, SysEqn >::lpt2lbIdParent ( const MInt  lptId)
inlineprivate

Definition at line 109 of file lblpt.h.

109{ return convertIdParent(lpt(), lbSolver(), lptId); };

◆ postCouple()

template<MInt nDim, MInt nDist, class SysEqn >
void LbLpt< nDim, nDist, SysEqn >::postCouple ( MInt  recipeStep)
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, Johannes Grafen
Date
May 2021
Parameters
[in]recipeStepCurrent step in the execution recipe

POST LPT: Transfer coupling terms from LPT to LB POST LB : Transfer flow field from LB to LPT

Reimplemented from CouplingParticle< nDim >.

Definition at line 341 of file lblpt.cpp.

341 {
342 TRACE();
343
344 // recipe-order is switched for ellipsoids
345 // if(lpt().m_ellipsoids) {
346 // recipeStep = recipeStep == 1 ? 0 : 1;
347 //}
348
349 // Post LPT (as the LPT-solver is called before the lb-solver!)
350 if(recipeStep == m_lptSolverOrder) {
352 }
353
354 // POST LB
356 if(recipeStep == postLbStep) {
358
361
362 // set particle velocity to fluid velocity in first timestep or in TimeStep in which desired velocitySkewness is
363 // reached
364 if((!(lpt().m_skewnessTimeStep == -1) && (globalTimeStep == 1 && lpt().m_skewnessTimeStep == 0))
365 || (globalTimeStep == lpt().m_skewnessTimeStep)) {
366 for(auto& part : lpt().m_partList) {
367 for(MInt i = 0; i < nDim; i++) {
368 MInt lbCellId = lpt2lbId(part.m_cellId);
369 part.m_velocity[i] = part.m_oldVel[i] =
370 lbSolver().a_variable(lbCellId, lbSolver().PV->VV[i]) * conversionLbLpt.velocity;
371 }
372 }
373 }
374 }
375}
void updateLbSolver()
Transfer all relevant data from LPT to LB solver.
Definition: lblpt.cpp:406
MInt lpt2lbId(const MInt lptId)
Definition: lblpt.h:108

◆ preCouple()

template<MInt nDim, MInt nDist, class SysEqn >
void LbLpt< nDim, nDist, SysEqn >::preCouple ( MInt  recipeStep)
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
Date
May 2021
Parameters
[in]recipeStep

Reimplemented from CouplingParticle< nDim >.

Definition at line 302 of file lblpt.cpp.

302 {
303 TRACE();
304
305 // PRE LPT
306 if(recipeStep == m_lptSolverOrder) {
307 // TODO m_solutionStep = 0;
308
309 // TODO:
310 /* if(fvSolver().m_hasExternalSource) {
311 if(!m_interLeafed) lbSolver().resetExternalSources();
312 } */
313 if(lbSolver().m_particleMomentumCoupling) lbSolver().resetExternalSources();
314
315 // update LPT bndryCells for wall-collision
317 }
318
319 // TODO: implement for interleaved
320 /* if(m_interLeafed) {
321 const MFloat conversionTime = conversionFvLpt.length / conversionFvLpt.velocity;
322 const MFloat fvTime = fvSolver().m_levelSetMb ? fvSolver().m_physicalTime : fvSolver().m_time;
323 if(fabs(fvTime * conversionTime - lpt().m_time) > MFloatEps) {
324 cerr << "LPT-time " << lpt().m_time << " Fv-time " << fvTime << endl;
325 mTerm(1, AT_, "Miss-matching time!");
326 }
327 } */
328}

◆ readProperties()

template<MInt nDim, MInt nDist, class SysEqn >
void LbLpt< nDim, nDist, SysEqn >::readProperties ( )
privatevirtual

Reimplemented from CouplingParticle< nDim >.

◆ transferCellStatus()

template<MInt nDim, MInt nDist, class SysEqn >
void LbLpt< nDim, nDist, SysEqn >::transferCellStatus
private
Author
Tim Wegmann

Definition at line 828 of file lblpt.cpp.

828 {
829 TRACE();
830 for(MInt lptCellId = 0; lptCellId < lpt().a_noCells(); lptCellId++) {
831 MInt lbCellId = lpt2lbIdParent(lptCellId);
832 if(lbCellId < 0 || lbCellId > lbSolver().a_noCells()) {
833 lpt().a_isValidCell(lptCellId) = false;
834 } else if(!lbSolver().a_isActive(lbCellId)) {
835 lpt().a_isValidCell(lptCellId) = false;
836 } else {
837 lpt().a_isValidCell(lptCellId) = true;
838 }
839 }
840}
MBool a_isActive(const MInt cellId, const MInt id=0) const
Definition: coupling.h:522

◆ transferFlowField()

template<MInt nDim, MInt nDist, class SysEqn >
void LbLpt< nDim, nDist, SysEqn >::transferFlowField
private
Author
Tim Wegmann, Daniel Lauwers

Transfer all flow variables from LB to LPT and apply the conversion

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
Date
May 2021

Definition at line 571 of file lblpt.cpp.

571 {
572 TRACE();
573#ifdef _OPENMP
574#pragma omp parallel for
575#endif
576 for(MInt lbCellId = 0; lbCellId < lbSolver().noInternalCells(); lbCellId++) {
577 if(!lbSolver().a_isActive(lbCellId)) {
578 continue;
579 }
580
581 const MInt lptCellId = lb2lptId(lbCellId);
582 if(lptCellId < 0) continue;
583
584 for(MInt n = 0; n < nDim; n++) {
585 lpt().a_fluidVelocity(lptCellId, n) =
586 lbSolver().a_variable(lbCellId, lbSolver().PV->VV[n]) * conversionLbLpt.velocity;
587 }
588 lpt().a_fluidDensity(lptCellId) = conversionLbLpt.density * lbSolver().a_variable(lbCellId, lbSolver().PV->RHO);
589
590 // Assume incompressible LB
591 lpt().a_fluidPressure(lptCellId) =
592 (lbSolver().a_variable(lbCellId, lbSolver().PV->RHO) - 1.0) * F1B3 * conversionLbLpt.pressure + 1.0;
593 // TODO: @Julian reactivate for thermal
594 /*lpt().a_fluidTemperature(lptCellId) = lbSolver().a_pvariable(lbCellId, lbSolver().PV->T)
595 * conversionLbLpt.temperature;*/
596 }
597
598 // NOTE: exchange is necessary as particles on window-cells interpolate the flow variables to their
599 // position and will need values on halo-cells to do so!
600 lpt().exchangeData(&lpt().a_fluidVariable(0, 0), lpt().PV.noVars());
601 if(lpt().m_evaporation) {
602 lpt().exchangeData(&lpt().a_fluidSpecies(0), 1);
603 }
604
605 lpt().checkCells();
606}
MInt lb2lptId(const MInt lbId)
Definition: lblpt.h:110

◆ transferTimeStep()

template<MInt nDim, MInt nDist, class SysEqn >
void LbLpt< nDim, nDist, SysEqn >::transferTimeStep
private
Author
Tim Wegmann

Definition at line 817 of file lblpt.cpp.

817 {
818 TRACE();
819
820 lpt().forceTimeStep(/*fvSolver().timeStep(true) */ conversionLbLpt.time);
821}

◆ updateLbSolver()

template<MInt nDim, MInt nDist, class SysEqn >
void LbLpt< nDim, nDist, SysEqn >::updateLbSolver
private
Author
Tim Wegmann
Date
May 2021

Definition at line 406 of file lblpt.cpp.

406 {
407 TRACE();
408
409 // transfer external Sources to LB-solver
410 if(!lbSolver().isActive() || !lpt().m_momentumCoupling) return;
411
412 // check if noInternalCells must be used
413#ifdef _OPENMP
414#pragma omp parallel for
415#endif
416 for(MInt lbCellId = 0; lbCellId < lbSolver().a_noCells(); lbCellId++) {
417 if(!lbSolver().a_isActive(lbCellId)) continue;
418 // check that externalForces is set to zeros
419 for(MInt i = 0; i < nDim; i++)
420 ASSERT(abs(lbSolver().a_externalForces(lbCellId, i)) < MFloatEps, "");
421 }
422
423 // TODO: interleaved
424 /*
425 const MInt lbMaxLevel = lbSolver().maxLevel();
426 #ifdef _OPENMP
427 #pragma omp parallel for
428 #endif
429 for(MInt lptCell = 0; lptCell < lpt().a_noCells(); lptCell++) {
430 // TODO-timw: check lpt-exchange! use below instead
431 // for(MInt lptCell = 0; lptCell < lpt().noInternalCells(); lptCell++) {
432 // the source term is only set on LPT leaf-cells
433 if(!lpt().c_isLeafCell(lptCell)) continue;
434 // TODO: always keep noParticles in cell up to date,
435 // so that cells without particles easily be skipped
436 MInt lbCellId = lpt2lbId(lptCell);
437 if(lbCellId > -1 && lbSolver().c_isLeafCell(lbCellId)) {
438 const MInt lbLevel = lbSolver().a_level(lbCellId);
439 const MFloat fLbCellVolume = FFPOW2(lbMaxLevel - lbLevel);
440 // simple transfer
441 for(MInt dir = 0; dir < nDim; dir++) {
442 lbSolver().a_externalForces(lbCellId, dir) -=
443 lpt().a_momentumFlux(lptCell, dir) * conversionLptLb.momentum * fLbCellVolume * m_factor;
444 if(abs(lpt().a_momentumFlux(lptCell, dir)) > 1e-5)
445 std::cerr << "lbforce " << lbSolver().a_externalForces(lbCellId, dir) << " conv " <<
446 conversionLptLb.momentum
447 << " fLbCV " << fLbCellVolume << " flux " << lpt().a_momentumFlux(lptCell, dir) << std::endl;
448 }
449 }
450 }
451 */
452
453#ifdef _OPENMP
454#pragma omp parallel for
455#endif
456 for(MInt lptCellId = 0; lptCellId < lpt().a_noCells(); lptCellId++) {
457 if(!lpt().c_isLeafCell(lptCellId)) continue;
458 const MInt lbCellId = lpt2lbId(lptCellId);
459 if(lbCellId < 0) continue;
460 if(lbCellId > -1 && lbSolver().c_isLeafCell(lbCellId)) {
461 for(MInt i = 0; i < nDim; i++) {
462 // Think about different refinement levels of lb-cells and lpt-cells like in fvparticle.cpp ->
463 // transferExternalSources()
464 // obtain reaction force density related to cellvolume in lb-Units acting on fluid
465 lbSolver().a_externalForces(lbCellId, i) -= lpt().a_momentumFlux(lptCellId, i) * conversionLptLb.momentum;
466 }
467 }
468 // TODO different refinement of LPT an LB
469 }
470 lbSolver().exchangeExternalSources();
471}
ConversionFactor & conversionLptLb
Definition: lblpt.h:56

◆ updateLPTBndry()

template<MInt nDim, MInt nDist, class SysEqn >
void LbLpt< nDim, nDist, SysEqn >::updateLPTBndry
private
Author
Tim Wegmann, Julian Vorspohl j.vor.nosp@m.spoh.nosp@m.l@aia.nosp@m..rwt.nosp@m.h-aac.nosp@m.hen..nosp@m.de, Johannes Grafen
Date
Dec 2021

Definition at line 614 of file lblpt.cpp.

614 {
615 TRACE();
616
617 if(!lpt().m_wallCollisions) return;
618
619 if(!lpt().isActive()) return;
620
621 MFloatScratchSpace bBox(2 * nDim, AT_, "bBox");
622 lbSolver().m_geometry->getBoundingBox(bBox.getPointer());
623
624 /*
625 using Ld = LbLatticeDescriptor<nDim, nDist>;
626 // just number of 2D distributions
627 static constexpr MInt dist1 = Ld::distFld(0);
628 static constexpr MInt maxDist1Idx = dist1; // for loops
629 static constexpr MInt dist2 = Ld::distFld(1);
630 static constexpr MInt maxDist2Idx = dist1 + dist2; // for loops
631 */
632 // Just once if no mesh adaptation during run
633 for(MInt bndryId = lbSolver().m_noOuterBndryCells; bndryId < a_noBndCells(); bndryId++) {
634 const MInt lbCellId = a_bndCellId(bndryId);
635
636 if(!lbSolver().c_isLeafCell(lbCellId)) continue;
637 MInt lptCellId = lb2lptId(lbCellId);
638 if(lptCellId < 0) {
639 lptCellId = lb2lptIdParent(lbCellId);
640 if(lptCellId < 0) continue;
641 if(lpt().c_level(lptCellId) < lpt().maxRefinementLevel()) continue;
642 ASSERT(m_lptlbInterpolation, "");
643 }
644
645 if(!lpt().c_isLeafCell(lptCellId)) {
646 ASSERT(m_lptlbInterpolation, "");
647 }
648
649 const MInt noSurf = 1; // lbSolver().m_bndCnd->m_bndCells->a[bndryId].m_noSrfcs
650
651 // bndryCell without a bndrySurface, how is that even possible?
652 // if(noSurf < 1 ) continue;
653
654 ASSERT(noSurf == 1, "Only for single bndry-surfaces!");
655
656 MFloatScratchSpace surfaceC(nDim, nDim + 1, AT_, "surfaceC");
657 std::array<MFloat, nDim> surfaceN;
658 std::array<MFloat, nDim> surfaceV;
659 std::array<MFloat, nDim + 1> bndryData;
660
661 // TODO: check correctness of addbndryCellMethod before reusing!
662 /* if(m_CalcSurface) {
663 const MFloat dx = lbSolver().c_cellLengthAtCell(lbCellId);
664 std::vector<const MFloat*> cellWallNormals; // store all Wall normals
665 std::vector<const MFloat*>
666 cellPlaneCoordinateVec; // 2D Distribution from cell center to point in the middle of an surface edge
667 const MFloat* SCdist{};
668 MInt wallCount = 0;
669 std::array<MBool, nDim> gridBoxDifference{};
670
671 for(MInt i = 0; i < nDim; i++) {
672 bndryData.at(1 + i) = lbSolver().a_coordinate(lbCellId, i);
673 }
674
675 for(MInt j = 0; j < maxDist1Idx; j++) {
676 if(lbSolver().a_hasNeighbor(lbCellId, j) == 0) {
677 SCdist = Ld::ppdfDir(j); // only for 1D, dist from cell center to SC
678 cellWallNormals.push_back(Ld::ppdfDir(Ld::oppositeDist(j)));
679 wallCount++;
680 }
681 }
682
683 // compute surface normals out of cellWallNormals, should be independent from number of distributions
684 for(MInt n = 0; n < nDim; n++) {
685 surfaceV.at(n) = 0; // for simple simulation not needed, can be set to zero;
686 for(size_t a = 0; a < cellWallNormals.size(); a++)
687 surfaceN.at(n) += cellWallNormals.at(a)[n]; // Assuming wallnormals have just one vec component unequal 0
688 }
689 maia::math::normalize(surfaceN);
690
691 switch(wallCount) {
692 case 0:
693 std::cerr << "Something went wrong, " << lbCellId << " is not a boundaryCell" << std::endl;
694 break;
695
696 case 1:
697 // set bndry-cell volume:
698 bndryData.at(0) = POW3(dx);
699 // Iterate over 2D distributions
700 for(MInt j = maxDist1Idx; j < maxDist2Idx; j++) {
701 for(MInt n = 0; n < nDim; n++) {
702 // Check for -1 * -1 or 1 * 1; -1 * 1 should not pass since SCdist[n] and ppdf(j,n) are not equal.
703 if(SCdist[n] * Ld::ppdfDir(j, n) + MFloatEps > 1.0) {
704 cellPlaneCoordinateVec.push_back(Ld::ppdfDir(j));
705 if(cellPlaneCoordinateVec.size() == 3) break; // only 3 points are needed
706 }
707 }
708 }
709
710 for(MInt n = 0; n < nDim; n++) {
711 gridBoxDifference.at(n) = false;
712 surfaceC.at(0).at(n) = bndryData.at(1 + n) - surfaceN.at(n) * dx / 2;
713 if(surfaceN.at(n) > 0.0) {
714 if(bBox[n] > m_gridBoundaries[2 * n]) {
715 surfaceC.at(0).at(n) = bBox[n];
716 gridBoxDifference.at(n) = true;
717 }
718 } else if(surfaceN.at(n) < 0.0) {
719 if(bBox[n + nDim] < m_gridBoundaries[2 * n + 1]) {
720 surfaceC.at(0).at(n) = bBox[n + nDim];
721 gridBoxDifference.at(n) = true;
722 }
723 }
724 }
725 break;
726
727 case 2:
728 // set bndry-cell volume:
729 bndryData.at(0) = POW3(dx) / 2;
730 // Iterate over 1D and 2D distributions
731 for(MInt j = 0; j < maxDist2Idx; j++) {
732 std::array<MFloat, nDim> tmpDist{};
733 for(MInt n = 0; n < nDim; n++) {
734 tmpDist[n] = Ld::ppdfDir(j, n);
735 }
736 // search for 1D and 2D distributions that are perpendicular to surface normal vector
737 if(abs(std::inner_product(surfaceN.cbegin(), surfaceN.cend(), tmpDist.cbegin(), 0.0)) < MFloatEps)
738 cellPlaneCoordinateVec.push_back(Ld::ppdfDir(j));
739 if(cellPlaneCoordinateVec.size() == 3) break;
740 }
741
742 for(MInt n = 0; n < nDim; n++) {
743 surfaceC.at(0).at(n) = bndryData.at(1 + n);
744 }
745 break;
746
747 case 3:
748 // set bndry-cell volume:
749 bndryData.at(0) = POW3(dx) * (1.0 - 0.25 * (0.5 * SQRT3 - sqrt(3 - SQRT6)));
750 // Iterate over 1D distributions
751 for(MInt j = 0; j < maxDist1Idx; j++) {
752 std::array<MFloat, nDim> tmpDist{};
753 for(MInt n = 0; n < nDim; n++) {
754 tmpDist[n] = Ld::ppdfDir(j, n);
755 }
756 // search for 1D distributions that are pointing in opposite halfspace of surface normal -> va * vb = abs(a)
757 // * abs(b) * cos(phi) < 0 -> yes
758 if(std::inner_product(surfaceN.cbegin(), surfaceN.cend(), tmpDist.cbegin(), 0.0) < MFloatEps)
759 cellPlaneCoordinateVec.push_back(Ld::ppdfDir(j));
760 if(cellPlaneCoordinateVec.size() == 3) break;
761 }
762
763 for(MInt n = 0; n < nDim; n++) {
764 surfaceC.at(0).at(n) = bndryData.at(1 + n) - surfaceN.at(n) * sqrt(3 - SQRT6) * dx; //? check
765 }
766 break;
767
768 default:
769 std::cerr << "No implementation for cells with more than 3 bounding walls!" << std::endl;
770 break;
771 }
772
773 // find 3 Distributions to get 3 points on surface edges
774 MFloat dL = 0.0;
775 // loop over coordinate x,y,z
776 for(MInt i = 0; i < nDim; i++) {
777 if(gridBoxDifference.at(i))
778 dL = bndryData.at(1 + i) - surfaceC.at(0).at(i);
779 else
780 dL = dx / 2;
781 // loop over surface point 1,2,3
782 for(MInt n = 0; n < nDim; n++) {
783 surfaceC.at(1 + n).at(i) = bndryData.at(1 + i) + cellPlaneCoordinateVec.at(n)[i] * dL;
784 }
785 } */
786 // Printing boundary surface information :
787 /* std::cout << "lbcellId: " << lbCellId << std::endl
788 << "lptcellId: " << lptCellId << std::endl
789 << "wallCount: " << wallCount << std::endl
790 << "bndrycell Volume: " << bndryData.at(0) << std::endl;
791 for(MInt i = 0; i < nDim; i++) std::cout << "bndryData[" << bndryId << "].m_coordinates "<< i << ": " <<
792 bndryData.at(1 + i) << std::endl; for(MInt i = 0; i < nDim; i++) std::cout << "surfaceN[ " << i << "] normalized:
793 " << surfaceN.at(i) << std::endl; for(MInt i = 0; i < nDim; i++) std::cout << "surfaceC[0][" << i << "]: " <<
794 surfaceC.at(0).at(i) << std::endl;
795
796 for(MInt i = 0; i < nDim; i++)
797 for(MInt n = 0; n <nDim; n++)
798 std::cout << "cellPlaneCoordinateVec[" << i <<"]["<<n<<"]: " << cellPlaneCoordinateVec.at(i)[n] << std::endl;
799 for(MInt i = 0; i < nDim; i++)
800 for(MInt n = 0; n <nDim; n++)
801 std::cout << "surfaceC[" << 1 + i << "]["<< n << "]: " << surfaceC.at(1 + i).at(n) << std::endl;
802 */
803
804 // clear all temporary vectors
805 /* cellWallNormals.clear();
806 cellPlaneCoordinateVec.clear();
807 } */
808 // append new LPT bndryCell based on LB data
809 lpt().addBndryCell(lptCellId, &bndryData[0], &surfaceN[0], surfaceC, &surfaceV[0]);
810 }
811}
MInt a_noBndCells(const MInt id=0)
Definition: coupling.h:539
MInt lb2lptIdParent(const MInt lbId)
Definition: lblpt.h:111
MInt a_bndCellId(const MInt bndCell, const MInt id=0)
Definition: coupling.h:537
MBool m_lptlbInterpolation
Definition: lblpt.h:123
This class is a ScratchSpace.
Definition: scratch.h:758

Member Data Documentation

◆ conversionLbLpt

template<MInt nDim, MInt nDist, class SysEqn >
ConversionFactor& LbLpt< nDim, nDist, SysEqn >::conversionLbLpt = BaseLptX::conversionFlowLpt
protected

Definition at line 55 of file lblpt.h.

◆ conversionLptLb

template<MInt nDim, MInt nDist, class SysEqn >
ConversionFactor& LbLpt< nDim, nDist, SysEqn >::conversionLptLb = BaseLptX::conversionLptFlow
protected

Definition at line 56 of file lblpt.h.

◆ m_CalcSurface

template<MInt nDim, MInt nDist, class SysEqn >
MBool LbLpt< nDim, nDist, SysEqn >::m_CalcSurface = false
private

Definition at line 125 of file lblpt.h.

◆ m_forceLbTimeStep

template<MInt nDim, MInt nDist, class SysEqn >
MBool LbLpt< nDim, nDist, SysEqn >::m_forceLbTimeStep = true
private

Definition at line 124 of file lblpt.h.

◆ m_gridBoundaries

template<MInt nDim, MInt nDist, class SysEqn >
std::array<MFloat, 2 * nDim> LbLpt< nDim, nDist, SysEqn >::m_gridBoundaries {}
private

Definition at line 120 of file lblpt.h.

◆ m_lbSolver

template<MInt nDim, MInt nDist, class SysEqn >
LbSolver* LbLpt< nDim, nDist, SysEqn >::m_lbSolver = nullptr
private

Definition at line 114 of file lblpt.h.

◆ m_lbSolverId

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

Definition at line 117 of file lblpt.h.

◆ m_lptlbInterpolation

template<MInt nDim, MInt nDist, class SysEqn >
MBool LbLpt< nDim, nDist, SysEqn >::m_lptlbInterpolation = false
private

Definition at line 123 of file lblpt.h.

◆ m_lptSolverId

template<MInt nDim, MInt nDist, class SysEqn >
MInt LbLpt< nDim, nDist, SysEqn >::m_lptSolverId {}
private

Definition at line 116 of file lblpt.h.

◆ m_lptSolverOrder

template<MInt nDim, MInt nDist, class SysEqn >
MInt LbLpt< nDim, nDist, SysEqn >::m_lptSolverOrder {}
private

Definition at line 118 of file lblpt.h.

◆ m_noSolverSteps

template<MInt nDim, MInt nDist, class SysEqn >
MInt LbLpt< nDim, nDist, SysEqn >::m_noSolverSteps {}
private

Definition at line 119 of file lblpt.h.

◆ m_particle

template<MInt nDim, MInt nDist, class SysEqn >
LPT<nDim>* LbLpt< nDim, nDist, SysEqn >::m_particle = nullptr
private

Definition at line 113 of file lblpt.h.


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