(82) |

where , and is the solution of the Euler equation. Here stands for the variables and . The Euler equations in conservation form are written as

(83) |

where

(84) |

and where the matrices can be found, for example, in Hirsch [12]. An important property of the equation that we use here is

(85) |

The change in the flux vector satisfies,

(86) |

and similar expressions for . The equation for the perturbation quantities reads

(87) |

or equivalently,

(88) |

Now consider the following identity which follows from integration by parts,

(89) |

and similar integrals for the and terms. Combining these identities we arrive at

(90) |

for an arbitrary . We will use the notation

(91) |

and note that is the normal flux at the boundary which has the form, see Hirsch [12],

(92) |

and at a wall where , it reduces to

(93) |

We have following (84),(86) and its analog for the terms, and

(94) |

Combining the last equalities and from (75), we get

(95) |

where we used the notation , and . The wall boundary condition

(96) |

becomes upon perturbation

(97) |

and as before we transfer this boundary condition to the original boundary ,

(98) |

Collecting only the terms we get

(99) |

The variation of the functional

(100) |

will be simplified by adding (90) to it, but with a choice of which makes the volume integral vanish. Thus, we assume that

(101) |

Using (90),(95) it leads to

(102) |

Now we come to use the boundary conditions for . We begin with the far field . We assume that the boundary conditions there are given in terms of characteristic variables and assume that is the matrix such that are the characteristic variables. We write the far field term as

(103) |

We distinguish the following cases.

(104) |

In summary, the boundary conditions for are

(105) |

With this choice for together with the interior equation (101) we
get that involves integrals depending on and
and not on terms.
Rearrangement by using integration by parts gives,

(106) |

The gradient of the functional in this case is therefore given by

(107) |