Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

DragParticle.H

Go to the documentation of this file.
00001 /*   _______              __
00002     / ___/ /  ___  __ _  / /  ___
00003    / /__/ _ \/ _ \/  ' \/ _ \/ _ \
00004    \___/_//_/\___/_/_/_/_.__/\___/
00005 */
00006 //
00007 // This software is copyright (C) by the Lawrence Berkeley
00008 // National Laboratory.  Permission is granted to reproduce
00009 // this software for non-commercial purposes provided that
00010 // this notice is left intact.
00011 //
00012 // It is acknowledged that the U.S. Government has rights to
00013 // this software under Contract DE-AC03-765F00098 between
00014 // the U.S.  Department of Energy and the University of
00015 // California.
00016 //
00017 // This software is provided as a professional and academic
00018 // contribution for joint exchange. Thus it is experimental,
00019 // is provided ``as is'', with no warranties of any kind
00020 // whatsoever, no support, no promise of updates, or printed
00021 // documentation. By using this software, you acknowledge
00022 // that the Lawrence Berkeley National Laboratory and
00023 // Regents of the University of California shall have no
00024 // liability with respect to the infringement of other
00025 // copyrights by any part of this software.
00026 //
00027 
00028 #ifndef _DRAGPARTICLE_H_
00029 #define _DRAGPARTICLE_H_
00030 
00031 #include "BinItem.H"
00032 #include "DiscreteDeltaFn.H"
00033 #include "PolynomialDelta.H"
00034 #include "SPMD.H"
00035 
00037 
00046 class DragParticle: public BinItem
00047 {
00048   
00049 public:
00050 
00052   DragParticle();
00053 
00055 
00057   DragParticle(const RealVect& a_position);
00058 
00060   DragParticle(const RealVect& a_position,
00061                const RealVect& a_velocity,
00062                const DiscreteDeltaFn* a_deltaFnPtr);
00063 
00064 
00066   DragParticle(const DragParticle&);
00067 
00069   virtual ~DragParticle();
00070 
00072   virtual void define(const RealVect& a_position);
00073 
00075   virtual void define(const RealVect& a_position,
00076                       const RealVect& a_velocity, 
00077                       const DiscreteDeltaFn* a_deltaFnPtr);
00078 
00080   virtual void setVel(const RealVect& a_vel);
00081   
00083   virtual void setFluidVel(const RealVect& a_vel);
00084 
00086   virtual void setFluidVel(Real a_vel, int a_comp);
00087 
00089   virtual void setDragForce(const RealVect& a_force);
00090 
00092 
00095   virtual void setBodyForce(const RealVect& a_force);
00096 
00097 
00099   virtual RealVect velocity() const {return m_velocity;};
00100   
00102   virtual RealVect fluidVel() const {return m_fluidVel;};
00103 
00105   virtual RealVect totalForce() const {return m_dragForce + m_bodyForce;};
00106 
00108   virtual RealVect dragForce() const {return m_dragForce;};
00109 
00111   virtual RealVect bodyForce() const {return m_bodyForce;}
00112 
00114   virtual void setDragCoeff(const Real a_dragCoeff);
00115 
00117   virtual Real dragCoeff() const {return m_dragCoeff;};
00118 
00120   virtual Real mass() const {return m_mass;}
00121 
00123   virtual void setMass(Real a_mass);
00124 
00126   virtual bool boundaryMarker() const {return m_boundaryMarker;}
00127 
00129   virtual void setBoundaryMarker(bool a_marker);
00130 
00132 
00135   virtual DragParticle* clone() const;
00136 
00138 
00142   virtual void computeDragForce(const RealVect& a_flowVelocity);
00143 
00145   virtual void computeDragForce();
00146 
00148 
00151   virtual Real computeK(const RealVect& a_x, int a_idir, int a_jdir) const;
00152 
00154 
00160   virtual Real computeProjForce(const RealVect& a_x, int a_idir) const;
00161 
00163 
00172   virtual void computeProjForce(FArrayBox& a_force, 
00173                                 const Box& a_box,
00174                                 Real a_dx,
00175                                 RealVect& a_origin) const;
00176 
00178 
00186   virtual void computeProjForce(FArrayBox& a_force, 
00187                                 const Box& a_box,
00188                                 int a_idir,
00189                                 int a_destComp,
00190                                 Real a_dx,
00191                                 RealVect& a_origin) const;
00192 
00193 
00194 
00195   // Linearization functions
00196   
00198 
00201   virtual int size() const;
00202 
00203 
00205   
00206   virtual int linearSize() const;
00207 
00209 
00213   virtual void linearOut(void* a_buf) const;
00214 
00216 
00219   virtual void linearIn(const void* const a_buf);
00220 
00222   int preAllocatable() {return 0;}
00223 
00224 
00226   DragParticle& operator= (const DragParticle& a_src);
00227 
00228 
00229 protected:
00231   RealVect m_velocity;
00232 
00233 
00235   RealVect m_fluidVel;
00236 
00238   RealVect m_dragForce;
00239 
00241   RealVect m_bodyForce;
00242 
00244   Real m_dragCoeff;
00245 
00247   Real m_mass;
00248 
00250   bool m_boundaryMarker;
00251 
00253   //DiscreteDeltaFn* m_deltaFnPtr;
00254   PolynomialDelta m_deltaFn;
00255   
00257   void setDefaultValues();
00258 
00259 };
00260 
00261 
00262 // Specializations for SPMD
00263 //Vector<DragParticle>  specialization
00264 template < > 
00265 int linearSize(const Vector<DragParticle>& a_input); 
00266 template < > 
00267 void linearIn(Vector<DragParticle>& a_outputT, const void* const inBuf); 
00268 template < > 
00269 void linearOut(void* const a_outBuf, const Vector<DragParticle>& a_inputT); 
00270 
00271 
00272 
00273 #endif

Generated on Wed Jan 19 17:51:24 2005 for Chombo&INSwithParticles by doxygen1.2.16