-
Notifications
You must be signed in to change notification settings - Fork 1
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)-
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)$ .
- the field
-
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 variational formulation for an unactuated flow reads as follows:
F = 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
+ 1/Re * inner(nabla_grad(u), nabla_grad(v)) * dx
+ 2 * dot(dot(u_n, nabla_grad(u_n)), v) * dx
+ -1 * dot(dot(u_nn, nabla_grad(u_nn)), v) * dx
- p * div(v) * dx
- div(u) * q * dx- To some extent, the toolbox aims at making the equations, numerical integration schemes and solvers replaceable by user-defined ones. For example, one may override the method:
_make_varf(self, order: int, **kwargs) -> dolfin.Formfrom the abstract class FlowSolver to implement new schemes.
Powered by GitHub