Rheolef  7.2
an efficient C++ finite element environment
oldroyd_theta_scheme3.h
Go to the documentation of this file.
1 template <class P>
27  const field& tau_h0, const field& uh0, const field& ph0,
28  field& tau_h, field& uh, field& ph) const
29 {
30  update_transport_stress (uh0);
31  field gamma_h = inv_mt*(th*tau_h0 - thb);
32  test v (Xh), xi (Th);
33  field lh = lambda*integrate (dot(uh0,v))
34  + b*(c1*tau_h0 + c2*gamma_h);
35  ph = ph0;
36  uh.set_u() = uh0.u();
37  stokes.solve (lh, field(Qh,0), uh, ph);
38  field Duh = inv_mt*integrate(ddot(D(uh),xi));
39  tau_h = c1*tau_h0 + c2*gamma_h + 2*c3*Duh;
40 }
41 template <class P>
43  const field& uh0,
44  const field& tau_h1, const field& uh1,
45  field& tau_h, field& uh) const
46 {
47  uh = (1-theta)/theta*uh1 - (1-2*theta)/theta*uh0;
48  test xi (Th);
49  if (We == 0) {
50  field Duh = inv_mt*integrate(ddot(D(uh),xi));
51  tau_h = 2*alpha*Duh;
52  return;
53  }
54  update_transport_stress (uh);
55  form th_nu = th + nu*mt;
56  typename P::tau_upstream tau_up (Th.get_geo(), We, alpha);
57  field lh = integrate (ddot(c4*tau_h1 + 2*c5*D(uh1),xi))
58  + integrate ("boundary",
59  max(0, -dot(uh,normal()))*ddot(tau_up,xi));
60  problem transport (th_nu);
61  transport.solve (lh, tau_h);
62 }
63 template <class P>
64 void
66  typename P::tau_upstream tau_up (Th.get_geo(), We, alpha);
67  trial tau (Th); test xi (Th);
68  auto ma = 0.5*((1-a)*grad(uh) - (1+a)*trans(grad(uh)));
69  auto beta_a = tau*ma + trans(ma)*tau;
70  th = integrate (ddot(grad_h(tau)*uh + beta_a,xi))
71  + integrate ("boundary", max(0, -dot(uh,normal()))*ddot(tau,xi))
72  + integrate ("internal_sides",
73  - dot(uh,normal())*ddot(jump(tau),average(xi))
74  + 0.5*abs(dot(uh,normal()))*ddot(jump(tau),jump(xi)));
75  thb = integrate ("boundary", max(0, -dot(uh,normal()))*ddot(tau_up,xi));
76 }
field lh(Float epsilon, Float t, const test &v)
see the field page for the full documentation
see the form page for the full documentation
see the problem page for the full documentation
see the test page for the full documentation
see the test page for the full documentation
Float alpha[pmax+1][pmax+1]
Definition: bdf.icc:28
rheolef::details::is_vec dot
std::enable_if< details::has_field_rdof_interface< Expr >::value,details::field_expr_v2_nonlinear_terminal_field< typename Expr::scalar_type,typename Expr::memory_type,details::differentiate_option::gradient >>::type grad(const Expr &expr)
grad(uh): see the expression page for the full documentation
csr< T, sequential > trans(const csr< T, sequential > &a)
trans(a): see the form page for the full documentation
Definition: csr.h:455
std::enable_if< details::is_field_expr_v2_nonlinear_arg< Expr >::value &&! is_undeterminated< Result >::value, Result >::type integrate(const geo_basic< T, M > &omega, const Expr &expr, const integrate_option &iopt, Result dummy=Result())
see the integrate page for the full documentation
Definition: integrate.h:211
std::enable_if< details::has_field_rdof_interface< Expr >::value,details::field_expr_v2_nonlinear_terminal_field< typename Expr::scalar_type,typename Expr::memory_type,details::differentiate_option::gradient >>::type grad_h(const Expr &expr)
grad_h(uh): see the expression page for the full documentation
std::enable_if< details::has_field_rdof_interface< Expr >::value,details::field_expr_v2_nonlinear_terminal_field< typename Expr::scalar_type,typename Expr::memory_type,details::differentiate_option::gradient >>::type D(const Expr &expr)
D(uh): see the expression page for the full documentation.
T ddot(const tensor_basic< T > &a, const tensor_basic< T > &b)
ddot(x,y): see the expression page for the full documentation
Definition: tensor.cc:278
details::field_expr_v2_nonlinear_terminal_function< details::normal_pseudo_function< Float > > normal()
normal: see the expression page for the full documentation
Definition: nu.h:26
void sub_step1(const field &tau_h0, const field &uh0, const field &ph0, field &tau_h, field &uh, field &ph) const
void update_transport_stress(const field &uh) const
void sub_step2(const field &uh0, const field &tau_h1, const field &uh1, field &tau_h, field &uh) const