/* This file is part of the OpenLB library
*
* Copyright (C) 2012-2015 Mathias J. Krause, Jonas Latt, Patrick Nathen
* E-mail contact: info@openlb.net
* The most recent release of OpenLB can be downloaded at
* <http://www.openlb.net/>
*
* 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.
*/
/** \file
* BGK Dynamics with adjusted omega -- generic implementation.
*/
#ifndef SMAGORINSKY_BGK_DYNAMICS_HH
#define SMAGORINSKY_BGK_DYNAMICS_HH
#include "smagorinskyBGKdynamics.h"
#include "core/cell.h"
#include "core/util.h"
#include "lbHelpers.h"
#include "math.h"
#include <complex> // For shear kalman Smagorinsky - Populations
namespace olb {
/// Smagorinsky Dynamics
template<typename T, typename DESCRIPTOR>
SmagorinskyDynamics<T,DESCRIPTOR>::SmagorinskyDynamics(T smagoConst_)
: smagoConst(smagoConst_), preFactor(computePreFactor())
{ }
template<typename T, typename DESCRIPTOR>
T SmagorinskyDynamics<T,DESCRIPTOR>::computePreFactor()
{
return (T)smagoConst*smagoConst*descriptors::invCs2<T,DESCRIPTOR>()*descriptors::invCs2<T,DESCRIPTOR>()*2*sqrt(2);
}
template<typename T, typename DESCRIPTOR>
T SmagorinskyDynamics<T,DESCRIPTOR>::getPreFactor()
{
return preFactor;
}
template<typename T, typename DESCRIPTOR>
T SmagorinskyDynamics<T,DESCRIPTOR>::getSmagoConst()
{
return smagoConst;
}
///////////////////////// ADM BGK /////////////////////////////
/*template<typename T, typename DESCRIPTOR>
ADMBGKdynamics<T,DESCRIPTOR>::ADMBGKdynamics(T omega_, Momenta<T,DESCRIPTOR>& momenta_ )
: BGKdynamics<T,DESCRIPTOR>(omega_,momenta_), omega(omega_)
{ }
template<typename T, typename DESCRIPTOR>
void ADMBGKdynamics<T,DESCRIPTOR>::collide(Cell<T,DESCRIPTOR>& cell, LatticeStatistics<T>& statistics )
{
T uSqr = lbHelpers<T,DESCRIPTOR>::bgkCollision(cell, *cell., cell[velocityBeginsAt], omega);
statistics.incrementStats(*cell[rhoIsAt], uSqr);
}*/
///////////////////////// ForcedADM BGK /////////////////////////////
template<typename T, typename DESCRIPTOR>
ForcedADMBGKdynamics<T,DESCRIPTOR>::ForcedADMBGKdynamics (
T omega_, Momenta<T,DESCRIPTOR>& momenta_ )
: BGKdynamics<T,DESCRIPTOR>(omega_,momenta_),
omega(omega_)
{ }
template<typename T, typename DESCRIPTOR>
void ForcedADMBGKdynamics<T,DESCRIPTOR>::collide (
Cell<T,DESCRIPTOR>&