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 "SPMD.H"
00034 
00036 
00045 class DragParticle: public BinItem
00046 {
00047   
00048 public:
00049 
00051   DragParticle();
00052 
00054 
00056   DragParticle(const RealVect& a_position);
00057 
00059   DragParticle(const RealVect& a_position,
00060                const RealVect& a_velocity,
00061                const DiscreteDeltaFn* a_deltaFnPtr);
00062 
00063 
00065   DragParticle(const DragParticle&);
00066 
00068   virtual ~DragParticle();
00069 
00071   virtual void define(const RealVect& a_position);
00072 
00074   virtual void define(const RealVect& a_position,
00075                       const RealVect& a_velocity, 
00076                       const DiscreteDeltaFn* a_deltaFnPtr);
00077 
00079   virtual void setVel(const RealVect& a_vel);
00080   
00082   virtual void setFluidVel(const RealVect& a_vel);
00083 
00085   virtual void setFluidVel(Real a_vel, int a_comp);
00086 
00088   virtual void setDragForce(const RealVect& a_force);
00089 
00091 
00094   virtual void setBodyForce(const RealVect& a_force);
00095 
00096 
00098   virtual RealVect velocity() const {return m_velocity;};
00099   
00101   virtual RealVect totalForce() const {return m_dragForce + m_bodyForce;};
00102 
00104   virtual RealVect dragForce() const {return m_dragForce;};
00105 
00107   virtual RealVect bodyForce() const {return m_bodyForce;}
00108 
00110   virtual void setDragCoeff(const Real a_dragCoeff);
00111 
00113   virtual Real mass() const {return m_mass;}
00114 
00116   virtual void setMass(Real a_mass);
00117 
00119   virtual bool boundaryMarker() const {return m_boundaryMarker;}
00120 
00122   virtual void setBoundaryMarker(bool a_marker);
00123 
00125 
00128   virtual DragParticle* clone() const;
00129 
00131 
00135   virtual void computeDragForce(const RealVect& a_flowVelocity);
00136 
00138   virtual void computeDragForce();
00139 
00141 
00144   virtual Real computeK(const RealVect& a_x, int a_idir, int a_jdir) const;
00145 
00147 
00153   virtual Real computeProjForce(const RealVect& a_x, int a_idir) const;
00154 
00156 
00165   virtual void computeProjForce(FArrayBox& a_force, 
00166                                 const Box& a_box,
00167                                 Real a_dx,
00168                                 RealVect& a_origin) const;
00169 
00171 
00179   virtual void computeProjForce(FArrayBox& a_force, 
00180                                 const Box& a_box,
00181                                 int a_idir,
00182                                 int a_destComp,
00183                                 Real a_dx,
00184                                 RealVect& a_origin) const;
00185 
00186 
00187 
00188   // Linearization functions
00189   
00191 
00194   virtual int size() const;
00195 
00196 
00198   
00199   virtual int linearSize() const;
00200 
00202 
00206   virtual void linearOut(void* a_buf) const;
00207 
00209 
00212   virtual void linearIn(const void* const a_buf);
00213 
00215   int preAllocatable() {return 0;}
00216 
00217 
00219   DragParticle& operator= (const DragParticle& a_src);
00220 
00221 
00222 protected:
00224   RealVect m_velocity;
00225 
00226 
00228   RealVect m_fluidVel;
00229 
00231   RealVect m_dragForce;
00232 
00234   RealVect m_bodyForce;
00235 
00237   Real m_dragCoeff;
00238 
00240   Real m_mass;
00241 
00243   bool m_boundaryMarker;
00244 
00246   DiscreteDeltaFn* m_deltaFnPtr;
00247   
00249   void setDefaultValues();
00250 
00251 };
00252 
00253 
00254 // Specializations for SPMD
00255 //Vector<DragParticle>  specialization
00256 template < > 
00257 int linearSize(const Vector<DragParticle>& a_input); 
00258 template < > 
00259 void linearIn(Vector<DragParticle>& a_outputT, const void* const inBuf); 
00260 template < > 
00261 void linearOut(void* const a_outBuf, const Vector<DragParticle>& a_inputT); 
00262 
00263 
00264 
00265 #endif

Generated on Wed Jun 2 13:53:33 2004 for Chombo&INSwithParticles by doxygen 1.3.2