$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 #ifndef OFF_LATTICE_BOUNDARY_PROFILES_3D_H 00026 #define OFF_LATTICE_BOUNDARY_PROFILES_3D_H 00027 00028 #include "core/globalDefs.h" 00029 #include "offLattice/triangularSurfaceMesh.h" 00030 00031 namespace plb { 00032 00033 00034 template<typename T, class SurfaceData> 00035 class BoundaryProfile3D { 00036 public: 00037 virtual ~BoundaryProfile3D() { } 00038 virtual void setNormal(Array<T,3> const& normal_) =0; 00039 virtual void defineCircularShape(Array<T,3> const& radius_, T center_) =0; 00040 virtual void getData( Array<T,3> const& pos, plint id, AtomicBlock3D const* argument, 00041 SurfaceData& data, OffBoundary::Type& bdType ) const =0; 00042 virtual BoundaryProfile3D<T,SurfaceData>* clone() const =0; 00043 }; 00044 00045 template<typename T, class SurfaceData> 00046 struct DefaultWallProfile3D { 00047 BoundaryProfile3D<T,SurfaceData>* generate() { 00048 // A default wall profile needs yet to be implemented for this case. 00049 PLB_ASSERT( false ); 00050 return 0; 00051 } 00052 }; 00053 00054 template<typename T, class SurfaceData> 00055 BoundaryProfile3D<T, SurfaceData>* generateDefaultWallProfile3D() { 00056 return DefaultWallProfile3D<T,SurfaceData>().generate(); 00057 } 00058 00059 template<typename T> 00060 class NoSlipProfile3D : public BoundaryProfile3D<T, Array<T,3> > 00061 { 00062 public: 00063 virtual void setNormal(Array<T,3> const& normal_); 00064 virtual void defineCircularShape(Array<T,3> const& center_, T radius_); 00065 virtual void getData( Array<T,3> const& pos, plint id, AtomicBlock3D const* argument, 00066 Array<T,3>& data, OffBoundary::Type& bdType ) const; 00067 virtual NoSlipProfile3D<T>* clone() const; 00068 }; 00069 00070 template<typename T> 00071 class FreeSlipProfile3D : public BoundaryProfile3D<T, Array<T,3> > 00072 { 00073 public: 00074 virtual void setNormal(Array<T,3> const& normal_); 00075 virtual void defineCircularShape(Array<T,3> const& center_, T radius_); 00076 virtual void getData( Array<T,3> const& pos, plint id, AtomicBlock3D const* argument, 00077 Array<T,3>& data, OffBoundary::Type& bdType ) const; 00078 virtual FreeSlipProfile3D<T>* clone() const; 00079 }; 00080 00081 template<typename T> 00082 class ConstantVelocityProfile3D : public BoundaryProfile3D<T, Array<T,3> > 00083 { 00084 public: 00085 ConstantVelocityProfile3D(Array<T,3> const& u_); 00086 virtual void setNormal(Array<T,3> const& normal_); 00087 virtual void defineCircularShape(Array<T,3> const& center_, T radius_); 00088 virtual void getData( Array<T,3> const& pos, plint id, AtomicBlock3D const* argument, 00089 Array<T,3>& data, OffBoundary::Type& bdType ) const; 00090 virtual ConstantVelocityProfile3D<T>* clone() const; 00091 private: 00092 Array<T,3> u; 00093 }; 00094 00095 template<typename T> 00096 class VelocityPlugProfile3D : public BoundaryProfile3D<T, Array<T,3> > 00097 { 00098 public: 00099 VelocityPlugProfile3D(T uMax_); 00100 virtual void setNormal(Array<T,3> const& normal_); 00101 virtual void defineCircularShape(Array<T,3> const& center_, T radius_); 00102 virtual void getData( Array<T,3> const& pos, plint id, AtomicBlock3D const* argument, 00103 Array<T,3>& data, OffBoundary::Type& bdType ) const; 00104 virtual VelocityPlugProfile3D<T>* clone() const; 00105 private: 00106 T uMax; 00107 Array<T,3> normal; 00108 }; 00109 00110 template< typename T, template<typename U> class Descriptor> 00111 class OscillatingPoiseuilleProfile3D : public BoundaryProfile3D<T, Array<T,3> > 00112 { 00113 public: 00114 OscillatingPoiseuilleProfile3D(T minUave_, T maxUave_, T period_); 00115 virtual void setNormal(Array<T,3> const& normal_); 00116 virtual void defineCircularShape(Array<T,3> const& center_, T radius_); 00117 virtual void getData( Array<T,3> const& pos, plint id, AtomicBlock3D const* argument, 00118 Array<T,3>& data, OffBoundary::Type& bdType ) const; 00119 virtual OscillatingPoiseuilleProfile3D<T,Descriptor>* clone() const; 00120 private: 00121 T minUave, maxUave, period; 00122 Array<T,3> normal; 00123 Array<T,3> center; 00124 T radius; 00125 }; 00126 00127 template< typename T, template<typename U> class Descriptor> 00128 class IncreasingPoiseuilleProfile3D : public BoundaryProfile3D<T, Array<T,3> > 00129 { 00130 public: 00131 IncreasingPoiseuilleProfile3D(T uAverage_, plint maxT_); 00132 virtual void setNormal(Array<T,3> const& normal_); 00133 virtual void defineCircularShape(Array<T,3> const& center_, T radius_); 00134 virtual void getData( Array<T,3> const& pos, plint id, AtomicBlock3D const* argument, 00135 Array<T,3>& data, OffBoundary::Type& bdType ) const; 00136 virtual IncreasingPoiseuilleProfile3D<T,Descriptor>* clone() const; 00137 private: 00138 T uAverage; 00139 plint maxT; 00140 Array<T,3> normal; 00141 Array<T,3> center; 00142 T radius; 00143 }; 00144 00145 template<typename T> 00146 class PoiseuilleProfile3D : public BoundaryProfile3D<T, Array<T,3> > 00147 { 00148 public: 00149 PoiseuilleProfile3D(T uAverage_); 00150 virtual void setNormal(Array<T,3> const& normal_); 00151 virtual void defineCircularShape(Array<T,3> const& center_, T radius_); 00152 virtual void getData( Array<T,3> const& pos, plint id, AtomicBlock3D const* argument, 00153 Array<T,3>& data, OffBoundary::Type& bdType ) const; 00154 virtual PoiseuilleProfile3D<T>* clone() const; 00155 private: 00156 T uAverage; 00157 Array<T,3> normal; 00158 Array<T,3> center; 00159 T radius; 00160 }; 00161 00162 template<typename T> 00163 class NeumannBoundaryProfile3D : public BoundaryProfile3D<T, Array<T,3> > 00164 { 00165 public: 00166 virtual void setNormal(Array<T,3> const& normal_); 00167 virtual void defineCircularShape(Array<T,3> const& center_, T radius_); 00168 virtual void getData( Array<T,3> const& pos, plint id, AtomicBlock3D const* argument, 00169 Array<T,3>& data, OffBoundary::Type& bdType ) const; 00170 virtual NeumannBoundaryProfile3D<T>* clone() const; 00171 private: 00172 Array<T,3> normal; 00173 }; 00174 00175 template<typename T> 00176 class DensityNeumannBoundaryProfile3D : public BoundaryProfile3D<T, Array<T,3> > 00177 { 00178 public: 00179 DensityNeumannBoundaryProfile3D(T rho_ = (T)1); 00180 virtual void setNormal(Array<T,3> const& normal_); 00181 virtual void defineCircularShape(Array<T,3> const& center_, T radius_); 00182 virtual void getData( Array<T,3> const& pos, plint id, AtomicBlock3D const* argument, 00183 Array<T,3>& data, OffBoundary::Type& bdType ) const; 00184 virtual DensityNeumannBoundaryProfile3D<T>* clone() const; 00185 private: 00186 Array<T,3> normal; 00187 T rho; 00188 }; 00189 00190 template<typename T> 00191 class ScalarNeumannProfile3D : public BoundaryProfile3D<T,Array<T,2> > 00192 { 00193 public: 00194 virtual void setNormal(Array<T,3> const& normal_); 00195 virtual void defineCircularShape(Array<T,3> const& center_, T radius_); 00196 virtual void getData( Array<T,3> const& pos, plint id, AtomicBlock3D const* argument, 00197 Array<T,2>& data, OffBoundary::Type& bdType ) const; 00198 virtual ScalarNeumannProfile3D<T>* clone() const; 00199 private: 00200 Array<T,3> normal; 00201 }; 00202 00203 template<typename T> 00204 class ScalarDirichletProfile3D : public BoundaryProfile3D<T,Array<T,2> > 00205 { 00206 public: 00207 ScalarDirichletProfile3D(T value_); 00208 virtual void setNormal(Array<T,3> const& normal_); 00209 virtual void defineCircularShape(Array<T,3> const& center_, T radius_); 00210 virtual void getData( Array<T,3> const& pos, plint id, AtomicBlock3D const* argument, 00211 Array<T,2>& data, OffBoundary::Type& bdType ) const; 00212 virtual ScalarDirichletProfile3D<T>* clone() const; 00213 private: 00214 T value; 00215 }; 00216 00217 template<typename T> 00218 class ScalarFluxProfile3D : public BoundaryProfile3D<T,Array<T,2> > 00219 { 00220 public: 00221 ScalarFluxProfile3D(T gradVal_); 00222 virtual void setNormal(Array<T,3> const& normal_); 00223 virtual void defineCircularShape(Array<T,3> const& center_, T radius_); 00224 virtual void getData( Array<T,3> const& pos, plint id, AtomicBlock3D const* argument, 00225 Array<T,2>& data, OffBoundary::Type& bdType ) const; 00226 virtual ScalarFluxProfile3D<T>* clone() const; 00227 private: 00228 Array<T,3> normal; 00229 T gradVal; 00230 }; 00231 00233 template<typename T> 00234 class ScalarIsolationProfile3D : public BoundaryProfile3D<T,Array<T,2> > 00235 { 00236 public: 00237 ScalarIsolationProfile3D(T asymptoticRho_, T kappa_); 00238 virtual void setNormal(Array<T,3> const& normal_); 00239 virtual void defineCircularShape(Array<T,3> const& center_, T radius_); 00240 virtual void getData( Array<T,3> const& pos, plint id, AtomicBlock3D const* argument, 00241 Array<T,2>& data, OffBoundary::Type& bdType ) const; 00242 virtual ScalarIsolationProfile3D<T>* clone() const; 00243 private: 00244 Array<T,3> normal; 00245 T asymptoticRho, kappa; 00246 }; 00247 00248 } // namespace plb 00249 00250 #endif // OFF_LATTICE_BOUNDARY_PROFILES_3D_H 00251
1.6.3
1.6.3