In this section, we present two numerical examples in order to validate the effectiveness of the above-presented algorithm. As a first numerical test, a Rayleigh-Bénard natural convection problem is described considering a square cavity. Later, we present a multi-region problem with a solid and a fluid domain that interact via a standard conjugate heat transfer model. For each application, we recall the objective functional, the control term in the state equations, and the corresponding boundary conditions. Numerical results are then compared with already published works with the same problem setting.
4.1. Rayleigh-Bénard Problem
For the first numerical test, we refer to the example reported by Lee [
3], where a vorticity minimization has been studied on a square domain. Specifically, the natural convection obtained from the Rayleigh-Bénard configuration has been simulated with both a distributed and a Neumann boundary control for the temperature equation. Among the several cases reported in [
3], we selected two of them that present different behaviors of the control and the optimal solution. Therefore, after a comparison of the uncontrolled solution, the cases with
and
will be discussed (same values have also been considered for the Neumann case, i.e. for
).
In
Figure 5, the domain
is shown, with the partition of the bottom boundary into two sections,
and
. The boundary conditions for the temperature field are as follows: a homogeneous Neumann is enforced on
and
; on
we have a homogeneous Dirichlet boundary condition, while on
we have a fixed temperature value
. Lastly, on
we have the nonhomogeneous Neumann boundary condition that acts as control.
The grid used for the simulation consists of elements for the FE code and elements for the FV code, both equally spaced. This discretization setup leads to a very similar amount of degrees of freedom for each code (the finite element grid is indeed equipped with biquadratic elements, therefore implying 1681 dofs).
In the case of the distributed control, we fix , while for the Neumann boundary control we set . Regarding the material properties of the fluid, we set .
We recall the optimality system in strong form for this problem, given by (
28), (
29) and (
34), along with the corresponding boundary conditions reported in
Table 1.
4.1.1. Uncontrolled Case
The results for the uncontrolled case (namely, the control variable is set to zero) are shown in
Figure 6. The contour plot of the temperature field is shown on the left side, while the velocity field is shown on the right.
4.1.2. Distributed Control
Figure 7 shows the results for the temperature fields in the distributed control case, compared to the same contour plot from [
3] which is shown with a dashed line. We observe that both temperature distributions get closer and closer to a purely vertical temperature gradient. It appears that the reduction in the horizontal temperature gradient leads to a temperature profile and hence a buoyancy force that is nearly constant along a single horizontal line. This evens out the horizontal differences in buoyancy and contributes to the minimization of the vorticity. A good agreement with respect to the reference paper can be observed for the isolines of the temperature field, in particular for the lowest
value.
The contour plot of the control
Q is shown in
Figure 8, on the left for the case with
and on the right for
. We recall that the control
Q acts as the volumetric source of the temperature equation, and we can see the different distributions for the two values of
. The lower the regularization factor
, the more the
Q field concentrates in magnitude at the bottom of the domain.
Figure 9 shows the adjoint velocity vector glyphs for each controlled case.
Similarly,
Figure 10 shows the velocity vector glyphs for each controlled case. Note that in this case we have rescaled the velocity profiles by a common scalar, in order to visualize the overall reduction in magnitude.
Specifically, the computed values of
are reported in
Table 2, where it can be noticed that the velocity magnitude decreases by increasing the control contribution, i.e. with a lower
value.
In
Table 3, we report the value of the objective term, the regularization term, and the total functional for the distributed case, with a comparison to the same results from [
3]. In the last column, we have reported the relative error of the total functional, computed as
where the subscripts
C and
R stand for
Coupled and
Reference, respectively. For the same reason, the results presented in this work are labeled with
C in the table. As we can see, the proposed algorithm is able to reproduce the same values of the cost functional terms with an error below
, validating the accuracy of the numerical code coupling. A good agreement is evident in each of the above cases. Slight differences appear for the uncontrolled case, while the results of the code coupling algorithm become closer and closer to the literature ones by decreasing the control parameter
.
4.1.3. Neumann Boundary Control
Regarding the Neumann boundary control, in
Figure 11 we plot the control
along the boundary
for each controlled case (
and
). In this case, this control represents the Neumann boundary condition for the temperature equation, which can be understood as the wall heat flux provided in order to minimize the vorticity. For the highest
case the control
seems to grow monotonically, while for
we can notice a peak in the left part of
, which is attached to
where we have a fixed temperature boundary condition. We remark that on the point between
and
the adjoint temperature
is zero. Hence,
cannot help pushing the control at this point and so the control
tends to have a local maximum nearby in order to compensate for the lack of push.
In
Figure 12, the contour plot for the temperature is reported for the Neumann boundary control case for each
, together with the reference case [
3] represented by dashed lines.
Some discrepancies appear between the solid isolines and the corresponding dotted lines as reported in [
3], especially for the case
in the bottom part of the domain, where indeed we have the control
. This situation improves with the lower
.
The velocity fields are reported in
Figure 13 for both controlled cases. Moreover, in
Table 4 we report a comparison of the maximum value of the velocity magnitude for the computed cases, and we notice a difference of one order of magnitude between the results of the two
values.
In
Table 3 we report the value of the objective term, the regularization term, and the total functional for the Neumann boundary control case, with a comparison of the same results from [
3].
Differently from the distributed control case, the values computed in
Table 5 for the Neumann control are sometimes significantly distant from the literature. Anyhow, the total value of the functional
with the proposed algorithm is smaller than the one obtained in [
3].
4.2. Solid/Fluid Heat Transfer Problem
In the second test, we reproduce the numerical examples proposed in [
4], which we use as a benchmark. Here a fluid domain exchanges heat with a neighboring solid region through a common boundary. This configuration is typically referred to as a conjugate heat transfer problem. The geometry is described in
Figure 14, which shows two neighboring regions,
for the solid and
for the fluid. The boundary walls of the fluid domain are given by
and
, which is the common interface with the solid. On the walls a no-slip condition is enforced, i.e., a homogeneous Dirichlet boundary condition for the velocity field. On the other hand,
and
are the inlet and the outlet boundaries of the channel through which the fluid flows. We impose a Dirichlet boundary condition at the inlet and a stress-free condition at the outlet.
The boundaries of the solid domain are , , and . The boundary conditions for the solid region are given by a Neumann boundary condition for each external edge, while on the common interface we enforce the continuity of the temperature and of the heat flux between the two domains. The aforementioned benchmark case has been obtained within a finite element environment. This presents some challenges when transitioning to the finite volume method.
In the FE formulation, the point at the junction belongs to boundary sections that require a temperature Dirichlet condition on one side and a Neumann condition on the other. In the FE context with Lagrange shape functions, the point itself is a degree of freedom carrier, and the Dirichlet condition can be enforced in essential way.
On the other hand, in the FV framework, the degrees of freedom are given by the cell centers, and a Dirichlet boundary condition involves the face of an element. In this situation, the intersection point will not behave in the FV code in the same way as in the FE code. Therefore, the FE versus the FV solutions show a rather different behavior at this intersection point. We have observed with auxiliary numerical tests that the results in [
4] have been obtained with a mesh size that yields a FE solution that is quite far from grid convergence. In spite of that, in order to compare with the reference paper values, we decided to choose an FV mesh with approximately the same dof count. At such a resolution, the Dirichlet value computed by the FV code on the lower-left corner of the solid domain turns out to be quite far from the FE value. We were able to fix this difference by simply enforcing a Dirichlet condition also on the first solid element above
.
We use a
element grid for the FE code and a similar-sized (from the d.o.f. point of view)
cell grid for the FV code to replicate the results proposed in [
4]. The latter grid is divided as a
grid in the fluid region and a
grid in the solid region, refined towards the solid/fluid interface
. Concerning the thermal diffusivity, we have
and
, while the kinematic viscosity for the momentum equations is
. Lastly, the volumetric heat source in the solid region is set
.
We recall the optimality system in strong form for this problem, given by Eqs. (
32), (
33) and (
34), along with the boundary conditions in
Table 6:
Notice that the state equations are reported explicitly over the two regions since OpenFOAM solves in a segregated way, while the adjoint uses the monolithic formulation. We also remark that, as in [
4], the Dirichlet condition on the inlet velocity
is enforced only in the normal direction.
4.2.1. Definition of the Target Temperature
Following [
4], the target of the control problem is the temperature profile
on
that is obtained with an analytical input velocity
, i.e. a Poiseuille flow. In the following, we refer to this as the uncontrolled solution. The target
is then fed to the optimal control system. For the solution of the optimality system, the first control in the steepest descent method is initialized with a different inlet boundary condition for the velocity field, i.e.
, and therefore the control acts on the interface boundary to reach a velocity field that matches the temperature distribution
as close as possible. It appears clear that the optimal solution should provide a control on the boundary that reproduces the original boundary inlet condition for the velocity field
. In this way, it is easy to check the quality of the optimal control solution. Of course, due to the presence of a regularization term, i.e. a parameter
, the control is not able to reproduce exactly that original velocity profile, but it provides the closest solution according to the value of
.
In
Figure 15, we report the target temperature solution. On the left we show the overall behavior as a contour map and on the right we plot the trend on a portion of the interface
, which corresponds to the target temperature
. We recall that the objective functional was defined only on a portion of the solid/fluid interface, i.e. the region
. The isolines in the left figure confirm the interface conditions of the CHT model, i.e. the continuity of the temperature and the change in slope due to the continuity of the heat flux across different conductivities.
4.2.2. Dirichlet Boundary Control
In
Figure 16, the Dirichlet velocity control on
is reported as a solid line for two controlled cases. In particular in Case 1 we set the pair
to
, while in Case 2 we set
. The comparison with the reference data of [
4] is shown with circular markers.
We notice a good agreement between our results and the reference data for each controlled case. The inlet velocity control that we obtain is not symmetric with respect to the midpoint of . In fact, since we want to match the temperature on a portion of , and since the solid has a volumetric heat source, we expect to have an advection contribution of the fluid that cools down the solid, i.e., a velocity field which is able to remove the heat generated. Therefore, the peak of the velocity profile is shifted towards the interface boundary. We also notice, as expected, that a lower combination of the values of yields a velocity profile closer to the target one represented by the dashed line.
In
Figure 17, we show the temperature profiles on
and the corresponding relative percentage errors with respect to the target value for both controlled cases. The temperature profile obtained with the initial guess of the inlet velocity
is also reported. Regarding the relative error with respect to
, we define
where
corresponds to the two controlled cases.
As expected, the numerical temperature field does not coincide with the target temperature since we weight the control contribution with the parameters. As a result, the case with the lowest values provides a temperature distribution on that is closer to . In fact, Case 2 presents a maximum error below , almost three times less than Case 1, which reaches a value close to . This aspect is confirmed later when we provide the values of the cost functional terms, specifically the objective term.
The adjoint velocity and the adjoint temperature have been reported in
Figure 18 for both controlled cases. More precisely, we report the vector glyph for the adjoint velocity on the left and the contour map for the adjoint temperature on the right. With regards to this latter plot, the adjoint temperature is multiplied by
, since its absolute values are relatively low.
As we know from the literature [
4,
42], the adjoint velocity of a fluid channel configuration with an inlet and an outlet behaves like a flow moving in the opposite direction. Indeed, the adjoint inlet is now
, while the other boundaries behave as a wall for the adjoint velocity, since velocity Dirichlet boundary conditions are enforced on them.
In analogy with the previous test, in
Table 7 we report the values of the cost functional terms, both for the uncontrolled case and for the two controlled cases. Unlike the boundary control of the Rayleigh-Bénard application, in this case the boundary control is in
, hence we take into account two contributions for the regularization part, which are given in separate columns.
The table confirms the expected behavior of the functional value in the last column, showing a lower number for the better controlled case, i.e. the one with the lowest . In fact, with the latter values of , we obtain a total functional almost six time lower than the other controlled case. This reduction is mainly due to the objective term, which has a decrease of one order of magnitude, despite the regularization terms being similar.