$treeview $search $mathjax
Palabos  Version 1.1
$projectbrief
$projectbrief
$searchbox

mrtLattices.h

Go to the documentation of this file.
00001 /* This file is part of the Palabos library.
00002  *
00003  * Copyright (C) 2011 FlowKit Sarl
00004  * Avenue de Chailly 23
00005  * 1012 Lausanne, Switzerland
00006  * E-mail contact: contact@flowkit.com
00007  *
00008  * The most recent release of Palabos can be downloaded at 
00009  * <http://www.palabos.org/>
00010  *
00011  * The library Palabos is free software: you can redistribute it and/or
00012  * modify it under the terms of the GNU Affero General Public License as
00013  * published by the Free Software Foundation, either version 3 of the
00014  * License, or (at your option) any later version.
00015  *
00016  * The library is distributed in the hope that it will be useful,
00017  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00018  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00019  * GNU Affero General Public License for more details.
00020  *
00021  * You should have received a copy of the GNU Affero General Public License
00022  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
00023 */
00024 
00025 /* Orestis Malaspinas contributed this code.
00026  */
00027 
00034 #ifndef MRT_LATTICES_H
00035 #define MRT_LATTICES_H
00036 
00037 #include "core/globalDefs.h"
00038 #include "latticeBoltzmann/nearestNeighborLattices2D.h"
00039 #include "latticeBoltzmann/nearestNeighborLattices3D.h"
00040 #include "latticeBoltzmann/externalFields.h"
00041 #include <vector>
00042 
00043 namespace plb {
00044 
00046 
00057 namespace descriptors {
00058 
00062     template <typename T>
00063     struct MRTD2Q9DescriptorBase : public D2Q9DescriptorBase<T>
00064     {
00065         typedef D2Q9DescriptorBase<T> BaseDescriptor;
00066         typedef MRTD2Q9DescriptorBase<T> SecondBaseDescriptor;
00067         enum { numPop=BaseDescriptor::q };
00068         
00069         static const T M[BaseDescriptor::q][BaseDescriptor::q];    // Matrix of base change between f and moments : moments=M.f
00070         static const T invM[BaseDescriptor::q][BaseDescriptor::q]; // inverse of base change matrix : f=invM.moments
00071         static const T S[BaseDescriptor::q];       // relaxation times
00072         enum {jIndexes = 2};
00073         static const int momentumIndexes[jIndexes]; // relevant indexes of r. t. for shear viscosity
00074         enum {shearIndexes = 2};
00075         static const int shearViscIndexes[shearIndexes]; // relevant indexes of r. t. for shear viscosity
00076         enum {qIndexes = 2};
00077         static const int qViscIndexes[qIndexes]; // relevant indexes of r. t. for q
00078         static const int bulkViscIndex  = 1; // relevant index of r. t. for bulk viscosity
00079         static const int epsilonIndex   = 2; // relevant index of r. t. for epsilon 
00080     };
00081     
00086     template <typename T>
00087     struct MRTD3Q19DescriptorBase : public D3Q19DescriptorBase<T>
00088     {
00089         typedef D3Q19DescriptorBase<T> BaseDescriptor;
00090         typedef MRTD3Q19DescriptorBase<T> SecondBaseDescriptor;
00091         enum { numPop=BaseDescriptor::q };
00092         
00093         static const T M[BaseDescriptor::q][BaseDescriptor::q];    // Matrix of base change between f and moments : moments=M.f
00094         static const T invM[BaseDescriptor::q][BaseDescriptor::q]; // inverse of base change matrix : f=invM.moments
00095         static const T S[BaseDescriptor::q];       // relaxation times
00096         enum {jIndexes = 3};
00097         static const int momentumIndexes[jIndexes]; // relevant indexes of r. t. for shear viscosity
00098         enum {shearIndexes = 5};
00099         static const int shearViscIndexes[shearIndexes]; // relevant indexes of r. t. for shear viscosity
00100         static const int bulkViscIndex  = 1; // relevant index of r. t. for bulk viscosity
00101         enum {qIndexes = 3};
00102         static const int qViscIndexes[qIndexes]; // relevant indexes of r. t. for q indices (s4,s6,s8 of the paper)
00103         static const int epsilonIndex   = 2; // relevant index of r. t. for epsilon (s2 in the original paper)
00104     };
00105 
00106     template <typename T>
00107     struct MRTD2Q9Descriptor
00108         : public MRTD2Q9DescriptorBase<T>, public NoExternalFieldBase
00109     {
00110         static const char name[];
00111     };
00112     
00113     template <typename T>
00114     struct ForcedMRTD2Q9Descriptor
00115         : public MRTD2Q9DescriptorBase<T>, public Force2dDescriptorBase
00116     {
00117         static const char name[];
00118     };
00119     
00120     template <typename T>
00121     struct ExternalVelocityMRTD2Q9Descriptor
00122         : public MRTD2Q9DescriptorBase<T>, public Velocity2dDescriptorBase
00123     {
00124         static const char name[];
00125     };
00126 
00127     template <typename T>
00128     struct MRTD3Q19Descriptor
00129         : public MRTD3Q19DescriptorBase<T>, public NoExternalFieldBase
00130     {
00131         static const char name[];
00132     };
00133     
00134     template <typename T>
00135     struct ForcedMRTD3Q19Descriptor
00136     : public MRTD3Q19DescriptorBase<T>, public Force3dDescriptorBase
00137     {
00138         static const char name[];
00139     };
00140     
00141     template <typename T>
00142     struct ExternalVelocityMRTD3Q19Descriptor
00143         : public MRTD3Q19DescriptorBase<T>, public Velocity3dBase
00144     {
00145         static const char name[];
00146     };
00147 
00148 
00149 }  // namespace descriptors
00150 
00151 }  // namespace plb
00152 
00153 #endif