ESyS-Particle  2.3.4
ABCDamping.hpp
Go to the documentation of this file.
1 // //
3 // Copyright (c) 2003-2017 by The University of Queensland //
4 // Centre for Geoscience Computing //
5 // http://earth.uq.edu.au/centre-geoscience-computing //
6 // //
7 // Primary Business: Brisbane, Queensland, Australia //
8 // Licensed under the Open Software License version 3.0 //
9 // http://www.apache.org/licenses/LICENSE-2.0 //
10 // //
12 
13 #ifndef MODEL_ABCDAMPING_HPP
14 #define MODEL_ABCDAMPING_HPP
15 
16 #include<cmath>
17 using std::fabs;
18 using std::exp;
19 
20 
21 
28 template <class ParticleType>
30 : CDamping<ParticleType>(P,param)
31 {
32  // calc local viscosity
33  Vec3 pos=param->getPos();
34  Vec3 normal=param->getNormal();
35  double c1=param->getC1();
36  double v_0=this->m_visc;
37  double dist=fabs((this->m_p->getInitPos()-pos)*normal);
38  double v_new=v_0/exp(dist*c1);
39  this->m_visc=v_new;
40 }
41 
42 template <class ParticleType>
44 {}
45 
46 
47 /* Get the particle member function which returns a scalar field of a given name.
48 
49  \param name the name of the field
50 */
51 template <class T>
53 {
55 
56  sf=NULL;
57  cerr << "ERROR - invalid name for interaction scalar access function" << endl;
58 
59  return sf;
60 }
61 
62 
68 template <class T>
70 {
72 
73  sf=NULL;
74  cerr << "ERROR - invalid name for interaction scalar access function" << endl;
75 
76  return sf;
77 }
78 
79 
85 template <class T>
87 {
89 
90  vf=NULL;
91  cerr << "ERROR - invalid name for interaction vector access function" << endl;
92 
93  return vf;
94 }
95 
96 #endif //MODEL_ABCDAMPING_HPP
ABCDamping::getCheckedScalarFieldFunction
static CheckedScalarFieldFunction getCheckedScalarFieldFunction(const string &)
Definition: ABCDamping.hpp:69
ABCDampingIGP::getNormal
Vec3 getNormal()
Definition: ABCDampingIGP.h:38
CDamping< ParticleType >::m_p
ParticleType * m_p
the particle
Definition: Damping.h:32
ABCDamping::getScalarFieldFunction
static ScalarFieldFunction getScalarFieldFunction(const string &)
Definition: ABCDamping.hpp:52
ABCDamping::ABCDamping
ABCDamping(ParticleType *, ABCDampingIGP *)
Definition: ABCDamping.hpp:29
ABCDampingIGP::getC1
double getC1()
Definition: ABCDampingIGP.h:40
CDamping
Damping of the particle motion by an artificial viscosity.
Definition: Damping.h:30
NULL
#define NULL
Definition: t_list.h:17
ABCDampingIGP::getPos
Vec3 getPos()
Definition: ABCDampingIGP.h:36
ABCDamping::~ABCDamping
virtual ~ABCDamping()
Definition: ABCDamping.hpp:43
Vec3
Definition: vec3.h:47
ABCDamping
Definition: ABCDamping.h:26
CDamping< ParticleType >::m_visc
double m_visc
artificial viscosity
Definition: Damping.h:34
ABCDampingIGP
Definition: ABCDampingIGP.h:24
ABCDamping::getVectorFieldFunction
static VectorFieldFunction getVectorFieldFunction(const string &)
Definition: ABCDamping.hpp:86