00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
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
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
00255
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