Skip to content
Snippets Groups Projects
Commit d2027373 authored by Kutscher's avatar Kutscher
Browse files

refactoring of kernels

parent 269e3cc5
No related branches found
No related tags found
2 merge requests!298[CPU] Clean CPU core,!297rename getDistributionInvForDirection to getPostCollisionDistributionForDirection
Showing
with 33 additions and 6117 deletions
...@@ -205,10 +205,8 @@ void run() ...@@ -205,10 +205,8 @@ void run()
} }
SPtr<LBMKernel> kernel = SPtr<LBMKernel>(new CompressibleCumulant4thOrderViscosityLBMKernel()); SPtr<LBMKernel> kernel = SPtr<LBMKernel>(new K15CompressibleNavierStokes());
//dynamicPointerCast<CompressibleCumulant4thOrderViscosityLBMKernel>(kernel)->setBulkViscosity(10.0*nuLB); //dynamicPointerCast<K15CompressibleNavierStokes>(kernel)->setBulkOmegaToOmega(true);
//SPtr<LBMKernel> kernel = SPtr<LBMKernel>(new CompressibleCumulantLBMKernel());
//dynamicPointerCast<CompressibleCumulantLBMKernel>(kernel)->setBulkOmegaToOmega(true);
// //
SPtr<BCSet> bcSet(new BCSet()); SPtr<BCSet> bcSet(new BCSet());
......
...@@ -102,7 +102,7 @@ void run(string configname) ...@@ -102,7 +102,7 @@ void run(string configname)
//SPtr<LBMKernel> kernel = SPtr<LBMKernel>(new CompressibleCumulant4thOrderViscosityLBMKernel()); //SPtr<LBMKernel> kernel = SPtr<LBMKernel>(new CompressibleCumulant4thOrderViscosityLBMKernel());
//double bulckViscosity = 3700*nuLB; //double bulckViscosity = 3700*nuLB;
//dynamicPointerCast<CompressibleCumulant4thOrderViscosityLBMKernel>(kernel)->setBulkViscosity(bulckViscosity); //dynamicPointerCast<CompressibleCumulant4thOrderViscosityLBMKernel>(kernel)->setBulkViscosity(bulckViscosity);
SPtr<LBMKernel> kernel = SPtr<LBMKernel>(new CumulantK17LBMKernel()); SPtr<LBMKernel> kernel = SPtr<LBMKernel>(new K17CompressibleNavierStokes());
kernel->setBCSet(bcProc); kernel->setBCSet(bcProc);
kernel->setBCSet(bcProc); kernel->setBCSet(bcProc);
......
...@@ -114,7 +114,7 @@ void pf1() ...@@ -114,7 +114,7 @@ void pf1()
//LBM kernel definition //LBM kernel definition
SPtr<LBMKernel> kernel; SPtr<LBMKernel> kernel;
kernel = SPtr<LBMKernel>(new IncompressibleCumulantLBMKernel()); kernel = SPtr<LBMKernel>(new K16IncompressibleNavierStokes());
SPtr<BCSet> bcProc(new BCSet()); SPtr<BCSet> bcProc(new BCSet());
kernel->setBCSet(bcProc); kernel->setBCSet(bcProc);
......
...@@ -166,10 +166,10 @@ void bflow(string configname) ...@@ -166,10 +166,10 @@ void bflow(string configname)
SPtr<BCSet> bcProc; SPtr<BCSet> bcProc;
bcProc = SPtr<BCSet>(new BCSet()); bcProc = SPtr<BCSet>(new BCSet());
//SPtr<LBMKernel> kernel = SPtr<LBMKernel>(new BGKLBMKernel()); //SPtr<LBMKernel> kernel = SPtr<LBMKernel>(new B92IncompressibleNavierStokes());
//SPtr<LBMKernel> kernel = SPtr<LBMKernel>(new CumulantLBMKernel()); //SPtr<LBMKernel> kernel = SPtr<LBMKernel>(new CumulantLBMKernel());
//SPtr<LBMKernel> kernel = SPtr<LBMKernel>(new CompressibleCumulant4thOrderViscosityLBMKernel()); //SPtr<LBMKernel> kernel = SPtr<LBMKernel>(new CompressibleCumulant4thOrderViscosityLBMKernel());
//SPtr<LBMKernel> kernel = SPtr<LBMKernel>(new IncompressibleCumulantLBMKernel()); //SPtr<LBMKernel> kernel = SPtr<LBMKernel>(new K16IncompressibleNavierStokes());
//SPtr<LBMKernel> kernel = SPtr<LBMKernel>(new CumulantK17LBMKernel()); //SPtr<LBMKernel> kernel = SPtr<LBMKernel>(new CumulantK17LBMKernel());
SPtr<LBMKernel> kernel = SPtr<LBMKernel>(new RheologyBinghamModelLBMKernel()); SPtr<LBMKernel> kernel = SPtr<LBMKernel>(new RheologyBinghamModelLBMKernel());
//SPtr<LBMKernel> kernel = SPtr<LBMKernel>(new HerschelBulkleyModelLBMKernel()); //SPtr<LBMKernel> kernel = SPtr<LBMKernel>(new HerschelBulkleyModelLBMKernel());
......
...@@ -198,8 +198,8 @@ void bflow(string configname) ...@@ -198,8 +198,8 @@ void bflow(string configname)
SPtr<BCSet> bcProc; SPtr<BCSet> bcProc;
bcProc = SPtr<BCSet>(new BCSet()); bcProc = SPtr<BCSet>(new BCSet());
//SPtr<LBMKernel> kernel = SPtr<LBMKernel>(new BGKLBMKernel()); //SPtr<LBMKernel> kernel = SPtr<LBMKernel>(new B92IncompressibleNavierStokes());
//SPtr<LBMKernel> kernel = SPtr<LBMKernel>(new IncompressibleCumulantLBMKernel()); //SPtr<LBMKernel> kernel = SPtr<LBMKernel>(new K16IncompressibleNavierStokes());
//SPtr<LBMKernel> kernel = SPtr<LBMKernel>(new CumulantLBMKernel()); //SPtr<LBMKernel> kernel = SPtr<LBMKernel>(new CumulantLBMKernel());
//SPtr<LBMKernel> kernel = SPtr<LBMKernel>(new CompressibleCumulant4thOrderViscosityLBMKernel()); //SPtr<LBMKernel> kernel = SPtr<LBMKernel>(new CompressibleCumulant4thOrderViscosityLBMKernel());
//SPtr<LBMKernel> kernel = SPtr<LBMKernel>(new CumulantK17LBMKernel()); //SPtr<LBMKernel> kernel = SPtr<LBMKernel>(new CumulantK17LBMKernel());
......
...@@ -212,8 +212,8 @@ void run(string configname) ...@@ -212,8 +212,8 @@ void run(string configname)
UBLOG(logINFO, "Available memory per process = " << availMem << " bytes"); UBLOG(logINFO, "Available memory per process = " << availMem << " bytes");
} }
SPtr<LBMKernel> kernel(new IncompressibleCumulantLBMKernel()); SPtr<LBMKernel> kernel(new K16IncompressibleNavierStokes());
//SPtr<LBMKernel> kernel(new CompressibleCumulantLBMKernel()); //SPtr<LBMKernel> kernel(new K15CompressibleNavierStokes());
SPtr<BCSet> bcSet(new BCSet()); SPtr<BCSet> bcSet(new BCSet());
......
...@@ -213,21 +213,17 @@ ...@@ -213,21 +213,17 @@
#include <LBM/Interpolation/CompressibleOffsetSquarePressureInterpolator.h> #include <LBM/Interpolation/CompressibleOffsetSquarePressureInterpolator.h>
#include <LBM/Interpolation/IncompressibleOffsetInterpolator.h> #include <LBM/Interpolation/IncompressibleOffsetInterpolator.h>
#include <LBM/Interpolation/Interpolator.h> #include <LBM/Interpolation/Interpolator.h>
#include <IncompressibleCumulantWithSpongeLayerLBMKernel.h>
#include <LBM/CompressibleCumulant4thOrderViscosityLBMKernel.h>
#include <LBM/CompressibleCumulantLBMKernel.h>
#include <LBM/D3Q27System.h> #include <LBM/D3Q27System.h>
#include <LBM/ICell.h> #include <LBM/Interpolation/ICell.h>
#include <LBM/IncompressibleCumulantLBMKernel.h>
#include <LBM/InitDensityLBMKernel.h>
#include <LBM/LBMKernel.h> #include <LBM/LBMKernel.h>
#include <LBM/LBMKernelETD3Q27BGK.h>
#include <LBM/LBMSystem.h> #include <LBM/LBMSystem.h>
#include <LBM/LBMUnitConverter.h> #include <LBM/LBMUnitConverter.h>
#include <LBM/BGKLBMKernel.h>
#include <LBM/CumulantLBMKernel.h>
#include <LBM/CumulantK17LBMKernel.h> #include <LBM/B92IncompressibleNavierStokes.h>
#include <LBM/K15CompressibleNavierStokes.h>
#include <LBM/K16IncompressibleNavierStokes.h>
#include <LBM/K17CompressibleNavierStokes.h>
#include <geometry3d/CoordinateTransformation3D.h> #include <geometry3d/CoordinateTransformation3D.h>
...@@ -277,7 +273,6 @@ ...@@ -277,7 +273,6 @@
#include <Utilities/VoxelMatrixUtil.hpp> #include <Utilities/VoxelMatrixUtil.hpp>
#include <CheckRatioBlockVisitor.h> #include <CheckRatioBlockVisitor.h>
#include <InitDistributionsFromFileBlockVisitor.h>
#include <InitDistributionsWithInterpolationGridVisitor.h> #include <InitDistributionsWithInterpolationGridVisitor.h>
#include <SpongeLayerBlockVisitor.h> #include <SpongeLayerBlockVisitor.h>
#include <Visitors/Block3DVisitor.h> #include <Visitors/Block3DVisitor.h>
...@@ -309,7 +304,6 @@ ...@@ -309,7 +304,6 @@
#include <Visitors/BoundaryConditionsBlockVisitor.h> #include <Visitors/BoundaryConditionsBlockVisitor.h>
#include <Visitors/BoundaryConditionsBlockVisitor.h> #include <Visitors/BoundaryConditionsBlockVisitor.h>
#include <Visitors/ChangeBoundaryDensityBlockVisitor.h> #include <Visitors/ChangeBoundaryDensityBlockVisitor.h>
#include <InitDistributionsFromFileBlockVisitor.h>
#include <InitDistributionsWithInterpolationGridVisitor.h> #include <InitDistributionsWithInterpolationGridVisitor.h>
#include <InitThixotropyBlockVisitor.h> #include <InitThixotropyBlockVisitor.h>
#include <CheckRatioBlockVisitor.h> #include <CheckRatioBlockVisitor.h>
......
#include "BGKLBMKernel.h" #include "B92IncompressibleNavierStokes.h"
#include "BCArray3D.h" #include "BCArray3D.h"
#include "BCSet.h" #include "BCSet.h"
#include "D3Q27EsoTwist3DSoA.h" #include "D3Q27EsoTwist3DSoA.h"
...@@ -11,21 +11,21 @@ ...@@ -11,21 +11,21 @@
#define PROOF_CORRECTNESS #define PROOF_CORRECTNESS
////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////
BGKLBMKernel::BGKLBMKernel() { this->compressible = false; } B92IncompressibleNavierStokes::B92IncompressibleNavierStokes() { this->compressible = false; }
////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////
BGKLBMKernel::~BGKLBMKernel(void) = default; B92IncompressibleNavierStokes::~B92IncompressibleNavierStokes(void) = default;
////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////
void BGKLBMKernel::initDataSet() void B92IncompressibleNavierStokes::initDataSet()
{ {
SPtr<DistributionArray3D> d(new D3Q27EsoTwist3DSplittedVector(nx[0] + 2, nx[1] + 2, nx[2] + 2, -999.9)); SPtr<DistributionArray3D> d(new D3Q27EsoTwist3DSplittedVector(nx[0] + 2, nx[1] + 2, nx[2] + 2, -999.9));
dataSet->setFdistributions(d); dataSet->setFdistributions(d);
} }
////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////
SPtr<LBMKernel> BGKLBMKernel::clone() SPtr<LBMKernel> B92IncompressibleNavierStokes::clone()
{ {
SPtr<LBMKernel> kernel(new BGKLBMKernel()); SPtr<LBMKernel> kernel(new B92IncompressibleNavierStokes());
kernel->setNX(nx); kernel->setNX(nx);
std::dynamic_pointer_cast<BGKLBMKernel>(kernel)->initDataSet(); std::dynamic_pointer_cast<B92IncompressibleNavierStokes>(kernel)->initDataSet();
kernel->setCollisionFactor(this->collFactor); kernel->setCollisionFactor(this->collFactor);
kernel->setBCSet(bcSet->clone(kernel)); kernel->setBCSet(bcSet->clone(kernel));
kernel->setWithForcing(withForcing); kernel->setWithForcing(withForcing);
...@@ -38,7 +38,7 @@ SPtr<LBMKernel> BGKLBMKernel::clone() ...@@ -38,7 +38,7 @@ SPtr<LBMKernel> BGKLBMKernel::clone()
return kernel; return kernel;
} }
////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////
void BGKLBMKernel::calculate(int step) void B92IncompressibleNavierStokes::calculate(int step)
{ {
using namespace D3Q27System; using namespace D3Q27System;
// using namespace UbMath; // using namespace UbMath;
...@@ -302,4 +302,4 @@ void BGKLBMKernel::calculate(int step) ...@@ -302,4 +302,4 @@ void BGKLBMKernel::calculate(int step)
} }
} }
////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////
real BGKLBMKernel::getCalculationTime() { return vf::basics::constant::c0o1; } real B92IncompressibleNavierStokes::getCalculationTime() { return vf::basics::constant::c0o1; }
#ifndef BGKLBMKernel_H #ifndef B92IncompressibleNavierStokes_H
#define BGKLBMKernel_H #define B92IncompressibleNavierStokes_H
#include "LBMKernel.h" #include "LBMKernel.h"
#include "basics/container/CbArray3D.h" #include "basics/container/CbArray3D.h"
#include "basics/container/CbArray4D.h" #include "basics/container/CbArray4D.h"
class BGKLBMKernel : public LBMKernel class B92IncompressibleNavierStokes : public LBMKernel
{ {
public: public:
BGKLBMKernel(); B92IncompressibleNavierStokes();
~BGKLBMKernel() override; ~B92IncompressibleNavierStokes() override;
void calculate(int step) override; void calculate(int step) override;
SPtr<LBMKernel> clone() override; SPtr<LBMKernel> clone() override;
real getCalculationTime() override; real getCalculationTime() override;
private: private:
void initDataSet(); void initDataSet();
// void collideAllCompressible();
// void collideAllIncompressible();
CbArray4D<real, IndexerX4X3X2X1>::CbArray4DPtr localDistributions; CbArray4D<real, IndexerX4X3X2X1>::CbArray4DPtr localDistributions;
CbArray4D<real, IndexerX4X3X2X1>::CbArray4DPtr nonLocalDistributions; CbArray4D<real, IndexerX4X3X2X1>::CbArray4DPtr nonLocalDistributions;
CbArray3D<real, IndexerX3X2X1>::CbArray3DPtr zeroDistributions; CbArray3D<real, IndexerX3X2X1>::CbArray3DPtr zeroDistributions;
mu::value_type muX1, muX2, muX3; mu::value_type muX1, muX2, muX3;
real forcingX1; real forcingX1 { 0 };
real forcingX2; real forcingX2 { 0 };
real forcingX3; real forcingX3 { 0 };
}; };
#endif #endif
#include "BasicLBMKernel.h"
#include "D3Q27System.h"
#include "BCArray3D.h"
#include "BCSet.h"
BasicLBMKernel::BasicLBMKernel()
{
}
BasicLBMKernel::~BasicLBMKernel(void)
{
}
void BasicLBMKernel::calculate(int step)
{
using namespace D3Q27System;
using namespace std;
//timer.resetAndStart();
/////////////////////////////////////
//localDistributions = dynamicPointerCast<D3Q27EsoTwist3DSplittedVector>(dataSet->getFdistributions())->getLocalDistributions();
//nonLocalDistributions = dynamicPointerCast<D3Q27EsoTwist3DSplittedVector>(dataSet->getFdistributions())->getNonLocalDistributions();
//zeroDistributions = dynamicPointerCast<D3Q27EsoTwist3DSplittedVector>(dataSet->getFdistributions())->getZeroDistributions();
initData();
SPtr<BCArray3D> bcArray = this->getBCSet()->getBCArray();
const int bcArrayMaxX1 = (int)bcArray->getNX1();
const int bcArrayMaxX2 = (int)bcArray->getNX2();
const int bcArrayMaxX3 = (int)bcArray->getNX3();
minX1 = ghostLayerWidth;
minX2 = ghostLayerWidth;
minX3 = ghostLayerWidth;
maxX1 = bcArrayMaxX1 - ghostLayerWidth;
maxX2 = bcArrayMaxX2 - ghostLayerWidth;
maxX3 = bcArrayMaxX3 - ghostLayerWidth;
for (int x3 = minX3; x3 < maxX3; x3++)
{
for (int x2 = minX2; x2 < maxX2; x2++)
{
for (int x1 = minX1; x1 < maxX1; x1++)
{
if (!bcArray->isSolid(x1, x2, x3) && !bcArray->isUndefined(x1, x2, x3))
{
nodeCollision(step, x1, x2, x3);
}
}
}
}
}
#ifndef BasicLBMKernel_h__
#define BasicLBMKernel_h__
#include "LBMKernel.h"
class BasicLBMKernel : public LBMKernel
{
public:
BasicLBMKernel();
virtual ~BasicLBMKernel(void);
virtual void calculate(int step);
virtual SPtr<LBMKernel> clone() = 0;
protected:
virtual void initData(){}
virtual void nodeCollision(int step, int x1, int x2, int x3) {}
int minX1;
int minX2;
int minX3;
int maxX1;
int maxX2;
int maxX3;
};
#endif // BasicLBMKernel_h__
\ No newline at end of file
This diff is collapsed.
#ifndef CompressibleCumulant4thOrderViscosityLBMKernel_h__
#define CompressibleCumulant4thOrderViscosityLBMKernel_h__
#include "LBMKernel.h"
#include "BCSet.h"
#include "D3Q27System.h"
#include "basics/utilities/UbTiming.h"
#include "basics/container/CbArray4D.h"
#include "basics/container/CbArray3D.h"
//! \brief compressible cumulant LBM kernel.
//! \details CFD solver that use Cascaded Cumulant Lattice Boltzmann method for D3Q27 model
//! \author K. Kutscher, M. Geier
class CompressibleCumulant4thOrderViscosityLBMKernel : public LBMKernel
{
public:
//! This option set relaxation parameter: NORMAL
enum Parameter{NORMAL, MAGIC};
public:
CompressibleCumulant4thOrderViscosityLBMKernel();
~CompressibleCumulant4thOrderViscosityLBMKernel() override;
void calculate(int step) override;
SPtr<LBMKernel> clone() override;
real getCalculationTime() override;
//! The value should not be equal to a shear viscosity
void setBulkViscosity(real value);
protected:
virtual void initDataSet();
real f[D3Q27System::ENDF+1];
UbTimer timer;
CbArray4D<real,IndexerX4X3X2X1>::CbArray4DPtr localDistributions;
CbArray4D<real,IndexerX4X3X2X1>::CbArray4DPtr nonLocalDistributions;
CbArray3D<real,IndexerX3X2X1>::CbArray3DPtr zeroDistributions;
mu::value_type muX1,muX2,muX3;
mu::value_type muDeltaT;
mu::value_type muNu;
real forcingX1;
real forcingX2;
real forcingX3;
// bulk viscosity
real OxxPyyPzz; //omega2 (bulk viscosity)
real bulkViscosity;
};
#endif // CompressibleCumulant4thOrderViscosityLBMKernel_h__
This diff is collapsed.
//=======================================================================================
// ____ ____ __ ______ __________ __ __ __ __
// \ \ | | | | | _ \ |___ ___| | | | | / \ | |
// \ \ | | | | | |_) | | | | | | | / \ | |
// \ \ | | | | | _ / | | | | | | / /\ \ | |
// \ \ | | | | | | \ \ | | | \__/ | / ____ \ | |____
// \ \ | | |__| |__| \__\ |__| \________/ /__/ \__\ |_______|
// \ \ | | ________________________________________________________________
// \ \ | | | ______________________________________________________________|
// \ \| | | | __ __ __ __ ______ _______
// \ | | |_____ | | | | | | | | | _ \ / _____)
// \ | | _____| | | | | | | | | | | \ \ \_______
// \ | | | | |_____ | \_/ | | | | |_/ / _____ |
// \ _____| |__| |________| \_______/ |__| |______/ (_______/
//
// 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 CumulantK17LBMKernel.h
//! \ingroup LBM
//! \author Konstantin Kutscher, Martin Geier
//=======================================================================================
#ifndef CumulantK17LBMKernel_h__
#define CumulantK17LBMKernel_h__
#include "LBMKernel.h"
#include "BCSet.h"
#include "D3Q27System.h"
#include "basics/utilities/UbTiming.h"
#include "basics/container/CbArray4D.h"
#include "basics/container/CbArray3D.h"
//! \brief Compressible cumulant LBM kernel.
//! \details LBM implementation that use Cascaded Cumulant Lattice Boltzmann method for D3Q27 model
//!
//! The model is publisched in
//! <a href="http://dx.doi.org/10.1016/j.jcp.2017.05.040"><b>[ Geier et al., (2017), 10.1016/j.jcp.2017.05.040]</b></a>,
//! <a href="http://dx.doi.org/10.1016/j.jcp.2017.07.004"><b>[ Geier et al., (2017), 10.1016/j.jcp.2017.07.004]</b></a>
//!
class CumulantK17LBMKernel : public LBMKernel
{
public:
CumulantK17LBMKernel();
~CumulantK17LBMKernel() = default;
void calculate(int step) override;
SPtr<LBMKernel> clone() override;
real getCalculationTime() override { return .0; }
protected:
virtual void initDataSet();
real f[D3Q27System::ENDF + 1];
CbArray4D<real, IndexerX4X3X2X1>::CbArray4DPtr localDistributions;
CbArray4D<real, IndexerX4X3X2X1>::CbArray4DPtr nonLocalDistributions;
CbArray3D<real, IndexerX3X2X1>::CbArray3DPtr restDistributions;
mu::value_type muX1, muX2, muX3;
mu::value_type muDeltaT;
mu::value_type muNu;
real forcingX1;
real forcingX2;
real forcingX3;
};
#endif // CumulantK17LBMKernel_h__
This diff is collapsed.
#ifndef CumulantLBMKernel_h__
#define CumulantLBMKernel_h__
#include "BasicLBMKernel.h"
#include "BCSet.h"
#include "D3Q27System.h"
#include "basics/utilities/UbTiming.h"
#include "basics/container/CbArray4D.h"
#include "basics/container/CbArray3D.h"
//! \brief compressible cumulant LBM kernel.
//! \details CFD solver that use Cascaded Cumulant Lattice Boltzmann method for D3Q27 model
//! \author K. Kutscher, M. Geier
class CumulantLBMKernel : public BasicLBMKernel
{
public:
//! This option set relaxation parameter: NORMAL
enum Parameter { NORMAL, MAGIC };
public:
CumulantLBMKernel();
virtual ~CumulantLBMKernel() = default;
//virtual void calculate(int step);
SPtr<LBMKernel> clone() override;
real getCalculationTime() override;
void setBulkOmegaToOmega(bool value);
void setRelaxationParameter(Parameter p);
protected:
void initData() override;
void nodeCollision(int step, int x1, int x2, int x3) override;
void initDataSet();
real f[D3Q27System::ENDF + 1];
UbTimer timer;
real OxyyMxzz;
Parameter parameter;
CbArray4D<real, IndexerX4X3X2X1>::CbArray4DPtr localDistributions;
CbArray4D<real, IndexerX4X3X2X1>::CbArray4DPtr nonLocalDistributions;
CbArray3D<real, IndexerX3X2X1>::CbArray3DPtr zeroDistributions;
mu::value_type muX1, muX2, muX3;
mu::value_type muDeltaT;
mu::value_type muNu;
real forcingX1;
real forcingX2;
real forcingX3;
// bulk viscosity
bool bulkOmegaToOmega;
real OxxPyyPzz;
real omega;
};
#endif // CumulantLBMKernel_h__
\ No newline at end of file
This diff is collapsed.
#ifndef IncompressibleCumulantWithSpongeLayerLBMKernel_H
#define IncompressibleCumulantWithSpongeLayerLBMKernel_H
#include "IncompressibleCumulantLBMKernel.h"
//! \brief Cascaded Cumulant LBM kernel.
//! \details CFD solver with sponge layer that use Cascaded Cumulant Lattice Boltzmann method for D3Q27 model <br>
//! variable spongeFactor is depending on funktion in muSpongeLayer and varies between 1 (do nothing) und 0.5 (collFactor about 1);
//! Initialization in test case (example): <br>
//! \code{.cpp}
//! int sizeSP=8; //width of sponge layer in blocks
//! mu::Parser spongeLayer;
//! spongeLayer.SetExpr("x1>=(sizeX-sizeSP)/dt ? (sizeX-(x1+1))/sizeSP/2.0 + 0.5 : 1.0");
//! spongeLayer.DefineConst("sizeX", nx[0]*blocknx[0]); // width of grid for X in coarse nodes
//! spongeLayer.DefineConst("sizeSP", sizeSP*blocknx[0]); // width of sponge layer in coarse nodes
//! kernel->setWithSpongeLayer(true);
//! kernel->setSpongeLayer(spongeLayer);
//! \endcode
//! \author K. Kucher, M. Geier, A. Karanchuk
class IncompressibleCumulantWithSpongeLayerLBMKernel : public IncompressibleCumulantLBMKernel
{
public:
IncompressibleCumulantWithSpongeLayerLBMKernel();
~IncompressibleCumulantWithSpongeLayerLBMKernel() override;
SPtr<LBMKernel> clone() override;
void calculate(int step) override;
void initRelaxFactor(int vdir, real vL1, real vdx, real vSP);
//! \param vdir where the sponge layer is placed
//! \param vL1 length of simulation domain
//! \param vdx subgrid space
//! \param vSP length of sponge layer
void setRelaxFactorParam(int vdir, real vL1, real vdx, real vSP);
protected:
void initDataSet() override;
real OxyyMxzz;
int direction;
real L1;
real dx;
real SP;
};
#endif
This diff is collapsed.
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