rheolef  6.5
stokes_contraction_bubble.cc
Go to the documentation of this file.
1 #include "rheolef.h"
2 using namespace rheolef;
3 using namespace std;
4 #include "poiseuille.h"
5 
6 int main(int argc, char**argv) {
7  environment rheolef (argc, argv);
8  geo omega (argv[1]);
9  space X1h (omega, "P1", "vector");
10  space Bh (omega, "bubble", "vector");
11  space Qh (omega, "P1");
12  space Wh (omega["upstream"], "P1");
13  X1h.block ("wall");
14  X1h.block ("upstream");
15  X1h[1].block ("axis");
16  X1h[1].block ("downstream");
17  trial u1 (X1h), ub (Bh), p (Qh);
18  test v1 (X1h), vb (Bh), q (Qh);
19  form mp = integrate (p*q);
20  form b1 = integrate (-div(u1)*q);
21  form bb = integrate (-div(ub)*q);
22  form a1 = integrate (2*ddot(D(u1),D(v1)));
23  form_option_type fopt;
24  fopt.invert = true;
25  form inv_ab = integrate (2*ddot(D(ub),D(vb)), fopt);
26  form c = bb*inv_ab*trans(bb);
27  field u1h (X1h, 0), ph (Qh, 0);
28  string sys_coord = omega.coordinate_system_name();
29  Float cr = omega.xmax()[1];
30  u1h[0]["upstream"] = interpolate (Wh, u_poiseuille(cr,sys_coord));
31  solver_abtb stokes (a1.uu(), b1.uu(), c.uu(), mp.uu());
32  stokes.solve (-(a1.ub()*u1h.b()), -(b1.ub()*u1h.b()),
33  u1h.set_u(), ph.set_u());
34  dout << catchmark("inv_lambda") << 0 << endl
35  << catchmark("u") << u1h
36  << catchmark("p") << ph;
37 }
38