gdmcbain/fenics-tuto-in-skfem

08_navier_stokes_cylinder

Closed this issue · 11 comments

Next after 07_navier_stokes_channel #4 is ft08_navier_stokes_cylinder.

There's an issue about this over at hplgit/fenics-tutorial#51.

That was about the line

https://github.com/hplgit/fenics-tutorial/blob/bf8120cb448f244df18871ee305f4b9c463896cf/pub/python/vol1/ft08_navier_stokes_cylinder.py#L115

Myself, I first tried replacing PROGRESS with its value

set_log_level(16)

but that didn't work either so I just commented it out and did without logging.

I had successfully modified this to run in the Docker image but now with FEniCS installed locally on Ubuntu 19.10 with

conda create -n FEniCS -c conda-forge fenics

it failed with

ModuleNotFoundError: No module named 'mshr'

Installing mshr #11:

conda install -c conda-forge mshr

So how does 08 differ from 07 Navier–Stokes channel #4?

  • geometry
  • shorter final time, 5. cf. 10.
  • much shorter time-steps, 1e-3 cf. .02
  • smaller (dynamic & thus kinematic) viscosity, 1e-3 cf. 1.
  • velocity (plane Poiseuille parabolic) rather than pressure (uniform nonzero) specified at inlet
  • nondefault linear solvers:
    • bicgstab and hypre_amg rather than default solver for tentative velocity step and pressure correction step
    • cg and sor for velocity correction step
  • slightly more elaborate postprocessing
    • in particular looking ahead to 09_reaction_system #12

But the pressure-correction algorithm is the same.

I presume that iterative solvers aren't really required for the problem as meshed—it's only 4585 triangles—but are rather given as a suggestion for larger more realistic problems.

Isn't the pressure-correction step symmetric? Why is the unsymmetric Bi-CGStab scheme adopted?

The velocity isn't written as a vector to the XDMF time series nschloe/meshio#522.

The original FEniCS tutorial uses HYPRE AMG accelerated by BiCG-Stab for the tentative velocity

https://github.com/hplgit/fenics-tutorial/blob/bf8120cb448f244df18871ee305f4b9c463896cf/pub/python/vol1/ft08_navier_stokes_cylinder.py#L127

and pressure correction

https://github.com/hplgit/fenics-tutorial/blob/bf8120cb448f244df18871ee305f4b9c463896cf/pub/python/vol1/ft08_navier_stokes_cylinder.py#L132

steps.

I assume these are via PETSc. We could make use of petsc4py here (see kinnala/scikit-fem#236) but excellent results are also obtained much more simply with pyamgcl.

final

Figure:— Plot of the velocity (coloured by pressure) for the cylinder test problem at final time