Article Diffuser and Nozzle Design Optimization by Entropy Generation Minimization

Abstract: Diffusers and nozzles within a ﬂow system are optimized with respect to theirwall shapes for a given change in cross sections. The optimization target is a low value ofthe head loss coefﬁcient K, which can be linked to the overall entropy generation due to theconduit component. First, a polynomial shape of the wall with two degrees of freedom isassumed. As a second approach six equally spaced diameters in a diffuser are determinedby a genetic algorithm such that the entropy generation and thus the head loss is minimized.It turns out that a visualization of cross section averaged entropy generation rates along theﬂowpathshouldbeusedtoidentifysourcesofhighentropygenerationbeforeandduringtheoptimization. Thusit willbe possibleto decide whether a givenparametric representation ofa component’s shape only leads to a redistribution of losses or (in the most-favored case) tominimal values for K. Keywords: second law analysis; entropy generation; optimization;diffuser 1. Introduction


Introduction
Diffusers and nozzles may either be the last part of a flow system, releasing the fluid into the ambient, or a conduit component within a flow system.These are two very different situations and as a consequence optimization occurs with respect to different aspects.The main purpose of using an end diffuser may be a high pressure recovery, while for a nozzle, however, it may be the homogeneity of the velocity profile, as for example with a nozzle in an open wind tunnel.
When diffusers and nozzles are internal conduit components within a flow system, their purpose is to increase or decrease the flow cross sections as shown in Figure 1.On a length L the hydraulic diameter changes from D hu to D hd with the indices u and d for upstream and downstream.Then the otherwise fully developed flow is influenced by the components within an upstream and downstream length L u and L d , respectively.

Figure 1.
Basic design of diffusers and nozzles within a flow system; 1 , 2 locations beyond the influence of the conduit component.1 2 With D hu , D hd and L prescribed, the open question is which shape of the wall (different from the straight walls in Figure 1) will be the best.Here "best" means what can result in the least loss of total head due to the presence of the diffuser or nozzle.This is the situation analyzed here: How to find the optimum conduit design by varying the wall shape of an internal diffuser or nozzle with prescribed values of D hu , D hd and L for a certain Reynolds number of the flow.The optimization target is to minimize the head loss coefficient with a value as low as possible.The main purpose, however, is not only to provide the information about the best diffuser or nozzle design but also to introduce a method for a systematic optimization based on the least entropy generation in the flow field.

Head Loss, Dissipation and Entropy Generation
Diffusers and nozzles, used as internal flow system components, are characterized by their head loss coefficient K.This coefficient describes the conversion of mechanical energy to thermal energy by a dissipation process.
A reasonable definition of K therefore is with ϕ as specific dissipation due to the presence of the conduit component in the flow system.
From a thermodynamic point of view dissipation of mechanical energy corresponds to a generation of entropy by this irreversible process.Thus K can also be expressed in terms of the specific overall entropy generation s including the mean temperature T m , i.e., Details of how to determine ϕ and s will be given later.First, four general remarks should be made with respect to the above Equations ( 1) and (2).
1.A K-value, defined for all kinds of conduit components like bends, trijunctions but also straight pipe segments, often is defined in terms of pressure differences that occur along that component.For example a straight pipe of diameter D and length L is characterized by a friction factor f with assuming that the flow is fully developed and therefore dp/dx = Δp/L holds.This definition, as well as all definitions with Δp as "pressure loss" are appropriate only in special situations.We recommend to use the definition of K according to (1) for all conduit components and as the only version to define a head loss coefficient, see [1] for more details, as well as the following point.
2. For conduit components with different cross section areas upstream and downstream (like with diffusers and nozzles, c.f. Figure 1) there should be a careful interpretation with respect to pressure differences which are often measured in order to characterize the components.If Δp = p 2 − p 1 is measured with p 1 and p 2 , being the pressure in cross sections 1 and 2 in Figure 1, there is • a change of pressure due to the change of cross section, Δp 12 CS , corresponding to the difference in kinetic energy in both cross sections.
• a loss of total head due to losses in the flow field, Δp 12  L .This Δp 12 L can formally be subdivided into two parts, i.e., Δp 12 L = Δp 12 L,AT + Δp 12 L,CC .Here, Δp 12 L,AT is the frictional loss in the adjacent tangents (index: AT) from the conduit component to the cross section 1 and 2 , respectively.It is determined under the assumption of a fully developed and undisturbed flow in the tangents upstream and downstream.Then Δp 12 L,CC corresponds to the loss of total head due to (not in) the conduit component (index: CC).It can be uniquely linked to the head loss coefficient K.It is the only part in that is subject to changes when the shape of the diffuser or nozzle is changed (keeping D hu and D hd unchanged), i.e., when an optimization is performed.This is sketched in Figure 2 where X is a parameter of the geometry that can be altered during the optimization process.With the definition of Δp 12 L,CC given above this part of the measured Δp (corresponding to the head loss coefficient) is independent of the exact location of 1 and 2 in Figure 1, provided both cross sections are outside the zones of influence upstream and downstream of the component.
In Figure 2b it has been anticipated that in a nozzle Δp 12 L,CC can be negative, i.e., the nozzle may reduce the head loss in the adjacent tangents compared to the assumed loss due to a fully developed and undisturbed flow.

Figure 2.
Typical overall pressure difference and its interpretation according to (5) for an optimization with respect to an optimization parameter X (not specified here).

Diffuser
Nozzle 3. Losses from a thermodynamic point of view are best described as losses of exergy, sometimes called losses of available work (exergy: maximum theoretical work obtainable from the energy interacting with the environment to equilibrium).In a power cycle, for example, this is especially important, since lost exergy is no longer available in the turbine of that cycle resulting in a reduced cycle efficiency, see [2] for a comprehensive discussion of this issue.
Dissipation of mechanical energy, which is directly linked to the head loss coefficient in (2), is with T m as mean temperature at which the dissipation process occurs.The specific entropy generated, s, is related to the corresponding specific exergy loss e L by s = e L T 0 (7) so that the relation between ϕ and e L is Here T 0 is the environmental temperature which occurs in the so-called Gouy-Stodola theorem.
For these basic thermodynamic relations see standard textbooks like [3][4][5].Note that all specific values introduced so far (ϕ, s, e L ) are their absolute values referred to the mass or more convenient for an interpretation their absolute values per time, i.e., rates Φ, Ṡ, ĖL , referred to the mass flux ṁ in the flow system.
Since according to (8) it depends on the temperature level T m how much exergy is lost with a certain dissipation the head loss coefficient K defined in (1) is not a general measure for the exergy lost in a conduit component.
Hence, in addition to K a second coefficient called exergy loss coefficient should be introduced.
With K E defined as there now are two loss coefficients K and K E related to each other by If, for example, the head loss occurs in a power cycle at an upper temperature level T m , the temperature ratio may be T m /T 0 = 3.Thus, the exergy loss is only one third of what it would be if the same flow would have the ambient temperature T 0 instead of T m .
4. During the optimization process described hereafter, K-values of the diffusers and nozzles will have to be determined.According to (2) this can either be done by the determination of ϕ (dissipation rate per mass flux) or of s (entropy generation rate per mass flux).We definitely prefer s since it is the more fundamental quantity of the conversion process (mechanical → thermal energy).A further argument in favor of the specific entropy is that then a common quantity exists when also losses (of exergy) in a superimposed heat transfer process are accounted for, see [1] for more details of this convective heat transfer situation.

Review of Literature
The scope of this paper is to provide a method for the design optimization of conduit components like diffusers and nozzles, based on the head losses involved.As shown in the previous section this can be accomplished by determining the entropy generation.Since s is closely related to the second law of thermodynamics this method is called second law analysis (SLA).A literature review with respect to this special aspect should, however, be accompanied by references about entropy in general.

Literature about Entropy in General
There is a vast amount of textbooks and monographs about thermodynamics which all have major parts with respect to entropy in it.Special books about entropy range from easy to read introductions like [6][7][8] over more comprehensive books like [9] to very challenging ones like [10,11].

Literature about Entropy Generation
The SLA approach in which irreversibilities are identified and determined is described and applied in fundamental studies like [12][13][14], for example.Almost all studies that incorporate a second law analysis refer to one of the several important contributions by Adrian Bejan, see [12,[15][16][17].In these studies entropy generation is often determined as an integral value within a finite solution domain, either by global balances or by integration of the local entropy generation density.A general and systematic comparison of various approaches can be found in [18,19].
In general, one can analyze a system as a whole or have a closer look to single components within a complex system.Studies about whole systems like [20][21][22] aim at improving the system performance, though there is no systematic optimization strategy involved, like in the special study [23], for example.Detailed studies about single components can be found in [24], where a vortex tube is analyzed, in [25] with a study about a crossflow heat exchanger, or in [26] where rectangular ducts are investigated, just to mention a few typical investigations out of the big number of studies based on the SLA approach.

Literature about Optimization Processes
Optimal shapes for diffusers have been investigated in several publications.Almost every optimization is based on the so-called pressure recovery factor c p which is basically the pressure difference between the outlet 2 and the inlet 1 , non-dimensionalized with the product of the kinetic energy based on the cross section averaged velocity at the inlet and the density, i.e., the "dynamic pressure".When the flow is fully developed at 1 and 2 a diffuser optimized for a maximum c p will also be a diffuser with a minimal value of K. Thus, designs from other publications can be used to compare the optimal designs found here.Since, however, c p also includes losses in the tangents and the difference in kinetic energy, see (5), the sensitivity of c p with respect to changes in the geometry is rather small.If K is used instead, a higher precision can be expected, since no use of averaged values, e.g., pressure or kinetic energy, at the inlet or outlet is made and integrating over a volume will generally be more accurate than the determination of values at two distinct positions.
Detailed information about 2-dimensional diffuser optimization can be found in [27] and [28], where c p is optimized using the standard k − turbulence model with wall functions and a similar parameterization as discussed here for the wall shape.In [27] the so-called Response Surface Approximation of c p based on a relatively small number of model evaluations is used as a surrogate for repetitive model evaluations during a conventional search strategy.Different from [27], a genetic algorithm is used in [28] in order to test a large variety of polynomial wall parameterizations.
An extensive overview about optimization in research and industrial relevant applications using CFD is given in [29], where various optimization methods are explained together with illustrative examples.Especially the adjoint method is discussed in detail.

Entropy Generation as an Optimization Criterion
For diffusers and nozzles, dissipation and therefore the entropy generation due to this process is the crucial quantity that should be optimized, i.e., minimized in the situation under consideration.Before a strategy with respect to this optimization will be discussed in the next section, we first show in detail how the overall entropy generation due to the components can be determined.

Determination of the Overall Entropy Generation Rate
As indicated in Figure 1 already, the conduit component has an influence on the upstream and downstream flow, so that corresponding lengths L u and L d have been introduced.Within these lengths the influence of the component can be felt by the otherwise fully developed and undisturbed flow.In order to have a clearly defined length of influence upstream and downstream, related lengths Ld and Lu are introduced.They are defined as those lengths up to which 95% of the overall upstream or downstream influence occurs and are explained in more details later.
Altogether the situation sketched in Figure 3 appears: A part of the flow field, V c , being the interior of the conduit component and upstream as well as downstream parts of it, V u and V d , have to be analyzed with respect to the (additional) entropy generation due to the component.
This entropy generation happens locally due to velocity gradients under the action of a finite molecular viscosity μ.Its amount, see [5] for example, in Cartesian coordinates is: This local value (with units W/( 3 mK)) when integrated over a certain volume of the flow field results in the overall entropy generation rate Ṡ or its specific value s = Ṡ/ ṁ in this volume.Outside of the diffuser or nozzle, however, only the additional entropy generation has to be determined, i.e., only that parts of Ṡ that do not exist in the fully developed and undisturbed flow in the adjacent tangents upstream and downstream.In Figure 4 the relevant entropy generation rate Ṡ = ϕ ṁ/T m with its three parts is shown as the integral over Ṡ and ( Ṡ − Ṡ 0 ), respectively.Away from the conduit component ( Ṡ − Ṡ 0 ) asymptotically tends to zero so that a finite value has to be set when the upstream and downstream lengths of influence should be determined.
We therefore define Lu and Ld as those lengths of influence within which 95% of the additional entropy generation occurs.These are characteristic lengths.The integration to determine Ṡ according to Figure 4, however, still has to be performed over the entire length of influence, i.e., over L u > Lu and L d > Ld .
With Ṡ according to (11) Ṡ can only be determined for laminar flows.When the flow is turbulent a RANS-approach (Reynolds averaged Navier-Stokes) is appropriate and Ṡ is split into a mean and a fluctuating part: with With the numerical result from the RANS-equations ( Ṡ ) according to (13) can be determined, but not ( Ṡ ) , for which a turbulence model is required.
A simple model which basically relates ( Ṡ ) to the turbulent dissipation rate ε and which can be justified in the limit of infinite Reynolds numbers, see [30], reads Since all RANS turbulence models provide the information about the turbulent dissipation rate ε in the flow field, ( Ṡ ) can be determined and together with ( Ṡ ) used to find Ṡ for turbulent flows.
In our investigations Menter's k − ω-SST model is chosen due to its ability to integrate the Navier-Stokes equations in the low Re regime near the wall without using damping corrections and to adequately predict flow separation, see [31].Thus, our model for ( Ṡ ) is with β = 0.09.

An Example
As an example and to demonstrate which information can be extracted from the numerical solutions, the results for a certain nozzle will be discussed prior to incorporating it into an optimization process.This nozzle with circular cross sections is shown in Figure 5.The Reynolds number Re = u m D/ν is defined with upstream quantities u m1 and D 1 and is Re 1 = u m1 D 1 /ν.The (polynomial) wall shape is Four of the five constants a i are determined by with which together with L can be varied in the subsequent optimization process.The final shape is fixed, once L is chosen.Here the radius R m halfway in the nozzle is selected to be R m = 0.375D 1 and L is set to L = 2D 1 .
Figure 5. Nozzle with circular cross sections.
The main result of the second law analysis is the local entropy generation rate Ṡ according to ( 12)- (14).With the cross sectional entropy generation rate emerges, which is shown in Figure 6 for Re 1 = 50000.Far upstream and downstream these rates are constant due to the fully developed and undisturbed (turbulent) velocity profiles.Non-dimensionalized with its upstream value Ṡ / Ṡ 1 continuously grows from 1 to Ṡ / Ṡ 1 = 26.83 in this example.Here, the third part is negative since less entropy is generated downstream of the nozzle than it would be in a fully developed and undisturbed flow right from the beginning of the downstream tangent.
For the head loss coefficient we thus get, c.f. (2), for this example.The negative value of K may be unexpected.The reason again is that altogether there is a lower entropy generation than it would be in the tangents with undisturbed flow.In Figure 6 that means that the gain outnumbers the loss.This result can be cross checked by considering the pressure distribution along the flow which was discussed in detail in Section 2, c.f. (5), applying a Bernoulli equation, which takes into account all flow losses.It reads, see for example [5], In a one-dimensional version the specific kinetic energy would just be e kin = u 2 m /2.If, however, the actual time averaged turbulent velocity distribution u(r) is taken into account, we have with u = u + u and k = ( Here α = 1 accounts for deviations from the one-dimensional specific kinetic energy u 2 m /2.In our example α 1 = 1.088 and α 2 = 1.069.This shows the effect of the Reynolds number on the fully developed turbulent flow.With Re = u m D/ν = 4 ṁ/(Dμπ) the local Reynolds number increases from upstream to downstream (by a factor 2). Pipe flows for Re → ∞ approach α = 1 which is in accordance with the trend seen in α 1 = 1.088 → α 2 = 1.069.
In (23) ϕ 12 is the overall dissipation between the cross sections 1 and 2 .According to (5) it corresponds to so that we can rewrite (23) as, c.f. also (5), with Here f 1 , f 2 are the friction factors of the fully developed pipe flows, L 1 = L u ,L 2 = L d are the upstream and downstream tangent lengths, and K is the head loss coefficient of the nozzle.It can now be written as From ( 29), ( 27) and ( 28) with our numerical results we get K = −0.125 which is very close to the result K = −0.121gained by the SLA approach in (22).
It is interesting to see how sensitive K responds in our case when the kinetic energy is not calculated adequately.Table 1 shows the K-values for three ways to determine the kinetic energy (with only the first one to be adequate).
Table 1.Three ways to determine e kin in (23).

Nozzle Optimization
In Section 4.2, the nozzle according to Figure 5 was prepared to be optimized.Numerical details of the CFD solutions will be given in Section 5.1.
Since the nozzle length L and the radius R m at L/2 are variable, there are two optimization parameters X i .They should be normalized with respect to the range in which they can vary.Thus we get If L is fixed by geometric constraints already, only one parameter X2 is left.For the more general case, however, an optimization procedure has to find the lowest value of the function K = K( X1 , X2 ).
A further extension would increase the number of optimization parameters by introducing more intermediate radii that can vary like R m used so far.In Section 6.2 for a diffuser we will fix the length L and the wall shape by choosing six radii at equidistant positions on the centerline, so that K = K( X1 , X2 , . . ., X6 ) has to be analyzed with respect to its optimum.
The optimization presented here should not only show the capabilities of an optimization algorithm or the existence of a global optimum.This has been done in earlier publications of different authors already, see [27,28] for diffusers.Here, we especially want to highlight the advantages of the SLA approach using every available information of entropy generation as a field variable and the opportunities to interpret the numerical results on a sound physical background.

Numerical Details
All calculations discussed in this paper are performed using the open source CFD toolkit OpenFOAM version 1.6, see [32].The structured grid exploits axial symmetry, which is applied using OpenFOAM's wedge boundary conditions at the opposing wedge faces.The boundary condition implies a transformation leading to the appropriate gradients in Cartesian coordinates.There is an angle of five degree with only one cell layer in circumferential direction which reduces the grid size by a factor of 1/72 compared to a corresponding full grid.
The domain is discretized with 660 steps in axial and 50 steps in radial direction with a decreasing cell size towards the wall.An initial grid is set up with OpenFOAM's blockMesh utility with a constant radius in streamwise direction to be rescaled radially by a Matlab script during the optimization.This can be achieved easily, since all point coordinates are stored as a compressed ASCII file.A typical grid for a diffuser is shown in Figure 7.At the inlet, profiles for u, k and ω for fully developed flow are provided.The profiles are gained from a channel flow solution which is computed using periodic boundary conditions for u, p, k and ω.A prescribed pressure gradient is imposed in the direction of the main flow which is adapted automatically to end up with a prescribed Reynolds number.As a pressure boundary condition a fixed value is set at the exit.The coupling of pressure and velocity is done by the OpenFOAM solver application simpleFoam, which uses the SIMPLE algorithm and computes, after an in-house adaption, the integral of ( 12) in every outer iteration of the coupled solution procedure.This value is needed to indicate convergence.Convergence is met when the relative difference of Ṡ between two consecutive iterations is smaller than 1 × 10 −7 and the relative difference of the averaged inlet pressure is smaller than 1 × 10 −5 at the same time.Using residuals as a convergence criterion instead is no option since the correlation between the residuals and changes in Ṡ can hardly be predicted.
For the discretization of the equations, gradient and interpolation schemes formally of second order are used, i.e., the OpenFOAM schemes Gauss linear for the convective terms, Gauss linear corrected for the diffusive terms and Gauss linear for the gradients.The midlength diameter R m varies within [0.3225D 1 , 0.4865D 1 ] so that X2 = (R m /D 1 − 0.3225)/0.164.For X1 we take 18 values, for X2 only 9, all of which equally distributed between 0 and 1 for X1 and X2 , respectively.In Figure 8   Here optimization will be performed by calculating all 18 × 9 = 162 cases and analyzing the results with respect to the optimal K-values.Calculations were performed on three cores of an Intel Core 2 Quad CPU at 2.83 GHz.Cases with three different lengths L were computed simultaneously.Values for R m were chosen in ascending order so that the result for a certain length L and a radius R m was a good initialization for the same L but the next R m .CPU time needed for computation was about four days per Reynolds number.K-values for the Reynolds numbers Re = 10000, Re = 20000 and Re = 50000 were investigated.

Nozzle Optimization for the
The resulting K-values in the design space are shown for Re = 20000 in Figure 9. Quite generally short nozzles have a lower K-value since the volume of the conduit component itself is smaller.Yet, one could expect that a short nozzle has a stronger influence on the losses downstream.This however is not the case as can be seen in Figure 10a   The best solutions for Re = 10000, Re = 20000 and Re = 50000 have a very similar shape but they differ in the K-value numbers.This Re-dependence of K opt , which will be regarded in the subsequent discussion prior to K, indicates that the inertia forces, i.e., the convective terms, which are the only non-linear terms in the Navier-Stokes equations, do not fully dominate the flow behavior at moderate Reynolds numbers.For each Reynolds number and a fixed value of L there is an optimal half length radius R m and thus a K opt .These values are shown in Figure 11 for all three Reynolds numbers.Since the Reynolds number is not a free parameter in the optimization process, optimal values are given for all three cases, again marked by square symbols.They all appear almost for the same L/D 1 (or X1 ) which again shows that the overall optimization procedure is basically the same for different Reynolds numbers.The polynomial nozzle seems to be adequate due to its smooth shape and its rounded corners.In order to evaluate the benefit of such a complicated geometry, the results are compared to those with the most simply shaped nozzle of prescribed length, a straight nozzle.For Re = 20000 this comparison reveals only a slight advantage of the polynomial nozzle in the case of high values for L, see Figure 13.Otherwise the straight nozzle is equally good or even superior.It turns out, however, that almost identical K-values for the straight and polynomial nozzles do not mean the same distribution of losses for both cases.Figure 14 shows details of how the losses are distributed in both cases, and why they nevertheless lead to the same K-value.Altogether we conclude that optimization only with one or two free parameters probably restricts the nozzle shapes too much.The extension to more free parameters will be made for the more interesting case of the diffuser optimization, however.

Diffuser Optimization
The examination of various diffuser designs will be started by asking whether a good nozzle (determined just before) is also a good diffuser.It turns out that the answer is definitely "no" since the physics in both cases are very different.The crucial aspect is that of flow separation, which in a nozzle might happen as a local event but in diffusers may determine the flow structure completely.This becomes obvious when the straight wall cases are compared.An optimal nozzle with straight walls according to Figure 13 is very short, with L/D 1 < 1.The corresponding diagram for a diffuser, Figure 15, is very different.Good diffusers are very long, thus avoiding massive flow separation.In Figure 15 the best diffuser is that for L/D 1 = 11.6 when L ∈ [4D 1 , 11.6D 1 ] is set.A further increase in L/D 1 would eventually lead to an increase in K due to the frictional losses within the diffuser.Note that a diffuser with Re = 40000 corresponds to the nozzle with Re = 20000 when D 1 /D 2 is set to 2 and 1/2, respectively, with the diameter in Re always being that of the conduit entrance.Then there is the same mass flow rate for both cases.Also, Figure 15 shows that now K-values are positive since kinetic energies for diffuser geometries cannot outbalance the pressure effects, c.f. Figure 11 for nozzles.As a first step the optimization is performed like for the nozzle in the previous section, i.e., by assigning a value to the ratio L/D 1 and systematically varying R m /D 1 .Here the parameter ranges are set to In Figure 16a (c.f. Figure 9 for the nozzle) K in the design space is shown with the optimal diffuser marked by the square symbol in Figure 16b.For all diffusers the losses can be illustrated by the cross sectional entropy generation rates inside the diffuser and the additional generation rates outside.Figure 17a shows these for diffusers with L/D 1 = 4, Figure 17b for L/D 1 = 11.6.The optimal diffusers for each length are shown in Figure 18 for three different Reynolds numbers.The best diffusers occur at the edge of the prescribed range for L/D 1 .Comparing these results (for Re = 40000) to those of the straight wall diffusers in Figure 19 it turns out, however, that all straight diffusers are superior to those with a polynomial shaped wall.It will be investigated next, whether this still holds for a non-straight wall shape with more than two optimization parameters.Since it has been shown before that a single degree of freedom for the optimization might lead to an unsatisfactory result, the shape for a fixed value of L/D 1 is now described via six parameters X 1 . . .X 6 provided at six equally spaced positions on the diffuser centerline.These parameters are again linearly scaled with a value Xi = 0 corresponding to R i = D 1 /2 and Xi = 1 corresponding to R i = D 2 /2.However, these bounds were not reached during the optimization by the optimal and close to optimal shapes.A monotonicity constraint for the wall is not applied as it is done in [27], since it turns out during the nozzle optimization that a convergent part of the geometry could be beneficial for the reduction of losses.The length of the diffuser is now fixed at L/D 1 = 4 because a strong need for optimization is given when losses are rather high due to the short length.The diameter ratio again is D 2 /D 1 = 2 as in the preceding examples.
In order to construct the wall shape from the discrete design variables Xi , a so called PCHIP interpolation is chosen, which is a cubic piecewise interpolation with reduced overshoot for non-smooth designs compared to splines and is available in Matlab R , see [33].This is convenient since Matlab R is used to generate the radially transformed structured grid for the repetitive computations which are performed using OpenFOAM, see Section 5.1.
We decided to use a genetic algorithm for the systematic variation of the parameters Xi , since this method is, besides its ability to deal with a complex design space, well documented and easy to understand.For simplicity the implementation of the genetic algorithm from the Matlab Global Optimization Toolbox is used, which offers a large variety of user settings.The population size is set to be 12 individuals, i.e., twice the number of the individual geometry parameters, which represent the "genome" of each individual.At every optimization step the population consists of one "elite child" from a last iteration, six "crossover children" and five "mutant children".The crossover children are based on a linear extrapolation of two parents selected from the preceding generation by a roulette wheel selection.Here, the child's genome lies on a straight line, which crosses the genomes of both parents, at a prescribed distance of 20% away from the better parent in outward direction.This choice seems reasonable, when a comparably small population is used, since a single point crossover might lead to many ill-designed diffusers with corrugated walls.The mutant children are gained from one parent each by replacing each of its six parameters with a fixed probability of 5% by a random value which is bounded by the upper and lower limit 0 ≤ Xi ≤ 1 for this parameter.This method is chosen to introduce new design candidates at every step of the optimization to prevent premature convergence due to the smooth crossover designs.
The best shape after 70 steps corresponding to a computational time of four weeks with at most four individuals computed simultaneously is presented in Figure 20.This design has a K-value of 0.158 while the K-number for the corresponding straight design is 0.191.Thus the introduction of the additional parameters is worthwhile since the variation of the shape leads to a reduction of losses and not only to their redistribution, as shown in Figure 21.In Figure 22 the six scaled coordinates and the corresponding scaled K-value are shown for the best candidate of each of the 70 optimization steps.Here, K is scaled according to K ≡ (K − K min )/(K max − K min ) and is bounded between 0 and 1 corresponding to the lowest and the highest value of K, respectively.Obviously there is a great influence of the wall shape on the entropy generation in the diffuser which is mainly due to the different turbulent entropy generation in the free shear layers.These layers can be identified in Figure 23 where the fluctuating part of the entropy generation is shown for the optimal and the straight geometry.A similar optimal shape has been found for a 2-dimensional planar case in [27].It seems also to be valid for the rotational symmetric case discussed here.

Conclusions
In this paper it has been shown how the entropy generation field obtained from a numerical simulation can be used to compute the K-value of conduit components as the target for optimization.Besides its advantages in the single objective optimization process, the ability of the second law analysis to contribute to the interpretation of the optimization results was illustrated for different nozzle and diffuser geometries.It was demonstrated how plots of the entropy generation in streamwise direction as well as upstream and downstream lengths of influence can be used to quantify the distribution of losses.Thus, for different strategies of shape optimization it could be checked whether a reduction of losses at a certain part of a conduit component led to an improvement of the whole component or only to the redistribution of losses within the component and its downstream section.

Figure 3 .
Figure 3. Different parts of the flow field determined or influenced by the conduit component.V c : volume of the component itself; V u : upstream volume affected by the component; V d : downstream volume affected by the component.

Figure 4 .
Figure 4. Determination of the overall entropy generation rate due to a conduit component.Δϕ u : additional specific dissipation upstream of the component; ϕ c : specific dissipation in the component; Δϕ d : additional specific dissipation downstream of the component.

Figure 6 .
Figure 6.Cross sectional entropy generation rate for the nozzle at Re 1 = 50000 with L = 2D 1 and R m = 0.375D 1 , dark: loss inside the nozzle, light: gain downstream of the nozzle.
Polynomial Wall Shape, K = K( X1 , X2 ) To investigate how the K-value depends on X1 and X2 , i.e., on L and R m , discrete values for both parameters are provided and all combinations are fed into the CFD-model.The nozzle length L varies within the interval [D 1 /4, 4D 1 ] so that X1 = (L/D 1 − 0.25)/3.75.
all 9 nozzle shapes are shown for L/D 1 = 1 as an example.
compared to Figure 10b.In Figure 9b K-values are shown for various lengths L. Optimal values, from now on called K opt , for most of the cases appear for the R m -values corresponding to X2 = 1, i.e., at the edge of the parameter range.However, some lie within the [0, 1]-range.The overall optimum, marked by the square symbol, appears for L/D 1 = 1, R m /D 1 = 0.446, corresponding to X1 = 0.2, X2 = 0.69.

Figure 11 .
Figure 11.Comparison of nozzles with optimized K for prescribed L.

Figure 12 .
Figure 12.Downstream length of impact L d for nozzles with Re = 20000.

Figure 20 .Figure 21 .Figure 22 .Figure 23 .
Figure 20.Optimum diffuser design with a PCHIP interpolation of the wall shape with six radii provided at equidistant positions on the centerline for Re = 100000. ∂x ∂x