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 "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
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
00254 PolynomialDelta m_deltaFn;
00255
00257 void setDefaultValues();
00258
00259 };
00260
00261
00262
00263
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