Hi everyone,
I’m working on a final project for my Finite Element Analysis course, and I need help setting up a time-dependent 1D Burgers’ equation using FEniCSx with linear Lagrange elements and backward Euler time stepping.
The equation is:
\frac{\partial u}{\partial t} + u \, \frac{\partial u}{\partial x} = \nu \, \frac{\partial^2 u}{\partial x^2}
x\epsilon[-5,10], t\epsilon[0,10]
with:
- Initial Condition u(x, 0) = \exp\left(-\frac{x^2}{2}\right)
- Boundary conditions: homogeneous Neumann, i.e., \frac{\partial u}{\partial x} = 0 at both ends
- Diffusion coefficient: \nu = 0.1, also to be repeated with \nu = 1.0 and \nu = 0.01
Goals:
- Use CG1 elements
- Apply backward Euler time integration
- Handle nonlinearity (possibly using
NewtonSolver
withNonlinearProblem
) - Save the solution at each full second until T = 10 s
- Perform a mesh independence check (e.g., using solution at t = 0.5 s)
Questions:
- What is the best way to implement the nonlinear convective term u , \frac{\partial u}{\partial x} in FEniCSx?
- Is
NonlinearProblem
withNewtonSolver
sufficient, or should I perform manual fixed-point (Picard) iteration? - Are there any example demos in FEniCSx that are close to this setup?
- Should I worry about stability or CFL conditions despite using implicit time stepping?
Any tips, example links, or general advice would be hugely appreciated!
Thanks in advance!``