Skip to content

Numerical details

William Jussiau edited this page Feb 22, 2025 · 41 revisions
  • For discretization in space, the Finite Element Method (FEM) is used, using default continuous Galerkin elements of order 2 (for each component of the velocity) and 1 (for the scalar pressure). In the code, the elements are repectively defined as:
Ve = dolfin.VectorElement("CG", self.mesh.ufl_cell(), 2)
Pe = dolfin.FiniteElement("CG", self.mesh.ufl_cell(), 1)
  • For the time integration, a linear multistep semi-implicit method is used (the nonlinear term is extrapolated with a second-order Adams–Bashforth scheme, while the viscous term is treated implicitly). The equations read as follows:
        F2 = (
            dot((3 * u - 4 * u_n + u_nn) / (2 * dt), v) * dx
            + dot(dot(U0, nabla_grad(u)), v) * dx
            + dot(dot(u, nabla_grad(U0)), v) * dx
            + invRe * inner(nabla_grad(u), nabla_grad(v)) * dx
            + dolfin.Constant(b0_2) * dot(dot(u_n, nabla_grad(u_n)), v) * dx
            + dolfin.Constant(b1_2) * dot(dot(u_nn, nabla_grad(u_nn)), v) * dx
            - p * div(v) * dx
            - div(u) * q * dx
            - dot(f, v) * dx
            - shift * dot(u, v) * dx
        )
  • The equations are implemented using a perturbation formulation:

    • the field $v(x,t)$ is decomposed as $v(x,t) = V(x) + v'(x, t)$,
    • $V(x)$ is computed first,
    • then, we can compute the time evolution of $v'(x,t)$.
  • To some extent, the toolbox aims at making the equations, numerical integration schemes and solvers replaceable by user-defined ones.

Clone this wiki locally