/* This file is part of the OpenLB library
*
* Copyright (C) 2013-2015 Patrick Nathen, Mathias J. Krause
* 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 TURBULENT_F_3D_H
#define TURBULENT_F_3D_H
#include
#include "blockBaseF3D.h"
#include "superBaseF3D.h"
#include "blockLatticeLocalF3D.h"
#include "superLatticeLocalF3D.h"
#include "core/unitConverter.h"
#include "functors/analytical/indicator/indicatorBaseF3D.h"
/** These are functors used for turbulent flows. Some like AMD have an execute member
* function which writes the data into the external field of a lattice descriptor.
*/
namespace olb {
/// functor to get pointwise yPlus from rho, shear stress and local density on local lattices
template
class SuperLatticeYplus3D : public SuperLatticePhysF3D {
private:
SuperGeometry3D& _superGeometry;
IndicatorF3D& _indicator;
const int _material;
public:
SuperLatticeYplus3D(SuperLattice3D& sLattice, const UnitConverter& converter,
SuperGeometry3D& superGeometry, IndicatorF3D& indicator,
const int material );
bool operator() (T output[], const int input[]) override;
};
/// functor to get pointwise explicit filtering on local lattice, if globIC is not on
/// the local processor, the returned vector is empty
/*template
class BlockLatticeADM3D : public BlockLatticeF3D {
protected:
T _sigma;
int _order;
bool _adaptive;
const UnitConverter& _converter;
public:
BlockLatticeADM3D(BlockLatticeStructure3D& blockLattice, T sigma, int order, bool adaptive, const UnitConverter& converter);
bool operator() (T output[], const int input[]);
void execute(const int input[]);
void execute();
};
/// functor to get pointwise ecplicit filter on local lattice, if globIC is not on
/// the local processor, the returned vector is empty
template
class SuperLatticeADM3D : public SuperLatticeF3D {
protected:
T _sigma;
int _order;
bool _adaptive;
const UnitConverter& _converter;
public:
SuperLatticeADM3D(SuperLattice3D& sLattice, T sigma, int order, bool adaptive, const UnitConverter& converter);
bool operator() (T output[], const int input[]);
void execute(SuperGeometry3D& superGeometry, const int material);
};
*/
/// functor to get pointwise finite difference Dissipation on local lattice, if globIC is not on
/// the local processor, the returned vector is empty
template
class BlockFiniteDifference3D : public BlockF3D {
private:
BlockGeometryStructure3D& _blockGeometry;
BlockF3D& _blockFunctor;
std::list& _matNumber;
int _targetDim;
int _n[3];
public:
BlockFiniteDifference3D(BlockGeometryStructure3D& blockGeometry, BlockF3D& blockFunctor, std::list& matNumber);
bool operator() (T output[], const int input[]) override;
};
/// functor to get pointwise explicit filter on local lattice, if globIC is not on
/// the local processor, the returned vector is empty
template
class SuperFiniteDifference3D : public SuperF3D {
private:
SuperGeometry3D& _sGeometry;
SuperF3D& _sFunctor;
std::list& _matNumber;
public:
SuperFiniteDifference3D(SuperGeometry3D& sGeometry, SuperF3D& sFunctor, std::list& matNumber);
bool operator() (T output[], const int input[]) override;
};
template
class BlockPhysFiniteDifference3D : public BlockF3D {
private:
BlockF3D& _blockFinDiff;
int _targetDim;
const UnitConverter& _converter;
public:
BlockPhysFiniteDifference3D(BlockF3D& blockFunctor, const UnitConverter& converter);
bool operator() (T output[], const int input[]) override;
};
/// functor to get pointwise explicit filter on local lattice, if globIC is not on
/// the local processor, the returned vector is empty
template
class SuperPhysFiniteDifference3D : public SuperF3D {
private:
SuperFiniteDifference3D _sFinDiff;
const UnitConverter& _converter;
public:
SuperPhysFiniteDifference3D(SuperGeometry3D& sGeometry, SuperF3D& sFunctor, std::list& matNumber, const UnitConverter& converter);
bool operator() (T output[], const int input[]) override;
};
template
class BlockLatticeVelocityGradientFD3D : public BlockLatticeF3D {
private:
BlockF3D& _blockFinDiff;
public:
BlockLatticeVelocityGradientFD3D(BlockLatticeStructure3D& blockLattice, BlockF3D& blockFunctor);
bool operator() (T output[], const int input[]);
};
template
class BlockLatticeExternalVelocityGradientFD3D : public BlockLatticeF3D {
private:
BlockF3D& _blockFinDiff;
public:
BlockLatticeExternalVelocityGradientFD3D(BlockLatticeStructure3D& blockLattice, BlockF3D& blockFunctor);
bool operator() (T output[], const int input[]);
};
/// functor to get pointwise explicit filter on local lattice, if globIC is not on
/// the local processor, the returned vector is empty
template
class SuperLatticeVelocityGradientFD3D : public SuperLatticeF3D {
private:
SuperLatticeVelocity3D _sVelocity;
SuperFiniteDifference3D _sFinDiff;
public:
SuperLatticeVelocityGradientFD3D(SuperGeometry3D& sGeometry, SuperLattice3D& sLattice, std::list& matNumber);
bool operator() (T output[], const int input[]);
};
/// functor to get pointwise explicit filter on local lattice, if globIC is not on
/// the local processor, the returned vector is empty
template
class SuperLatticeExternalVelocityGradientFD3D : public SuperLatticeF3D {
private:
SuperLatticeExternalVelocity3D _sVelocity;
SuperFiniteDifference3D _sFinDiff;
public:
SuperLatticeExternalVelocityGradientFD3D(SuperGeometry3D& sGeometry, SuperLattice3D& sLattice, std::list& matNumber);
bool operator() (T output[], const int input[]);
};
template
class BlockLatticePhysVelocityGradientFD3D : public BlockLatticeF3D {
private:
BlockF3D& _blockFinDiff;
const UnitConverter& _converter;
public:
BlockLatticePhysVelocityGradientFD3D(BlockLatticeStructure3D& blockLattice, BlockF3D& blockFunctor, const UnitConverter& converter);
bool operator() (T output[], const int input[]) override;
};
/// functor to get pointwise explicit filter on local lattice, if globIC is not on
/// the local processor, the returned vector is empty
template
class SuperLatticePhysVelocityGradientFD3D : public SuperLatticeF3D {
private:
SuperLatticePhysVelocity3D _sVelocity;
SuperPhysFiniteDifference3D _sFinDiff;
const UnitConverter& _converter;
public:
SuperLatticePhysVelocityGradientFD3D(SuperGeometry3D& sGeometry, SuperLattice3D& sLattice, std::list& matNumber, const UnitConverter& converter);
bool operator() (T output[], const int input[]) override;
};
template
class BlockLatticeStrainRateFD3D : public BlockLatticeF3D {
private:
BlockF3D& _blockVeloGrad;
public:
BlockLatticeStrainRateFD3D(BlockLatticeStructure3D& blockLattice, BlockF3D& blockFunctor);
bool operator() (T output[], const int input[]);
};
/// functor to get pointwise explicit filter on local lattice, if globIC is not on
/// the local processor, the returned vector is empty
template
class SuperLatticeStrainRateFD3D : public SuperLatticeF3D {
private:
SuperLatticeVelocityGradientFD3D _sVeloGrad;
public:
SuperLatticeStrainRateFD3D(SuperGeometry3D& sGeometry, SuperLattice3D& sLattice, std::list& matNumber);
bool operator() (T output[], const int input[]);
};
template
class BlockLatticePhysStrainRateFD3D : public BlockLatticeF3D {
private:
BlockF3D& _blockVeloGrad;
const UnitConverter& _converter;
public:
BlockLatticePhysStrainRateFD3D(BlockLatticeStructure3D& blockLattice, BlockF3D& blockFunctor, const UnitConverter& converter);
bool operator() (T output[], const int input[]);
};
/// functor to get pointwise explicit filter on local lattice, if globIC is not on
/// the local processor, the returned vector is empty
template
class SuperLatticePhysStrainRateFD3D : public SuperLatticeF3D {
private:
SuperLatticePhysVelocityGradientFD3D _sVeloGrad;
const UnitConverter& _converter;
public:
SuperLatticePhysStrainRateFD3D(SuperGeometry3D& sGeometry, SuperLattice3D& sLattice, std::list& matNumber, const UnitConverter& converter);
bool operator() (T output[], const int input[]);
};
template
class BlockLatticeDissipationFD3D : public BlockLatticeF3D {
private:
BlockF3D& _blockVeloGrad;
const UnitConverter& _converter;
public:
BlockLatticeDissipationFD3D(BlockLatticeStructure3D& blockLattice, BlockF3D& blockFunctor, const UnitConverter& converter);
bool operator() (T output[], const int input[]);
};
/// functor to get pointwise explicit filter on local lattice, if globIC is not on
/// the local processor, the returned vector is empty
template
class SuperLatticeDissipationFD3D : public SuperLatticeF3D {
private:
SuperLatticeVelocityGradientFD3D _sVeloGrad;
const UnitConverter& _converter;
public:
SuperLatticeDissipationFD3D(SuperGeometry3D& sGeometry, SuperLattice3D& sLattice, std::list& matNumber, const UnitConverter& converter);
bool operator() (T output[], const int input[]);
};
template
class BlockLatticePhysDissipationFD3D : public BlockLatticeF3D {
private:
BlockF3D& _blockVeloGrad;
const UnitConverter& _converter;
public:
BlockLatticePhysDissipationFD3D(BlockLatticeStructure3D& blockLattice, BlockF3D& blockFunctor, const UnitConverter& _converter);
bool operator() (T output[], const int input[]) override;
};
/// functor to get pointwise explicit filter on local lattice, if globIC is not on
/// the local processor, the returned vector is empty
template
class SuperLatticePhysDissipationFD3D : public SuperLatticeF3D {
private:
SuperLatticePhysVelocityGradientFD3D _sVeloGrad;
const UnitConverter& _converter;
public:
SuperLatticePhysDissipationFD3D(SuperGeometry3D& sGeometry, SuperLattice3D& sLattice, std::list& matNumber, const UnitConverter& converter);
bool operator() (T output[], const int input[]) override;
};
template
class BlockLatticeEffectiveDissipationFD3D : public BlockLatticeF3D {
private:
BlockF3D& _blockVeloGrad;
const UnitConverter& _converter;
LESDynamics& _LESdynamics;
public:
BlockLatticeEffectiveDissipationFD3D(BlockLatticeStructure3D& blockLattice, BlockF3D& blockFunctor,
const UnitConverter& converter, LESDynamics& LESdynamics);
bool operator() (T output[], const int input[]);
};
/// functor to get pointwise explicit filter on local lattice, if globIC is not on
/// the local processor, the returned vector is empty
template
class SuperLatticeEffectiveDissipationFD3D : public SuperLatticeF3D {
private:
SuperLatticeVelocityGradientFD3D _sVeloGrad;
const UnitConverter& _converter;
public:
SuperLatticeEffectiveDissipationFD3D(SuperGeometry3D& sGeometry, SuperLattice3D& sLattice, std::list& matNumber,
const UnitConverter& converter, LESDynamics& LESdynamics);
bool operator() (T output[], const int input[]);
};
template
class BlockLatticePhysEffectiveDissipationFD3D : public BlockLatticeF3D {
private:
BlockF3D& _blockVeloGrad;
const UnitConverter& _converter;
LESDynamics& _LESdynamics;
public:
BlockLatticePhysEffectiveDissipationFD3D(BlockLatticeStructure3D& blockLattice, BlockF3D& blockFunctor,
const UnitConverter& converter, LESDynamics& LESdynamics);
bool operator() (T output[], const int input[]) override;
};
/// functor to get pointwise explicit filter on local lattice, if globIC is not on
/// the local processor, the returned vector is empty
template
class SuperLatticePhysEffectiveDissipationFD3D : public SuperLatticeF3D {
private:
SuperLatticePhysVelocityGradientFD3D _sVeloGrad;
const UnitConverter& _converter;
public:
SuperLatticePhysEffectiveDissipationFD3D(SuperGeometry3D& sGeometry, SuperLattice3D& sLattice, std::list& matNumber,
const UnitConverter& converter, LESDynamics& LESdynamics);
bool operator() (T output[], const int input[]) override;
};
template
class BlockLatticeVorticityFD3D : public BlockLatticeF3D {
private:
BlockF3D& _blockVeloGrad;
public:
BlockLatticeVorticityFD3D(BlockLatticeStructure3D& blockLattice, BlockF3D& blockFunctor);
bool operator() (T output[], const int input[]);
};
/// functor to get pointwise explicit filter on local lattice, if globIC is not on
/// the local processor, the returned vector is empty
template
class SuperLatticeVorticityFD3D : public SuperLatticeF3D {
private:
SuperLatticeVelocityGradientFD3D _sVeloGrad;
public:
SuperLatticeVorticityFD3D(SuperGeometry3D& sGeometry, SuperLattice3D& sLattice, std::list& matNumber);
bool operator() (T output[], const int input[]);
};
template
class BlockLatticePhysVorticityFD3D : public BlockLatticeF3D {
private:
BlockF3D& _blockVeloGrad;
const UnitConverter& _converter;
public:
BlockLatticePhysVorticityFD3D(BlockLatticeStructure3D& blockLattice, BlockF3D& blockFunctor, const UnitConverter& converter);
bool operator() (T output[], const int input[]);
};
/// functor to get pointwise explicit filter on local lattice, if globIC is not on
/// the local processor, the returned vector is empty
template
class SuperLatticePhysVorticityFD3D : public SuperLatticeF3D {
private:
SuperLatticePhysVelocityGradientFD3D _sVeloGrad;
const UnitConverter& _converter;
public:
SuperLatticePhysVorticityFD3D(SuperGeometry3D& sGeometry, SuperLattice3D& sLattice, std::list& matNumber, const UnitConverter& converter);
bool operator() (T output[], const int input[]);
};
/// functor that returns pointwise the enstrophy
template
class BlockLatticePhysEnstrophyFD3D : public BlockLatticeF3D {
private:
BlockF3D& _blockVeloGrad;
const UnitConverter& _converter;
public:
BlockLatticePhysEnstrophyFD3D(BlockLatticeStructure3D& blockLattice, BlockF3D& blockVeloGrad, const UnitConverter& converter);
bool operator() (T output[], const int input[]);
};
template
class SuperLatticePhysEnstrophyFD3D : public SuperLatticeF3D {
private:
SuperLatticePhysVelocityGradientFD3D _sVeloGrad;
const UnitConverter& _converter;
public:
SuperLatticePhysEnstrophyFD3D(SuperGeometry3D& sGeometry, SuperLattice3D& sLattice, std::list& matNumber, const UnitConverter& converter);
bool operator() (T output[], const int input[]);
};
template
class BlockLatticePhysStressFD3D : public BlockLatticeF3D {
private:
BlockF3D& _blockStrainRate;
const UnitConverter& _converter;
public:
BlockLatticePhysStressFD3D(BlockLatticeStructure3D& blockLattice, BlockF3D& blockFunctor, const UnitConverter& converter);
bool operator() (T output[], const int input[]);
};
/// functor to get pointwise explicit filter on local lattice, if globIC is not on
/// the local processor, the returned vector is empty
template
class SuperLatticePhysStressFD3D : public SuperLatticeF3D {
private:
SuperLatticePhysStrainRateFD3D _sStrainRate;
const UnitConverter& _converter;
public:
SuperLatticePhysStressFD3D(SuperGeometry3D& sGeometry, SuperLattice3D& sLattice, std::list& matNumber, const UnitConverter& converter);
bool operator() (T output[], const int input[]);
};
/// functor that returns pointwise the turbulent, kinetic energy
template
class BlockIsotropicHomogeneousTKE3D : public BlockLatticeF3D {
private:
BlockF3D& _blockVelocity;
public:
BlockIsotropicHomogeneousTKE3D(BlockLatticeStructure3D& blockLattice, BlockF3D& f);
bool operator() (T output[], const int input[]);
};
template
class SuperIsotropicHomogeneousTKE3D : public SuperLatticeF3D {
private:
SuperLatticePhysVelocity3D _sVelocity;
const UnitConverter& _converter;
public:
SuperIsotropicHomogeneousTKE3D( SuperLattice3D& sLattice, const UnitConverter& converter);
bool operator() (T output[], const int input[]);
};
/*
template
class BlockLatticeSigmaADM3D : public BlockLatticeF3D {
protected:
public:
BlockLatticeSigmaADM3D(BlockLatticeStructure3D& blockLattice);
bool operator() (T output[], const int input[]);
};
/// functor to get pointwise explicit filter on local lattice, if globIC is not on
/// the local processor, the returned vector is empty
template
class SuperLatticeSigmaADM3D : public SuperLatticeF3D {
protected:
public:
SuperLatticeSigmaADM3D(SuperLattice3D