OpenLB 1.7
Loading...
Searching...
No Matches
stochasticSGSdynamics.h
Go to the documentation of this file.
1/* This file is part of the OpenLB library
2 *
3 * Copyright (C) 2013 Patrick Nathen
4 * E-mail contact: info@openlb.net
5 * The most recent release of OpenLB can be downloaded at
6 * <http://www.openlb.net/>
7 *
8 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU General Public License
10 * as published by the Free Software Foundation; either version 2
11 * of the License, or (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public
19 * License along with this program; if not, write to the Free
20 * Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
21 * Boston, MA 02110-1301, USA.
22*/
23
27#ifndef STOCHASTIC_SGS_DYNAMICS_H
28#define STOCHASTIC_SGS_DYNAMICS_H
29
30#include "mrtDynamics.h"
31#include "core/cell.h"
32
33
34namespace olb {
35
38template<typename T, typename DESCRIPTOR, typename MOMENTA=momenta::BulkTuple>
39class StochasticSGSdynamics : public MRTdynamics<T,DESCRIPTOR,MOMENTA> {
40public:
41 template<typename M>
43
45 StochasticSGSdynamics(T omega_, T turbulenceInt_, T charU_, T smagoConst_, T dx_ = 1, T dt_ = 1 );
46
47
48 // Collide
50 LatticeStatistics<T>& statistics_);
51
53 virtual void setOmega(T omega_);
54
56 virtual T getSmagorinskyOmega(Cell<T,DESCRIPTOR>& cell_, T X_lang_n_);
57
59 virtual T getRandBMTrans(Cell<T,DESCRIPTOR>& cell_, T turbulenceInt_, T charU_);
60
62 // virtual void setRandomWalk(Cell<T,DESCRIPTOR>& cell_, T CharU, T drift_, T result_ );
63 virtual T getRandomWalk(Cell<T,DESCRIPTOR>& cell_, T drift_, T result_);
64
65
66private:
68 T computePreFactor(T omega_, T smagoConst_);
69
71 T computeOmega(T omega0_, T preFactor_, T rho_, T pi_[util::TensorVal<DESCRIPTOR >::n], T X_lang_n_);
72
74 T computeTimeScale(T preFactor_, T rho_, T pi_[util::TensorVal<DESCRIPTOR >::n], T smagoConst_, T X_lang_n_);
75 // virtual void setTimeScale(T preFactor_, T rho_, T pi_[util::TensorVal<DESCRIPTOR >::n], T smagoConst_ ,T X_lang_n_);
76
77private:
79 T tau_eff;
81 T turbulenceInt;
84 T smagoConst;
85 T preFactor;
86
87 T dx;
88 T dt;
89
90 T omega; // the shear viscosity relaxatin time
91 T lambda;// the bulk viscosity relaxatin time
92
93 //T result;
94 T charU;
95 //T drift;
96 T X_lang_n;
97
98 // Relaxation Time Matrix for
99 T invM_S_SGS[DESCRIPTOR::q][DESCRIPTOR::q];
100
101};
102
103}
104
105#endif
Definition of a LB cell – header file.
Highest-level interface to Cell data.
Definition cell.h:148
Implementation of the MRT collision step with stochastic relaxation based on " A stochastic subgrid m...
virtual T getRandomWalk(Cell< T, DESCRIPTOR > &cell_, T drift_, T result_)
Get local Random number of BoxMüllertransform -> returns randBM.
virtual T getSmagorinskyOmega(Cell< T, DESCRIPTOR > &cell_, T X_lang_n_)
Get local smagorinsky relaxation parameter of the dynamics.
virtual CellStatistic< T > collide(Cell< T, DESCRIPTOR > &cell, LatticeStatistics< T > &statistics_)
virtual void setOmega(T omega_)
Set local relaxation parameter of the dynamics.
virtual T getRandBMTrans(Cell< T, DESCRIPTOR > &cell_, T turbulenceInt_, T charU_)
Get local Random number of BoxMüllertransform -> returns randBM.
StochasticSGSdynamics(T omega_, T turbulenceInt_, T charU_, T smagoConst_, T dx_=1, T dt_=1)
Constructor.
This object is a MRT LB dynamics as described in D.Yu et al.
Top level namespace for all of OpenLB.
Return value of any collision.
Definition interface.h:43
Dynamics constructed as a tuple of momenta, equilibrium and collision.
Definition interface.h:182
Compute number of elements of a symmetric d-dimensional tensor.
Definition util.h:210