OpenLB 1.7
Loading...
Searching...
No Matches
rtlbmDynamics.h
Go to the documentation of this file.
1/* This file is part of the OpenLB library
2 *
3 * Copyright (C) 2017 Albert Mink, Christopher McHardy
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
28#ifndef RTLBM_DYNAMICS_H
29#define RTLBM_DYNAMICS_H
30
31#include "dynamics/dynamics.h"
32
33namespace olb {
34
35
36
45template<typename T, typename DESCRIPTOR, typename MOMENTA=momenta::BulkTuple>
46class RTLBMdynamicsMcHardy : public legacy::BasicDynamics<T,DESCRIPTOR,MOMENTA> {
47public:
48 template<typename M>
50
51
53 RTLBMdynamicsMcHardy( T latticeAbsorption, T latticeScattering, std::array<std::array<T,DESCRIPTOR::q>, DESCRIPTOR::q>& anisoMatrix );
55 T computeEquilibrium( int iPop, T rho, const T u[DESCRIPTOR::d], T uSqr ) const override;
59 T getOmega() const;
61 void setOmega( T omega );
62 T getSink() const;
63
64protected:
67 std::array<std::array<T,DESCRIPTOR::q>, DESCRIPTOR::q>& _anisoMatrix;
68};
69
70template<typename T, typename DESCRIPTOR, typename MOMENTA=momenta::BulkTuple>
71class RTLBMdynamicsMcHardyRK : public legacy::BasicDynamics<T,DESCRIPTOR,MOMENTA> {
72public:
73 static_assert(DESCRIPTOR::template provides<descriptors::tag::RTLBM>(), "Must be RTLBM");
74
75 template<typename M>
77
79 RTLBMdynamicsMcHardyRK( T latticeAbsorption, T latticeScattering, std::array<std::array<T,DESCRIPTOR::q>, DESCRIPTOR::q>& anisoMatrix );
81 T computeEquilibrium( int iPop, T rho, const T u[DESCRIPTOR::d], T uSqr ) const override;
85 T getOmega() const;
87 void setOmega( T omega );
88private:
89 void computeEquilibriumAniso( Cell<T,DESCRIPTOR>& cell, std::array<T,DESCRIPTOR::q>& feq );
90 std::array<T,DESCRIPTOR::q> doCollision( Cell<T,DESCRIPTOR>& cell, std::array<T,DESCRIPTOR::q>& feq );
91 T _absorption;
92 T _scattering;
93 std::array<std::array<T,DESCRIPTOR::q>, DESCRIPTOR::q>& _anisoMatrix;
94};
95
96
97} // namespace olb
98
99#endif
Highest-level interface to Cell data.
Definition cell.h:148
CellStatistic< T > collide(Cell< T, DESCRIPTOR > &cell, LatticeStatistics< T > &statistics) override
Collision step.
T computeEquilibrium(int iPop, T rho, const T u[DESCRIPTOR::d], T uSqr) const override
Compute equilibrium distribution function.
void setOmega(T omega)
Set local relaxation parameter of the dynamics.
RTLBMdynamicsMcHardyRK(T latticeAbsorption, T latticeScattering, std::array< std::array< T, DESCRIPTOR::q >, DESCRIPTOR::q > &anisoMatrix)
Constructor.
T getOmega() const
Get local relaxation parameter of the dynamics.
Solves RTE according Christopher McHardy et al 2016.
RTLBMdynamicsMcHardy(T latticeAbsorption, T latticeScattering, std::array< std::array< T, DESCRIPTOR::q >, DESCRIPTOR::q > &anisoMatrix)
Constructor.
CellStatistic< T > collide(Cell< T, DESCRIPTOR > &cell, LatticeStatistics< T > &statistics) override
Collision step.
T getOmega() const
Get local relaxation parameter of the dynamics.
std::array< std::array< T, DESCRIPTOR::q >, DESCRIPTOR::q > & _anisoMatrix
T computeEquilibrium(int iPop, T rho, const T u[DESCRIPTOR::d], T uSqr) const override
Compute equilibrium distribution function.
void setOmega(T omega)
Set local relaxation parameter of the dynamics.
Top level namespace for all of OpenLB.
Return value of any collision.
Definition interface.h:43