Rheolef  7.1
an efficient C++ finite element environment
transport_tensor_exact.icc
Go to the documentation of this file.
1 point u(const point& x) { return point (-x[1], x[0]); }
26 tensor grad_u = {{0,-1},{1,0}};
27 
28 struct sigma_exact {
29  Float f (const point& x) const {
30  return 0.5*exp( - nu*t - norm2(x-xt)/sqr(r0));
31  }
32  Float df_dt (const point& x) const {
33  return ( - nu + 2*dot(vt,x-xt)/sqr(r0))*f(x);
34  }
35  tensor operator() (const point& x) const {
36  Float c0 = f(x);
37  tensor s;
38  s(0,0) = c0*(1+cos(2*t));
39  s(1,1) = c0*(1-cos(2*t));
40  s(0,1) =
41  s(1,0) = c0*sin(2*t);
42  return s;
43  }
44  tensor time_derivative (const point& x) const {
45  Float c0 = f(x);
46  Float c1 = df_dt(x);
47  tensor s;
48  s(0,0) = c1*(1+cos(2*t)) - 2*c0*sin(2*t);
49  s(1,1) = c1*(1-cos(2*t)) + 2*c0*sin(2*t);
50  s(0,1) =
51  s(1,0) = c1*sin(2*t) + 2*c0*cos(2*t);
52  return s;
53  }
54  sigma_exact (Float nu1, Float t1 = 0)
55  : nu(nu1), t(t1), r0(0.1), x0(0.25,0), xt(), vt()
56  {
57  xt = point( x0[0]*cos(t) - x0[1]*sin(t),
58  x0[0]*sin(t) + x0[1]*cos(t));
59  vt = point(-x0[0]*sin(t) - x0[1]*cos(t),
60  x0[0]*cos(t) - x0[1]*sin(t));
61  }
62  Float nu, t, r0;
64 };
65 struct chi {
66  tensor operator() (const point& x) const {
67  return - _s.time_derivative(x);
68  }
69  chi (Float nu, Float t = 0): _s(nu, t) {}
71 };
sigma_exact::df_dt
Float df_dt(const point &x) const
Definition: transport_tensor_exact.icc:32
tensor
see the tensor page for the full documentation
sigma_exact::operator()
tensor operator()(const point &x) const
Definition: transport_tensor_exact.icc:35
sigma_exact::nu
Float nu
Definition: transport_tensor_exact.icc:62
u
point u(const point &x)
Definition: transport_tensor_exact.icc:25
sigma_exact::sigma_exact
sigma_exact(Float nu1, Float t1=0)
Definition: transport_tensor_exact.icc:54
sigma_exact::t
Float t
Definition: transport_tensor_exact.icc:62
chi
Definition: transport_tensor_exact.icc:65
nu
Definition: nu.h:26
sigma_exact::f
Float f(const point &x) const
Definition: transport_tensor_exact.icc:29
sigma_g
sigma_exact sigma_g
Definition: transport_tensor_exact.icc:72
chi::_s
sigma_exact _s
Definition: transport_tensor_exact.icc:70
rheolef::norm2
T norm2(const vec< T, M > &x)
norm2(x): see the expression page for the full documentation
Definition: vec.h:379
rheolef::exp
tensor_basic< T > exp(const tensor_basic< T > &a, size_t d)
Definition: tensor-exp.cc:92
rheolef::details::dot
rheolef::details::is_vec dot
chi::operator()
tensor operator()(const point &x) const
Definition: transport_tensor_exact.icc:66
Float
see the Float page for the full documentation
sigma_exact::xt
point xt
Definition: transport_tensor_exact.icc:63
point
see the point page for the full documentation
sigma_exact
Definition: transport_tensor_exact.icc:28
sigma_exact::time_derivative
tensor time_derivative(const point &x) const
Definition: transport_tensor_exact.icc:44
sigma_exact::r0
Float r0
Definition: transport_tensor_exact.icc:62
sigma_exact::vt
point vt
Definition: transport_tensor_exact.icc:63
sigma_exact::x0
point x0
Definition: transport_tensor_exact.icc:63
chi::chi
chi(Float nu, Float t=0)
Definition: transport_tensor_exact.icc:69
grad_u
Definition: combustion_exact.icc:34