Memosa-FVM  0.2
RelaxationTimeFunction.h
Go to the documentation of this file.
1 #ifndef _RELAXATIONTIMEFUNCTION_H_
2 #define _RELAXATIONTIMEFUNCTION_H_
3 
4 #include <math.h>
5 
6 template<class T>
7 struct RelTimeFun
8 {
9 
11  {
12  this->_A=1.;
13  this->_B=1.;
14  this->_C=1.;
15  this->_constTau=true;
16  }
17 
18  RelTimeFun(const T A, const T B, const T C)
19  {
20  this->_A=A;
21  this->_B=B;
22  this->_C=C;
23  }
24 
25  void update(const T w, const T Tl, T& tau)
26  {
27  if(!_constTau)
28  {
29  T umk=_B*Tl*pow(w,2.)*exp(-_C/Tl);
30  T imp=_A*pow(w,4.);
31  tau=1./(umk+imp);
32  }
33  }
34 
35  T _A;
36  T _B;
37  T _C;
38  bool _constTau;
39 };
40 
41 
42 
43 #endif
RelTimeFun(const T A, const T B, const T C)
void update(const T w, const T Tl, T &tau)