Consider the implementation of the Poiseuille flow given in the FEniCSx tutorial: Test problem 1: Channel flow (Poiseuille flow) — FEniCSx tutorial (jsdokken.com)
This problem was initialized as:
from mpi4py import MPI
from petsc4py import PETSc
import numpy as np
import pyvista
from dolfinx.fem import Constant, Function, FunctionSpace, assemble_scalar, dirichletbc, form, locate_dofs_geometrical
from dolfinx.fem.petsc import assemble_matrix, assemble_vector, apply_lifting, create_vector, set_bc
from dolfinx.io import VTXWriter
from dolfinx.mesh import create_unit_square
from dolfinx.plot import vtk_mesh
from ufl import (FacetNormal, FiniteElement, Identity, TestFunction, TrialFunction, VectorElement,
div, dot, ds, dx, inner, lhs, nabla_grad, rhs, sym)
mesh = create_unit_square(MPI.COMM_WORLD, 10, 10)
t = 0
T = 10
num_steps = 500
dt = T / num_steps
This gives the mesh size \Delta x=0.1 and Time step dt=0.02
I wanted to see whether Courant–Friedrichs–Lewy (CFL) condition is satisfied for this problem.
The question I’m having is, CFL condition is defined as C\frac{dt}{\Delta x} where C represent the maximum velocity. However, before solving this problem we do not have that value. Notice that the pressure values are given as boundary conditions (Not the velocity) in this problem.
def inflow(x):
return np.isclose(x[0], 0)
inflow_dofs = locate_dofs_geometrical(Q, inflow)
bc_inflow = dirichletbc(PETSc.ScalarType(8), inflow_dofs, Q)
So, may I please know whether there is a smart way to figure out whether the choice of \frac{dt}{\Delta x} is appropriate