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>
30#include "acl/aclMath/aclVectorOfElementsDef.h"
31#include "acl/aclMath/aclMatrixOfElements.h"
32
33namespace asl
34{
35 class Block;
36 class VectorTemplate;
37 template <typename V> class DataWithGhostNodes;
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:
87 Data f;
88 DataD v;
89 DataD rho;
90
91 std::shared_ptr<AVec<int>> fShifts;
92 std::shared_ptr<AVec<int>> fShiftsIncrement;
93
94 std::vector<acl::SPKernel> copyKernels;
95
100
102 bool flagComputeRho;
103 bool flagCompressible;
104
108 virtual void preProcessing();
109 virtual void init0();
110
111 public:
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();
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
137 class LBGKUtilities
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);
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
178 inline LBGK::Data LBGK::getF()
179 {
180 return f;
181 }
182
184 {
185 return rho;
186 }
187
189 {
190 return v;
191 }
192
193 inline const VectorTemplate* LBGK::getVectorTemplate() const
194 {
195 return vectorTemplate;
196 }
197
198 inline void LBGK::setCompressible(bool flag)
199 {
201 }
202
203 inline const bool & LBGK::getCompressible() const
204 {
205 return flagCompressible;
206 }
207
208} // asl
209#endif // ASLLBGK_H
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
DataD getVelocity()
Definition aslLBGK.h:188
void setViscosity(Param nu)
const VectorTemplate * getVectorTemplate() const
Data getF()
Param omega
Definition aslLBGK.h:99
DataD getVelocity()
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
const VectorTemplate * vectorTemplate
Definition aslLBGK.h:84
bool flagCompressible
Definition aslLBGK.h:103
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)
std::vector< acl::SPKernel > copyKernels
Definition aslLBGK.h:94
std::shared_ptr< AVec< int > > fShifts
Definition aslLBGK.h:91
Param deltat
Definition aslLBGK.h:97
void setVectorTemplate(const VectorTemplate *vT)
DataD getRho()
Definition aslLBGK.h:183
DataD getRho()
std::shared_ptr< AVec< int > > fShiftsIncrement
Definition aslLBGK.h:92
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
Data f
Definition aslLBGK.h:87
void setCompressible(bool flag=true)
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.
SPDataWrapperACLData generateDataContainerACL_SP(const Block &b, unsigned int n=1)
generates pointer to ACL Data field with n components
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
acl::MatrixOfElements generateLBGKMatrix(acl::VectorOfElements nu)
std::shared_ptr< AbstractDataWithGhostNodes > SPAbstractDataWithGhostNodes
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
DataWithGhostNodes< acl::VectorOfElements > DataWithGhostNodesACL
std::shared_ptr< DataWithGhostNodesACL > SPDataWithGhostNodesACL
std::shared_ptr< DataWithGhostNodesACLData > SPDataWithGhostNodesACLData
acl::MatrixOfElements generateMRTMatrix(acl::VectorOfElements nu)
std::shared_ptr< LBGK > SPLBGK
Definition aslLBGK.h:133
std::shared_ptr< LBGKTurbulence > SPLBGKTurbulence
Definition aslLBGK.h:173
std::shared_ptr< LBGKUtilities > SPLBGKUtilities
Definition aslLBGK.h:161