**4. Numerical scheme**

#### **4.1 State equation**

The state equation is solved by using a method of ℙ<sup>1</sup> discontinuous Galerkin in space and implicit finite difference in time. The fluid velocity is very high in relation to its thermal conductivity. To stabilize the induced oscillations, streamline diffusion [12] is introduced in the scheme; hence the solved state equation is as follows:

$$\frac{\partial T}{\partial t} - k\Delta T + u.\nabla T + \underbrace{\frac{H}{|u|}u\Delta(uT)}\_{\text{streamline diffusion}} = f\psi\_1 + U\psi\_2. \tag{37}$$

allows to do the domain meshing, the computation, and the post-processing of the solution. The numerical code is run on a computer of characteristics ProBook 250 G2, processor Intel(R) Core(TM) I5-5200U CPU @ 2.20 GHz 2.20 GHz, and RAM

This section presents numerical tests to illustrate the validity of our approach.

The initial temperature is always constant and equal to *T*<sup>0</sup> ¼ 30°*C*. The initial

*Tin* ¼ 30°*C*, while the velocity profile is described by the parabolic function:

*<sup>h</sup>* **<sup>x</sup>***;* **<sup>y</sup>***; <sup>t</sup>* <sup>¼</sup> *<sup>u</sup>*max <sup>∗</sup> **<sup>y</sup>** <sup>∗</sup> <sup>2</sup> � **<sup>y</sup>** *<sup>m</sup>:<sup>s</sup>*

*u*max is the maximal value of the velocity. At the outflow boundary, mixed boundary conditions are used with *<sup>α</sup><sup>T</sup>* <sup>¼</sup> <sup>10</sup>�<sup>8</sup> and *<sup>α</sup><sup>u</sup>* <sup>¼</sup> <sup>10</sup>�8. The velocity source at

*f* <sup>1</sup> ¼ ð Þ 0*;* �*v*max *m: s*

area is equal to *Td* ¼ 30°*C*, and the target control is of *Ud* ¼ 0°*C:s*

*tol* ¼ 0*:*02, and the step of the descent gradient algorithm by *τ* ¼ 0*:*5.

with *v*max . 0. For the optimal control, the target temperature in the observation

We assume that hot water is discharged in Ω<sup>1</sup> by power plants. The distribution of the water temperature at different time steps is shown in **Figure 5**. The flow velocity is presented in **Figure 6**. It can be observed that flow displaces the thermal

In **Figure 7**, we present the influence of different discharge rates on the thermal plume area. For low rates, we observe a high temperature far from the discharge area. However, for high rates, the temperature seems to be high near the emission zone and small far from the discharge zone. In this last case, the polluted area is

**Parameters Notation Value Unit** Viscosity *ν* 8*:*84 ∗ 10�<sup>4</sup> *m*<sup>2</sup>*:s*

Thermal diffusion *k* 1*:*5 ∗ 10�<sup>7</sup> *m*<sup>2</sup>*:s*

efficiency ratio of the objective functional is defined by *β* ¼ 1. The time step is set to Δ*t* ¼ 0*:*1 *s*. The stopping criteria tolerance of the iterative algorithm is given by

�1. The temperature at the inlet boundary is set to

�1

�1

*:* (39)

�1. The cost-

�1

�1

*,* (40)

memory 8.00 Go.

**5. Numerical results**

velocity is given by *u*<sup>0</sup> ¼ 0*m:s*

the discharge is given by

**5.1 Thermal pollution simulation**

**5.2 Influence of the discharge rates**

more extended.

*Physical parameters of the river.*

**Table 1**

**31**

plume from the power plants to the right hand side.

The river parameters are listed in **Table 1**.

*DOI: http://dx.doi.org/10.5772/intechopen.88646*

*Optimal Control of Thermal Pollution Emitted by Power Plants*

*H* being the maximal mesh element diameter.

#### **4.2 Adjoint equation**

As the state equation, the adjoint problem is solved by using a method of ℙ<sup>1</sup> discontinuous Galerkin in space and implicit finite difference in time. Streamline diffusion is introduced in the scheme; hence the solved adjoint state is as follows:

$$\left(\frac{\partial \overline{p}}{\partial t} - k\Delta \overline{p} - u.\nabla \overline{p} + \underbrace{\frac{H}{|u|} u\Delta (u \overline{p})}\_{\text{stremilinear diffusion}}\right)(t) = \mathcal{y}\_{\text{OBS}}(T - T\_d) \left(T\_f - t\right). \tag{38}$$

#### **4.3 Navier-Stokes system**

The Navier-Stokes system is solved by means of a *P*<sup>1</sup> Lagrange finite element method for the velocity and the pressure. The following algorithm proposed by Chorin [14] is used for the time discretization:

1.Computation of an intermediate solution *u*<sup>∗</sup>

$$\frac{u^{\*} - u^{n}}{\Delta t} = -(u^{n}.\nabla)u^{n} + \nu \Delta u^{n} + \tilde{f}n,$$

2.Computation of the pressure *pn*þ<sup>1</sup>

$$
\Delta p^{n+1} = \frac{1}{\Delta t} \nabla \boldsymbol{u}^\*,
$$

3.Computation of the velocity *un*þ<sup>1</sup>

$$
\boldsymbol{\mu}^{n+1} = \boldsymbol{\mu}^\* - \Delta t \nabla p^{n+1},
$$

where *u<sup>n</sup>*, *pn*, and ~*f n*, *n* ∈ N<sup>∗</sup> , are, respectively, the approximated velocity, pressure, and source term at the *nth* time step. The mesh is frequently adapted to improve the solution efficiency. For the numerical implementation, the solver of partial differential equations FreeFem++ downloadable at http://www.freefem.org/ff++

allows to do the domain meshing, the computation, and the post-processing of the solution. The numerical code is run on a computer of characteristics ProBook 250 G2, processor Intel(R) Core(TM) I5-5200U CPU @ 2.20 GHz 2.20 GHz, and RAM memory 8.00 Go.
