Neko-TOP
A portable framework for high-order spectral element flow toplogy optimization.
Loading...
Searching...
No Matches
Adjoint sensitivity analysis

Adjoint fluid

In neko, and by extension neko-top, we solve the Navier–Stokes equations

\[ {\frac {\partial \mathbf {u} }{\partial t}} + (\mathbf {u} \cdot \nabla)\mathbf {u} = -\nabla p +{\frac {1}{Re}}\nabla ^{2}\mathbf {u} + \mathbf{f}, \text{ in } \Omega,\\ \nabla \cdot \mathbf {u} = 0, \text{ in } \Omega, \]

where \(\mathbf {u}(\mathbf{x},t)\) denotes the velocity field, \(p(\mathbf{x},t)\) the pressure field, \(\mathbf{f}\) a forcing term and where \(Re\) denotes the Reynolds number. The governing equations are subjected boundary conditions on

\[ \frac{1}{Re} \nabla \mathbf{u} \cdot \mathbf{n} -p \mathbf{n} = 0, \text{ on } \Gamma_O, \\ \mathbf{u} = \mathbf{u}_\text{in}, \text{ on } \Gamma_D, \\ \]

where \(\Gamma_N\) and \(\Gamma_D\) denote outflow and dirichlet boundaries respectively.

A common formulation of the adjoint Navier-Stokes equations reads

\[ {-\frac {\partial \mathbf {u}^\dagger }{\partial t}} + (\nabla \mathbf {u})^T \mathbf {u}^\dagger - (\mathbf {u} \cdot \nabla) \mathbf {u}^\dagger = -\nabla p^\dagger +{\frac {1}{Re}}\nabla ^{2}\mathbf {u}^\dagger + \mathbf{f}^\dagger, \\ \nabla \cdot \mathbf {u} ^\dagger= 0, \]

where where \(\mathbf {u}^\dagger(\mathbf{x},t)\) denotes the adjoint velocity field, \(p^\dagger(\mathbf{x},t)\) the adjoint pressure field and \(\mathbf{f}^\dagger\) denoting a forcing term applied to the adjoint system which generally arises as a consequence of objective functions being evaluated.

The corresponding boundary conditions generally read

\[ \frac{1}{Re} \nabla \mathbf{u}^\dagger \cdot \mathbf{n} -p^\dagger \mathbf{n} + (\mathbf{u} \cdot \mathbf{n}) \mathbf{u}^\dagger = \mathbf{0} \text{ on } \Gamma_N, \\ \mathbf{u} = \mathbf{0}, \text{ on } \Gamma_D. \\ \]

The spectral element method which underpins neko solves the above system of equations using the weak formulation, which has important implications when solving the adjoint system. Primarily, when deriving the adjoint system in strong form, one introduces additional boundary terms on Neumann boundaries, and more importantly, one applies the divergence free condition strongly.

An alternative to the above adjoint system is to remain in weak form and not integrate the convective term by parts, resulting in no additional boundary terms, and more importantly, no pointwise application of the divergence free condition.

This alternative system is what is implemented in neko-top, which reads (in weak form),

\[ -\int_\Omega \mathbf{v}\cdot {\frac {\partial \mathbf {u}^\dagger } {\partial t}} + \int_\Omega \mathbf{v}\cdot (\nabla \mathbf {u})^T \mathbf {u}^\dagger + \int_\Omega \nabla \mathbf{v}\cdot (\mathbf {u} \otimes \mathbf {u}^\dagger ) = -\int_\Omega \mathbf{v}\cdot \nabla p^\dagger +{\frac {1}{Re}}\int_\Omega \nabla \mathbf{v}\cdot \nabla \mathbf {u}^\dagger + \int_\Omega \mathbf{v}\cdot \mathbf{f}^\dagger, \\ \int_\Omega q \nabla \cdot \mathbf {u} ^\dagger= 0, \]

where \(\mathbf {v}\) is a test function.

Adjoint scalar

The adjoint scalar equation takes the following form

\[ {\frac {\partial \phi }{\partial t}} + (\mathbf {u} \cdot \nabla)\phi = {\frac {1}{Pe}}\nabla ^{2}\phi , \text{ in } \Omega,\\ \]

where \(\phi(\mathbf{x},t)\) denotes the scalar field, and where \(Pe\) denotes the Peclet number. In the context of conjugate heat transfer, the velocity equation is often coupled to the scalar equation through the Boussinesq approximation for instance, however, in lieu of this coupling the scalar is often referred to as a "passive scalar" to imply the one way coupling.

In neko-top the adjoint scalar reads (in weak form),

\[ -\int_\Omega \psi\cdot {\frac {\partial \phi^\dagger } {\partial t}} + \int_\Omega (\nabla \psi \cdot \mathbf {u}) \phi^\dagger = {\frac {1}{Pe}}\int_\Omega \nabla \psi \cdot \nabla \phi^\dagger,\\ \]

where \(\phi(\mathbf{x},t)^\dagger\) denotes the adjoint scalar field and where \(\psi\) is a test function. In addition, the perturbation of the term \((\mathbf {u} \cdot \nabla)\phi\) results in an additional term in adjoint velocity momentum equation, which now reads

\[ -\int_\Omega \mathbf{v}\cdot {\frac {\partial \mathbf {u}^\dagger } {\partial t}} + \int_\Omega \mathbf{v}\cdot (\nabla \mathbf {u})^T \mathbf {u}^\dagger + \int_\Omega \nabla \mathbf{v}\cdot (\mathbf {u} \otimes \mathbf {u}^\dagger ) \underline{+ \int_\Omega (\mathbf{v}\cdot \nabla \phi ) \phi^\dagger} = -\int_\Omega \mathbf{v}\cdot \nabla p^\dagger +{\frac {1}{Re}}\int_\Omega \nabla \mathbf{v}\cdot \nabla \mathbf {u}^\dagger + \int_\Omega \mathbf{v}\cdot \mathbf{f}^\dagger. \]

It can be seen from the above equations that due to the one way coupling between \(\mathbf{u}\) and \(\phi\), when solving the forward problem one must first solve for \(\mathbf{u}\) and then solve for \(\phi\). However, in the adjoint the opposite occurs as the equation for \(\mathbf{u}^\dagger\) depends on \(\phi^\dagger\), hence in neko-top we first solve for the adjoint scalar and then solve for the adjoint velocity.

Immersed Boundary Methods

Following a Brinkman style immersed boundary method, the presence of an immersed object is imposed by the Brinkman forcing term \(\mathbf{f} = - \chi \mathbf{u}\), where \(\chi\) is the spatially dependent Brinkman coefficient, satisfying

\[ \chi = \begin{cases} 0 & \text{in the fluid region,} \\ \overline{\chi} & \text{in the solid region.} \end{cases} \]

Considering \(\overline{\chi}\) to be a large value, this discontinuous forcing term models a momentum loss in solid region, and thereby simulating porous media with very low permeability. It is worth noting that while the Brinkman penalization method is rooted in the idea of modelling solid regions as porous media with vanishing permeability, the approach proposed by Goldstein frames the interaction of the solid on the fluid as a control problem, where the feedback force is tuned to drive the velocity to zero in the solid region. Regardless of their different motivation, both methods result in a similar mathematical structure. More information regarding the mapping of \(\chi\) can be found in Mapping cascade.

Note
In the future we will provide a full adjoint derivation in this section of the theory guide. This will tie together all aspects from the mapping, to how these terms arise etc. For now we are simply documenting the equations being solved.