I’m trying to solve a pde optimization problem governed by the Navier-Stokes equations. My goal is to minimize the recirculation area in the domain. I would like to define the functional as:
I’ve also tried the function .project() in order to extract the first component of u_n.
where
V = VectorFunctionSpace(mesh, 'CG', 2)
u_n = Function(V, annotate=annotate)
this gives as error:
ValueError: Invalid type conversion: f_91 / 0.001 can not be converted to any UFL type.
My first idea was to define the functional as the integral of the indicator function on the subdomain where u_n[0]<0., i changed it using tanh to make it differentiable.
Do you have any idea on how i have to treat u_n in order to make it work?the best thing would be to use the indicator function as integrand, but also a solution for the smoothed one would be great.
Thank you!!!