Hi,
I'm very new to FEniCS and was running the 2D NS flow around a cylinder program given in section 3.4 of the FEniCS tutorial vol1. In addition to the velocity and pressure want to plot the some quantities like vorticity or enstrophy ( 0.5*(u_x^2 + v_y^2) where the solution is U = U(u,v,t) ). I tried adding
#calculate enstrophy
n_y = Expression(('0.0','1.0'),degree = 0)
uy = dot(grad(u_),n_y)
n_x = Expression(('1.0','0.0'),degree = 0)
ux = dot(grad(u_),n_x)
ens = dolfin.project(dot(ux,ux) + dot(uy,uy))
# Save to file (.pvd)
vfile << ens
to the time-stepping loop.
This does not cause an error and I was almost able to plot it in Paraview but not quite (only the first frame had color, values on the scale looked too large).
Any advice on how to properly calculate such quantities would be greatly appreciated.
Thanks,
Eric