Skip to content
Snippets Groups Projects
Commit 24375ea4 authored by Christoph Schwarzmeier's avatar Christoph Schwarzmeier
Browse files

Remove SimpleExtrapolationOutflow

parent 14cb2f21
Branches
Tags
No related merge requests found
//======================================================================================================================
//
// This file is part of waLBerla. waLBerla 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 3 of
// the License, or (at your option) any later version.
//
// waLBerla 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 waLBerla (see COPYING.txt). If not, see <http://www.gnu.org/licenses/>.
//
//! \file SimpleExtrapolationOutflow.h
//! \ingroup lbm
//! \author Christoph Schwarzmeier <christoph.schwarzmeier@fau.de>
//! \brief Outflow boundary condition based on extrapolation. See equation F.1 in Geier et al., 2005,
//! doi: 10.1016/j.camwa.2015.05.001
//
//======================================================================================================================
#pragma once
#include "boundary/Boundary.h"
#include "core/DataTypes.h"
#include "core/cell/CellInterval.h"
#include "core/config/Config.h"
#include "core/debug/Debug.h"
#include "lbm/field/PdfField.h"
#include "stencil/Directions.h"
#include <vector>
namespace walberla
{
namespace lbm
{
template< typename LatticeModel_T, typename FlagField_T >
class SimpleExtrapolationOutflow : public Boundary< typename FlagField_T::flag_t >
{
protected:
using PDFField = PdfField< LatticeModel_T >;
using Stencil = typename LatticeModel_T::Stencil;
using flag_t = typename FlagField_T::flag_t;
public:
static const bool threadsafe = true;
static shared_ptr< BoundaryConfiguration > createConfiguration(const Config::BlockHandle& /*config*/)
{
return make_shared< BoundaryConfiguration >();
}
SimpleExtrapolationOutflow(const BoundaryUID& boundaryUID, const FlagUID& uid, PDFField* const pdfField)
: Boundary< flag_t >(boundaryUID), uid_(uid), pdfField_(pdfField)
{
WALBERLA_ASSERT_NOT_NULLPTR(pdfField_);
}
void pushFlags(std::vector< FlagUID >& uids) const { uids.push_back(uid_); }
void beforeBoundaryTreatment() const {}
void afterBoundaryTreatment() const {}
template< typename Buffer_T >
void packCell(Buffer_T&, const cell_idx_t, const cell_idx_t, const cell_idx_t) const
{}
template< typename Buffer_T >
void registerCell(Buffer_T&, const flag_t, const cell_idx_t, const cell_idx_t, const cell_idx_t)
{}
void registerCell(const flag_t, const cell_idx_t, const cell_idx_t, const cell_idx_t, const BoundaryConfiguration&)
{}
void registerCells(const flag_t, const CellInterval&, const BoundaryConfiguration&) {}
template< typename CellIterator >
void registerCells(const flag_t, const CellIterator&, const CellIterator&, const BoundaryConfiguration&)
{}
void unregisterCell(const flag_t, const cell_idx_t, const cell_idx_t, const cell_idx_t) const {}
#ifndef NDEBUG
inline void treatDirection(const cell_idx_t x, const cell_idx_t y, const cell_idx_t z, const stencil::Direction dir,
const cell_idx_t nx, const cell_idx_t ny, const cell_idx_t nz, const flag_t mask)
#else
inline void treatDirection(const cell_idx_t x, const cell_idx_t y, const cell_idx_t z, const stencil::Direction dir,
const cell_idx_t nx, const cell_idx_t ny, const cell_idx_t nz, const flag_t /*mask*/)
#endif
{
WALBERLA_ASSERT_EQUAL(nx, x + cell_idx_c(stencil::cx[dir]));
WALBERLA_ASSERT_EQUAL(ny, y + cell_idx_c(stencil::cy[dir]));
WALBERLA_ASSERT_EQUAL(nz, z + cell_idx_c(stencil::cz[dir]));
WALBERLA_ASSERT_UNEQUAL(mask & this->mask_, numeric_cast< flag_t >(0));
// only true if "this->mask_" only contains one single flag, which is the case for the current implementation of
// this boundary condition (Outlet)
WALBERLA_ASSERT_EQUAL(mask & this->mask_, this->mask_);
// equation F.1 in Geier et al. 2015
pdfField_->get(nx, ny, nz, Stencil::invDirIdx(dir)) = pdfField_->get(x, y, z, Stencil::invDirIdx(dir));
}
private:
const FlagUID uid_;
PDFField* const pdfField_;
}; // class Outlet
} // namespace lbm
} // namespace walberla
\ No newline at end of file
//====================================================================================================================== //======================================================================================================================
// //
// This file is part of waLBerla. waLBerla is free software: you can // This file is part of waLBerla. waLBerla is free software: you can
// redistribute it and/or modify it under the terms of the GNU General Public // redistribute it and/or modify it under the terms of the GNU General Public
// License as published by the Free Software Foundation, either version 3 of // License as published by the Free Software Foundation, either version 3 of
// the License, or (at your option) any later version. // the License, or (at your option) any later version.
// //
// waLBerla is distributed in the hope that it will be useful, but WITHOUT // waLBerla is distributed in the hope that it will be useful, but WITHOUT
// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or // ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License // FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
// for more details. // for more details.
// //
// You should have received a copy of the GNU General Public License along // You should have received a copy of the GNU General Public License along
// with waLBerla (see COPYING.txt). If not, see <http://www.gnu.org/licenses/>. // with waLBerla (see COPYING.txt). If not, see <http://www.gnu.org/licenses/>.
// //
...@@ -34,7 +34,6 @@ ...@@ -34,7 +34,6 @@
#include "ParserUBB.h" #include "ParserUBB.h"
#include "Pressure.h" #include "Pressure.h"
#include "SimpleDiffusionDirichlet.h" #include "SimpleDiffusionDirichlet.h"
#include "SimpleExtrapolationOutflow.h"
#include "SimplePAB.h" #include "SimplePAB.h"
#include "SimplePressure.h" #include "SimplePressure.h"
#include "SimpleUBB.h" #include "SimpleUBB.h"
......
...@@ -100,7 +100,6 @@ void addVTKOutput(const std::weak_ptr< StructuredBlockForest >& blockForestPtr, ...@@ -100,7 +100,6 @@ void addVTKOutput(const std::weak_ptr< StructuredBlockForest >& blockForestPtr,
flagMapper->addMapping(FreeSurfaceBoundaryHandling_T::pressureFlagID, uint_c(8)); flagMapper->addMapping(FreeSurfaceBoundaryHandling_T::pressureFlagID, uint_c(8));
flagMapper->addMapping(FreeSurfaceBoundaryHandling_T::pressureOutflowFlagID, uint_c(9)); flagMapper->addMapping(FreeSurfaceBoundaryHandling_T::pressureOutflowFlagID, uint_c(9));
flagMapper->addMapping(FreeSurfaceBoundaryHandling_T::outletFlagID, uint_c(10)); flagMapper->addMapping(FreeSurfaceBoundaryHandling_T::outletFlagID, uint_c(10));
flagMapper->addMapping(FreeSurfaceBoundaryHandling_T::simpleExtrapolationOutflowFlagID, uint_c(11));
writers.push_back(flagMapper); writers.push_back(flagMapper);
......
...@@ -58,12 +58,11 @@ class FreeSurfaceBoundaryHandling ...@@ -58,12 +58,11 @@ class FreeSurfaceBoundaryHandling
using PdfField_T = lbm::PdfField< LatticeModel_T >; using PdfField_T = lbm::PdfField< LatticeModel_T >;
// boundary // boundary
using NoSlip_T = lbm::NoSlip< LatticeModel_T, flag_t >; using NoSlip_T = lbm::NoSlip< LatticeModel_T, flag_t >;
using FreeSlip_T = lbm::FreeSlip< LatticeModel_T, FlagField_T >; using FreeSlip_T = lbm::FreeSlip< LatticeModel_T, FlagField_T >;
using UBB_T = lbm::UBB< LatticeModel_T, flag_t >; using UBB_T = lbm::UBB< LatticeModel_T, flag_t >;
using Pressure_T = SimplePressureWithFreeSurface< LatticeModel_T, FlagField_T >; using Pressure_T = SimplePressureWithFreeSurface< LatticeModel_T, FlagField_T >;
using Outlet_T = lbm::Outlet< LatticeModel_T, FlagField_T, 4, 3 >; using Outlet_T = lbm::Outlet< LatticeModel_T, FlagField_T, 4, 3 >;
using SimpleExtrapolationOutflow_T = lbm::SimpleExtrapolationOutflow< LatticeModel_T, FlagField_T >;
using UBB_Inflow_T = using UBB_Inflow_T =
lbm::UBB< LatticeModel_T, flag_t >; // creates interface cells in the direction of the prescribed velocity, i.e., lbm::UBB< LatticeModel_T, flag_t >; // creates interface cells in the direction of the prescribed velocity, i.e.,
// represents an inflow boundary condition // represents an inflow boundary condition
...@@ -71,7 +70,6 @@ class FreeSurfaceBoundaryHandling ...@@ -71,7 +70,6 @@ class FreeSurfaceBoundaryHandling
// handling type // handling type
using BoundaryHandling_T = using BoundaryHandling_T =
BoundaryHandling< FlagField_T, Stencil_T, NoSlip_T, UBB_T, UBB_Inflow_T, Pressure_T, Pressure_T, Outlet_T, BoundaryHandling< FlagField_T, Stencil_T, NoSlip_T, UBB_T, UBB_Inflow_T, Pressure_T, Pressure_T, Outlet_T,
SimpleExtrapolationOutflow_T,
FreeSlip_T >; // 2 pressure boundaries with different densities, e.g., inflow-outflow FreeSlip_T >; // 2 pressure boundaries with different densities, e.g., inflow-outflow
using FlagInfo_T = FlagInfo< FlagField_T >; using FlagInfo_T = FlagInfo< FlagField_T >;
...@@ -128,7 +126,6 @@ class FreeSurfaceBoundaryHandling ...@@ -128,7 +126,6 @@ class FreeSurfaceBoundaryHandling
static const field::FlagUID pressureFlagID; static const field::FlagUID pressureFlagID;
static const field::FlagUID pressureOutflowFlagID; static const field::FlagUID pressureOutflowFlagID;
static const field::FlagUID outletFlagID; static const field::FlagUID outletFlagID;
static const field::FlagUID simpleExtrapolationOutflowFlagID;
static const field::FlagUID freeSlipFlagID; static const field::FlagUID freeSlipFlagID;
// boundary IDs // boundary IDs
...@@ -138,7 +135,6 @@ class FreeSurfaceBoundaryHandling ...@@ -138,7 +135,6 @@ class FreeSurfaceBoundaryHandling
static const BoundaryUID pressureBoundaryID; static const BoundaryUID pressureBoundaryID;
static const BoundaryUID pressureOutflowBoundaryID; static const BoundaryUID pressureOutflowBoundaryID;
static const BoundaryUID outletBoundaryID; static const BoundaryUID outletBoundaryID;
static const BoundaryUID simpleExtrapolationOutflowBoundaryID;
static const BoundaryUID freeSlipBoundaryID; static const BoundaryUID freeSlipBoundaryID;
inline BlockDataID getHandlingID() const { return handlingID_; } inline BlockDataID getHandlingID() const { return handlingID_; }
......
...@@ -85,12 +85,10 @@ class BoundaryBlockDataHandling ...@@ -85,12 +85,10 @@ class BoundaryBlockDataHandling
typename B::Pressure_T pressureOutflow(B::pressureOutflowBoundaryID, B::pressureOutflowFlagID, block, pdfField, typename B::Pressure_T pressureOutflow(B::pressureOutflowBoundaryID, B::pressureOutflowFlagID, block, pdfField,
flagField, interfaceFlag, real_c(1.0)); flagField, interfaceFlag, real_c(1.0));
typename B::Outlet_T outlet(B::outletBoundaryID, B::outletFlagID, pdfField, flagField, domainMask); typename B::Outlet_T outlet(B::outletBoundaryID, B::outletFlagID, pdfField, flagField, domainMask);
typename B::SimpleExtrapolationOutflow_T simpleExtrapolationOutflow(
B::simpleExtrapolationOutflowBoundaryID, B::simpleExtrapolationOutflowFlagID, pdfField);
typename B::FreeSlip_T freeSlip(B::freeSlipBoundaryID, B::freeSlipFlagID, pdfField, flagField, domainMask); typename B::FreeSlip_T freeSlip(B::freeSlipBoundaryID, B::freeSlipFlagID, pdfField, flagField, domainMask);
return new BoundaryHandling_T("Boundary Handling", flagField, domainMask, noslip, ubb, ubbInflow, pressure, return new BoundaryHandling_T("Boundary Handling", flagField, domainMask, noslip, ubb, ubbInflow, pressure,
pressureOutflow, outlet, simpleExtrapolationOutflow, freeSlip); pressureOutflow, outlet, freeSlip);
} }
void serialize(IBlock* const block, const BlockDataID& id, mpi::SendBuffer& buffer) void serialize(IBlock* const block, const BlockDataID& id, mpi::SendBuffer& buffer)
...@@ -143,13 +141,11 @@ FreeSurfaceBoundaryHandling< LatticeModel_T, FlagField_T, ScalarField_T >::FreeS ...@@ -143,13 +141,11 @@ FreeSurfaceBoundaryHandling< LatticeModel_T, FlagField_T, ScalarField_T >::FreeS
obstacleIDs += pressureOutflowFlagID; obstacleIDs += pressureOutflowFlagID;
obstacleIDs += freeSlipFlagID; obstacleIDs += freeSlipFlagID;
obstacleIDs += outletFlagID; obstacleIDs += outletFlagID;
obstacleIDs += simpleExtrapolationOutflowFlagID;
// initialize outflowIDs // initialize outflowIDs
Set< FlagUID > outflowIDs; Set< FlagUID > outflowIDs;
outflowIDs += pressureOutflowFlagID; outflowIDs += pressureOutflowFlagID;
outflowIDs += outletFlagID; outflowIDs += outletFlagID;
outflowIDs += simpleExtrapolationOutflowFlagID;
// initialize outflowIDs // initialize outflowIDs
Set< FlagUID > inflowIDs; Set< FlagUID > inflowIDs;
...@@ -207,11 +203,6 @@ template< typename LatticeModel_T, typename FlagField_T, typename ScalarField_T ...@@ -207,11 +203,6 @@ template< typename LatticeModel_T, typename FlagField_T, typename ScalarField_T
const field::FlagUID const field::FlagUID
FreeSurfaceBoundaryHandling< LatticeModel_T, FlagField_T, ScalarField_T >::outletFlagID = field::FlagUID("Outlet"); FreeSurfaceBoundaryHandling< LatticeModel_T, FlagField_T, ScalarField_T >::outletFlagID = field::FlagUID("Outlet");
template< typename LatticeModel_T, typename FlagField_T, typename ScalarField_T >
const field::FlagUID
FreeSurfaceBoundaryHandling< LatticeModel_T, FlagField_T, ScalarField_T >::simpleExtrapolationOutflowFlagID =
field::FlagUID("SimpleExtrapolationOutflow");
template< typename LatticeModel_T, typename FlagField_T, typename ScalarField_T > template< typename LatticeModel_T, typename FlagField_T, typename ScalarField_T >
const field::FlagUID FreeSurfaceBoundaryHandling< LatticeModel_T, FlagField_T, ScalarField_T >::freeSlipFlagID = const field::FlagUID FreeSurfaceBoundaryHandling< LatticeModel_T, FlagField_T, ScalarField_T >::freeSlipFlagID =
field::FlagUID("FreeSlip"); field::FlagUID("FreeSlip");
...@@ -240,11 +231,6 @@ template< typename LatticeModel_T, typename FlagField_T, typename ScalarField_T ...@@ -240,11 +231,6 @@ template< typename LatticeModel_T, typename FlagField_T, typename ScalarField_T
const BoundaryUID const BoundaryUID
FreeSurfaceBoundaryHandling< LatticeModel_T, FlagField_T, ScalarField_T >::outletBoundaryID = BoundaryUID("Outlet"); FreeSurfaceBoundaryHandling< LatticeModel_T, FlagField_T, ScalarField_T >::outletBoundaryID = BoundaryUID("Outlet");
template< typename LatticeModel_T, typename FlagField_T, typename ScalarField_T >
const BoundaryUID
FreeSurfaceBoundaryHandling< LatticeModel_T, FlagField_T, ScalarField_T >::simpleExtrapolationOutflowBoundaryID =
BoundaryUID("SimpleExtrapolationOutflow");
template< typename LatticeModel_T, typename FlagField_T, typename ScalarField_T > template< typename LatticeModel_T, typename FlagField_T, typename ScalarField_T >
const BoundaryUID FreeSurfaceBoundaryHandling< LatticeModel_T, FlagField_T, ScalarField_T >::freeSlipBoundaryID = const BoundaryUID FreeSurfaceBoundaryHandling< LatticeModel_T, FlagField_T, ScalarField_T >::freeSlipBoundaryID =
BoundaryUID("FreeSlip"); BoundaryUID("FreeSlip");
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment