diff --git a/src/cpu/VirtualFluidsCore/BoundaryConditions/BCAdapter.h b/src/cpu/VirtualFluidsCore/BoundaryConditions/BCAdapter.h index 2a522376595f0b198d1dbd91db0a0064c2f7831b..f1eef89477f4446e0e658ac00923f1fd0f1ed78d 100644 --- a/src/cpu/VirtualFluidsCore/BoundaryConditions/BCAdapter.h +++ b/src/cpu/VirtualFluidsCore/BoundaryConditions/BCAdapter.h @@ -1,36 +1,47 @@ -// _ ___ __ __________ _ __ -// | | / (_)____/ /___ ______ _/ / ____/ /_ __(_)___/ /____ -// | | / / / ___/ __/ / / / __ `/ / /_ / / / / / / __ / ___/ -// | |/ / / / / /_/ /_/ / /_/ / / __/ / / /_/ / / /_/ (__ ) -// |___/_/_/ \__/\__,_/\__,_/_/_/ /_/\__,_/_/\__,_/____/ +//======================================================================================= +// ____ ____ __ ______ __________ __ __ __ __ +// \ \ | | | | | _ \ |___ ___| | | | | / \ | | +// \ \ | | | | | |_) | | | | | | | / \ | | +// \ \ | | | | | _ / | | | | | | / /\ \ | | +// \ \ | | | | | | \ \ | | | \__/ | / ____ \ | |____ +// \ \ | | |__| |__| \__\ |__| \________/ /__/ \__\ |_______| +// \ \ | | ________________________________________________________________ +// \ \ | | | ______________________________________________________________| +// \ \| | | | __ __ __ __ ______ _______ +// \ | | |_____ | | | | | | | | | _ \ / _____) +// \ | | _____| | | | | | | | | | | \ \ \_______ +// \ | | | | |_____ | \_/ | | | | |_/ / _____ | +// \ _____| |__| |________| \_______/ |__| |______/ (_______/ // +// This file is part of VirtualFluids. VirtualFluids 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. +// +// VirtualFluids 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 VirtualFluids (see COPYING.txt). If not, see <http://www.gnu.org/licenses/>. +// +//! \file BCAdapter.h +//! \ingroup BoundarConditions +//! \author Sören Freudiger +//======================================================================================= #ifndef BCAdapter_H #define BCAdapter_H #include <PointerDefinitions.h> #include "BoundaryConditions.h" -#include "basics/objects/ObObject.h" -#include "basics/utilities/UbFileOutput.h" -#include "basics/utilities/UbFileInput.h" #include "BCAlgorithm.h" - -/*=========================================================================*/ -/* D3Q27BoundaryConditionAdapter */ -/* */ -/** -<BR><BR> -@author <A HREF="mailto:muffmolch@gmx.de">S. Freudiger</A> -@version 1.0 - 06.09.06 -*/ - -/* -usage: ... -*/ - class D3Q27Interactor; +//! \brief Abstract class of baundary conditions adapter +//! \details BCAdapter supports the definition of boundary conditions in grid generation class BCAdapter { public: @@ -40,6 +51,7 @@ public: , algorithmType(-1) { } + //! \param secondaryBcOption additional option of boundary conditions BCAdapter(const short& secondaryBcOption) : secondaryBcOption(secondaryBcOption) , type(0) @@ -74,9 +86,6 @@ protected: static const char TIMEDEPENDENT = 1<<0;//'1'; static const char TIMEPERIODIC = 1<<1;//'2'; - -private: - }; diff --git a/src/cpu/VirtualFluidsCore/BoundaryConditions/BCAlgorithm.cpp b/src/cpu/VirtualFluidsCore/BoundaryConditions/BCAlgorithm.cpp index dbdfb9ed19b3f4018265b1ad2d1a59e0c4d1a91f..7ec1efcc307e9cd288853faf72601306d9b89bd6 100644 --- a/src/cpu/VirtualFluidsCore/BoundaryConditions/BCAlgorithm.cpp +++ b/src/cpu/VirtualFluidsCore/BoundaryConditions/BCAlgorithm.cpp @@ -1,3 +1,36 @@ +//======================================================================================= +// ____ ____ __ ______ __________ __ __ __ __ +// \ \ | | | | | _ \ |___ ___| | | | | / \ | | +// \ \ | | | | | |_) | | | | | | | / \ | | +// \ \ | | | | | _ / | | | | | | / /\ \ | | +// \ \ | | | | | | \ \ | | | \__/ | / ____ \ | |____ +// \ \ | | |__| |__| \__\ |__| \________/ /__/ \__\ |_______| +// \ \ | | ________________________________________________________________ +// \ \ | | | ______________________________________________________________| +// \ \| | | | __ __ __ __ ______ _______ +// \ | | |_____ | | | | | | | | | _ \ / _____) +// \ | | _____| | | | | | | | | | | \ \ \_______ +// \ | | | | |_____ | \_/ | | | | |_/ / _____ | +// \ _____| |__| |________| \_______/ |__| |______/ (_______/ +// +// This file is part of VirtualFluids. VirtualFluids 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. +// +// VirtualFluids 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 VirtualFluids (see COPYING.txt). If not, see <http://www.gnu.org/licenses/>. +// +//! \file BCAlgorithm.cpp +//! \ingroup BoundarConditions +//! \author Konstantin Kutscher +//======================================================================================= + #include "BCAlgorithm.h" #include "BoundaryConditions.h" diff --git a/src/cpu/VirtualFluidsCore/BoundaryConditions/BCAlgorithm.h b/src/cpu/VirtualFluidsCore/BoundaryConditions/BCAlgorithm.h index ab9484fbde1b467124896e7907d8403589543a21..d7bb9c0432e714cc0334487a7ef7838085dac8e2 100644 --- a/src/cpu/VirtualFluidsCore/BoundaryConditions/BCAlgorithm.h +++ b/src/cpu/VirtualFluidsCore/BoundaryConditions/BCAlgorithm.h @@ -1,3 +1,35 @@ +//======================================================================================= +// ____ ____ __ ______ __________ __ __ __ __ +// \ \ | | | | | _ \ |___ ___| | | | | / \ | | +// \ \ | | | | | |_) | | | | | | | / \ | | +// \ \ | | | | | _ / | | | | | | / /\ \ | | +// \ \ | | | | | | \ \ | | | \__/ | / ____ \ | |____ +// \ \ | | |__| |__| \__\ |__| \________/ /__/ \__\ |_______| +// \ \ | | ________________________________________________________________ +// \ \ | | | ______________________________________________________________| +// \ \| | | | __ __ __ __ ______ _______ +// \ | | |_____ | | | | | | | | | _ \ / _____) +// \ | | _____| | | | | | | | | | | \ \ \_______ +// \ | | | | |_____ | \_/ | | | | |_/ / _____ | +// \ _____| |__| |________| \_______/ |__| |______/ (_______/ +// +// This file is part of VirtualFluids. VirtualFluids 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. +// +// VirtualFluids 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 VirtualFluids (see COPYING.txt). If not, see <http://www.gnu.org/licenses/>. +// +//! \file BCAlgorithm.h +//! \ingroup BoundarConditions +//! \author Konstantin Kutscher +//======================================================================================= #ifndef BOUNDARYCONDITIONS_H #define BOUNDARYCONDITIONS_H @@ -10,6 +42,8 @@ class DistributionArray3D; class BCArray3D; class BoundaryConditions; +//! \brief Abstract class of baundary conditions algorithm +//! \details BCAlgorithm provides interface for implementation of diferent boundary conditions class BCAlgorithm { public: diff --git a/src/cpu/VirtualFluidsCore/BoundaryConditions/BCArray3D.cpp b/src/cpu/VirtualFluidsCore/BoundaryConditions/BCArray3D.cpp index 87df6d4bdeb9c58da391091d24ff170f01af6b8d..69de4c349dce851032d45b9136c6b6e768e2ddc1 100644 --- a/src/cpu/VirtualFluidsCore/BoundaryConditions/BCArray3D.cpp +++ b/src/cpu/VirtualFluidsCore/BoundaryConditions/BCArray3D.cpp @@ -1,5 +1,37 @@ -#include "BCArray3D.h" +//======================================================================================= +// ____ ____ __ ______ __________ __ __ __ __ +// \ \ | | | | | _ \ |___ ___| | | | | / \ | | +// \ \ | | | | | |_) | | | | | | | / \ | | +// \ \ | | | | | _ / | | | | | | / /\ \ | | +// \ \ | | | | | | \ \ | | | \__/ | / ____ \ | |____ +// \ \ | | |__| |__| \__\ |__| \________/ /__/ \__\ |_______| +// \ \ | | ________________________________________________________________ +// \ \ | | | ______________________________________________________________| +// \ \| | | | __ __ __ __ ______ _______ +// \ | | |_____ | | | | | | | | | _ \ / _____) +// \ | | _____| | | | | | | | | | | \ \ \_______ +// \ | | | | |_____ | \_/ | | | | |_/ / _____ | +// \ _____| |__| |________| \_______/ |__| |______/ (_______/ +// +// This file is part of VirtualFluids. VirtualFluids 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. +// +// VirtualFluids 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 VirtualFluids (see COPYING.txt). If not, see <http://www.gnu.org/licenses/>. +// +//! \file BCArray3D.cpp +//! \ingroup BoundarConditions +//! \author Sören Freudiger +//======================================================================================= +#include "BCArray3D.h" const int BCArray3D::SOLID = -1; const int BCArray3D::FLUID = -2; @@ -48,7 +80,7 @@ void BCArray3D::setBC(std::size_t x1, std::size_t x2, std::size_t x3, SPtr<Bound else this->deleteBC(x1, x2, x3); } - //wenn keine frei gewordene BCs vorhanden + //if no vacant BCs available if (indexContainer.empty()) { bcvector.push_back(bc); @@ -185,19 +217,20 @@ void BCArray3D::deleteBCAndSetType(std::size_t x1, std::size_t x2, std::size_t x { this->deleteBC(x1, x2, x3); - //matrix neuen Typ zuweisen + //Assign matrix to new type bcindexmatrix(x1, x2, x3) = type; } ////////////////////////////////////////////////////////////////////////// void BCArray3D::deleteBC(std::size_t x1, std::size_t x2, std::size_t x3) { - //ueberpruefen, ob ueberhaupt BC vorhanden + //check if BC exists at all int index = bcindexmatrix(x1, x2, x3); if (index < 0) return; - //frei gewordenen Index in den Indexcontainer schieben + //slide the released index into the index container indexContainer.push_back(index); - //element "loeschen" + //"delete" element bcvector[index] = SPtr<BoundaryConditions>(); - } \ No newline at end of file + } + \ No newline at end of file diff --git a/src/cpu/VirtualFluidsCore/BoundaryConditions/BCArray3D.h b/src/cpu/VirtualFluidsCore/BoundaryConditions/BCArray3D.h index b8e9b711dd4afb1fc8dc4935bd5e780e08203767..a189737f0e75be576253883bd25186e33c6c79f6 100644 --- a/src/cpu/VirtualFluidsCore/BoundaryConditions/BCArray3D.h +++ b/src/cpu/VirtualFluidsCore/BoundaryConditions/BCArray3D.h @@ -1,3 +1,36 @@ +//======================================================================================= +// ____ ____ __ ______ __________ __ __ __ __ +// \ \ | | | | | _ \ |___ ___| | | | | / \ | | +// \ \ | | | | | |_) | | | | | | | / \ | | +// \ \ | | | | | _ / | | | | | | / /\ \ | | +// \ \ | | | | | | \ \ | | | \__/ | / ____ \ | |____ +// \ \ | | |__| |__| \__\ |__| \________/ /__/ \__\ |_______| +// \ \ | | ________________________________________________________________ +// \ \ | | | ______________________________________________________________| +// \ \| | | | __ __ __ __ ______ _______ +// \ | | |_____ | | | | | | | | | _ \ / _____) +// \ | | _____| | | | | | | | | | | \ \ \_______ +// \ | | | | |_____ | \_/ | | | | |_/ / _____ | +// \ _____| |__| |________| \_______/ |__| |______/ (_______/ +// +// This file is part of VirtualFluids. VirtualFluids 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. +// +// VirtualFluids 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 VirtualFluids (see COPYING.txt). If not, see <http://www.gnu.org/licenses/>. +// +//! \file BCArray3D.h +//! \ingroup BoundarConditions +//! \author Sören Freudiger +//======================================================================================= + #ifndef BCArray_H #define BCArray_H @@ -8,7 +41,7 @@ #include <PointerDefinitions.h> - +//! A class implements array to store boundary conditions flags class BCArray3D { public: diff --git a/src/cpu/VirtualFluidsCore/BoundaryConditions/BCFunction.cpp b/src/cpu/VirtualFluidsCore/BoundaryConditions/BCFunction.cpp index d2ca1b159f3f699f3d9f49df1c76837aa3df9c19..3bb9ebe406b18a01ede578c34b9f3d794f89751a 100644 --- a/src/cpu/VirtualFluidsCore/BoundaryConditions/BCFunction.cpp +++ b/src/cpu/VirtualFluidsCore/BoundaryConditions/BCFunction.cpp @@ -1,3 +1,36 @@ +//======================================================================================= +// ____ ____ __ ______ __________ __ __ __ __ +// \ \ | | | | | _ \ |___ ___| | | | | / \ | | +// \ \ | | | | | |_) | | | | | | | / \ | | +// \ \ | | | | | _ / | | | | | | / /\ \ | | +// \ \ | | | | | | \ \ | | | \__/ | / ____ \ | |____ +// \ \ | | |__| |__| \__\ |__| \________/ /__/ \__\ |_______| +// \ \ | | ________________________________________________________________ +// \ \ | | | ______________________________________________________________| +// \ \| | | | __ __ __ __ ______ _______ +// \ | | |_____ | | | | | | | | | _ \ / _____) +// \ | | _____| | | | | | | | | | | \ \ \_______ +// \ | | | | |_____ | \_/ | | | | |_/ / _____ | +// \ _____| |__| |________| \_______/ |__| |______/ (_______/ +// +// This file is part of VirtualFluids. VirtualFluids 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. +// +// VirtualFluids 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 VirtualFluids (see COPYING.txt). If not, see <http://www.gnu.org/licenses/>. +// +//! \file BCFunction.cpp +//! \ingroup BoundarConditions +//! \author Sören Freudiger +//======================================================================================= + #include "BCFunction.h" const double BCFunction::INFTIMEDEPENDENT = -1.0; diff --git a/src/cpu/VirtualFluidsCore/BoundaryConditions/BCFunction.h b/src/cpu/VirtualFluidsCore/BoundaryConditions/BCFunction.h index 4372cacd94a4102c6e9be2b3084487d383e7528c..ca2671178cdcd1239329ab0bca574d2570f876f5 100644 --- a/src/cpu/VirtualFluidsCore/BoundaryConditions/BCFunction.h +++ b/src/cpu/VirtualFluidsCore/BoundaryConditions/BCFunction.h @@ -1,9 +1,36 @@ -// _ ___ __ __________ _ __ -// | | / (_)____/ /___ ______ _/ / ____/ /_ __(_)___/ /____ -// | | / / / ___/ __/ / / / __ `/ / /_ / / / / / / __ / ___/ -// | |/ / / / / /_/ /_/ / /_/ / / __/ / / /_/ / / /_/ (__ ) -// |___/_/_/ \__/\__,_/\__,_/_/_/ /_/\__,_/_/\__,_/____/ +//======================================================================================= +// ____ ____ __ ______ __________ __ __ __ __ +// \ \ | | | | | _ \ |___ ___| | | | | / \ | | +// \ \ | | | | | |_) | | | | | | | / \ | | +// \ \ | | | | | _ / | | | | | | / /\ \ | | +// \ \ | | | | | | \ \ | | | \__/ | / ____ \ | |____ +// \ \ | | |__| |__| \__\ |__| \________/ /__/ \__\ |_______| +// \ \ | | ________________________________________________________________ +// \ \ | | | ______________________________________________________________| +// \ \| | | | __ __ __ __ ______ _______ +// \ | | |_____ | | | | | | | | | _ \ / _____) +// \ | | _____| | | | | | | | | | | \ \ \_______ +// \ | | | | |_____ | \_/ | | | | |_/ / _____ | +// \ _____| |__| |________| \_______/ |__| |______/ (_______/ // +// This file is part of VirtualFluids. VirtualFluids 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. +// +// VirtualFluids 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 VirtualFluids (see COPYING.txt). If not, see <http://www.gnu.org/licenses/>. +// +//! \file BCFunction.h +//! \ingroup BoundarConditions +//! \author Sören Freudiger +//======================================================================================= + #ifndef D3Q27BCFUNCTION_H #define D3Q27BCFUNCTION_H @@ -11,7 +38,7 @@ #include <muParser.h> - +//! A class implements function parcer for boundary conditions class BCFunction { public: diff --git a/src/cpu/VirtualFluidsCore/BoundaryConditions/BCProcessor.cpp b/src/cpu/VirtualFluidsCore/BoundaryConditions/BCProcessor.cpp index 452af7bc486d3354cc1ad877751281c3fc116837..9f4d9eab15320e28edbbf6dad2a47dcbfa2af118 100644 --- a/src/cpu/VirtualFluidsCore/BoundaryConditions/BCProcessor.cpp +++ b/src/cpu/VirtualFluidsCore/BoundaryConditions/BCProcessor.cpp @@ -1,3 +1,36 @@ +//======================================================================================= +// ____ ____ __ ______ __________ __ __ __ __ +// \ \ | | | | | _ \ |___ ___| | | | | / \ | | +// \ \ | | | | | |_) | | | | | | | / \ | | +// \ \ | | | | | _ / | | | | | | / /\ \ | | +// \ \ | | | | | | \ \ | | | \__/ | / ____ \ | |____ +// \ \ | | |__| |__| \__\ |__| \________/ /__/ \__\ |_______| +// \ \ | | ________________________________________________________________ +// \ \ | | | ______________________________________________________________| +// \ \| | | | __ __ __ __ ______ _______ +// \ | | |_____ | | | | | | | | | _ \ / _____) +// \ | | _____| | | | | | | | | | | \ \ \_______ +// \ | | | | |_____ | \_/ | | | | |_/ / _____ | +// \ _____| |__| |________| \_______/ |__| |______/ (_______/ +// +// This file is part of VirtualFluids. VirtualFluids 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. +// +// VirtualFluids 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 VirtualFluids (see COPYING.txt). If not, see <http://www.gnu.org/licenses/>. +// +//! \file BCProcessor.h +//! \ingroup BoundarConditions +//! \author Konstantin Kutscher +//======================================================================================= + #include "BCProcessor.h" #include "D3Q27EsoTwist3DSplittedVector.h" #include "DataSet3D.h" @@ -12,7 +45,7 @@ BCProcessor::BCProcessor() ////////////////////////////////////////////////////////////////////////// BCProcessor::BCProcessor(SPtr<ILBMKernel> kernel) { - SPtr<DistributionArray3D> distributions = dynamicPointerCast<EsoTwist3D>(kernel->getDataSet()->getFdistributions()); + SPtr<DistributionArray3D> distributions = std::dynamic_pointer_cast<EsoTwist3D>(kernel->getDataSet()->getFdistributions()); bcArray = SPtr<BCArray3D>(new BCArray3D( distributions->getNX1(), distributions->getNX2(), distributions->getNX3(), BCArray3D::FLUID)); } ////////////////////////////////////////////////////////////////////////// diff --git a/src/cpu/VirtualFluidsCore/BoundaryConditions/BCProcessor.h b/src/cpu/VirtualFluidsCore/BoundaryConditions/BCProcessor.h index 88bb72a76773ce237bd71e7dc05145af1e93d6c9..91537e74cc3d2488c952221ac66ba5ef595a5228 100644 --- a/src/cpu/VirtualFluidsCore/BoundaryConditions/BCProcessor.h +++ b/src/cpu/VirtualFluidsCore/BoundaryConditions/BCProcessor.h @@ -1,3 +1,36 @@ +//======================================================================================= +// ____ ____ __ ______ __________ __ __ __ __ +// \ \ | | | | | _ \ |___ ___| | | | | / \ | | +// \ \ | | | | | |_) | | | | | | | / \ | | +// \ \ | | | | | _ / | | | | | | / /\ \ | | +// \ \ | | | | | | \ \ | | | \__/ | / ____ \ | |____ +// \ \ | | |__| |__| \__\ |__| \________/ /__/ \__\ |_______| +// \ \ | | ________________________________________________________________ +// \ \ | | | ______________________________________________________________| +// \ \| | | | __ __ __ __ ______ _______ +// \ | | |_____ | | | | | | | | | _ \ / _____) +// \ | | _____| | | | | | | | | | | \ \ \_______ +// \ | | | | |_____ | \_/ | | | | |_/ / _____ | +// \ _____| |__| |________| \_______/ |__| |______/ (_______/ +// +// This file is part of VirtualFluids. VirtualFluids 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. +// +// VirtualFluids 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 VirtualFluids (see COPYING.txt). If not, see <http://www.gnu.org/licenses/>. +// +//! \file BCProcessor.h +//! \ingroup BoundarConditions +//! \author Konstantin Kutscher +//======================================================================================= + #ifndef BC_PROCESSSOR_H #define BC_PROCESSSOR_H @@ -8,6 +41,7 @@ class BCArray3D; class BCAlgorithm; class ILBMKernel; +//! A class provides an interface for boundary conditions in the calculation loop. class BCProcessor { public: diff --git a/src/cpu/VirtualFluidsCore/BoundaryConditions/BoundaryConditions.cpp b/src/cpu/VirtualFluidsCore/BoundaryConditions/BoundaryConditions.cpp index 4a384f865f37cf8b3177278ab6aedf6ba4e4bb6a..0f209e0a24cdd19dec1c30d5b4231bc27518e7ac 100644 --- a/src/cpu/VirtualFluidsCore/BoundaryConditions/BoundaryConditions.cpp +++ b/src/cpu/VirtualFluidsCore/BoundaryConditions/BoundaryConditions.cpp @@ -1,3 +1,36 @@ +//======================================================================================= +// ____ ____ __ ______ __________ __ __ __ __ +// \ \ | | | | | _ \ |___ ___| | | | | / \ | | +// \ \ | | | | | |_) | | | | | | | / \ | | +// \ \ | | | | | _ / | | | | | | / /\ \ | | +// \ \ | | | | | | \ \ | | | \__/ | / ____ \ | |____ +// \ \ | | |__| |__| \__\ |__| \________/ /__/ \__\ |_______| +// \ \ | | ________________________________________________________________ +// \ \ | | | ______________________________________________________________| +// \ \| | | | __ __ __ __ ______ _______ +// \ | | |_____ | | | | | | | | | _ \ / _____) +// \ | | _____| | | | | | | | | | | \ \ \_______ +// \ | | | | |_____ | \_/ | | | | |_/ / _____ | +// \ _____| |__| |________| \_______/ |__| |______/ (_______/ +// +// This file is part of VirtualFluids. VirtualFluids 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. +// +// VirtualFluids 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 VirtualFluids (see COPYING.txt). If not, see <http://www.gnu.org/licenses/>. +// +//! \file BoundaryConditions.h +//! \ingroup BoundarConditions +//! \author Sören Freudiger +//======================================================================================= + #include "BoundaryConditions.h" const long long BoundaryConditions::maxOptionVal = ( 1<<optionDigits ) - 1; //2^3-1 -> 7 diff --git a/src/cpu/VirtualFluidsCore/BoundaryConditions/BoundaryConditions.h b/src/cpu/VirtualFluidsCore/BoundaryConditions/BoundaryConditions.h index 0c91558b4cec7b39f6b003703ebb91eba7a796c0..2c138e437aa8392ff851ce2852357090131b728f 100644 --- a/src/cpu/VirtualFluidsCore/BoundaryConditions/BoundaryConditions.h +++ b/src/cpu/VirtualFluidsCore/BoundaryConditions/BoundaryConditions.h @@ -1,27 +1,51 @@ -// _ ___ __ __________ _ __ -// | | / (_)____/ /___ ______ _/ / ____/ /_ __(_)___/ /____ -// | | / / / ___/ __/ / / / __ `/ / /_ / / / / / / __ / ___/ -// | |/ / / / / /_/ /_/ / /_/ / / __/ / / /_/ / / /_/ (__ ) -// |___/_/_/ \__/\__,_/\__,_/_/_/ /_/\__,_/_/\__,_/____/ +//======================================================================================= +// ____ ____ __ ______ __________ __ __ __ __ +// \ \ | | | | | _ \ |___ ___| | | | | / \ | | +// \ \ | | | | | |_) | | | | | | | / \ | | +// \ \ | | | | | _ / | | | | | | / /\ \ | | +// \ \ | | | | | | \ \ | | | \__/ | / ____ \ | |____ +// \ \ | | |__| |__| \__\ |__| \________/ /__/ \__\ |_______| +// \ \ | | ________________________________________________________________ +// \ \ | | | ______________________________________________________________| +// \ \| | | | __ __ __ __ ______ _______ +// \ | | |_____ | | | | | | | | | _ \ / _____) +// \ | | _____| | | | | | | | | | | \ \ \_______ +// \ | | | | |_____ | \_/ | | | | |_/ / _____ | +// \ _____| |__| |________| \_______/ |__| |______/ (_______/ // +// This file is part of VirtualFluids. VirtualFluids 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. +// +// VirtualFluids 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 VirtualFluids (see COPYING.txt). If not, see <http://www.gnu.org/licenses/>. +// +//! \file BoundaryConditions.h +//! \ingroup BoundarConditions +//! \author Sören Freudiger +//======================================================================================= #ifndef BoundaryConditions_H #define BoundaryConditions_H #include <vector> #include <string> -#include "basics/utilities/Vector3D.h" - -#include <basics/utilities/UbException.h> -#include <basics/utilities/UbSystem.h> -#include <basics/utilities/UbTuple.h> +#include "Vector3D.h" +#include "UbException.h" +#include "UbSystem.h" +#include "UbTuple.h" #include "D3Q27System.h" #include <PointerDefinitions.h> +//! Difenition of baundary conditions in grid generation class BoundaryConditions { -//public: -// enum BcAlgorithm{VelocityBC, SlipBC, NoSlipBC, ThinWallNoSlipBC, HighViscosityNoSlipBC, EqDensityBC, NonEqDensityBC, NonReflectingVelocityBC, NonReflectingDensityBC}; public: BoundaryConditions() : noslipBoundaryFlags(0) @@ -43,10 +67,7 @@ public: , nx3(0.0f) , algorithmType(-1) { - //wenn folgendes nicht geht, dann hat man weiter unten bei der bit-geschichte ein ernstes problem!!! UB_STATIC_ASSERT( sizeof(long long) >= 8); - //UB_STATIC_ASSERT( sizeof(double) >= 16); - //UB_STATIC_ASSERT( sizeof(long long) == 32); UB_STATIC_ASSERT( (sizeof(long long)*8) >= (D3Q27System::FENDDIR+1)*BoundaryConditions::optionDigits ); for(int fdir=D3Q27System::FSTARTDIR; fdir<=D3Q27System::FENDDIR; fdir++) @@ -74,9 +95,9 @@ protected: if( (secOpt+1)>maxOptionVal ) throw UbException(UB_EXARGS,"error: option > "+UbSystem::toString(maxOptionVal-1)); - //alle digits an den betreffenden postionen auf "0" + //all digits at the respective positions to "0" flag &= ~( maxOptionVal<<(direction*optionDigits) ); - //alle digitsan den betreffenden postionen entsprechend der marke setzen + //set all digits according to the flag at the respective positions flag |= ((long long)(secOpt+1)<<(direction*optionDigits)); } public: @@ -104,8 +125,8 @@ public: bool hasSlipBoundary() { return (slipBoundaryFlags!=0); } bool hasSlipBoundaryFlag(const int& direction) { return ( ( ( slipBoundaryFlags>>(optionDigits*direction) ) & maxOptionVal ) != 0); } short getSlipSecondaryOption(const int& direction) { return (short)( ( ( slipBoundaryFlags>>(optionDigits*direction) ) & maxOptionVal ) - 1 ); } - void setNormalVector(const float& nx1,const float& nx2,const float& nx3) { this->nx1 = nx1; this->nx2 = nx2; this->nx3 = nx3;} - UbTupleFloat3 getNormalVector() { return makeUbTuple(nx1,nx2,nx3); } + void setNormalVector(const LBMReal& nx1,const LBMReal& nx2,const LBMReal& nx3) { this->nx1 = nx1; this->nx2 = nx2; this->nx3 = nx3;} + UbTupleDouble3 getNormalVector() { return makeUbTuple(nx1,nx2,nx3); } /*============== Velocity Boundary ========================*/ void setVelocityBoundaryFlag(const int& direction, const short& secOpt=0) { this->setFlagBits(velocityBoundaryFlags,direction,secOpt); } @@ -118,46 +139,46 @@ public: void setBoundaryVelocity(const Vector3D& vx) { - setBoundaryVelocityX1((float)vx[0]); - setBoundaryVelocityX2((float)vx[1]); - setBoundaryVelocityX3((float)vx[2]); + setBoundaryVelocityX1((LBMReal)vx[0]); + setBoundaryVelocityX2((LBMReal)vx[1]); + setBoundaryVelocityX3((LBMReal)vx[2]); } - void setBoundaryVelocityX1(const float& vx1) { this->bcVelocityX1 = vx1; } - void setBoundaryVelocityX2(const float& vx2) { this->bcVelocityX2 = vx2; } - void setBoundaryVelocityX3(const float& vx3) { this->bcVelocityX3 = vx3; } - float getBoundaryVelocityX1() { return this->bcVelocityX1; } - float getBoundaryVelocityX2() { return this->bcVelocityX2; } - float getBoundaryVelocityX3() { return this->bcVelocityX3; } - float getBoundaryVelocity(const int& direction) + void setBoundaryVelocityX1(const LBMReal& vx1) { this->bcVelocityX1 = vx1; } + void setBoundaryVelocityX2(const LBMReal& vx2) { this->bcVelocityX2 = vx2; } + void setBoundaryVelocityX3(const LBMReal& vx3) { this->bcVelocityX3 = vx3; } + LBMReal getBoundaryVelocityX1() { return this->bcVelocityX1; } + LBMReal getBoundaryVelocityX2() { return this->bcVelocityX2; } + LBMReal getBoundaryVelocityX3() { return this->bcVelocityX3; } + LBMReal getBoundaryVelocity(const int& direction) { switch(direction) { - case D3Q27System::E : return (float)( UbMath::c4o9*(+bcVelocityX1) ); //(2/cs^2)(=6)*rho_0(=1 bei inkompr)*wi*u*ei mit cs=1/sqrt(3) - case D3Q27System::W : return (float)( UbMath::c4o9*(-bcVelocityX1) ); //z.B. aus paper manfred MRT LB models in three dimensions (2002) - case D3Q27System::N : return (float)( UbMath::c4o9*(+bcVelocityX2) ); - case D3Q27System::S : return (float)( UbMath::c4o9*(-bcVelocityX2) ); - case D3Q27System::T : return (float)( UbMath::c4o9*(+bcVelocityX3) ); - case D3Q27System::B : return (float)( UbMath::c4o9*(-bcVelocityX3) ); - case D3Q27System::NE: return (float)( UbMath::c1o9*(+bcVelocityX1+bcVelocityX2 ) ); - case D3Q27System::SW: return (float)( UbMath::c1o9*(-bcVelocityX1-bcVelocityX2 ) ); - case D3Q27System::SE: return (float)( UbMath::c1o9*(+bcVelocityX1-bcVelocityX2 ) ); - case D3Q27System::NW: return (float)( UbMath::c1o9*(-bcVelocityX1+bcVelocityX2 ) ); - case D3Q27System::TE: return (float)( UbMath::c1o9*(+bcVelocityX1 +bcVelocityX3) ); - case D3Q27System::BW: return (float)( UbMath::c1o9*(-bcVelocityX1 -bcVelocityX3) ); - case D3Q27System::BE: return (float)( UbMath::c1o9*(+bcVelocityX1 -bcVelocityX3) ); - case D3Q27System::TW: return (float)( UbMath::c1o9*(-bcVelocityX1 +bcVelocityX3) ); - case D3Q27System::TN: return (float)( UbMath::c1o9*( +bcVelocityX2+bcVelocityX3) ); - case D3Q27System::BS: return (float)( UbMath::c1o9*( -bcVelocityX2-bcVelocityX3) ); - case D3Q27System::BN: return (float)( UbMath::c1o9*( +bcVelocityX2-bcVelocityX3) ); - case D3Q27System::TS: return (float)( UbMath::c1o9*( -bcVelocityX2+bcVelocityX3) ); - case D3Q27System::TNE: return (float)( UbMath::c1o36*(+bcVelocityX1+bcVelocityX2+bcVelocityX3) ); - case D3Q27System::BSW: return (float)( UbMath::c1o36*(-bcVelocityX1-bcVelocityX2-bcVelocityX3) ); - case D3Q27System::BNE: return (float)( UbMath::c1o36*(+bcVelocityX1+bcVelocityX2-bcVelocityX3) ); - case D3Q27System::TSW: return (float)( UbMath::c1o36*(-bcVelocityX1-bcVelocityX2+bcVelocityX3) ); - case D3Q27System::TSE: return (float)( UbMath::c1o36*(+bcVelocityX1-bcVelocityX2+bcVelocityX3) ); - case D3Q27System::BNW: return (float)( UbMath::c1o36*(-bcVelocityX1+bcVelocityX2-bcVelocityX3) ); - case D3Q27System::BSE: return (float)( UbMath::c1o36*(+bcVelocityX1-bcVelocityX2-bcVelocityX3) ); - case D3Q27System::TNW: return (float)( UbMath::c1o36*(-bcVelocityX1+bcVelocityX2+bcVelocityX3) ); + case D3Q27System::E : return (LBMReal)( UbMath::c4o9*(+bcVelocityX1) ); //(2/cs^2)(=6)*rho_0(=1 for incompressible)*wi*u*ei with cs=1/sqrt(3) + case D3Q27System::W : return (LBMReal)( UbMath::c4o9*(-bcVelocityX1) ); + case D3Q27System::N : return (LBMReal)( UbMath::c4o9*(+bcVelocityX2) ); + case D3Q27System::S : return (LBMReal)( UbMath::c4o9*(-bcVelocityX2) ); + case D3Q27System::T : return (LBMReal)( UbMath::c4o9*(+bcVelocityX3) ); + case D3Q27System::B : return (LBMReal)( UbMath::c4o9*(-bcVelocityX3) ); + case D3Q27System::NE: return (LBMReal)( UbMath::c1o9*(+bcVelocityX1+bcVelocityX2 ) ); + case D3Q27System::SW: return (LBMReal)( UbMath::c1o9*(-bcVelocityX1-bcVelocityX2 ) ); + case D3Q27System::SE: return (LBMReal)( UbMath::c1o9*(+bcVelocityX1-bcVelocityX2 ) ); + case D3Q27System::NW: return (LBMReal)( UbMath::c1o9*(-bcVelocityX1+bcVelocityX2 ) ); + case D3Q27System::TE: return (LBMReal)( UbMath::c1o9*(+bcVelocityX1 +bcVelocityX3) ); + case D3Q27System::BW: return (LBMReal)( UbMath::c1o9*(-bcVelocityX1 -bcVelocityX3) ); + case D3Q27System::BE: return (LBMReal)( UbMath::c1o9*(+bcVelocityX1 -bcVelocityX3) ); + case D3Q27System::TW: return (LBMReal)( UbMath::c1o9*(-bcVelocityX1 +bcVelocityX3) ); + case D3Q27System::TN: return (LBMReal)( UbMath::c1o9*( +bcVelocityX2+bcVelocityX3) ); + case D3Q27System::BS: return (LBMReal)( UbMath::c1o9*( -bcVelocityX2-bcVelocityX3) ); + case D3Q27System::BN: return (LBMReal)( UbMath::c1o9*( +bcVelocityX2-bcVelocityX3) ); + case D3Q27System::TS: return (LBMReal)( UbMath::c1o9*( -bcVelocityX2+bcVelocityX3) ); + case D3Q27System::TNE: return (LBMReal)( UbMath::c1o36*(+bcVelocityX1+bcVelocityX2+bcVelocityX3) ); + case D3Q27System::BSW: return (LBMReal)( UbMath::c1o36*(-bcVelocityX1-bcVelocityX2-bcVelocityX3) ); + case D3Q27System::BNE: return (LBMReal)( UbMath::c1o36*(+bcVelocityX1+bcVelocityX2-bcVelocityX3) ); + case D3Q27System::TSW: return (LBMReal)( UbMath::c1o36*(-bcVelocityX1-bcVelocityX2+bcVelocityX3) ); + case D3Q27System::TSE: return (LBMReal)( UbMath::c1o36*(+bcVelocityX1-bcVelocityX2+bcVelocityX3) ); + case D3Q27System::BNW: return (LBMReal)( UbMath::c1o36*(-bcVelocityX1+bcVelocityX2-bcVelocityX3) ); + case D3Q27System::BSE: return (LBMReal)( UbMath::c1o36*(+bcVelocityX1-bcVelocityX2-bcVelocityX3) ); + case D3Q27System::TNW: return (LBMReal)( UbMath::c1o36*(-bcVelocityX1+bcVelocityX2+bcVelocityX3) ); default: throw UbException(UB_EXARGS,"unknown error"); } } @@ -171,37 +192,37 @@ public: bool hasDensityBoundaryFlag(const int& direction) { return ( ( ( densityBoundaryFlags>>(optionDigits*direction) ) & maxOptionVal ) != 0); } short getDensitySecondaryOption(const int& direction) { return (short)( ( ( densityBoundaryFlags>>(optionDigits*direction) ) & maxOptionVal ) - 1 ); } - void setBoundaryDensity(float density) { this->bcDensity = density; } - float getBoundaryDensity() { return this->bcDensity; } + void setBoundaryDensity(LBMReal density) { this->bcDensity = density; } + LBMReal getBoundaryDensity() { return this->bcDensity; } //Lodi extension - void setDensityLodiDensity(const float& bcLodiDensity) { this->bcLodiDensity = bcLodiDensity; } - void setDensityLodiVelocityX1(const float& bcLodiVelocityX1) { this->bcLodiVelocityX1 = bcLodiVelocityX1; } - void setDensityLodiVelocityX2(const float& bcLodiVelocityX2) { this->bcLodiVelocityX2 = bcLodiVelocityX2; } - void setDensityLodiVelocityX3(const float& bcLodiVelocityX3) { this->bcLodiVelocityX3 = bcLodiVelocityX3; } - void setDensityLodiLength(const float& bcLodiLentgh) { this->bcLodiLentgh = bcLodiLentgh; } - float getDensityLodiDensity() const { return this->bcLodiDensity; } - float getDensityLodiVelocityX1() const { return this->bcLodiVelocityX1; } - float getDensityLodiVelocityX2() const { return this->bcLodiVelocityX2; } - float getDensityLodiVelocityX3() const { return this->bcLodiVelocityX3; } - float getDensityLodiLength() const { return this->bcLodiLentgh; } + void setDensityLodiDensity(const LBMReal& bcLodiDensity) { this->bcLodiDensity = bcLodiDensity; } + void setDensityLodiVelocityX1(const LBMReal& bcLodiVelocityX1) { this->bcLodiVelocityX1 = bcLodiVelocityX1; } + void setDensityLodiVelocityX2(const LBMReal& bcLodiVelocityX2) { this->bcLodiVelocityX2 = bcLodiVelocityX2; } + void setDensityLodiVelocityX3(const LBMReal& bcLodiVelocityX3) { this->bcLodiVelocityX3 = bcLodiVelocityX3; } + void setDensityLodiLength(const LBMReal& bcLodiLentgh) { this->bcLodiLentgh = bcLodiLentgh; } + LBMReal getDensityLodiDensity() const { return this->bcLodiDensity; } + LBMReal getDensityLodiVelocityX1() const { return this->bcLodiVelocityX1; } + LBMReal getDensityLodiVelocityX2() const { return this->bcLodiVelocityX2; } + LBMReal getDensityLodiVelocityX3() const { return this->bcLodiVelocityX3; } + LBMReal getDensityLodiLength() const { return this->bcLodiLentgh; } - float& densityLodiDensity() { return this->bcLodiDensity; } - float& densityLodiVelocityX1() { return this->bcLodiVelocityX1; } - float& densityLodiVelocityX2() { return this->bcLodiVelocityX2; } - float& densityLodiVelocityX3() { return this->bcLodiVelocityX3; } - float& densityLodiLentgh() { return this->bcLodiLentgh; } + LBMReal& densityLodiDensity() { return this->bcLodiDensity; } + LBMReal& densityLodiVelocityX1() { return this->bcLodiVelocityX1; } + LBMReal& densityLodiVelocityX2() { return this->bcLodiVelocityX2; } + LBMReal& densityLodiVelocityX3() { return this->bcLodiVelocityX3; } + LBMReal& densityLodiLentgh() { return this->bcLodiLentgh; } - const float& densityLodiDensity() const { return this->bcLodiDensity; } - const float& densityLodiVelocityX1() const { return this->bcLodiVelocityX1; } - const float& densityLodiVelocityX2() const { return this->bcLodiVelocityX2; } - const float& densityLodiVelocityX3() const { return this->bcLodiVelocityX3; } - const float& densityLodiLentgh() const { return this->bcLodiLentgh; } + const LBMReal& densityLodiDensity() const { return this->bcLodiDensity; } + const LBMReal& densityLodiVelocityX1() const { return this->bcLodiVelocityX1; } + const LBMReal& densityLodiVelocityX2() const { return this->bcLodiVelocityX2; } + const LBMReal& densityLodiVelocityX3() const { return this->bcLodiVelocityX3; } + const LBMReal& densityLodiLentgh() const { return this->bcLodiLentgh; } /*======================= Qs =============================*/ - void setQ(const float& val, const int& direction) { q[direction] = val; } - float getQ(const int& direction) { return q[direction]; } + void setQ(const LBMReal& val, const int& direction) { q[direction] = val; } + LBMReal getQ(const int& direction) { return q[direction]; } virtual std::vector< std::string > getBCNames() { @@ -231,12 +252,11 @@ public: char getBcAlgorithmType() { return algorithmType; } public: - static const int optionDigits = 2; //--> 3 bits für secondary Option --> maxOptionVal = 7, da man mit drei Digits max die 7 darstellen kann + static const int optionDigits = 2; //--> 2 bits for secondary Option --> maxOptionVal = 7 static const long long maxOptionVal;// = ( 1<<optionDigits ) - 1; //2^3-1 -> 7 protected: - float q[D3Q27System::FENDDIR+1]; - //float q[D3Q27System::STARTF+1]; + LBMReal q[D3Q27System::FENDDIR+1]; long long noslipBoundaryFlags; long long slipBoundaryFlags; @@ -244,26 +264,26 @@ protected: long long densityBoundaryFlags; long long wallModelBoundaryFlags; - float bcVelocityX1; - float bcVelocityX2; - float bcVelocityX3; - float bcDensity; + LBMReal bcVelocityX1; + LBMReal bcVelocityX2; + LBMReal bcVelocityX3; + LBMReal bcDensity; - float bcLodiDensity; - float bcLodiVelocityX1; - float bcLodiVelocityX2; - float bcLodiVelocityX3; - float bcLodiLentgh; + LBMReal bcLodiDensity; + LBMReal bcLodiVelocityX1; + LBMReal bcLodiVelocityX2; + LBMReal bcLodiVelocityX3; + LBMReal bcLodiLentgh; - float nx1,nx2,nx3; + LBMReal nx1,nx2,nx3; char algorithmType; -private: + private: friend class MPIIORestartCoProcessor; friend class MPIIOMigrationCoProcessor; friend class MPIIOMigrationBECoProcessor; }; -#endif //D3Q27BOUNDARYCONDITION_H +#endif diff --git a/src/cpu/VirtualFluidsCore/BoundaryConditions/NoSlipBCAdapter.cpp b/src/cpu/VirtualFluidsCore/BoundaryConditions/NoSlipBCAdapter.cpp index 24bc5794ca50c22f806d5ffda746de9408f2a9a5..a69f38d0dcfa5f35b8f996254a8724b65294be16 100644 --- a/src/cpu/VirtualFluidsCore/BoundaryConditions/NoSlipBCAdapter.cpp +++ b/src/cpu/VirtualFluidsCore/BoundaryConditions/NoSlipBCAdapter.cpp @@ -1 +1,33 @@ +//======================================================================================= +// ____ ____ __ ______ __________ __ __ __ __ +// \ \ | | | | | _ \ |___ ___| | | | | / \ | | +// \ \ | | | | | |_) | | | | | | | / \ | | +// \ \ | | | | | _ / | | | | | | / /\ \ | | +// \ \ | | | | | | \ \ | | | \__/ | / ____ \ | |____ +// \ \ | | |__| |__| \__\ |__| \________/ /__/ \__\ |_______| +// \ \ | | ________________________________________________________________ +// \ \ | | | ______________________________________________________________| +// \ \| | | | __ __ __ __ ______ _______ +// \ | | |_____ | | | | | | | | | _ \ / _____) +// \ | | _____| | | | | | | | | | | \ \ \_______ +// \ | | | | |_____ | \_/ | | | | |_/ / _____ | +// \ _____| |__| |________| \_______/ |__| |______/ (_______/ +// +// This file is part of VirtualFluids. VirtualFluids 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. +// +// VirtualFluids 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 VirtualFluids (see COPYING.txt). If not, see <http://www.gnu.org/licenses/>. +// +//! \file NoSlipBCAdapter.cpp +//! \ingroup BoundarConditions +//! \author Sören Freudiger +//======================================================================================= #include "NoSlipBCAdapter.h" diff --git a/src/cpu/VirtualFluidsCore/BoundaryConditions/NoSlipBCAdapter.h b/src/cpu/VirtualFluidsCore/BoundaryConditions/NoSlipBCAdapter.h index 6354e4d6b5e55037925ddae3cd75867c98b538fc..accf430cae4d798119afb67ca7d9ea731d082b49 100644 --- a/src/cpu/VirtualFluidsCore/BoundaryConditions/NoSlipBCAdapter.h +++ b/src/cpu/VirtualFluidsCore/BoundaryConditions/NoSlipBCAdapter.h @@ -1,21 +1,42 @@ +//======================================================================================= +// ____ ____ __ ______ __________ __ __ __ __ +// \ \ | | | | | _ \ |___ ___| | | | | / \ | | +// \ \ | | | | | |_) | | | | | | | / \ | | +// \ \ | | | | | _ / | | | | | | / /\ \ | | +// \ \ | | | | | | \ \ | | | \__/ | / ____ \ | |____ +// \ \ | | |__| |__| \__\ |__| \________/ /__/ \__\ |_______| +// \ \ | | ________________________________________________________________ +// \ \ | | | ______________________________________________________________| +// \ \| | | | __ __ __ __ ______ _______ +// \ | | |_____ | | | | | | | | | _ \ / _____) +// \ | | _____| | | | | | | | | | | \ \ \_______ +// \ | | | | |_____ | \_/ | | | | |_/ / _____ | +// \ _____| |__| |________| \_______/ |__| |______/ (_______/ +// +// This file is part of VirtualFluids. VirtualFluids 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. +// +// VirtualFluids 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 VirtualFluids (see COPYING.txt). If not, see <http://www.gnu.org/licenses/>. +// +//! \file NoSlipBCAdapter.cpp +//! \ingroup BoundarConditions +//! \author Sören Freudiger +//======================================================================================= + #ifndef NoSlipBCAdapter_H #define NoSlipBCAdapter_H #include "BCAdapter.h" -/*=========================================================================*/ -/* D3Q27NoSlipBCAdapter */ -/* */ -/** -<BR><BR> -@author <A HREF="mailto:muffmolch@gmx.de">S. Freudiger</A> -@version 1.0 - 06.09.06 -*/ - -/* -usage: ... -*/ - +//! A class provides an interface for no-slip boundary condition in grid generator class NoSlipBCAdapter : public BCAdapter { public: diff --git a/src/cpu/VirtualFluidsCore/BoundaryConditions/NoSlipBCAlgorithm.cpp b/src/cpu/VirtualFluidsCore/BoundaryConditions/NoSlipBCAlgorithm.cpp index 412c1d10459ee410aad7a8fc1bae0d1b4c7ff094..677eb3ef7105db64e784bf369323d2815b33c961 100644 --- a/src/cpu/VirtualFluidsCore/BoundaryConditions/NoSlipBCAlgorithm.cpp +++ b/src/cpu/VirtualFluidsCore/BoundaryConditions/NoSlipBCAlgorithm.cpp @@ -1,3 +1,36 @@ +//======================================================================================= +// ____ ____ __ ______ __________ __ __ __ __ +// \ \ | | | | | _ \ |___ ___| | | | | / \ | | +// \ \ | | | | | |_) | | | | | | | / \ | | +// \ \ | | | | | _ / | | | | | | / /\ \ | | +// \ \ | | | | | | \ \ | | | \__/ | / ____ \ | |____ +// \ \ | | |__| |__| \__\ |__| \________/ /__/ \__\ |_______| +// \ \ | | ________________________________________________________________ +// \ \ | | | ______________________________________________________________| +// \ \| | | | __ __ __ __ ______ _______ +// \ | | |_____ | | | | | | | | | _ \ / _____) +// \ | | _____| | | | | | | | | | | \ \ \_______ +// \ | | | | |_____ | \_/ | | | | |_/ / _____ | +// \ _____| |__| |________| \_______/ |__| |______/ (_______/ +// +// This file is part of VirtualFluids. VirtualFluids 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. +// +// VirtualFluids 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 VirtualFluids (see COPYING.txt). If not, see <http://www.gnu.org/licenses/>. +// +//! \file NoSlipBCAlgorithm.cpp +//! \ingroup BoundarConditions +//! \author Konstantin Kutscher +//======================================================================================= + #include "NoSlipBCAlgorithm.h" #include "DistributionArray3D.h" #include "BoundaryConditions.h" diff --git a/src/cpu/VirtualFluidsCore/BoundaryConditions/NoSlipBCAlgorithm.h b/src/cpu/VirtualFluidsCore/BoundaryConditions/NoSlipBCAlgorithm.h index 402e2e2bb70286533aafb7992a6186d28eb0e360..b2dfa7b39f9128c117c0338b09e6c2da013d5402 100644 --- a/src/cpu/VirtualFluidsCore/BoundaryConditions/NoSlipBCAlgorithm.h +++ b/src/cpu/VirtualFluidsCore/BoundaryConditions/NoSlipBCAlgorithm.h @@ -1,3 +1,36 @@ +//======================================================================================= +// ____ ____ __ ______ __________ __ __ __ __ +// \ \ | | | | | _ \ |___ ___| | | | | / \ | | +// \ \ | | | | | |_) | | | | | | | / \ | | +// \ \ | | | | | _ / | | | | | | / /\ \ | | +// \ \ | | | | | | \ \ | | | \__/ | / ____ \ | |____ +// \ \ | | |__| |__| \__\ |__| \________/ /__/ \__\ |_______| +// \ \ | | ________________________________________________________________ +// \ \ | | | ______________________________________________________________| +// \ \| | | | __ __ __ __ ______ _______ +// \ | | |_____ | | | | | | | | | _ \ / _____) +// \ | | _____| | | | | | | | | | | \ \ \_______ +// \ | | | | |_____ | \_/ | | | | |_/ / _____ | +// \ _____| |__| |________| \_______/ |__| |______/ (_______/ +// +// This file is part of VirtualFluids. VirtualFluids 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. +// +// VirtualFluids 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 VirtualFluids (see COPYING.txt). If not, see <http://www.gnu.org/licenses/>. +// +//! \file NoSlipBCAlgorithm.h +//! \ingroup BoundarConditions +//! \author Konstantin Kutscher +//======================================================================================= + #ifndef NoSlipBCAlgorithm_h__ #define NoSlipBCAlgorithm_h__ @@ -6,6 +39,7 @@ class DistributionArray3D; +//! A class implements no-slip boundary condition class NoSlipBCAlgorithm : public BCAlgorithm { public: @@ -16,4 +50,4 @@ public: void applyBC() override; private: }; -#endif // NoSlipBCAlgorithm_h__ +#endif diff --git a/src/cpu/VirtualFluidsCore/BoundaryConditions/VelocityBCAdapter.cpp b/src/cpu/VirtualFluidsCore/BoundaryConditions/VelocityBCAdapter.cpp index 2d7d4857bb4c7525f205bf7bcac26a2acd978827..96dd5e78d294d720f63d03ee50768cdcbba12eb7 100644 --- a/src/cpu/VirtualFluidsCore/BoundaryConditions/VelocityBCAdapter.cpp +++ b/src/cpu/VirtualFluidsCore/BoundaryConditions/VelocityBCAdapter.cpp @@ -1,3 +1,36 @@ +//======================================================================================= +// ____ ____ __ ______ __________ __ __ __ __ +// \ \ | | | | | _ \ |___ ___| | | | | / \ | | +// \ \ | | | | | |_) | | | | | | | / \ | | +// \ \ | | | | | _ / | | | | | | / /\ \ | | +// \ \ | | | | | | \ \ | | | \__/ | / ____ \ | |____ +// \ \ | | |__| |__| \__\ |__| \________/ /__/ \__\ |_______| +// \ \ | | ________________________________________________________________ +// \ \ | | | ______________________________________________________________| +// \ \| | | | __ __ __ __ ______ _______ +// \ | | |_____ | | | | | | | | | _ \ / _____) +// \ | | _____| | | | | | | | | | | \ \ \_______ +// \ | | | | |_____ | \_/ | | | | |_/ / _____ | +// \ _____| |__| |________| \_______/ |__| |______/ (_______/ +// +// This file is part of VirtualFluids. VirtualFluids 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. +// +// VirtualFluids 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 VirtualFluids (see COPYING.txt). If not, see <http://www.gnu.org/licenses/>. +// +//! \file VelocityBCAdapter.cpp +//! \ingroup BoundarConditions +//! \author Sören Freudiger +//======================================================================================= + #include "VelocityBCAdapter.h" #include "basics/utilities/UbLogger.h" #include "basics/utilities/UbMath.h" @@ -256,9 +289,9 @@ void VelocityBCAdapter::setNodeVelocity( const D3Q27Interactor& interactor, SPtr this->x3 = worldX3; this->timeStep = timestep; - if(tmpVx1Function) bc->setBoundaryVelocityX1((float)tmpVx1Function->Eval()); - if(tmpVx2Function) bc->setBoundaryVelocityX2((float)tmpVx2Function->Eval()); - if(tmpVx3Function) bc->setBoundaryVelocityX3((float)tmpVx3Function->Eval()); + if(tmpVx1Function) bc->setBoundaryVelocityX1((LBMReal)tmpVx1Function->Eval()); + if(tmpVx2Function) bc->setBoundaryVelocityX2((LBMReal)tmpVx2Function->Eval()); + if(tmpVx3Function) bc->setBoundaryVelocityX3((LBMReal)tmpVx3Function->Eval()); } catch(mu::Parser::exception_type& e){ stringstream error; error<<"mu::parser exception occurs, message("<<e.GetMsg()<<"), formula("<<e.GetExpr()+"), token("+e.GetToken()<<")" <<", pos("<<e.GetPos()<<"), error code("<<e.GetCode(); throw UbException(error.str()); } diff --git a/src/cpu/VirtualFluidsCore/BoundaryConditions/VelocityBCAdapter.h b/src/cpu/VirtualFluidsCore/BoundaryConditions/VelocityBCAdapter.h index e17bce3734590b5e747e36d7877aae08123fca6a..133779e8a06a9a989cace57e13b1da3de34eadc2 100644 --- a/src/cpu/VirtualFluidsCore/BoundaryConditions/VelocityBCAdapter.h +++ b/src/cpu/VirtualFluidsCore/BoundaryConditions/VelocityBCAdapter.h @@ -1,9 +1,35 @@ -// _ ___ __ __________ _ __ -// | | / (_)____/ /___ ______ _/ / ____/ /_ __(_)___/ /____ -// | | / / / ___/ __/ / / / __ `/ / /_ / / / / / / __ / ___/ -// | |/ / / / / /_/ /_/ / /_/ / / __/ / / /_/ / / /_/ (__ ) -// |___/_/_/ \__/\__,_/\__,_/_/_/ /_/\__,_/_/\__,_/____/ +//======================================================================================= +// ____ ____ __ ______ __________ __ __ __ __ +// \ \ | | | | | _ \ |___ ___| | | | | / \ | | +// \ \ | | | | | |_) | | | | | | | / \ | | +// \ \ | | | | | _ / | | | | | | / /\ \ | | +// \ \ | | | | | | \ \ | | | \__/ | / ____ \ | |____ +// \ \ | | |__| |__| \__\ |__| \________/ /__/ \__\ |_______| +// \ \ | | ________________________________________________________________ +// \ \ | | | ______________________________________________________________| +// \ \| | | | __ __ __ __ ______ _______ +// \ | | |_____ | | | | | | | | | _ \ / _____) +// \ | | _____| | | | | | | | | | | \ \ \_______ +// \ | | | | |_____ | \_/ | | | | |_/ / _____ | +// \ _____| |__| |________| \_______/ |__| |______/ (_______/ // +// This file is part of VirtualFluids. VirtualFluids 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. +// +// VirtualFluids 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 VirtualFluids (see COPYING.txt). If not, see <http://www.gnu.org/licenses/>. +// +//! \file VelocityBCAdapter.h +//! \ingroup BoundarConditions +//! \author Sören Freudiger +//======================================================================================= #ifndef VelocityBCAdapter_H #define VelocityBCAdapter_H @@ -12,61 +38,48 @@ #include <sstream> #include <vector> -#ifdef CAB_RCF - #include <3rdParty/rcf/RcfSerializationIncludes.h> -#endif - #include <basics/utilities/UbInfinity.h> -#include <basics/utilities/UbFileOutput.h> -#include <basics/utilities/UbFileInput.h> - -class UbFileOutput; -class UbFileInput; #include <BCAdapter.h> #include <BCFunction.h> -//example: -// vector<D3Q27BCFunction> vx1BCs,vx2BCs,vx3BCs; -// vx1BCs.push_back(D3Q27BCFunction(0.01 , 0 , 100) ); //t=[0 ..100[ -> vx1 = 0.01 -// vx1BCs.push_back(D3Q27BCFunction(0.004, 100, 200) ); //t=[100..200[ -> vx1 = 0.004 -// vx1BCs.push_back(D3Q27BCFunction(0.03 , 200, 400) ); //t=[200..400] -> vx1 = 0.03 -// -// vx2BCs.push_back(D3Q27BCFunction(0.02 , 0 , 200) ); //t=[0 ..200[ -> vx2 = 0.02 -// vx2BCs.push_back(D3Q27BCFunction(0.002, 200, 300) ); //t=[200..300[ -> vx2 = 0.002 -// vx2BCs.push_back(D3Q27BCFunction(0.043, 300, 600) ); //t=[300..600] -> vx2 = 0.043 -// -// D3Q27VelocityBCAdapter bcAdapter(vx1BCs,vx2BCs,vx3BCs); -// bcAdapter.setTimePeriodic(); //-> t=[0 ..100[ -> vx1 = 0.01 -// // t=[100..200[ -> vx1 = 0.004 -// // t=[200..400[ -> vx1 = 0.03 -// // t=[400..500[ -> vx1 = 0.01 -// // t=[500..600[ -> vx1 = 0.004 -// // t=[600..800[ -> vx1 = 0.03 ... -// // t=[0 ..200[ -> vx2 = 0.02 -// // t=[200..300[ -> vx2 = 0.002 -// // t=[300..600] -> vx2 = 0.043 -// // t=[600..800[ -> vx2 = 0.02 -// // t=[800..900[ -> vx2 = 0.002 -// // t=[900..1200]-> vx2 = 0.043 ... -// -// example parabolic inflow: -// mu::Parser fct; -// fct.SetExpr("max(vmax*(1.0-4.0*((x2-x2_vmax)^2+(x3-x3_vmax)^2)/H^2),0.0)"); //paraboloid (mit vmax bei (0/x2_vmax/x3_vmax) -// fct.DefineConst("x2Vmax", 0.0 ); //x2-Pos für vmax -// fct.DefineConst("x3Vmax", 0.0 ); //x3-Pos für vmax -// fct.DefineConst("H" , rohrDurchmesser); -// fct.DefineConst("vmax" , vmax ); -// D3Q27VelocityBCAdapter velBC(true, false ,false ,fct, 0, D3Q27BCFunction::INFCONST); - -/*=========================================================================*/ -/* D3Q27VelocityBCAdapter */ -/* */ -/** -<BR><BR> -@author <A HREF="mailto:muffmolch@gmx.de">S. Freudiger</A> -@version 1.0 - 06.09.06 -*/ +//! \brief A class provides an interface for velocity boundary condition in grid generator. + +//! \details +//! Example: +//! \code{.cpp} vector<BCFunction> vx1BCs,vx2BCs,vx3BCs; +//! vx1BCs.push_back(BCFunction(0.01 , 0 , 100) ); //t=[0 ..100[ -> vx1 = 0.01 +//! vx1BCs.push_back(BCFunction(0.004, 100, 200) ); //t=[100..200[ -> vx1 = 0.004 +//! vx1BCs.push_back(BCFunction(0.03 , 200, 400) ); //t=[200..400] -> vx1 = 0.03 +//! +//! vx2BCs.push_back(BCFunction(0.02 , 0 , 200) ); //t=[0 ..200[ -> vx2 = 0.02 +//! vx2BCs.push_back(BCFunction(0.002, 200, 300) ); //t=[200..300[ -> vx2 = 0.002 +//! vx2BCs.push_back(BCFunction(0.043, 300, 600) ); //t=[300..600] -> vx2 = 0.043 +//! +//! VelocityBCAdapter bcAdapter(vx1BCs,vx2BCs,vx3BCs); +//! bcAdapter.setTimePeriodic(); //-> t=[0 ..100[ -> vx1 = 0.01 +//! // t=[100..200[ -> vx1 = 0.004 +//! // t=[200..400[ -> vx1 = 0.03 +//! // t=[400..500[ -> vx1 = 0.01 +//! // t=[500..600[ -> vx1 = 0.004 +//! // t=[600..800[ -> vx1 = 0.03 ... +//! // t=[0 ..200[ -> vx2 = 0.02 +//! // t=[200..300[ -> vx2 = 0.002 +//! // t=[300..600] -> vx2 = 0.043 +//! // t=[600..800[ -> vx2 = 0.02 +//! // t=[800..900[ -> vx2 = 0.002 +//! // t=[900..1200]-> vx2 = 0.043 ... +//! \endcode +//! Example of parabolic inflow: +//! \code{.cpp} +//! mu::Parser fct; +//! fct.SetExpr("max(vmax*(1.0-4.0*((x2-x2_vmax)^2+(x3-x3_vmax)^2)/H^2),0.0)"); //paraboloid (with vmax for (0/x2_vmax/x3_vmax) +//! fct.DefineConst("x2Vmax", 0.0 ); //x2-Pos für vmax +//! fct.DefineConst("x3Vmax", 0.0 ); //x3-Pos für vmax +//! fct.DefineConst("H" , diameterOfPipe); +//! fct.DefineConst("vmax" , vmax ); +//! VelocityBCAdapter velBC(true, false ,false ,fct, 0, BCFunction::INFCONST); +//! \endcode class VelocityBCAdapter : public BCAdapter { @@ -101,13 +114,13 @@ public: void unsetTimePeriodic() { (this->type &= ~TIMEPERIODIC); } bool isTimePeriodic() { return ((this->type & TIMEPERIODIC) == TIMEPERIODIC); } - //folgendes ist fuer moving objects gedadacht... + //The following is meant for moving objects... void setNewVelocities(const double& vx1, const double& vx1StartTime, const double& vx1EndTime, const double& vx2, const double& vx2StartTime, const double& vx2EndTime, const double& vx3, const double& vx3StartTime, const double& vx3EndTime); - //------------- implements D3Q27BoundaryConditionAdapter ----- start + //------------- implements BCAdapter ----- start std::string toString(); void init(const D3Q27Interactor* const& interactor, const double& time=0); @@ -116,7 +129,7 @@ public: void adaptBCForDirection( const D3Q27Interactor& interactor, SPtr<BoundaryConditions> bc, const double& worldX1, const double& worldX2, const double& worldX3, const double& q, const int& fdirection, const double& time=0 ); void adaptBC( const D3Q27Interactor& interactor, SPtr<BoundaryConditions> bc, const double& worldX1, const double& worldX2, const double& worldX3, const double& time=0 ); - //------------- implements D3Q27BoundaryConditionAdapter ----- end + //------------- implements BCAdapter ----- end UbTupleDouble3 getVelocity(const double& x1, const double& x2, const double& x3, const double& timeStep) const; @@ -125,7 +138,7 @@ protected: void init(); void init(std::vector<BCFunction>& vxBCs); - //time dependency wird automatisch ueber D3Q27BCFunction Intervalle ermittelt! + //time dependency is determined automatically via BCFunction intervals! void setTimeDependent() { (this->type |= TIMEDEPENDENT); } void unsetTimeDependent() { (this->type &= ~TIMEDEPENDENT); } @@ -144,8 +157,6 @@ private: std::vector<BCFunction> vx2BCs; std::vector<BCFunction> vx3BCs; -private: - }; #endif diff --git a/src/cpu/VirtualFluidsCore/BoundaryConditions/VelocityBCAlgorithm.cpp b/src/cpu/VirtualFluidsCore/BoundaryConditions/VelocityBCAlgorithm.cpp index ece5e7edc43d3072c502da5a426fa51f5aa7588f..c4dc5bee263fd6ecbaeccc1bd5af950e84f72dc3 100644 --- a/src/cpu/VirtualFluidsCore/BoundaryConditions/VelocityBCAlgorithm.cpp +++ b/src/cpu/VirtualFluidsCore/BoundaryConditions/VelocityBCAlgorithm.cpp @@ -1,3 +1,36 @@ +//======================================================================================= +// ____ ____ __ ______ __________ __ __ __ __ +// \ \ | | | | | _ \ |___ ___| | | | | / \ | | +// \ \ | | | | | |_) | | | | | | | / \ | | +// \ \ | | | | | _ / | | | | | | / /\ \ | | +// \ \ | | | | | | \ \ | | | \__/ | / ____ \ | |____ +// \ \ | | |__| |__| \__\ |__| \________/ /__/ \__\ |_______| +// \ \ | | ________________________________________________________________ +// \ \ | | | ______________________________________________________________| +// \ \| | | | __ __ __ __ ______ _______ +// \ | | |_____ | | | | | | | | | _ \ / _____) +// \ | | _____| | | | | | | | | | | \ \ \_______ +// \ | | | | |_____ | \_/ | | | | |_/ / _____ | +// \ _____| |__| |________| \_______/ |__| |______/ (_______/ +// +// This file is part of VirtualFluids. VirtualFluids 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. +// +// VirtualFluids 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 VirtualFluids (see COPYING.txt). If not, see <http://www.gnu.org/licenses/>. +// +//! \file VelocityBCAlgorithm.cpp +//! \ingroup BoundarConditions +//! \author Konstantin Kutscher +//======================================================================================= + #include "VelocityBCAlgorithm.h" #include "DistributionArray3D.h" #include "BoundaryConditions.h" @@ -39,7 +72,7 @@ void VelocityBCAlgorithm::applyBC() if (bcPtr->hasVelocityBoundaryFlag(fdir)) { const int invDir = D3Q27System::INVDIR[fdir]; - LBMReal q = bcPtr->getQ(invDir);// m+m q=0 stabiler + LBMReal q = bcPtr->getQ(invDir); LBMReal velocity = bcPtr->getBoundaryVelocity(invDir); LBMReal fReturn = ((1.0-q)/(1.0+q))*((f[invDir]-feq[invDir])/(1.0-collFactor)+feq[invDir])+((q*(f[invDir]+f[fdir])-velocity*rho)/(1.0+q)); distributions->setDistributionForDirection(fReturn, x1+D3Q27System::DX1[invDir], x2+D3Q27System::DX2[invDir], x3+D3Q27System::DX3[invDir], fdir); diff --git a/src/cpu/VirtualFluidsCore/BoundaryConditions/VelocityBCAlgorithm.h b/src/cpu/VirtualFluidsCore/BoundaryConditions/VelocityBCAlgorithm.h index c33ae68167a097eb1cdc298c7de3c7a074ff61ce..f4d62f5367f1219fa782684232004de2a8244af0 100644 --- a/src/cpu/VirtualFluidsCore/BoundaryConditions/VelocityBCAlgorithm.h +++ b/src/cpu/VirtualFluidsCore/BoundaryConditions/VelocityBCAlgorithm.h @@ -1,11 +1,45 @@ -#ifndef VelocityBoundaryCondition_h__ -#define VelocityBoundaryCondition_h__ +//======================================================================================= +// ____ ____ __ ______ __________ __ __ __ __ +// \ \ | | | | | _ \ |___ ___| | | | | / \ | | +// \ \ | | | | | |_) | | | | | | | / \ | | +// \ \ | | | | | _ / | | | | | | / /\ \ | | +// \ \ | | | | | | \ \ | | | \__/ | / ____ \ | |____ +// \ \ | | |__| |__| \__\ |__| \________/ /__/ \__\ |_______| +// \ \ | | ________________________________________________________________ +// \ \ | | | ______________________________________________________________| +// \ \| | | | __ __ __ __ ______ _______ +// \ | | |_____ | | | | | | | | | _ \ / _____) +// \ | | _____| | | | | | | | | | | \ \ \_______ +// \ | | | | |_____ | \_/ | | | | |_/ / _____ | +// \ _____| |__| |________| \_______/ |__| |______/ (_______/ +// +// This file is part of VirtualFluids. VirtualFluids 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. +// +// VirtualFluids 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 VirtualFluids (see COPYING.txt). If not, see <http://www.gnu.org/licenses/>. +// +//! \file VelocityBCAlgorithm.h +//! \ingroup BoundarConditions +//! \author Konstantin Kutscher +//======================================================================================= + +#ifndef VelocityBCAlgorithm_H +#define VelocityBCAlgorithm_H #include "BCAlgorithm.h" #include <PointerDefinitions.h> class DistributionArray3D; +//! \brief A class implements velocyty boundary condition class VelocityBCAlgorithm : public BCAlgorithm { public: @@ -16,5 +50,5 @@ public: void applyBC() override; }; -#endif // VelocityBoundaryCondition_h__ +#endif