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

generalizedBoundaryDynamics.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 
00029 #ifndef GENERALIZED_BOUNDARY_DYNAMICS_H
00030 #define GENERALIZED_BOUNDARY_DYNAMICS_H
00031 
00032 #include "core/globalDefs.h"
00033 #include "boundaryCondition/boundaryDynamics.h"
00034 
00035 namespace plb {
00036 
00038 template<typename T, template<typename U> class Descriptor>
00039 class GeneralizedVelocityBoundaryDynamics :
00040     public StoreVelocityDynamics<T,Descriptor>
00041 {
00042 public:
00043     GeneralizedVelocityBoundaryDynamics(Dynamics<T,Descriptor>* baseDynamics_,
00044                                         std::vector<plint> missingIndices_,
00045                                         bool automaticPrepareCollision = true);
00046     GeneralizedVelocityBoundaryDynamics(HierarchicUnserializer& unserializer);
00047 
00049     virtual GeneralizedVelocityBoundaryDynamics<T,Descriptor>* clone() const;
00050 
00052     virtual int getId() const;
00053 
00054     virtual void serialize(HierarchicSerializer& serializer) const;
00055     virtual void unserialize(HierarchicUnserializer& unserializer);
00056     
00057     void computeUlb(Cell<T,Descriptor> const& cell, 
00058                     Array<T,Descriptor<T>::d> &uLb) const;
00059 
00061     virtual void completePopulations(Cell<T,Descriptor>& cell) const;
00062 private:
00063     static int id;
00064     std::vector<plint> missingIndices, knownIndices;
00065 };
00066 
00068 template<typename T, template<typename U> class Descriptor>
00069 class GeneralizedMassConservingVelocityBoundaryDynamics :
00070     public StoreVelocityDynamics<T,Descriptor>
00071 {
00072 public:
00073     GeneralizedMassConservingVelocityBoundaryDynamics(Dynamics<T,Descriptor>* baseDynamics_,
00074                                         std::vector<plint> missingIndices_,
00075                                         std::vector<plint> knownIndices_,
00076                                         std::vector<plint> inGoingIndices_,
00077                                         bool automaticPrepareCollision = true);
00078     GeneralizedMassConservingVelocityBoundaryDynamics(HierarchicUnserializer& unserializer);
00079 
00081     virtual GeneralizedMassConservingVelocityBoundaryDynamics<T,Descriptor>* clone() const;
00082 
00084     virtual int getId() const;
00085 
00086     virtual void serialize(HierarchicSerializer& serializer) const;
00087     virtual void unserialize(HierarchicUnserializer& unserializer);
00088     
00089     void computeUlb(Cell<T,Descriptor> const& cell, 
00090                     Array<T,Descriptor<T>::d> &uLb) const;
00091 
00093     virtual void completePopulations(Cell<T,Descriptor>& cell) const;
00094 private:
00095     static int id;
00096     std::vector<plint> missingIndices, knownIndices, inGoingIndices;
00097 };
00098 
00100 template<typename T, template<typename U> class Descriptor,
00101          int direction, int orientation>
00102 class GeneralizedDensityBoundaryDynamics :
00103      public DensityDirichletBoundaryDynamics<T,Descriptor,direction,orientation>
00104 {
00105 public:
00106     GeneralizedDensityBoundaryDynamics(Dynamics<T,Descriptor>* baseDynamics_,
00107                                    std::vector<plint> missingIndices_,
00108                                    bool automaticPrepareCollision = true);
00109     GeneralizedDensityBoundaryDynamics(HierarchicUnserializer& unserializer);
00110 
00112     virtual GeneralizedDensityBoundaryDynamics<T,Descriptor,direction,orientation>* clone() const;
00113 
00115     virtual int getId() const;
00116     
00117     virtual void serialize(HierarchicSerializer& serializer) const;
00118     virtual void unserialize(HierarchicUnserializer& unserializer);
00119 
00121     virtual void completePopulations(Cell<T,Descriptor>& cell) const;
00122 private:
00123     static int id;
00124     std::vector<plint> missingIndices, knownIndices;
00125 };
00126 
00127 // ========================================================================== //
00128 // ============= Generalized Temperature and Velocity imposed BC ============ //
00129 // ========== On wall node (in opposition to bulk nodes with unknowns======== //
00130 // ========================================================================== //
00131 
00133 template<typename T, template<typename U> class Descriptor>
00134 class GeneralizedVelocityTemperatureBoundaryDynamics :
00135     public StoreTemperatureAndVelocityDynamics<T,Descriptor>
00136 {
00137 public:
00138     GeneralizedVelocityTemperatureBoundaryDynamics(Dynamics<T,Descriptor>* baseDynamics_,
00139                                         std::vector<plint> missingIndices_,
00140                                         bool massConserving,
00141                                         bool automaticPrepareCollision = true);
00142     GeneralizedVelocityTemperatureBoundaryDynamics(Dynamics<T,Descriptor>* baseDynamics_,
00143                                         std::vector<plint> missingIndices_,
00144                                         std::vector<plint> knownIndices_,
00145                                         bool massConserving,
00146                                         bool automaticPrepareCollision = true);                                    
00147                                         
00148     GeneralizedVelocityTemperatureBoundaryDynamics(HierarchicUnserializer& unserializer);
00149 
00151     virtual GeneralizedVelocityTemperatureBoundaryDynamics<T,Descriptor>* clone() const;
00152 
00154     virtual int getId() const;
00155 
00156     virtual void serialize(HierarchicSerializer& serializer) const;
00157     virtual void unserialize(HierarchicUnserializer& unserializer);
00158     
00159 //     virtual T computeRhoBar(Cell<T,Descriptor> const& cell) const;
00160 //     
00161 //     virtual void computeRhoBarJ(Cell<T,Descriptor> const& cell,
00162 //                                 T& rhoBar, Array<T,Descriptor<T>::d>& j) const;
00163     
00164     void computeUlb(Cell<T,Descriptor> const& cell, 
00165                     Array<T,Descriptor<T>::d> &uLb) const;
00166     
00167 //     virtual void computeDeviatoricStress(
00168 //             Cell<T,Descriptor> const& cell, 
00169 //             Array<T,SymmetricTensor<T,Descriptor>::n>& PiNeq ) const;
00170 
00172     virtual void completePopulations(Cell<T,Descriptor>& cell) const;
00173 private:
00174     static int id;
00175     std::vector<plint> missingIndices, knownIndices;
00176     bool massConserving;
00177 };
00178 
00179 // ========================================================================== //
00180 //  Generalized bulk node (nodes where there are unknown f_is close to walls  //
00181 // ========================================================================== //
00182 
00184 template<typename T, template<typename U> class Descriptor>
00185 class GeneralizedNextToBoundaryDynamics : public BoundaryCompositeDynamics<T,Descriptor>
00186 {
00187 public:
00188     GeneralizedNextToBoundaryDynamics(Dynamics<T,Descriptor>* baseDynamics_,
00189                                   std::vector<plint> missingIndices_,
00190                                   bool automaticPrepareCollision = true);
00191                                   
00192     GeneralizedNextToBoundaryDynamics(Dynamics<T,Descriptor>* baseDynamics_,
00193                                   std::vector<plint> missingIndices_,
00194                                   std::vector<plint> knownIndices_,
00195                                   bool automaticPrepareCollision = true);
00196                                   
00197     GeneralizedNextToBoundaryDynamics(HierarchicUnserializer& unserializer);
00198 
00200     virtual GeneralizedNextToBoundaryDynamics<T,Descriptor>* clone() const;
00201 
00203     virtual int getId() const;
00204 
00205     virtual void serialize(HierarchicSerializer& serializer) const;
00206     virtual void unserialize(HierarchicUnserializer& unserializer);
00207     
00208 //     virtual T computeRhoBar(Cell<T,Descriptor> const& cell) const;
00209 //     
00210 //     virtual void computeRhoBarJ(Cell<T,Descriptor> const& cell,
00211 //                                 T& rhoBar, Array<T,Descriptor<T>::d>& j) const;
00212 //     
00213 //     void computeUlb(Cell<T,Descriptor> const& cell, 
00214 //                     Array<T,Descriptor<T>::d> &uLb) const;
00215 //     
00216 //     virtual void computeDeviatoricStress(
00217 //             Cell<T,Descriptor> const& cell, 
00218 //             Array<T,SymmetricTensor<T,Descriptor>::n>& PiNeq ) const;
00219 //             
00220 //     virtual void computeTemperature(
00221 //             Cell<T,Descriptor> const& cell) const;
00222 
00224     virtual void completePopulations(Cell<T,Descriptor>& cell) ;
00225 private:
00226     static int id;
00227     std::vector<plint> missingIndices, knownIndices;
00228     T rho, thetaBar;
00229     Array<T,Descriptor<T>::d> u;
00230     Array<T,SymmetricTensor<T,Descriptor>::n> PiNeq;
00231     Array<T,SymmetricRankThreeTensor<T,Descriptor>::n> Qneq;
00232 };
00233 
00234 }  // namespace plb
00235 
00236 #endif  // GENERALIZED_BOUNDARY_DYNAMICS_H