Hello,
i want to minimizing a functional, subject to stationary navier stokes equation, with dirichlet inflow condition, no slip boundary condition and do nothing outflow condition. More precise
$\min_{u} J(u)=\int_{\Gamma_s} F(\frac{\partial u}{\partial n})d\Gamma_s$ where $\Gamma_s$ is a small part of the boundary
$\frac{-1}{Re}\Delta{u}+(u\nabla )u + \nabla p=0$
$-\operatorname{div}(u)=0$
$u=g\ \text{on}\ \Gamma_{in}$
$u=0\ \text{on}\ \Gamma \setminus(\Gamma_{in} \cup \Gamma_{out})$
$\frac{1}{Re}\frac{\partial u}{\partial n}=pn\ \text{on}\ \Gamma_{out}$
The underlying model problem, is the backward facing step and the cost function should minimizing the recirculation bubble.
I am able to solve the stationary problem without functional (taylorhood elements) like here:
a1 = inner(grad(u) * u, v) * dx
a2 = self.nu * inner(grad(u), grad(v)) * dx
a3 = -1 * p * div(v) * dx
cond = -1 * div(u) * q * dx
rhs = inner(self.rhs, v) * dx
F = a1 + a2 + a3 + cond + rhs
# build derivative
dw = TrialFunction(self.W)
dF = derivative(F, w, dw)
# solve the problem
nsproblem = NonlinearVariationalProblem(F, w, bc, dF)
solver = NonlinearVariationalSolver(nsproblem)
About any idea how to formulate this in Fenics or in a mathematical way, i would be apreciate.