Loading...
Searching...
No Matches
diffusion_transport_tensor_exact.icc

The tensor transport-diffusion benchmark – right-hand-side and exact solution.

The tensor transport-diffusion benchmark – right-hand-side and exact solution

point u(const point& x) { return point (-x[1], x[0]); }
tensor grad_u = {{0,-1},{1,0}};
struct sigma_exact {
Float f (const point& x) const {
return 0.5*exp( - nu*t - norm2(x-xt)/sqr(r0));
}
Float df_dt (const point& x) const {
return ( - nu + 2*dot(vt,x-xt)/sqr(r0))*f(x);
}
tensor operator() (const point& x) const {
Float c0 = f(x);
tensor s;
s(0,0) = c0*(1+cos(2*t));
s(1,1) = c0*(1-cos(2*t));
s(0,1) =
s(1,0) = c0*sin(2*t);
return s;
}
tensor time_derivative (const point& x) const {
Float c0 = f(x);
Float c1 = df_dt(x);
tensor s;
s(0,0) = c1*(1+cos(2*t)) - 2*c0*sin(2*t);
s(1,1) = c1*(1-cos(2*t)) + 2*c0*sin(2*t);
s(0,1) =
s(1,0) = c1*sin(2*t) + 2*c0*cos(2*t);
return s;
}
tensor3 grad (const point& x) const {
tensor s = operator()(x);
point vec = x - xt;
tensor3 A;
for (size_t i = 0; i < 2; i++)
for (size_t j = 0; j < 2; j++)
for (size_t k = 0; k < 2; k++)
A(i,j,k) = s(i,j)*vec[k];
A *= (-2/sqr(r0));
return A;
}
tensor laplacian (const point& x) const {
tensor s = operator()(x);
return (norm2(x-xt)/sqr(r0) - 1)*(4/sqr(r0))*s;
}
sigma_exact (Float nu1, Float t1 = 0)
: nu(nu1), t(t1), r0(0.1), x0(0.25,0), xt(), vt()
{
xt = point( x0[0]*cos(t) - x0[1]*sin(t),
x0[0]*sin(t) + x0[1]*cos(t));
vt = point(-x0[0]*sin(t) - x0[1]*cos(t),
x0[0]*cos(t) - x0[1]*sin(t));
}
Float nu, t, r0;
point x0, xt, vt;
};
struct chi {
tensor operator() (const point& x) const {
return - _eps * _s.laplacian(x) - _s.time_derivative(x);
}
chi (Float eps, Float nu, Float t = 0): _eps(eps), _s(nu, t) {}
Float _eps;
sigma_exact _s;
};
struct grad_sigma_g {
tensor3 operator() (const point& x) const {
return _s.grad(x);
}
grad_sigma_g (Float nu, Float t = 0): _s(nu, t) {}
sigma_exact _s;
};
typedef sigma_exact sigma_g;
Float
see the Float page for the full documentation
point
see the point page for the full documentation
tensor3
see the tensor3 page for the full documentation
tensor
see the tensor page for the full documentation
sigma_g
sigma_exact sigma_g
Definition diffusion_tensor_exact.icc:50
rheolef::details::dot
rheolef::details::is_vec dot
rheolef::exp
tensor_basic< T > exp(const tensor_basic< T > &a, size_t d)
Definition tensor-exp.cc:92
rheolef::norm2
T norm2(const vec< T, M > &x)
norm2(x): see the expression page for the full documentation
Definition vec.h:379
A
Definition diffusion_isotropic.h:25
chi
Definition diffusion_tensor_exact.icc:38
chi::operator()
tensor operator()(const point &x) const
Definition diffusion_tensor_exact.icc:39
chi::_s
sigma_exact _s
Definition diffusion_transport_tensor_exact.icc:86
chi::chi
chi()
Definition diffusion_tensor_exact.icc:48
chi::_eps
Float _eps
Definition diffusion_transport_tensor_exact.icc:85
f
Definition cavity_dg.h:29
grad_sigma_g
Definition diffusion_transport_tensor_exact.icc:88
grad_sigma_g::operator()
tensor3 operator()(const point &x) const
Definition diffusion_transport_tensor_exact.icc:89
grad_sigma_g::_s
sigma_exact _s
Definition diffusion_transport_tensor_exact.icc:93
grad_u
Definition combustion_exact.icc:34
nu
Definition nu.h:26
sigma_exact
Definition diffusion_tensor_exact.icc:25
sigma_exact::sigma_exact
sigma_exact()
Definition diffusion_tensor_exact.icc:35
sigma_exact::xt
point xt
Definition diffusion_transport_tensor_exact.icc:78
sigma_exact::laplacian
tensor laplacian(const point &x) const
Definition diffusion_transport_tensor_exact.icc:65
sigma_exact::operator()
tensor operator()(const point &x) const
Definition diffusion_tensor_exact.icc:26
sigma_exact::grad
tensor3 grad(const point &x) const
Definition diffusion_transport_tensor_exact.icc:54
sigma_exact::df_dt
Float df_dt(const point &x) const
Definition diffusion_transport_tensor_exact.icc:32
sigma_exact::t
Float t
Definition diffusion_transport_tensor_exact.icc:77
sigma_exact::x0
point x0
Definition diffusion_transport_tensor_exact.icc:78
sigma_exact::time_derivative
tensor time_derivative(const point &x) const
Definition diffusion_transport_tensor_exact.icc:44
sigma_exact::vt
point vt
Definition diffusion_transport_tensor_exact.icc:78
sigma_exact::nu
Float nu
Definition diffusion_transport_tensor_exact.icc:77
sigma_exact::r0
Float r0
Definition diffusion_transport_tensor_exact.icc:77
u
Definition leveque.h:25