$treeview $search $mathjax
|
Palabos
Version 1.1
$projectbrief
|
$projectbrief
|
$searchbox |
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 /* Main author: Orestis Malaspinas 00026 */ 00027 00034 #ifndef ADVECTION_DIFFUSION_MOMENTS_TEMPLATES_3D_H 00035 #define ADVECTION_DIFFUSION_MOMENTS_TEMPLATES_3D_H 00036 00037 namespace plb { 00038 00039 // This structure forwards the calls to the appropriate helper class 00040 template<typename T> 00041 struct advectionDiffusionMomentTemplatesImpl<T,descriptors::D3Q7DescriptorBase<T> > 00042 { 00043 00044 typedef descriptors::D3Q7DescriptorBase<T> Descriptor; 00045 00046 static void get_rhoBar_jEq(Array<T,Descriptor::q> const& f, T& rhoBar, 00047 Array<T,Descriptor::d>& jEq, const T u[Descriptor::d] ) 00048 { 00049 rhoBar = momentTemplatesImpl<T,Descriptor>::get_rhoBar(f); 00050 T rho = Descriptor::fullRho(rhoBar); 00051 jEq[0] = rho * u[0]; 00052 jEq[1] = rho * u[1]; 00053 jEq[2] = rho * u[2]; 00054 } 00055 00056 static void get_jEq(const T& rhoBar, Array<T,Descriptor::d>& jEq, const T *u) 00057 { 00058 T rho = Descriptor::fullRho(rhoBar); 00059 jEq[0] = rho * u[0]; 00060 jEq[1] = rho * u[1]; 00061 jEq[2] = rho * u[2]; 00062 } 00063 00064 static void get_rhoBar_jEq_jNeq(Array<T,Descriptor::q> const& f, T& rhoBar, 00065 Array<T,Descriptor::d>& jEq, Array<T,Descriptor::d>& jNeq, 00066 const T *u) 00067 { 00068 rhoBar = momentTemplatesImpl<T,Descriptor>::get_rhoBar(f); 00069 T rho = Descriptor::fullRho(rhoBar); 00070 jEq[0] = rho * u[0]; 00071 jEq[1] = rho * u[1]; 00072 jEq[2] = rho * u[2]; 00073 00074 jNeq[0] = - f[1] + f[4] - jEq[0]; 00075 jNeq[1] = - f[2] + f[5] - jEq[1]; 00076 jNeq[2] = - f[3] + f[6] - jEq[2]; 00077 } 00078 00079 }; // struct advectionDiffusionMomentTemplatesImpl 00080 00081 } // namespace plb 00082 00083 #endif
1.6.3
1.6.3