Go to the documentation of this file.
13 #ifndef __ROT_DAMPING_HPP
14 #define __ROT_DAMPING_HPP
61 Vec3 v=m_p->getAngVel();
63 Vec3 frc=m_p->getMoment();
65 double s=1.0/m_p->getInertRot();
66 double in=m_p->getInertRot();
67 double mass=m_p->getMass();
71 while((error*error>s_limit2) & (count<m_maxiter)){
74 v_rel=v-m_vref+s*m_dt*(frc-v_rel*m_visc*in);
75 error=(v_rel-v_old).norm2();
79 v_rel=
Vec3(0.0,0.0,0.0);
81 m_force=-1.0*m_visc*v_rel*mass;
82 m_p->applyMoment(-1.0*m_visc*v_rel*in);
83 m_E_diss=m_visc*v_rel*v*m_dt;
96 if(name==
"dissipated_energy"){
100 cerr <<
"ERROR - invalid name for interaction scalar access function" << endl;
117 cerr <<
"ERROR - invalid name for interaction scalar access function" << endl;
137 cerr <<
"ERROR - invalid name for interaction vector access function" << endl;
167 int tag1=m_p->getTag();
169 return ((tag1 & mask)==(tag & mask));
180 res.push_back(m_p->getID());
185 #endif // __ROT_DAMPING_HPP
virtual ~CRotDamping()
Definition: RotDamping.hpp:42
void setTimeStepSize(double dt)
Definition: RotDamping.hpp:47
CRotDamping(T *, CDampingIGP *)
Definition: RotDamping.hpp:29
double getDissipatedEnergy() const
Definition: RotDamping.hpp:147
static CheckedScalarFieldFunction getCheckedScalarFieldFunction(const string &)
Definition: RotDamping.hpp:112
Vec3 getVRef() const
Definition: DampingIGP.h:49
int getMaxIter() const
Definition: DampingIGP.h:56
Vec3 getForce() const
Definition: RotDamping.hpp:153
static ScalarFieldFunction getScalarFieldFunction(const string &)
Definition: RotDamping.hpp:92
static VectorFieldFunction getVectorFieldFunction(const string &)
Definition: RotDamping.hpp:129
#define NULL
Definition: t_list.h:17
Damping of the rotational part of the particle motion by an artificial viscosity.
Definition: RotDamping.h:28
virtual void calcForces()
Definition: RotDamping.hpp:58
virtual bool hasTag(int, int) const
Definition: RotDamping.hpp:165
Interaction group parameters for CDampingGroup.
Definition: DampingIGP.h:28
vector< int > getAllID() const
Definition: RotDamping.hpp:176
double getTimeStep() const
Definition: DampingIGP.h:54
double getVisc() const
Definition: DampingIGP.h:51