@@ -18,11 +18,11 @@ using real_t = double;
1818
1919struct exact_f
2020{
21- real_t t, mu;
21+ real_t t, mu, advective_vel ;
2222
2323 real_t operator ()(const real_t x) const
2424 {
25- return 2 + std::sin (x - t) * std::exp (-mu * t);
25+ return 2 + std::sin (x - advective_vel * t) * std::exp (-mu * t);
2626
2727 }
2828 BZ_DECLARE_FUNCTOR (exact_f);
@@ -71,7 +71,7 @@ class adv_diffusion_solver : public libmpdataxx::solvers::mpdata_rhs_vip<ct_para
7171
7272 protected:
7373
74- real_t mu;
74+ real_t mu, advective_vel ;
7575
7676 void hook_ante_loop (const typename parent_t ::advance_arg_t nt)
7777 {
@@ -91,7 +91,7 @@ class adv_diffusion_solver : public libmpdataxx::solvers::mpdata_rhs_vip<ct_para
9191 tmp (ii) = exact_f{-this ->dt , mu}(ii * this ->di );
9292 }
9393 this ->xchng_sclr (tmp);
94- this ->vip_stash (-1 )[0 ](i) = 1 + diffusive_vel<diffusive_vel_ord>(tmp, i, this ->di , mu);
94+ this ->vip_stash (-1 )[0 ](i) = advective_vel + diffusive_vel<diffusive_vel_ord>(tmp, i, this ->di , mu);
9595
9696 if (parent_t ::div3_mpdata)
9797 {
@@ -101,7 +101,7 @@ class adv_diffusion_solver : public libmpdataxx::solvers::mpdata_rhs_vip<ct_para
101101 tmp (ii) = exact_f{-2 * this ->dt , mu}(ii * this ->di );
102102 }
103103 this ->xchng_sclr (tmp);
104- this ->vip_stash (-2 )[0 ](i) = 1 + diffusive_vel<diffusive_vel_ord>(tmp, i, this ->di , mu);
104+ this ->vip_stash (-2 )[0 ](i) = advective_vel + diffusive_vel<diffusive_vel_ord>(tmp, i, this ->di , mu);
105105 }
106106 }
107107
@@ -111,7 +111,7 @@ class adv_diffusion_solver : public libmpdataxx::solvers::mpdata_rhs_vip<ct_para
111111 const auto &i = this ->i ;
112112
113113 this ->xchng_sclr (psi);
114- this ->vips ()[0 ](i) = 1 + diffusive_vel<diffusive_vel_ord>(psi, i, this ->di , mu);
114+ this ->vips ()[0 ](i) = advective_vel + diffusive_vel<diffusive_vel_ord>(psi, i, this ->di , mu);
115115
116116 return parent_t::calc_gc ();
117117 }
@@ -120,14 +120,15 @@ class adv_diffusion_solver : public libmpdataxx::solvers::mpdata_rhs_vip<ct_para
120120
121121 struct rt_params_t : parent_t ::rt_params_t
122122 {
123- real_t mu;
123+ real_t mu, advective_vel ;
124124 };
125125
126126 adv_diffusion_solver (
127127 typename parent_t ::ctor_args_t args,
128128 const rt_params_t &p
129129 ) :
130130 parent_t (args, p),
131- mu (p.mu)
131+ mu (p.mu),
132+ advective_vel (p.advective_vel)
132133 {}
133134};
0 commit comments