MaMiCo 1.2
Loading...
Searching...
No Matches
coupling::transferstrategies::TransferStrategy4NieCoupling< LinkedCell, dim > Class Template Reference

#include <TransferStrategy4NieCoupling.h>

Inheritance diagram for coupling::transferstrategies::TransferStrategy4NieCoupling< LinkedCell, dim >:
Collaboration diagram for coupling::transferstrategies::TransferStrategy4NieCoupling< LinkedCell, dim >:

Public Member Functions

 TransferStrategy4NieCoupling (coupling::interface::MDSolverInterface< LinkedCell, dim > *const mdSolverInterface, unsigned int numberMDSteps, double shiftTimestep, tarch::la::Vector< 2 *dim, bool > massFluxBoundary)
 a simple
 
virtual ~TransferStrategy4NieCoupling ()
 a dummy destructor
 
void beginProcessInnerCouplingCellsBeforeReceivingMacroscopicSolverData () override
 stores the old cont.-velocity field solution and resets time step counter
 
void processInnerCouplingCellBeforeReceivingMacroscopicSolverData (coupling::datastructures::CouplingCellWithLinkedCells< LinkedCell, dim > &cell, I02 index) override
 store old microscopic mass in excess-mass buffer and reset microscopic mass buffer
 
void processInnerCouplingCellAfterReceivingMacroscopicSolverData (coupling::datastructures::CouplingCellWithLinkedCells< LinkedCell, dim > &cell, I02 index) override
 converts momentum into velocity values;
 
void processInnerCouplingCellBeforeSendingMDSolverData (coupling::datastructures::CouplingCellWithLinkedCells< LinkedCell, dim > &cell, I02 index) override
 divides accumulated mass and momentum values by time step counter.
 
void beginProcessInnerCouplingCellsAfterMDTimestep () override
 increments time step counter
 
void processInnerCouplingCellAfterMDTimestep (coupling::datastructures::CouplingCellWithLinkedCells< LinkedCell, dim > &cell, I02 index) override
 computes current velocity (linear time interpolation) in this cell and accumulates mass/momentum for sampling
 
- Public Member Functions inherited from coupling::transferstrategies::TransferStrategy< LinkedCell, dim >
 TransferStrategy (coupling::interface::MDSolverInterface< LinkedCell, dim > *const mdSolverInterface)
 a simple destructor
 
virtual ~TransferStrategy ()
 a dummy destructor
 
virtual void endProcessInnerCouplingCellsBeforeReceivingMacroscopicSolverData ()
 the method is called after the cells are processed, e.g. some general evaluation might happen like sum/counter
 
virtual void processOuterCouplingCellBeforeReceivingMacroscopicSolverData (coupling::datastructures::CouplingCellWithLinkedCells< LinkedCell, dim > &cell, I02 index)
 is called on the outer coupling cells before the data from the macro solver is applied
 
virtual void beginProcessOuterCouplingCellsBeforeReceivingMacroscopicSolverData ()
 the method is called before the outer cells are processed, e.g. general values might be set here
 
virtual void endProcessOuterCouplingCellsBeforeReceivingMacroscopicSolverData ()
 the method is called after the outer cells are processed, e.g. general values might be set here
 
virtual void beginProcessInnerCouplingCellsAfterReceivingMacroscopicSolverData ()
 the method is called before the inner cells are processed, e.g. general values might be set here
 
virtual void endProcessInnerCouplingCellsAfterReceivingMacroscopicSolverData ()
 the method is called after the inner cells are processed, e.g. general values might be set here
 
virtual void processOuterCouplingCellAfterReceivingMacroscopicSolverData (coupling::datastructures::CouplingCellWithLinkedCells< LinkedCell, dim > &cell, I02 index)
 is called for every coupling cell after the microscopicMass and -Momentum have been filled in with data from the macroscopic solver.
 
virtual void beginProcessOuterCouplingCellsAfterReceivingMacroscopicSolverData ()
 the method is called before the outer cells are processed, e.g. general values might be set here
 
virtual void endProcessOuterCouplingCellsAfterReceivingMacroscopicSolverData ()
 the method is called after the outer cells are processed, e.g. general values might be set here
 
virtual void beginProcessInnerCouplingCellsBeforeSendingMDSolverData ()
 the method is called before the inner cell data is send, e.g. general values might be set here
 
virtual void endProcessInnerCouplingCellsBeforeSendingMDSolverData ()
 the method is called after the inner cell data is send, e.g. general values might be set here
 
virtual void processOuterCouplingCellBeforeSendingMDSolverData (coupling::datastructures::CouplingCellWithLinkedCells< LinkedCell, dim > &cell, I02 index)
 is called for outer coupling cell before sending the macroscopicMass and -Momentum data to the macroscopic solver and before noise reduction invocation.
 
virtual void beginProcessOuterCouplingCellsBeforeSendingMDSolverData ()
 the method is called before the outer cells are processed, e.g. general values might be set here
 
virtual void endProcessOuterCouplingCellsBeforeSendingMDSolverData ()
 the method is called after the outer cells are processed, e.g. general values might be set here
 
virtual void endProcessInnerCouplingCellsAfterMDTimestep ()
 the method is called after the inner cell data is send, e.g. general values might be set here
 

Private Member Functions

double computeMassFlux (const double &mass, const tarch::la::Vector< dim, double > &velocity, I01 index)
 

Private Attributes

coupling::cellmappings::ComputeMassMapping< LinkedCell, dim > _massMapping
 
coupling::cellmappings::ComputeMomentumMapping< LinkedCell, dim > _momentumMapping
 
tarch::la::Vector< dim, double > * _oldSolution
 
tarch::la::Vector< dim, double > * _newSolution
 
const unsigned int _numberMDSteps
 
const double _shiftTimestep
 
const unsigned int _numberLocalCells
 
unsigned int _timestepCounter
 
double * _excessMass
 
const tarch::la::Vector< 2 *dim, bool > _massFluxBoundary
 

Additional Inherited Members

- Protected Attributes inherited from coupling::transferstrategies::TransferStrategy< LinkedCell, dim >
coupling::interface::MDSolverInterface< LinkedCell, dim > *const _mdSolverInterface
 

Detailed Description

template<class LinkedCell, unsigned int dim>
class coupling::transferstrategies::TransferStrategy4NieCoupling< LinkedCell, dim >

transfer strategy for Nie coupling algorithm, adopted from: X.B. Nie, S.Y. Chen, W.N. E, M.O. Robbins A continuum and molecular dynamics hybrid method for micro- and nano-fluid flow J. Fluid. Mech. 500: 55-64, 2004 We basically sample in every MD time step.

Author
Philipp Neumann
Template Parameters
LinkedCellthe LinkedCell class is given by the implementation of linked cells in the molecular dynamics simulation
dimrefers to the spacial dimension of the simulation, can be 1, 2, or 3

Constructor & Destructor Documentation

◆ TransferStrategy4NieCoupling()

template<class LinkedCell, unsigned int dim>
coupling::transferstrategies::TransferStrategy4NieCoupling< LinkedCell, dim >::TransferStrategy4NieCoupling ( coupling::interface::MDSolverInterface< LinkedCell, dim > *const mdSolverInterface,
unsigned int numberMDSteps,
double shiftTimestep,
tarch::la::Vector< 2 *dim, bool > massFluxBoundary )

a simple

Parameters
mdSolverInterfaceinterface for the md solver
shiftTimestepparameter for the inter- and extrapolation of the time steps refers to the Nie algorithm
massFluxBoundaryindicates at which boundary mass shall be transferred (true) or not (false); in their order the entries refer to: west, east, south, north, bottom, top boundary

Member Function Documentation

◆ beginProcessInnerCouplingCellsAfterMDTimestep()

template<class LinkedCell, unsigned int dim>
void coupling::transferstrategies::TransferStrategy4NieCoupling< LinkedCell, dim >::beginProcessInnerCouplingCellsAfterMDTimestep ( )
overridevirtual

increments time step counter

Reimplemented from coupling::transferstrategies::TransferStrategy< LinkedCell, dim >.

◆ beginProcessInnerCouplingCellsBeforeReceivingMacroscopicSolverData()

template<class LinkedCell, unsigned int dim>
void coupling::transferstrategies::TransferStrategy4NieCoupling< LinkedCell, dim >::beginProcessInnerCouplingCellsBeforeReceivingMacroscopicSolverData ( )
overridevirtual

stores the old cont.-velocity field solution and resets time step counter

Reimplemented from coupling::transferstrategies::TransferStrategy< LinkedCell, dim >.

◆ computeMassFlux()

template<class LinkedCell, unsigned int dim>
double coupling::transferstrategies::TransferStrategy4NieCoupling< LinkedCell, dim >::computeMassFlux ( const double & mass,
const tarch::la::Vector< dim, double > & velocity,
I01 index )
private

computes the mass flux in the outermost inner coupling cells. For all other cells, 0.0 is returned.

◆ processInnerCouplingCellAfterMDTimestep()

template<class LinkedCell, unsigned int dim>
void coupling::transferstrategies::TransferStrategy4NieCoupling< LinkedCell, dim >::processInnerCouplingCellAfterMDTimestep ( coupling::datastructures::CouplingCellWithLinkedCells< LinkedCell, dim > & cell,
I02 index )
overridevirtual

computes current velocity (linear time interpolation) in this cell and accumulates mass/momentum for sampling

Parameters
cellthe coupling cell to be processed
indexthe index of the coupling cell

Reimplemented from coupling::transferstrategies::TransferStrategy< LinkedCell, dim >.

◆ processInnerCouplingCellAfterReceivingMacroscopicSolverData()

template<class LinkedCell, unsigned int dim>
void coupling::transferstrategies::TransferStrategy4NieCoupling< LinkedCell, dim >::processInnerCouplingCellAfterReceivingMacroscopicSolverData ( coupling::datastructures::CouplingCellWithLinkedCells< LinkedCell, dim > & cell,
I02 index )
overridevirtual

converts momentum into velocity values;

stores velocity values in new cont.-velocity field solution and sets correct velocity value for first MD time step in microscopic momentum buffer.

Parameters
cellthe coupling cell to be processed
indexthe index of the coupling cell

Reimplemented from coupling::transferstrategies::TransferStrategy< LinkedCell, dim >.

◆ processInnerCouplingCellBeforeReceivingMacroscopicSolverData()

template<class LinkedCell, unsigned int dim>
void coupling::transferstrategies::TransferStrategy4NieCoupling< LinkedCell, dim >::processInnerCouplingCellBeforeReceivingMacroscopicSolverData ( coupling::datastructures::CouplingCellWithLinkedCells< LinkedCell, dim > & cell,
I02 index )
overridevirtual

store old microscopic mass in excess-mass buffer and reset microscopic mass buffer

Parameters
cellthe coupling cell to be processed
indexthe index of the coupling cell

Reimplemented from coupling::transferstrategies::TransferStrategy< LinkedCell, dim >.

◆ processInnerCouplingCellBeforeSendingMDSolverData()

template<class LinkedCell, unsigned int dim>
void coupling::transferstrategies::TransferStrategy4NieCoupling< LinkedCell, dim >::processInnerCouplingCellBeforeSendingMDSolverData ( coupling::datastructures::CouplingCellWithLinkedCells< LinkedCell, dim > & cell,
I02 index )
overridevirtual

divides accumulated mass and momentum values by time step counter.

Reimplemented from coupling::transferstrategies::TransferStrategy< LinkedCell, dim >.

Member Data Documentation

◆ _excessMass

template<class LinkedCell, unsigned int dim>
double* coupling::transferstrategies::TransferStrategy4NieCoupling< LinkedCell, dim >::_excessMass
private

mass that was transferred in an earlier coupled step

◆ _massFluxBoundary

template<class LinkedCell, unsigned int dim>
const tarch::la::Vector<2 * dim, bool> coupling::transferstrategies::TransferStrategy4NieCoupling< LinkedCell, dim >::_massFluxBoundary
private

true in each entry if west/east, south/north, bottom/top boundary is a mass flux boundary

◆ _massMapping

template<class LinkedCell, unsigned int dim>
coupling::cellmappings::ComputeMassMapping<LinkedCell, dim> coupling::transferstrategies::TransferStrategy4NieCoupling< LinkedCell, dim >::_massMapping
private

class to compute the amount of mass in every single cell

◆ _momentumMapping

template<class LinkedCell, unsigned int dim>
coupling::cellmappings::ComputeMomentumMapping<LinkedCell, dim> coupling::transferstrategies::TransferStrategy4NieCoupling< LinkedCell, dim >::_momentumMapping
private

class to compute the amount of momentum in every single cell

◆ _newSolution

template<class LinkedCell, unsigned int dim>
tarch::la::Vector<dim, double>* coupling::transferstrategies::TransferStrategy4NieCoupling< LinkedCell, dim >::_newSolution
private

solution of velocity field at the end of coupling cycle

◆ _numberLocalCells

template<class LinkedCell, unsigned int dim>
const unsigned int coupling::transferstrategies::TransferStrategy4NieCoupling< LinkedCell, dim >::_numberLocalCells
private

local number of cells (incl. ghost layers)

◆ _numberMDSteps

template<class LinkedCell, unsigned int dim>
const unsigned int coupling::transferstrategies::TransferStrategy4NieCoupling< LinkedCell, dim >::_numberMDSteps
private

number of MD time steps per coupling cycle

◆ _oldSolution

template<class LinkedCell, unsigned int dim>
tarch::la::Vector<dim, double>* coupling::transferstrategies::TransferStrategy4NieCoupling< LinkedCell, dim >::_oldSolution
private

solution of velocity field at the beginning of coupling cycle (=end of old coupling cycle)

◆ _shiftTimestep

template<class LinkedCell, unsigned int dim>
const double coupling::transferstrategies::TransferStrategy4NieCoupling< LinkedCell, dim >::_shiftTimestep
private

offset by which evaluation of time interval is shifted compared to continuum solver. A value of zero implies interpolation between new and old solution, corresponding to a time interval t->t+dt. A value of one implies extrapolation between the times t+dt (newSolution) and t+2dt using oldSolution and newSolution. All inter-/extrapolations are linear.

◆ _timestepCounter

template<class LinkedCell, unsigned int dim>
unsigned int coupling::transferstrategies::TransferStrategy4NieCoupling< LinkedCell, dim >::_timestepCounter
private

time step counter within a coupling cycle (should run from 0 to _numberMDSteps)


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