/* This file is part of the OpenLB library
*
* Copyright (C) 2017 Albert Mink
* E-mail contact: info@openlb.net
* The most recent release of OpenLB can be downloaded at
*
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public
* License along with this program; if not, write to the Free
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301, USA.
*/
#ifndef RTLBM_BOUNDARY_HH
#define RTLBM_BOUNDARY_HH
#include "rtlbmBoundary.h"
#include "rtlbmBoundaryDynamics.h"
#include "momentaOnBoundaries.h"
#include "advectionDiffusionBoundaryInstantiator3D.h" // detects orientation of boundary
#include "advectionDiffusionBoundaries.h"
namespace olb {
template
class RtlbmDiffuseBoundaryManager3D {
public:
template
static Momenta* getTemperatureBoundaryMomenta()
{
return new EquilibriumBM;
}
template
static Dynamics* getTemperatureBoundaryDynamics(T omega, Momenta& momenta)
{
return new RtlbmDiffuseBoundaryDynamics(omega, momenta);
}
template
static PostProcessorGenerator3D* getTemperatureBoundaryProcessor(int x0, int x1, int y0, int y1, int z0, int z1)
{
return nullptr;
}
template
static Momenta* getTemperatureBoundaryEdgeMomenta()
{
return new EquilibriumBM;
}
template
static Dynamics* getTemperatureBoundaryEdgeDynamics(T omega, Momenta& momenta)
{
return new RtlbmDiffuseEdgeBoundaryDynamics(omega, momenta);
}
template
static PostProcessorGenerator3D* getTemperatureBoundaryEdgeProcessor(int x0, int x1, int y0, int y1, int z0, int z1)
{
return nullptr;
}
template
static Momenta* getTemperatureBoundaryCornerMomenta()
{
return new EquilibriumBM;
}
template
static Dynamics* getTemperatureBoundaryCornerDynamics(T omega, Momenta& momenta)
{
return new RtlbmDiffuseCornerBoundaryDynamics(omega, momenta);
}
template
static PostProcessorGenerator3D* getTemperatureBoundaryCornerProcessor(int x, int y, int z)
{
return nullptr;
}
};
//================== creator function ================================
// blockLattice creator
template
OnLatticeAdvectionDiffusionBoundaryCondition3D* createRtlbmDiffuseBoundaryCondition3D( BlockLatticeStructure3D& block )
{
return new AdvectionDiffusionBoundaryConditionInstantiator3D > (block);
}
// superLattice creator
template
void createRtlbmDiffuseBoundaryCondition3D( sOnLatticeBoundaryCondition3D& sBC )
{
sBC.setOverlap(1);
for (int iC = 0; iC < sBC.getSuperLattice().getLoadBalancer().size(); iC++) {
OnLatticeAdvectionDiffusionBoundaryCondition3D* blockBC =
createRtlbmDiffuseBoundaryCondition3D( sBC.getSuperLattice().getExtendedBlockLattice(iC) );
sBC.getADblockBCs().push_back(blockBC);
}
}
template
class RtlbmDiffuseConstBoundaryManager3D {
public:
template
static Momenta* getTemperatureBoundaryMomenta()
{
return new EquilibriumBM;
}
template
static Dynamics* getTemperatureBoundaryDynamics(T omega, Momenta& momenta)
{
return new RtlbmDiffuseConstBoundaryDynamics(omega, momenta);
}
template
static PostProcessorGenerator3D* getTemperatureBoundaryProcessor(int x0, int x1, int y0, int y1, int z0, int z1)
{
return nullptr;
}
template
static Momenta* getTemperatureBoundaryEdgeMomenta()
{
return new EquilibriumBM;
}
template
static Dynamics* getTemperatureBoundaryEdgeDynamics(T omega, Momenta& momenta)
{
return new RtlbmDiffuseConstEdgeBoundaryDynamics(omega, momenta);
}
template
static PostProcessorGenerator3D* getTemperatureBoundaryEdgeProcessor(int x0, int x1, int y0, int y1, int z0, int z1)
{
return nullptr;
}
template
static Momenta* getTemperatureBoundaryCornerMomenta()
{
return new EquilibriumBM;
}
template
static Dynamics* getTemperatureBoundaryCornerDynamics(T omega, Momenta& momenta)
{
return new RtlbmDiffuseConstCornerBoundaryDynamics(omega, momenta);
}
template
static PostProcessorGenerator3D* getTemperatureBoundaryCornerProcessor(int x, int y, int z)
{
return nullptr;
}
};
//================== creator function ================================
// blockLattice creator
template
OnLatticeAdvectionDiffusionBoundaryCondition3D* createRtlbmDiffuseConstBoundaryCondition3D( BlockLatticeStructure3D& block )
{
return new AdvectionDiffusionBoundaryConditionInstantiator3D > (block); // TODO AM mark as placeholder
}
// superLattice creator
template
void createRtlbmDiffuseConstBoundaryCondition3D( sOnLatticeBoundaryCondition3D& sBC )
{
sBC.setOverlap(1);
for (int iC = 0; iC < sBC.getSuperLattice().getLoadBalancer().size(); iC++) {
OnLatticeAdvectionDiffusionBoundaryCondition3D* blockBC =
createRtlbmDiffuseConstBoundaryCondition3D( sBC.getSuperLattice().getExtendedBlockLattice(iC) );
sBC.getADblockBCs().push_back(blockBC);
}
}
template
class RtlbmDirectedBoundaryManager3D {
public:
// ====== flats
template
static Momenta* getTemperatureBoundaryMomenta()
{
return new EquilibriumBM;
}
template
static Dynamics* getTemperatureBoundaryDynamics(T omega, Momenta& momenta)
{
return new RtlbmDirectedBoundaryDynamics(omega, momenta);
}
template
static PostProcessorGenerator3D* getTemperatureBoundaryProcessor(int x0, int x1, int y0, int y1, int z0, int z1)
{
return nullptr;
}
// ====== edged
template
static Momenta* getTemperatureBoundaryEdgeMomenta()
{
return new EquilibriumBM;
}
template
static Dynamics* getTemperatureBoundaryEdgeDynamics(T omega, Momenta& momenta)
{
return new AdvectionDiffusionEdgesDynamics,plane,normal1,normal2>(omega, momenta); // placeholder
}
template
static PostProcessorGenerator3D* getTemperatureBoundaryEdgeProcessor(int x0, int x1, int y0, int y1, int z0, int z1)
{
return nullptr;
}
// ====== corners
template
static Momenta* getTemperatureBoundaryCornerMomenta()
{
return new EquilibriumBM;
}
template
static Dynamics* getTemperatureBoundaryCornerDynamics(T omega, Momenta& momenta)
{
return new AdvectionDiffusionCornerDynamics3D,normalX,normalY,normalZ>(omega, momenta); // placeholder
}
template
static PostProcessorGenerator3D* getTemperatureBoundaryCornerProcessor(int x, int y, int z)
{
return nullptr;
}
};
//================== creator function ================================
// blockLattice creator
template
OnLatticeAdvectionDiffusionBoundaryCondition3D* createRtlbmDirectedBoundaryCondition3D( BlockLatticeStructure3D& block )
{
return new AdvectionDiffusionBoundaryConditionInstantiator3D > (block);
}
// superLattice creator
template
void createRtlbmDirectedBoundaryCondition3D( sOnLatticeBoundaryCondition3D& sBC )
{
sBC.setOverlap(1);
for (int iC = 0; iC < sBC.getSuperLattice().getLoadBalancer().size(); iC++) {
OnLatticeAdvectionDiffusionBoundaryCondition3D* blockBC =
createRtlbmDirectedBoundaryCondition3D( sBC.getSuperLattice().getExtendedBlockLattice(iC) );
sBC.getADblockBCs().push_back(blockBC);
}
}
} // namespace olb
#endif