Skip to content
Snippets Groups Projects
Commit 3bab5f7c authored by Henrik Asmuth's avatar Henrik Asmuth
Browse files

Added TurbulenceModelFactory

parent 9bcfe64a
No related branches found
No related tags found
1 merge request!143Experimental merge
#include "TurbulenceModelFactory.h"
#include "GPU/TurbulentViscosity.h"
#include "Parameter/Parameter.h"
#include <variant>
void TurbulenceModelFactory::setTurbulenceModel(const TurbulenceModelFactory::TurbulenceModel _turbulenceModel)
{
this->turbulenceModel = _turbulenceModel;
}
TurbulenceModelFactory::TurbulenceModel TurbulenceModelFactory::getTurbulenceModel()
{
return this->turbulenceModel;
}
turbulenceModelKernel TurbulenceModelFactory::getTurbulenceModelKernel() const
{
switch (this->turbulenceModel) {
case TurbulenceModel::AMD:
return calcTurbulentViscosityAMD;
break;
default:
return nullptr;
}
}
//=======================================================================================
// ____ ____ __ ______ __________ __ __ __ __
// \ \ | | | | | _ \ |___ ___| | | | | / \ | |
// \ \ | | | | | |_) | | | | | | | / \ | |
// \ \ | | | | | _ / | | | | | | / /\ \ | |
// \ \ | | | | | | \ \ | | | \__/ | / ____ \ | |____
// \ \ | | |__| |__| \__\ |__| \________/ /__/ \__\ |_______|
// \ \ | | ________________________________________________________________
// \ \ | | | ______________________________________________________________|
// \ \| | | | __ __ __ __ ______ _______
// \ | | |_____ | | | | | | | | | _ \ / _____)
// \ | | _____| | | | | | | | | | | \ \ \_______
// \ | | | | |_____ | \_/ | | | | |_/ / _____ |
// \ _____| |__| |________| \_______/ |__| |______/ (_______/
//
// 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 TurbulentViscosityFactory.h
//! \ingroup TurbulentViscosity
//! \author Henrik Asmuth
//=======================================================================================#ifndef BC_FACTORY
#ifndef TurbulenceModelFactory_H
#define TurbulenceModelFactory_H
#include <functional>
#include <map>
#include <string>
#include <variant>
#include "LBM/LB.h"
#include "Parameter/Parameter.h"
struct LBMSimulationParameter;
class Parameter;
using turbulenceModelKernel = std::function<void(Parameter *, int )>;
class TurbulenceModelFactory
{
public:
//! \brief An enumeration for selecting a turbulence model
enum class TurbulenceModel {
//! - AMD (Anisotropic Minimum Dissipation) model, see e.g. Rozema et al., Phys. Fluids 27, 085107 (2015), https://doi.org/10.1063/1.4928700
AMD,
//! - Smagorinsky
Smagorinsky,
//! - QR model by Verstappen
QR,
//! - TODO: move the model here from the old kernels
//WALE
//! - No turbulence model
None
};
void setTurbulenceModel(const TurbulenceModelFactory::TurbulenceModel _turbulenceModel);
// void setModelConstant(const real modelConstant);
TurbulenceModelFactory::TurbulenceModel getTurbulenceModel();
[[nodiscard]] turbulenceModelKernel getTurbulenceModelKernel() const;
private:
TurbulenceModelFactory::TurbulenceModel turbulenceModel = TurbulenceModel::None;
};
#endif
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment