/* This file is part of the OpenLB library * * Copyright (C) 2016 Robin Trunk * E-mail contact: info@openlb.net * The most recent release of OpenLB can be downloaded at * * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public * License along with this program; if not, write to the Free * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #ifndef ADVECTION_DIFFUSION_FORCES_H #define ADVECTION_DIFFUSION_FORCES_H #include "core/unitConverter.h" namespace olb { template> class AdvectionDiffusionForce3D { public: AdvectionDiffusionForce3D() { initArg = 0; }; virtual ~AdvectionDiffusionForce3D() {}; virtual void applyForce(T force[], Cell *nsCell, Cell *adCell, T vel[], int latticeR[])=0; int getInitArg() { return initArg; } private: int initArg; }; template> class AdvDiffDragForce3D : public AdvectionDiffusionForce3D { public: AdvDiffDragForce3D(UnitConverter const& converter_, T St_); AdvDiffDragForce3D(UnitConverter const& converter_, T pRadius_, T pRho_); ~AdvDiffDragForce3D() override {}; void applyForce(T force[], Cell *nsCell, Cell *adCell, T vel[], int latticeR[]) override; private: int initArg; T dragCoeff; }; template> class AdvDiffRotatingForce3D : public AdvectionDiffusionForce3D { public: AdvDiffRotatingForce3D(SuperGeometry3D& superGeometry_, const UnitConverter& converter_, std::vector axisPoint_, std::vector axisDirection_, T w_, T* frac_, bool centrifugeForceOn_ = true, bool coriolisForceOn_ = true); AdvDiffRotatingForce3D(UnitConverter const& converter_, T pRadius_, T pRho_); virtual ~AdvDiffRotatingForce3D() {}; void applyForce(T force[], Cell *nsCell, Cell *adCell, T vel[], int latticeR[]); protected: SuperGeometry3D& sg; std::vector axisPoint; std::vector axisDirection; T invMassLessForce; T w; T* frac; bool centrifugeForceOn; bool coriolisForceOn; }; template> class AdvDiffMagneticWireForce3D : public AdvectionDiffusionForce3D { public: AdvDiffMagneticWireForce3D(SuperGeometry3D& superGeometry_, UnitConverter const& converter_, T pMass, AnalyticalF3D& getMagForce); ~AdvDiffMagneticWireForce3D() override {}; void applyForce(T force[], Cell *nsCell, Cell *adCell, T vel[], int latticeR[]) override; private: SuperGeometry3D& sg; int initArg; T _pMass; T _conversionVelocity; AnalyticalF3D& _getMagForce; }; } #endif