OpenLB 1.7
Loading...
Searching...
No Matches
entropicDynamics.h
Go to the documentation of this file.
1/* This file is part of the OpenLB library
2 *
3 * Copyright (C) 2006, 2007, 2017 Orestis Malaspinas, Jonas Latt, Mathias J. Krause
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
35#ifndef ENTROPIC_LB_DYNAMICS_H
36#define ENTROPIC_LB_DYNAMICS_H
37
38#include "dynamics/dynamics.h"
39
40namespace olb {
41
42
44template<typename T, typename DESCRIPTOR, typename MOMENTA=momenta::BulkTuple>
45class EntropicEqDynamics : public legacy::BasicDynamics<T,DESCRIPTOR,MOMENTA> {
46public:
47 template<typename M>
49
51 EntropicEqDynamics(T omega_);
53 T computeEquilibrium(int iPop, T rho, const T u[DESCRIPTOR::d], T uSqr) const override;
57 T getOmega() const;
59 void setOmega(T omega_);
60private:
61 T omega;
62};
63
65template<typename T, typename DESCRIPTOR, typename MOMENTA=momenta::BulkTuple>
66class ForcedEntropicEqDynamics : public legacy::BasicDynamics<T,DESCRIPTOR,MOMENTA> {
67public:
68 template<typename M>
70
74 virtual T computeEquilibrium(int iPop, T rho, const T u[DESCRIPTOR::d], T uSqr) const;
78 virtual T getOmega() const;
80 virtual void setOmega(T omega_);
81private:
82 T omega;
83};
84
86
87template<typename T, typename DESCRIPTOR, typename MOMENTA=momenta::BulkTuple>
88class EntropicDynamics : public legacy::BasicDynamics<T,DESCRIPTOR,MOMENTA> {
89public:
90 template<typename M>
92
94 EntropicDynamics(T omega_);
96 T computeEquilibrium(int iPop, T rho, const T u[DESCRIPTOR::d], T uSqr) const override;
100 T getOmega() const;
102 void setOmega(T omega_);
103private:
105 T computeEntropy(const T f[]);
107 T computeEntropyGrowth(const T f[], const T fNeq[], const T &alpha);
110 T computeEntropyGrowthDerivative(const T f[], const T fNeq[], const T &alpha);
112 bool getAlpha(T &alpha, const T f[], const T fNeq[]);
113
114 T omega;
115};
116
118template<typename T, typename DESCRIPTOR, typename MOMENTA=momenta::BulkTuple>
119class ForcedEntropicDynamics : public legacy::BasicDynamics<T,DESCRIPTOR,MOMENTA> {
120public:
121 template<typename M>
123
125 ForcedEntropicDynamics(T omega_);
127 virtual T computeEquilibrium(int iPop, T rho, const T u[DESCRIPTOR::d], T uSqr) const;
131 virtual T getOmega() const;
133 virtual void setOmega(T omega_);
134private:
136 T computeEntropy(const T f[]);
138 T computeEntropyGrowth(const T f[], const T fNeq[], const T &alpha);
141 T computeEntropyGrowthDerivative(const T f[], const T fNeq[], const T &alpha);
143 bool getAlpha(T &alpha, const T f[], const T fNeq[]);
144
145 T omega;
146};
147}
148
149#endif
Highest-level interface to Cell data.
Definition cell.h:148
Implementation of the entropic collision step.
T computeEquilibrium(int iPop, T rho, const T u[DESCRIPTOR::d], T uSqr) const override
Compute equilibrium distribution function.
CellStatistic< T > collide(Cell< T, DESCRIPTOR > &cell) override
Collision step.
void setOmega(T omega_)
Set local relaxation parameter of the dynamics.
T getOmega() const
Get local relaxation parameter of the dynamics.
EntropicDynamics(T omega_)
Constructor.
Implementation of the entropic collision step.
EntropicEqDynamics(T omega_)
Constructor.
T computeEquilibrium(int iPop, T rho, const T u[DESCRIPTOR::d], T uSqr) const override
Compute equilibrium distribution function.
CellStatistic< T > collide(Cell< T, DESCRIPTOR > &cell) override
Collision step.
void setOmega(T omega_)
Set local relaxation parameter of the dynamics.
T getOmega() const
Get local relaxation parameter of the dynamics.
Implementation of the forced entropic collision step.
virtual void setOmega(T omega_)
Set local relaxation parameter of the dynamics.
ForcedEntropicDynamics(T omega_)
Constructor.
virtual T getOmega() const
Get local relaxation parameter of the dynamics.
virtual CellStatistic< T > collide(Cell< T, DESCRIPTOR > &cell)
Collision step.
virtual T computeEquilibrium(int iPop, T rho, const T u[DESCRIPTOR::d], T uSqr) const
Compute equilibrium distribution function.
Implementation of the forced entropic collision step.
virtual T computeEquilibrium(int iPop, T rho, const T u[DESCRIPTOR::d], T uSqr) const
Compute equilibrium distribution function.
virtual void setOmega(T omega_)
Set local relaxation parameter of the dynamics.
virtual CellStatistic< T > collide(Cell< T, DESCRIPTOR > &cell)
Collision step.
virtual T getOmega() const
Get local relaxation parameter of the dynamics.
ForcedEntropicEqDynamics(T omega_)
Constructor.
Top level namespace for all of OpenLB.
Return value of any collision.
Definition interface.h:43