diff --git a/src/lbm/boundary/SimpleExtrapolationOutflow.h b/src/lbm/boundary/SimpleExtrapolationOutflow.h deleted file mode 100644 index 46c43aa70a9b9958955ca21a3c2e5892234b975f..0000000000000000000000000000000000000000 --- a/src/lbm/boundary/SimpleExtrapolationOutflow.h +++ /dev/null @@ -1,114 +0,0 @@ -//====================================================================================================================== -// -// 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 diff --git a/src/lbm/boundary/all.h b/src/lbm/boundary/all.h index 11f7698b3a79b9596219eede7d177af33cf0b211..009c88888f8b30b7107d2a210a0f0df31ed74b0b 100644 --- a/src/lbm/boundary/all.h +++ b/src/lbm/boundary/all.h @@ -1,15 +1,15 @@ //====================================================================================================================== // -// 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 -// 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. -// -// 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 +// +// 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/>. // @@ -34,7 +34,6 @@ #include "ParserUBB.h" #include "Pressure.h" #include "SimpleDiffusionDirichlet.h" -#include "SimpleExtrapolationOutflow.h" #include "SimplePAB.h" #include "SimplePressure.h" #include "SimpleUBB.h" diff --git a/src/lbm/free_surface/VtkWriter.h b/src/lbm/free_surface/VtkWriter.h index 36f056740a2a566fee8e70a19ff56084f74b4b43..f1ff2b93c6e3fdde748c1cf2b579837f37542cc1 100644 --- a/src/lbm/free_surface/VtkWriter.h +++ b/src/lbm/free_surface/VtkWriter.h @@ -100,7 +100,6 @@ void addVTKOutput(const std::weak_ptr< StructuredBlockForest >& blockForestPtr, flagMapper->addMapping(FreeSurfaceBoundaryHandling_T::pressureFlagID, uint_c(8)); flagMapper->addMapping(FreeSurfaceBoundaryHandling_T::pressureOutflowFlagID, uint_c(9)); flagMapper->addMapping(FreeSurfaceBoundaryHandling_T::outletFlagID, uint_c(10)); - flagMapper->addMapping(FreeSurfaceBoundaryHandling_T::simpleExtrapolationOutflowFlagID, uint_c(11)); writers.push_back(flagMapper); diff --git a/src/lbm/free_surface/boundary/FreeSurfaceBoundaryHandling.h b/src/lbm/free_surface/boundary/FreeSurfaceBoundaryHandling.h index f21e971cefcc5b0e152586be0bf70e0bc249abe1..0279bd4b9c445260180c8e61d9ae293db71acde9 100644 --- a/src/lbm/free_surface/boundary/FreeSurfaceBoundaryHandling.h +++ b/src/lbm/free_surface/boundary/FreeSurfaceBoundaryHandling.h @@ -58,12 +58,11 @@ class FreeSurfaceBoundaryHandling using PdfField_T = lbm::PdfField< LatticeModel_T >; // boundary - using NoSlip_T = lbm::NoSlip< LatticeModel_T, flag_t >; - using FreeSlip_T = lbm::FreeSlip< LatticeModel_T, FlagField_T >; - using UBB_T = lbm::UBB< LatticeModel_T, flag_t >; - using Pressure_T = SimplePressureWithFreeSurface< LatticeModel_T, FlagField_T >; - using Outlet_T = lbm::Outlet< LatticeModel_T, FlagField_T, 4, 3 >; - using SimpleExtrapolationOutflow_T = lbm::SimpleExtrapolationOutflow< LatticeModel_T, FlagField_T >; + using NoSlip_T = lbm::NoSlip< LatticeModel_T, flag_t >; + using FreeSlip_T = lbm::FreeSlip< LatticeModel_T, FlagField_T >; + using UBB_T = lbm::UBB< LatticeModel_T, flag_t >; + using Pressure_T = SimplePressureWithFreeSurface< LatticeModel_T, FlagField_T >; + using Outlet_T = lbm::Outlet< LatticeModel_T, FlagField_T, 4, 3 >; using UBB_Inflow_T = lbm::UBB< LatticeModel_T, flag_t >; // creates interface cells in the direction of the prescribed velocity, i.e., // represents an inflow boundary condition @@ -71,7 +70,6 @@ class FreeSurfaceBoundaryHandling // handling type using BoundaryHandling_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 using FlagInfo_T = FlagInfo< FlagField_T >; @@ -128,7 +126,6 @@ class FreeSurfaceBoundaryHandling static const field::FlagUID pressureFlagID; static const field::FlagUID pressureOutflowFlagID; static const field::FlagUID outletFlagID; - static const field::FlagUID simpleExtrapolationOutflowFlagID; static const field::FlagUID freeSlipFlagID; // boundary IDs @@ -138,7 +135,6 @@ class FreeSurfaceBoundaryHandling static const BoundaryUID pressureBoundaryID; static const BoundaryUID pressureOutflowBoundaryID; static const BoundaryUID outletBoundaryID; - static const BoundaryUID simpleExtrapolationOutflowBoundaryID; static const BoundaryUID freeSlipBoundaryID; inline BlockDataID getHandlingID() const { return handlingID_; } diff --git a/src/lbm/free_surface/boundary/FreeSurfaceBoundaryHandling.impl.h b/src/lbm/free_surface/boundary/FreeSurfaceBoundaryHandling.impl.h index e5fde552fe8ff32e4b5a70f72aa4b03700149667..38f62011908bc4c71049ed42377264509724df50 100644 --- a/src/lbm/free_surface/boundary/FreeSurfaceBoundaryHandling.impl.h +++ b/src/lbm/free_surface/boundary/FreeSurfaceBoundaryHandling.impl.h @@ -85,12 +85,10 @@ class BoundaryBlockDataHandling typename B::Pressure_T pressureOutflow(B::pressureOutflowBoundaryID, B::pressureOutflowFlagID, block, pdfField, flagField, interfaceFlag, real_c(1.0)); 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); 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) @@ -143,13 +141,11 @@ FreeSurfaceBoundaryHandling< LatticeModel_T, FlagField_T, ScalarField_T >::FreeS obstacleIDs += pressureOutflowFlagID; obstacleIDs += freeSlipFlagID; obstacleIDs += outletFlagID; - obstacleIDs += simpleExtrapolationOutflowFlagID; // initialize outflowIDs Set< FlagUID > outflowIDs; outflowIDs += pressureOutflowFlagID; outflowIDs += outletFlagID; - outflowIDs += simpleExtrapolationOutflowFlagID; // initialize outflowIDs Set< FlagUID > inflowIDs; @@ -207,11 +203,6 @@ template< typename LatticeModel_T, typename FlagField_T, typename ScalarField_T const field::FlagUID 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 > const field::FlagUID FreeSurfaceBoundaryHandling< LatticeModel_T, FlagField_T, ScalarField_T >::freeSlipFlagID = field::FlagUID("FreeSlip"); @@ -240,11 +231,6 @@ template< typename LatticeModel_T, typename FlagField_T, typename ScalarField_T const BoundaryUID 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 > const BoundaryUID FreeSurfaceBoundaryHandling< LatticeModel_T, FlagField_T, ScalarField_T >::freeSlipBoundaryID = BoundaryUID("FreeSlip");