Hi, I am trying to extract vorticity from the velocity field for fluid simulation. This is my code and extracted field. I am wondering why the vorticity field is so large that it ranges from -160 to 160. Am I doing the computation wrongly?
// We have a known mesh in the file fname mesh = gen_mesh_from_file(fnames) nodes = mesh.coordinates() cell = mesh.cells() // define function space V = VectorFunctionSpace(mesh, "Lagrange", 2) Q = FunctionSpace(mesh, "Lagrange", 1) u_n = Function(V) // We have a vector field u_n in second order VectorFunctionSpace, and we compute vorticity from that ux, uy = u_n.split(deepcopy=True) vortex = ux.dx(1)-uy.dx(0) vor = Function(Q) vor = project(vortex,Q) // We plot the vorticity np_solution = vor.compute_vertex_values() plot_fig = plt.tricontourf(nodes[:,0], nodes[:,1],cell,np_solution,levels=100,cmap=cmocean.cm.thermal)