ASL 0.1.7
Advanced Simulation Library
Loading...
Searching...
No Matches
aslLBGK.h
Go to the documentation of this file.
1/*
2 * Advanced Simulation Library <http://asl.org.il>
3 *
4 * Copyright 2015 Avtech Scientific <http://avtechscientific.com>
5 *
6 *
7 * This file is part of Advanced Simulation Library (ASL).
8 *
9 * ASL is free software: you can redistribute it and/or modify it
10 * under the terms of the GNU Affero General Public License as
11 * published by the Free Software Foundation, version 3 of the License.
12 *
13 * ASL 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 Affero General Public License for more details.
17 *
18 * You should have received a copy of the GNU Affero General Public License
19 * along with ASL. If not, see <http://www.gnu.org/licenses/>.
20 *
21 */
22
23
24#ifndef ASLLBGK_H
25#define ASLLBGK_H
26
27#include "aslSingleKernelNM.h"
28#include <acl/aclHardware.h>
29#include <math/aslVectors.h>
32
33namespace asl
34{
35 class Block;
36 class VectorTemplate;
37 template <typename V> class DataWithGhostNodes;
38 typedef DataWithGhostNodes<acl::VectorOfElements> DataWithGhostNodesACL;
39 typedef DataWithGhostNodes<acl::VectorOfElementsData> DataWithGhostNodesACLData;
40 typedef std::shared_ptr<DataWithGhostNodesACL> SPDataWithGhostNodesACL;
41 typedef std::shared_ptr<DataWithGhostNodesACLData> SPDataWithGhostNodesACLData;
42 class AbstractDataWithGhostNodes;
43 typedef std::shared_ptr<AbstractDataWithGhostNodes> SPAbstractDataWithGhostNodes;
44
45
47
54
56
63
66
69
71
73
77 class LBGK: public SingleKernelNM
78 {
79 public:
83
85 protected:
90
91 std::shared_ptr<AVec<int>> fShifts;
92 std::shared_ptr<AVec<int>> fShiftsIncrement;
93
94 std::vector<acl::SPKernel> copyKernels;
95
100
104
108 virtual void preProcessing();
109 virtual void init0();
110
111 public:
113 LBGK(DataD v, Param nu, const VectorTemplate* vT);
114 LBGK(Block b, Param nu, const VectorTemplate* vT,
115 bool compVel=true, bool compRho=true,
116 acl::CommandQueue queue = acl::hardware.defaultQueue);
118 double getViscosity(unsigned int i = 0);
122 inline const VectorTemplate* getVectorTemplate() const;
123
124
125 inline Data getF();
126 inline DataD getRho();
127 inline DataD getVelocity();
128
129 inline void setCompressible(bool flag = true);
130 inline const bool & getCompressible() const;
131 };
132
133 typedef std::shared_ptr<LBGK> SPLBGK;
134
135
138 {
139 private:
141
142 SPLBGK num;
143 acl::SPKernel kernelComputeV;
144 acl::SPKernel kernelComputeRho;
145 acl::SPKernel kernelComputeRhoV;
146 acl::SPKernel kernelInitF;
147
148 Param velocity;
149 Param rho;
150
151 public:
156 void initF(Param rho, Param vel);
158 void initF(Param vel);
159 };
160
161 typedef std::shared_ptr<LBGKUtilities> SPLBGKUtilities;
162
163 class LBGKTurbulence: public LBGK
164 {
165 public:
168 bool compVel=true, bool compRho=true,
169 acl::CommandQueue queue = acl::hardware.defaultQueue);
170 virtual void init0();
171 };
172
173 typedef std::shared_ptr<LBGKTurbulence> SPLBGKTurbulence;
174
175// ------------------------- Implementation ------------------------
176
177
179 {
180 return f;
181 }
182
184 {
185 return rho;
186 }
187
189 {
190 return v;
191 }
192
194 {
195 return vectorTemplate;
196 }
197
198 inline void LBGK::setCompressible(bool flag)
199 {
200 flagCompressible=flag;
201 }
202
203 inline const bool & LBGK::getCompressible() const
204 {
205 return flagCompressible;
206 }
207
208} // asl
209#endif // ASLLBGK_H
definition of class АVec<T>
The class represents a matrix elements of Element.
The class represents several ElementData.
The class represents several Element.
Numerical method for fluid flow.
Definition: aslLBGK.h:78
std::shared_ptr< AVec< int > > fShiftsIncrement
Definition: aslLBGK.h:92
DataD getVelocity()
Definition: aslLBGK.h:188
void setViscosity(Param nu)
const VectorTemplate * getVectorTemplate() const
Definition: aslLBGK.h:193
Param omega
Definition: aslLBGK.h:99
LBGK(DataD v, Param nu, const VectorTemplate *vT)
virtual void init0()
full initialisation but without kernel->setup()
bool flagComputeRho
Definition: aslLBGK.h:102
DataD v
Definition: aslLBGK.h:88
bool flagCompressible
Definition: aslLBGK.h:103
std::vector< acl::SPKernel > copyKernels
Definition: aslLBGK.h:94
virtual void preProcessing()
contains classical moving procedure
Param force
Definition: aslLBGK.h:98
void createCopyKernels()
acl::VectorOfElements computeRho(acl::VectorOfElements f, const VectorTemplate *vt)
returns VectorOfElements with values of rho
LBGK(Block b, Param nu, const VectorTemplate *vT, bool compVel=true, bool compRho=true, acl::CommandQueue queue=acl::hardware.defaultQueue)
acl::VectorOfElementsData fPool
Definition: aslLBGK.h:86
bool flagComputeVelocity
Definition: aslLBGK.h:101
acl::VectorOfElements computeMomentum(acl::VectorOfElements f, const VectorTemplate *vt)
returns VectorOfElements with values of velocity
acl::VectorOfElements Param
Definition: aslLBGK.h:82
Param viscosity
Definition: aslLBGK.h:96
double getViscosity(unsigned int i=0)
const VectorTemplate * vectorTemplate
Definition: aslLBGK.h:84
Param deltat
Definition: aslLBGK.h:97
void setVectorTemplate(const VectorTemplate *vT)
DataD getRho()
Definition: aslLBGK.h:183
Data getF()
Definition: aslLBGK.h:178
SPDataWithGhostNodesACLData DataD
Definition: aslLBGK.h:81
void createData(Block b, acl::CommandQueue queue, acl::TypeID type)
DataD rho
Definition: aslLBGK.h:89
const bool & getCompressible() const
Definition: aslLBGK.h:203
Data f
Definition: aslLBGK.h:87
void setCompressible(bool flag=true)
Definition: aslLBGK.h:198
std::shared_ptr< AVec< int > > fShifts
Definition: aslLBGK.h:91
void setOmega(Param w)
sets angular velocity for Coriolis term in noninertial reference frame
SPDataWithGhostNodesACL Data
Definition: aslLBGK.h:80
virtual void init0()
full initialisation but without kernel->setup()
LBGKTurbulence(Block b, Param nu, const VectorTemplate *vT, bool compVel=true, bool compRho=true, acl::CommandQueue queue=acl::hardware.defaultQueue)
LBGKTurbulence(DataD v, Param nu, const VectorTemplate *vT)
contains different kernels for preprocessing and posprocessing of data used by LBGK
Definition: aslLBGK.h:138
void initF(Param rho, Param vel)
LBGKUtilities(SPLBGK lbgk)
void initF(Param vel)
dencity is suposed to be 1
Defines set of vectros with several properties.
Definition: aslTemplates.h:88
acl::TypeID type(acl::typeToTypeID< FlT >())
std::shared_ptr< cl::CommandQueue > CommandQueue
Definition: acl.h:51
Hardware hardware
TypeID
Definition: aclTypes.h:39
std::shared_ptr< Kernel > SPKernel
Advanced Simulation Library.
Definition: aslDataInc.h:31
DataWithGhostNodes< acl::VectorOfElementsData > DataWithGhostNodesACLData
Definition: aslGenerators.h:46
std::shared_ptr< LBGKUtilities > SPLBGKUtilities
Definition: aslLBGK.h:161
acl::MatrixOfElements generateLBGKMatrix(acl::VectorOfElements nu)
std::shared_ptr< AbstractDataWithGhostNodes > SPAbstractDataWithGhostNodes
Definition: aslGenerators.h:51
acl::MatrixOfElements generateDifKinMatrix(acl::VectorOfElements nu)
acl::VectorOfElements generateInverceVector(acl::VectorOfElements f, const VectorTemplate *vt)
generates Vector Of Elements with inverce components according to vt
std::shared_ptr< LBGKTurbulence > SPLBGKTurbulence
Definition: aslLBGK.h:173
DataWithGhostNodes< acl::VectorOfElements > DataWithGhostNodesACL
Definition: aslGenerators.h:48
std::shared_ptr< DataWithGhostNodesACL > SPDataWithGhostNodesACL
Definition: aslGenerators.h:49
std::shared_ptr< DataWithGhostNodesACLData > SPDataWithGhostNodesACLData
Definition: aslGenerators.h:47
acl::MatrixOfElements generateMRTMatrix(acl::VectorOfElements nu)
std::shared_ptr< LBGK > SPLBGK
Definition: aslLBGK.h:133