Full Three-Dimensional Inverse Design Method for S-Ducts Using a New Dimensionless Flow Parameter

In this study, a new inverse design method is proposed for the full 3-D inverse design of S-ducts using curvature-based dimensionless pressure distribution as a target function. The wall pressure distribution in a 3-D curved duct is a function of the centerline curvature and the cross-sectional profile and area. A dimensionless pressure parameter was obtained as a function of the duct curvature and height of the cross-sections based on the normal pressure gradient equation. The dimensionless pressure parameter was used to eliminate the effect of the cross-sectional area on the wall pressure distribution. Full 3-D inverse design of an S-shaped duct was carried out by substituting the 3-D duct with a large number of 2-D planar ducts. The ball-spine inverse design method with vertical spins was coupled with the dimensionless pressure parameter as a target function for the design of the planar ducts. The inverse design process was performed in two steps. First, the height of each cross-section was considered constant, and only the duct centerline was allowed to be deformed by applying the difference between the dimensionless pressure on the upper and lower lines of symmetry plane. Then, a constant curvature was considered for each centerline in the equation, and the difference between the current and the target dimensionless pressure was applied to each upper and lower line of the planar sections to correct the heights of the 2-D planar sections, separately. The method was validated by choosing a straight duct as an initial guess, which converges to the target S-shaped duct. The results showed that the method is an efficient physical-based residual-correction method with low computational cost and good convergence rate. The 3-D wall pressure distribution of a high-deflected 3-D S-shaped diffuser was modified to eliminate the separation, secondary flow, and outlet distortion. Finally, the geometry corresponding to the modified pressure was obtained by the proposed 3-D inverse design method, which revealed higher pressure recovery, lower total pressure loss, and lower outlet flow distortion and swirl angle.


Introduction
The flow pattern in curved ducts such as S-shaped ducts is quite complex because of the curvature, diffusion, and inflexion in the curvature. Any separation or secondary flow inside a curved duct increases the total pressure losses and flow distortion at the outlet, which deteriorates the performance of the downstream component.
One of the optimal shape design methods is surface shape design, which usually involves finding a shape associated with a prescribed distribution of surface pressure or velocity in fluid flow problems. However, the solution of a shape design problem is not generally an optimum solution in a mathematical sense, which means that the solution only satisfies a target pressure distribution that resembles a nearly optimum performance. To solve shape design problems, there are two different approaches: coupled (non-iterative) and decoupled (iterative) approaches. A coupled approach uses an alternative formulation of the problem, in which the surface coordinates appear explicitly or implicitly as a dependent variable. A fully coupled method reformulates the governing equations in a way that the shape, computational grid, and the fluid state are all updated simultaneously. The main problems of the couple methods are the complexity of the governing equations in viscous flows and complex geometries [1,2].
Stanitz [3] converted the physical space (x, y) into a computational space (u, w) to regenerate an inverse design from of the Laplace equation in two-dimensional potential flows. Stanitz [4] developed a prominent three-dimensional version of his method for inverse design in potential flow regimes. Zannetti [5] developed a similar formulation for the Euler equations for the design of two-dimensional axisymmetric channels. Ahmed et al. [6] employed 2-D boundary layer calculations combined with inviscid through flow methods to predict the flow without swirl in axisymmetric diffusers. Chaviaropoulos et al. [7] formulated a fully coupled three-dimensional shape design problem for potential flow. Chaviaropoulos et al. [8] applied the developed three-dimensional inverse design method for 3-D ducts.
Ashrafizadeh et al. [9] proposed a direct shape design method. They showed that a fully coupled formulation of a shape design problem could be solved in the physical domain using a simple extension of commonly used CFD algorithms. Taiebi-Rahni et al. [10] used a direct design approach for duct shape design with Euler equations. Ghadak [11] extended the application of this method for the design of ducts with nonlinear coupled Euler equations. Ashrafizadeh et al. [12] presented a new element-based finite-volume discretization approach for the solution of incompressible flow problems on co-located grids. The proposed method, which was called the method of proper closure equations (MPCE), employed a proper set of physically relevant equations to the constraints of velocity and pressure at an integration point.
The decoupled algorithms are mainly different from coupled ones due to their shape modification strategy. In mathematical-based decoupled shape design algorithms, which are commonly called optimization methods, the difference between the target and current pressure distribution is defined as an objective function, and the minimum of this function is sought using ideas rooted in calculus. In physical-based decoupled shape design algorithms, assumptions are made, and the physical analogies are employed to guide the shape evolution during the iterations.
Gradient-based optimization methods [13] generate information regarding the objective function gradients and use it to specify the search direction and its step size in the design space. Evolutionary methods find the optimum solution based on repeated function evaluations. ZiaeiRad et al. [14] developed an efficient algorithm for the design optimization of the compressible fluid flow problem through a flexible structure. They coupled a supersonic flow solver, an aeroelastic solver, and genetic algorithm to calculate the optimum shape of a supersonic diffuser with flexible wall for a prescribed pressure distribution. Gan et al. [15] optimized a three-dimensional S-shaped diffuser using multiobjective optimization strategy and a modified shear stress transport (SST) turbulent model. Optimization methods are generally computationally expensive and rather mathematically complex. However, they can be used to minimize different objective functions while satisfying various constraints on the design variables.
Chiereghin et al. [16] coupled the free form deformation method with a multi-objective genetic algorithm to optimize the shape of a diffusing S-duct. They controlled the number of geometrical variables to limit the complexity of the flow simulation methods and obtain acceptable optimization times. A fast multi-objective optimization method for S-duct scoop inlets considering both inflow and outflow was developed and validated by Zeng et al. [17]. They developed an automated optimization system integrating the computational fluid dynamics analysis, non-uniform rational B-spline geometric representation technique, and non-dominated sorting genetic algorithm to minimize the total pressure loss and distortion at the exit of diffuser. D'Ambros et al. [18] performed the multi-objective optimization of an S-shaped duct based on a Tabu search algorithm. They used a free-form deformation approach with 36 • of freedom. A substantial improvement in the values of both objective functions was reported, but 1300 simulations were needed to obtain the results.
Physical-based decoupled shape design algorithms are rather mathematically simple, and a linear relation is often established between the boundary node displacement (∆r i ) and the local surface pressure mismatch (∆p i ) to update the shape. Residual-correction methods have also been developed to solve shape design problems. Barger and Brooks [19] related the boundary curvature to the tangential velocity mismatch on a wall for an inviscid low. Garabedian and McFadden [20] proposed a residual-correction method called the GM method to design a part of a transonic airfoil geometry. Malone et al. [21] developed a modified version called the MGM method to overcome some of the limitations of the GM method. Dulikravich and Baker [22] proposed a method using elastic membranes, which considerably increased the convergence rate of the MGM method.
Nili-Ahmadabadi et al. [23] presented the flexile string algorithm (FSA) as a residualcorrection method for duct design. They considered the duct wall as a flexible string that is deformed under the difference between the target and computed pressure distribution. The FSA was developed for inviscid compressible [24] and viscous incompressible internal flow regimes [25].
Nili-Ahmadabadi et al. [26,27] developed the ball-spine algorithm (BSA) for the quasi-3D design of a centrifugal compressor's impeller. The wall is replaced by virtual balls that freely move along the specified directions called spines. The difference between the target and current pressure distribution at each modification step is applied to each ball as a force that frequently deforms the wall. The BSA was developed for the inverse design of the 90-degree bent between the radial and axial diffuser of a centrifugal compressor [28]. The BSA was also developed for the inverse design of airfoils in subsonic and transonic external flow regimes [29]. Samadi et al. [30] incorporated the BSA into the FLUENT software using User Defined Function (UDF) for the inverse design of an axisymmetric duct. Hoghoughi et al. [31] applied the BSA for the aerodynamic design of the nozzle of a wind tunnel to achieve uniform airflow with minimum turbulence intensity and flow angle. Shumal et al. [32] developed the BSA for swirling viscous flow regime to improve the performance of an axisymmetric 90-degree bend duct between the radial and axial diffuser of a centrifugal compressor. Mayeli et al. [33] presented a novel iterative physical-based method for solving inverse heat conduction problems. The method extended the BSA concept to inverse heat conduction problems by employing a suitable physical-sense rule.
Madadi et al. [34] implemented the BSA for the quasi-three-dimensional design of an S-shaped diffuser. They developed this method for the design of two-dimensional blades with blunt [35] and sharp [36,37] leading edges, and for the quasi-three-dimensional design of rotor and stator blades in axial compressors [38]. They designed a rotor blade with a higher loading coefficient, which increased the outlet pressure of the third stage by 10%. Hesami et al. [39] presented a novel shape design method for the numerical solution of inverse heat convection problems (IHCPs) of nanofluids.
Safari et al. [40] presented another physical-based algorithm for external flows called Elastic Surface Algorithm (ESA). In their method, the airfoil surface was considered as an elastic beam that was deformed due to the stress provided by the difference between the current and target pressure distributions. The internal stresses in the beam are then set to zero in each modified shape and the process is repeated until the calculated shape satisfies the target pressure distribution along the airfoil surface. Nasrazadani et al. [41] upgraded the ESA for the sharp-edged blades in the cascade of axial compressors in a non-viscous subsonic and transonic flow regime, which is capable of reaching sever pressure gradients in the sharp edges.
The proposed method was the extension of the BSA inverse method for full 3-D curved ducts. In the present work, the BSA was three-dimensionally developed for the design of 3-D curved ducts with different cross-sectional shapes. For the flow inside a three-dimensional duct, the wall pressure contour is affected by the cross-sectional Appl. Sci. 2021, 11, 1119 4 of 31 area in addition to the curvature. The original BSA inverse design method diverges if the wall nodes are corrected based on the difference of the target and current pressures. Therefore, the current work defines a new dimensionless pressure distribution using the flow curvature equation to eliminate the area effect on the wall pressure for the convergence of the inverse design. By eliminating the area effect in the new dimensionless pressure, the inverse design of a 3-D curved duct was accomplished by the correction of many 2-D longitudinal planar ducts. To show the capability of the proposed method, a highdeflected 3-D S-shaped diffuser with separation and secondary flow was considered as an initial guess for 3-D inverse design. The dimensionless pressure was three-dimensionally modified so that the pressure loading decreased on the symmetry plane and increased on adjacent 2-D planar planes to remove the separation and secondary flow.

Flow Solver and Geometry Definition
In iterative inverse design methods, a shape modification algorithm is incorporated into a flow solver, and the flow field is solved to obtain the wall pressure distribution at each shape-modification step. In the current work, the equations of the flow inside the duct geometry were numerically solved using an in-house 3-D Euler solver based on the flux difference-splitting scheme of the Roe method [42]. A higher order of spatial accuracy was obtained in all calculations using MUSL (monotone upstream centered scheme) for conservation laws with a third-order interpolation. Figure 1a shows the geometry and grid generation of a 3-D S-shaped diffuser. The white dots on the wall surface indicate the control points (balls), which can be displaced according to the inverse design algorithm. The grid size was optimized through a grid refinement study. In this respect, the computational domain was meshed by O-grid structured mesh with N x × N r × N θ = 80 × 10 × 30, 100 × 20 × 30, and 100 × 30 × 40 in which N x , N r , and N θ imply the number of nodes in the axial, radial, and angular directions, respectively. The wall pressure distributions along the upper and lower lines of the symmetry plane were obtained for various grid sizes and plotted in Figure 1b. It is apparent that for grid sizes finer than N x × N r × N θ = 100 × 20 × 30, the results are identical. design of 3-D curved ducts with different cross-sectional shapes. For the flow inside a three-dimensional duct, the wall pressure contour is affected by the cross-sectional area in addition to the curvature. The original BSA inverse design method diverges if the wall nodes are corrected based on the difference of the target and current pressures. Therefore, the current work defines a new dimensionless pressure distribution using the flow curvature equation to eliminate the area effect on the wall pressure for the convergence of the inverse design. By eliminating the area effect in the new dimensionless pressure, the inverse design of a 3-D curved duct was accomplished by the correction of many 2-D longitudinal planar ducts. To show the capability of the proposed method, a high-deflected 3-D S-shaped diffuser with separation and secondary flow was considered as an initial guess for 3-D inverse design. The dimensionless pressure was three-dimensionally modified so that the pressure loading decreased on the symmetry plane and increased on adjacent 2-D planar planes to remove the separation and secondary flow.

Flow Solver and Geometry Definition
In iterative inverse design methods, a shape modification algorithm is incorporated into a flow solver, and the flow field is solved to obtain the wall pressure distribution at each shape-modification step. In the current work, the equations of the flow inside the duct geometry were numerically solved using an in-house 3-D Euler solver based on the flux difference-splitting scheme of the Roe method [42]. A higher order of spatial accuracy was obtained in all calculations using MUSL (monotone upstream centered scheme) for conservation laws with a third-order interpolation. Figure 1a shows the geometry and grid generation of a 3-D S-shaped diffuser. The white dots on the wall surface indicate the control points (balls), which can be displaced according to the inverse design algorithm. The grid size was optimized through a grid refinement study. In this respect, the computational domain was meshed by O-grid structured mesh with × × = 80 × 10 × 30, 100 × 20 × 30, and 100 × 30 × 40 in which , , and imply the number of nodes in the axial, radial, and angular directions, respectively. The wall pressure distributions along the upper and lower lines of the symmetry plane were obtained for various grid sizes and plotted in Figure 1b. It is apparent that for grid sizes finer than × × = 100 × 20 × 30, the results are identical.

Inverse Design Method
The BSA inverse design method was upgraded for the 3-D design of an S-shaped duct. All the previous developments of the BSA were limited to 2-D and quasi-3-D ducts in which only the upper and lower lines of the symmetry plane were modified based on the target pressure distribution. The BSA method is described here in brief, but it has been previously described by details [26][27][28][29]. In the BSA, the wall surface is composed of imaginary balls that can freely move along the specified directions called spines. Due to the difference between the current and target pressure distribution, a force is applied to each ball along the corresponding spine. As the difference between the current and target pressure reaches zero, the balls stop moving, and the target shape is achieved. Figure 2 shows the whole procedure of the inverse design solution. The displacement of balls in each shape modification step is calculated using Equation (1) as follows: where ∆y is the displacement of each point along its spine, ∆P is the difference between the current and target pressure, and C is the geometry correction factor. It is important to find the optimum value for the geometry correction factor, which should be determined by trial and error.

Inverse Design Method
The BSA inverse design method was upgraded for the 3-D design of an Sduct. All the previous developments of the BSA were limited to 2-D and quasi-3-D in which only the upper and lower lines of the symmetry plane were modified ba the target pressure distribution. The BSA method is described here in brief, but it h previously described by details [26][27][28][29]. In the BSA, the wall surface is composed o inary balls that can freely move along the specified directions called spines. Due difference between the current and target pressure distribution, a force is applied ball along the corresponding spine. As the difference between the current and targ sure reaches zero, the balls stop moving, and the target shape is achieved. Figure 2 the whole procedure of the inverse design solution. The displacement of balls shape modification step is calculated using Equation (1) as follows: where ∆ is the displacement of each point along its spine, ∆ is the difference b the current and target pressure, and C is the geometry correction factor. It is impo find the optimum value for the geometry correction factor, which should be dete by trial and error. In 3-D inverse design, the difference between the current and target pressur the correct criterion for moving the balls due to the effects of area on the pressure c Thus, a new dimensionless pressure parameter was defined based on the streamli vature. Similar to the 2-D inverse design, the axial length of the S-shaped duct wa as a specific length to achieve a unique answer. Another characteristic that is requ the inverse design of a 3-D duct is constant cross-sectional width along the duct. A constraint is that the outlet area of the duct should remain fixed to consider an unc mass flow rate during the shape-modification process. As shown in Figure 3, the 3 fuser can be considered as several 2-D planar ducts, and the control points are pla the upper and lower walls of these 2-D ducts. If the widths of all cross-sections a sidered to be fixed, all the spines should be vertical on the cross-section plane. In 3-D inverse design, the difference between the current and target pressure is not the correct criterion for moving the balls due to the effects of area on the pressure contour. Thus, a new dimensionless pressure parameter was defined based on the streamline curvature. Similar to the 2-D inverse design, the axial length of the S-shaped duct was fixed as a specific length to achieve a unique answer. Another characteristic that is required for the inverse design of a 3-D duct is constant cross-sectional width along the duct. Another constraint is that the outlet area of the duct should remain fixed to consider an unchanged mass flow rate during the shape-modification process. As shown in Figure 3, the 3-D diffuser can be considered as several 2-D planar ducts, and the control points are placed on the upper and lower walls of these 2-D ducts. If the widths of all cross-sections are considered to be fixed, all the spines should be vertical on the cross-section plane.

Filtering Operation
Since the wall is considered as a set of separate virtual balls, the wall curvature may be discontinuous between adjacent nodes during the geometry correction process. To smooth the wall curvature, a Savitzky-Golay filter [43,44] was applied to the wall nodes after each geometry correction step. The Savitzky-Golay filter method performs a local polynomial regression in order to determine the smoothed values for each data point. The filtration was performed using a second-order polynomial with 5 data points. The equation for this particular Savitzky-Golay smoothing is defined as follows: where g i is the filtered value at the position i, f j is the unfiltered value at the position j, n L and n R respectively, specify the data points on the left and right of the point that is supposed to be smoothed, and C n is the weighting function according to Table 1.

Filtering Operation
Since the wall is considered as a set of separate virtual balls, the wall curvature may be discontinuous between adjacent nodes during the geometry correction process. To smooth the wall curvature, a Savitzky-Golay filter [43,44] was applied to the wall nodes after each geometry correction step. The Savitzky-Golay filter method performs a loca polynomial regression in order to determine the smoothed values for each data point. The filtration was performed using a second-order polynomial with 5 data points. The equa tion for this particular Savitzky-Golay smoothing is defined as follows: where is the filtered value at the position i, is the unfiltered value at the position j and respectively, specify the data points on the left and right of the point that is supposed to be smoothed, and is the weighting function according to Table 1. Table 1 shows the weighting function for the Savitzky-Golay smoothing scheme us ing a second-order polynomial and five data points. The filtering operation was carried out along the longitudinal direction of the duct and each cross-section Figure 4 because the geometry was a three-dimensional shell. The filtering for all points of the longitudina sections (red points) was performed based on Equation (2) and Figure 4. The end point o each longitudinal section was fixed due to the fixed outlet section. The filtering was also performed at each cross-section (blue points) in which the upper and lower points of each cross-section and the duct centerline were kept constant on the symmetry plane. Table 1. Weighting function for SG (Savitzky-Golay) using second-order polynomial and five data points.   Table 1 shows the weighting function for the Savitzky-Golay smoothing scheme using a second-order polynomial and five data points. The filtering operation was carried out along the longitudinal direction of the duct and each cross-section Figure 4 because the geometry was a three-dimensional shell. The filtering for all points of the longitudinal sections (red points) was performed based on Equation (2) and Figure 4. The end point of each longitudinal section was fixed due to the fixed outlet section. The filtering was also performed at each cross-section (blue points) in which the upper and lower points of each cross-section and the duct centerline were kept constant on the symmetry plane.

Upgrading and Validating the 3-D BSA for Unique Solution
To validate a 3-D inverse design method, the target geometry is assumed to be known and the corresponding wall pressure distributions along all lines of the wall are consid ered as the target pressure Figure 5. If an arbitrary geometry as an initial guess converge to the target geometry through the inverse design procedure, the validation of the invers design method is correctly performed. In addition to the duct curvature, the area and the shape of the duct cross-section affect the pressure distribution and flow quality. The criterion of the ball displacement in 2-D and quasi 3-D BSA inverse design method is the pressure difference according to Equation (1). However, the pressure difference is not an appropriate criterion for the balls displacement in the 3-D inverse design. In other words, the pressure difference causes th divergence in the 3-D inverse design due the effects of area on the pressure contour. Fo example, although the symmetry planes of the initial and target geometry are the same in Figure 6, the pressure difference due to the area difference causes the lower and uppe lines of the symmetry plane to shift and the solution to diverge. To upgrade the BSA fo 3-D design and to eliminate the area effects, a dimensionless pressure parameter was de fined.

Upgrading and Validating the 3-D BSA for Unique Solution
To validate a 3-D inverse design method, the target geometry is assumed to be known, and the corresponding wall pressure distributions along all lines of the wall are considered as the target pressure Figure 5. If an arbitrary geometry as an initial guess converges to the target geometry through the inverse design procedure, the validation of the inverse design method is correctly performed.

Upgrading and Validating the 3-D BSA for Unique Solution
To validate a 3-D inverse design method, the target geometry is assumed to be known, and the corresponding wall pressure distributions along all lines of the wall are considered as the target pressure Figure 5. If an arbitrary geometry as an initial guess converges to the target geometry through the inverse design procedure, the validation of the inverse design method is correctly performed. In addition to the duct curvature, the area and the shape of the duct cross-sections affect the pressure distribution and flow quality. The criterion of the ball displacement in 2-D and quasi 3-D BSA inverse design method is the pressure difference according to Equation (1). However, the pressure difference is not an appropriate criterion for the balls' displacement in the 3-D inverse design. In other words, the pressure difference causes the divergence in the 3-D inverse design due the effects of area on the pressure contour. For example, although the symmetry planes of the initial and target geometry are the same in Figure 6, the pressure difference due to the area difference causes the lower and upper lines of the symmetry plane to shift and the solution to diverge. To upgrade the BSA for 3-D design and to eliminate the area effects, a dimensionless pressure parameter was defined. In addition to the duct curvature, the area and the shape of the duct cross-sections affect the pressure distribution and flow quality. The criterion of the ball displacement in 2-D and quasi 3-D BSA inverse design method is the pressure difference according to Equation (1). However, the pressure difference is not an appropriate criterion for the balls' displacement in the 3-D inverse design. In other words, the pressure difference causes the divergence in the 3-D inverse design due the effects of area on the pressure contour. For example, although the symmetry planes of the initial and target geometry are the same in Figure 6, the pressure difference due to the area difference causes the lower and upper lines of the symmetry plane to shift and the solution to diverge. To upgrade the BSA for 3-D design and to eliminate the area effects, a dimensionless pressure parameter was defined.

Definition of Curvature-Based Dimensionless Pressure Parameter for Upgrading the 3-D BSA
For an inviscid flow along a curved streamline with the curvature of (1/R), where ∂p/∂n is the pressure gradient perpendicular to the streamline in the s-n coordinate system. This is why the cross-sections are considered perpendicular to the diffuser centerline according to Figure 7.
For each longitudinal section of the S-shaped diffuser, such as section "A" Figure 7b, the pressure difference between the upper and lower walls is due to the curvature and mean velocity at each cross-section Figure 7b according to Equation (3). By discretizing Equation (3) along the centerline of each longitudinal section, the following equation is obtained: where and are respectively the upper and lower pressures of the corresponding points, which are obtained by intersection of the longitudinal section "A" and crosssection "B". In Equation (4), a is half of the distance between these two corresponding points Figure 7c, and R is the curvature of the centerline at each longitudinal section.
The average pressure for the two corresponding points is defined as: The dynamic pressure can be written as: Substituting Equations (5) and (6) into Equation (4) yields: The left side of Equation (7) is defined as dimensionless pressure, which is a function

Definition of Curvature-Based Dimensionless Pressure Parameter for Upgrading the 3-D BSA
For an inviscid flow along a curved streamline with the curvature of (1/R), where ∂p/∂n is the pressure gradient perpendicular to the streamline in the s-n coordinate system. This is why the cross-sections are considered perpendicular to the diffuser centerline according to Figure 7.
Appl. Sci. 2021, 11, x FOR PEER REVIEW 9 of 30 cross-sectional area. Figure 8 shows the target geometry and the two different initial guesses. The centerline curvature and the width of cross-sections are the same for all three geometries. As can be seen, the second and target geometries have the same cross-sectional areas while the first and target geometries have the same symmetry planes. Figures 9 and 10, respectively, compare the wall pressure and the dimensionless pressure distributions on the symmetry planes of these three geometries. The wall pressure distributions on the symmetry planes of the first and target geometry are different in Figure 9 due to the difference in their cross-sectional areas. However, their dimensionless pressures are the same in Figure10 because both the centerline curvature and the parameter a on the symmetry planes of the first and target geometry are the same. Therefore, if the parameters a and R (centerline curvature) are equal for two different ducts, their dimensionless pressure distributions will be the same, as indicated in Equation (7). Figure 9 also shows that the wall pressure distributions of the second and target geometries on their symmetry plane are almost the same, which is the reason of their equal distributions of cross-sectional area (A) and centerline curvatures (R). Figure 10 shows that there is a small difference between the dimensionless pressure distributions for the second geometry relative to the first and target geometry. This is due to the different a parameter for the second geometry. Overall, Figure 10 proves that the dimensionless pressure parameter removes the effect of cross-sectional area, and it can be used as an appropriate criterion for the displacement of balls in the 3-D inverse design.  For each longitudinal section of the S-shaped diffuser, such as section "A" Figure 7b, the pressure difference between the upper and lower walls is due to the curvature and mean velocity at each cross-section Figure 7b according to Equation (3). By discretizing Equation (3) along the centerline of each longitudinal section, the following equation is obtained: where p up and p down are respectively the upper and lower pressures of the corresponding points, which are obtained by intersection of the longitudinal section "A" and cross-section "B". In Equation (4), a is half of the distance between these two corresponding points Figure 7c, and R is the curvature of the centerline at each longitudinal section. The average pressure for the two corresponding points is defined as: The dynamic pressure can be written as: Substituting Equations (5) and (6) into Equation (4) yields: The left side of Equation (7) is defined as dimensionless pressure, which is a function of the two parameters a and R. The dimensionless pressure eliminates the effect of the cross-sectional area. Figure 8 shows the target geometry and the two different initial guesses. The centerline curvature and the width of cross-sections are the same for all three geometries. As can be seen, the second and target geometries have the same cross-sectional areas while the first and target geometries have the same symmetry planes.  9 and 10, respectively, compare the wall pressure and the dimensionless pressure distributions on the symmetry planes of these three geometries. The wall pressure distributions on the symmetry planes of the first and target geometry are different in Figure 9 due to the difference in their cross-sectional areas. However, their dimensionless pressures are the same in Figure 10 because both the centerline curvature and the parameter a on the symmetry planes of the first and target geometry are the same. Therefore, if the parameters a and R (centerline curvature) are equal for two different ducts, their dimensionless pressure distributions will be the same, as indicated in Equation (7).       Figure 9 also shows that the wall pressure distributions of the second and target geometries on their symmetry plane are almost the same, which is the reason of their equal distributions of cross-sectional area (A) and centerline curvatures (R). Figure 10 shows that there is a small difference between the dimensionless pressure distributions for the second geometry relative to the first and target geometry. This is due to the different a parameter for the second geometry. Overall, Figure 10 proves that the dimensionless pressure parameter removes the effect of cross-sectional area, and it can be used as an appropriate criterion for the displacement of balls in the 3-D inverse design.

Correction of Cross Sections Based on Dimensionless Pressure
If R is assumed to be known and it is supposed to be unchanged, the following equation can be obtained from Equation (7) for the target and current geometry: where ∆a i is the displacement of each wall point along its spine based on the dimensionless pressure. The value of R for each point of the target geometry is assumed to be known and considered to be the same for the current geometry. C is the geometry correction coefficient. By this equation, the difference between the dimensionless pressure distributions of the target and the current geometry is used for the correction of wall points. It should be noted that the cross-sections must be perpendicular to the centerline of the diffuser in this procedure.

Correction of Centerline Curvature Based on Dimensionless Pressure
If the distribution of the parameter a on the symmetry plane is assumed to be known, and it is supposed to be unchanged during the geometry corrections, Equation (9) is obtained from Equation (7) for the diffuser centerline based on the difference between the upper and lower wall pressure distribution as follows: By considering the balls on the main centerline of the duct, the value of R for each point of the centerline is obtained at each geometry correction as follows: where the coefficient C is the geometry correction factor. The curvature (1/R) is defined as follows: 1 R = y 1 + y 2 3/2 , y, y end point = 0 The curvature for all points of the centerline is obtained from Equation (10). If the duct length and the x-coordinate of each point on the centerline are considered to be constant, and the values of y and y are specified at the end point of the centerline, the values of y at all points on the centerline are obtained by the second order Rung-Kutta method starting from the end point.

Validation of 3-D Upgraded Inverse Design for 3D S-Duct with Specified Centerline Curvature
Initially, it was assumed that the duct centerline curvature is specified, and the proposed inverse design method is used to correct the cross-sections. The initial and target geometries shown in Figure 6 were used for the validation to show the capability and convergence of the method using the dimensionless pressure and eliminating the effects of area.
With a specified centerline curvature, the cross-sections perpendicular to the centerline are corrected according to Equation (8). The balls are placed along the upper and lower walls of the 2-D planar ducts. The difference between the current and target dimensionless pressure is applied to each upper and lower lines of the planar ducts separately to correct the height distribution of the longitudinal sections. Figure 11 shows the convergence process of the initial geometry to the target geometry after only 40 geometry corrections. Figure 11a,b shows how the cross-sections and pressure distributions along the upper and lines of the symmetry plane converge. Figure 11c compares the dimensionless pressure distributions on cross-section "C" for the initial, target, and two intermediate modified geometries. Since the curvature of the centerline for the initial geometry is known and equal to that for the target geometry, the dimensionless pressures at points "A" and "B" in Figure 11 for the initial and target geometry are equal. Thus, these points do not shift during the inverse design process. However, according to Figure 11b, the amount of pressure at these points varies due to the effects of area. For this reason, the use of the pressure parameter causes divergence (Figure 6), while the use of the dimensionless pressure parameter causes convergence for the geometry correction in the inverse design of a 3-D duct.

Validation of 3D Geometry with Desired Centerline Curvature
The S-shaped duct with a predefined width and elliptic cross-sectional profiles was chosen as the target geometry for the validation of the upgraded BSA. To do this, a numerical simulation inside the target geometry was accomplished to obtain the walls pressure distributions. This pressure distribution was first nondimensionalized and then applied to the upgraded BSA as the target parameter. Figure 12 shows the initial guess and target geometries with their upper and lower wall pressure contours on their symmetry planes. The initial guess geometry is a straight duct with an arbitrary distribution of crosssectional area in which only its cross-sectional width is equal to that of the target geometry.
The 3-D inverse design of the S-shaped duct is started by replacing the 3-D duct with a large number of 2-D planner ducts, as shown in Figure 3. The centerline curvature is the same for all 2-D planar ducts, and the cross-section profile is modified by the change of the parameter a for each 2-D planar duct. Because the control points are displaced based on the dimensionless pressure difference, the cross-sections should be considered perpendicular to the duct centerline. Since both parameters a and R are unknown for using the dimensionless pressure, the inverse design was performed in two steps, alternately. In this way, if one parameter is assumed to be known, another parameter is modified by the inverse design.
First, the height and profile of each cross-section are considered to be constant, and only the duct centerline is deformed according to Equation (10) by applying the difference between the dimensionless pressures on the upper and lower lines of the duct symmetry plane. Each ball is placed on the centerline with a fixed and specified x-coordinate according to Figure 13. The curvature of the duct is modified for the symmetry plane according to Equation (10), and the cross-sections are placed perpendicular to the centerline along the duct while maintaining the cross-sections' profile and height.
upper and lines of the symmetry plane converge. Figure 11c compares the dimensionless pressure distributions on cross-section "C" for the initial, target, and two intermediate modified geometries. Since the curvature of the centerline for the initial geometry is known and equal to that for the target geometry, the dimensionless pressures at points "A" and "B" in Figure 11 for the initial and target geometry are equal. Thus, these points do not shift during the inverse design process. However, according to Figure 11b, the amount of pressure at these points varies due to the effects of area. For this reason, the use of the pressure parameter causes divergence (Figure 6), while the use of the dimensionless pressure parameter causes convergence for the geometry correction in the inverse design of a 3-D duct.

Validation of 3D Geometry with Desired Centerline Curvature
The S-shaped duct with a predefined width and elliptic cross-sectional profiles was chosen as the target geometry for the validation of the upgraded BSA. To do this, a numerical simulation inside the target geometry was accomplished to obtain the walls pres-   First, the height and profile of each cross-section are considered to be constant, and only the duct centerline is deformed according to Equation (10) by applying the difference between the dimensionless pressures on the upper and lower lines of the duct symmetry plane. Each ball is placed on the centerline with a fixed and specified x-coordinate according to Figure 13. The curvature of the duct is modified for the symmetry plane according to Equation (10), and the cross-sections are placed perpendicular to the centerline along the duct while maintaining the cross-sections' profile and height. Figure 14 shows how the current wall pressure on the symmetry plane approaches the target wall pressure only after 10 geometry corrections, while its centerline is still a little different compared to the target centerline. This occurs because parameter a is not the same on the symmetry planes of the initial and target geometry, which means that their parameter R should not be the same for pressure convergence according to Equation (9). In other words, the ratio a/R, instead of R, changes until the difference of the dimensionless pressure on the upper and lower lines of the symmetry plane in the current geometry equals that in the target geometry.  Figure 14 shows how the current wall pressure on the symmetry plane approaches the target wall pressure only after 10 geometry corrections, while its centerline is still a little different compared to the target centerline. This occurs because parameter a is not the same on the symmetry planes of the initial and target geometry, which means that their parameter R should not be the same for pressure convergence according to Equation (9). In other words, the ratio a/R, instead of R, changes until the difference of the dimensionless pressure on the upper and lower lines of the symmetry plane in the current geometry equals that in the target geometry.
In the second step, the curvature of the centerline is considered to be constant, and only the cross-sections perpendicular to the centerline are modified according to Equation (8). The balls are placed along the upper and lower walls of the 2-D planar ducts. The difference between the current and target dimensionless pressure on each upper and lower line is applied to each upper and lower lines of the planar ducts separately to correct the height distribution of the longitudinal sections. Figure 15 shows how the dimensionless pressure and the profiles of the cross-sections change through the second step of the inverse design. Figure 16 compares the geometry after 45 corrections and the target geometry, and their wall pressure on the symmetry plane.  In the second step, the curvature of the centerline is considered to be constant, and only the cross-sections perpendicular to the centerline are modified according to Equation (8). The balls are placed along the upper and lower walls of the 2-D planar ducts. The difference between the current and target dimensionless pressure on each upper and lower line is applied to each upper and lower lines of the planar ducts separately to correct the height distribution of the longitudinal sections. Figure 15 shows how the dimensionless pressure and the profiles of the cross-sections change through the second step of the inverse design. Figure 16 compares the geometry after 45 corrections and the target geometry, and their wall pressure on the symmetry plane.  In the second step, the curvature of the centerline is considered to be constant, and only the cross-sections perpendicular to the centerline are modified according to Equation (8). The balls are placed along the upper and lower walls of the 2-D planar ducts. The difference between the current and target dimensionless pressure on each upper and lower line is applied to each upper and lower lines of the planar ducts separately to correct the height distribution of the longitudinal sections. Figure 15 shows how the dimensionless pressure and the profiles of the cross-sections change through the second step of the inverse design. Figure 16 compares the geometry after 45 corrections and the target geometry, and their wall pressure on the symmetry plane. After correcting the cross-sections, a new distribution of the parameter a on the symmetry plane is obtained, and the first and second steps are repeated until the target pressure is reached for all control points on the geometry wall. Figure 17 shows the geometry modifications based on the first and second steps, alternately. From iterations 100 to 200, several geometry corrections for the centerline (first step) and several geometry corrections for the cross-sections perpendicular to the centerline (second step) are carried out to reach the target geometry. The 3-D inverse design flowchart for the S-shaped diffuser based on the upgraded BSA is shown in Figure 18. After correcting the cross-sections, a new distribution of the parameter a on the symmetry plane is obtained, and the first and second steps are repeated until the target pressure is reached for all control points on the geometry wall. Figure 17 shows the geometry modifications based on the first and second steps, alternately. From iterations 100 to 200, several geometry corrections for the centerline (first step) and several geometry corrections for the cross-sections perpendicular to the centerline (second step) are carried out to reach the target geometry. The 3-D inverse design flowchart for the S-shaped diffuser based on the upgraded BSA is shown in Figure 18.

Design Example
In order to show the capability of the proposed 3-D inverse design method, a highdeflected 3-D S-shaped diffuser was first considered as the initial guess for 3-D inverse design. After modifying the 3-D pressure contour on the wall, the 3-D geometry of the duct was improved by applying the modified pressure contour to the upgraded 3-D inverse design code. To evaluate the general parameters of the flow such as pressure recovery, total pressure loss, and outlet flow distortion for the initial and designed ducts, the Reynods-Average Navier Stokes (RANS) equations with the k-ω SST turbulence model were solved by Ansys Fluent 2020R2 software to compare their overall aerodynamic performances.
The short-offset S-duct inherently have complex three-dimensional flows, which is a challenge for CFD to accurately simulate the secondary flow and flow separation. The accu-

Design Example
In order to show the capability of the proposed 3-D inverse design method, a highdeflected 3-D S-shaped diffuser was first considered as the initial guess for 3-D inverse design. After modifying the 3-D pressure contour on the wall, the 3-D geometry of the duct was improved by applying the modified pressure contour to the upgraded 3-D inverse design code. To evaluate the general parameters of the flow such as pressure recovery, total pressure loss, and outlet flow distortion for the initial and designed ducts, the Reynods-Average Navier Stokes (RANS) equations with the k-ω SST turbulence model were solved by Ansys Fluent 2020R2 software to compare their overall aerodynamic performances.
The short-offset S-duct inherently have complex three-dimensional flows, which is a challenge for CFD to accurately simulate the secondary flow and flow separation. The accuracy of CFD solutions mainly depend on the turbulence model that is employed. Previous studies show that k − ω SST is mostly used for S-duct numerical simulation [17,18,45]. Zhang et al. [46] used k − ω SST turbulence model for S-duct numerical simulation and the results agreed well with experimental data. Fiola and Agarwal [47] compared the simulation results of diffusing S-duct using four different turbulence models. They found that k − ω SST turbulence model gave best agreement with the experimental data in predicting the pressure distribution along the duct, the separated flow region, and the secondary flow.
The computational mesh that was used for the RANS flow solver was a hybrid mesh. It consisted of the boundary layer mesh near the duct surface and the unstructured mesh elements in the interior of the duct Figure 19. Fine grids were used near the wall (with a first layer thickness of 5 × 10 −6 m) so that the value of y + was less than 2 to accurately capture the boundary layer ( Figure 20). Several grid sizes were generated to ensure that the simulation results were sufficiently grid-independent. Figure 21 shows how the pressure recovery and DC (90) changed in terms of the number of mesh elements. It indicates that the pressure recovery and outlet flow distortion became stable and remained nearly unchanged for the values greater than 1.13 million mesh elements.
Appl. Sci. 2021, 11, x FOR PEER REVIEW Zhang et al. [46] used − SST turbulence model for S-duct numerical simulatio results agreed well with experimental data. Fiola and Agarwal [47] compared the si results of diffusing S-duct using four different turbulence models. They found th SST turbulence model gave best agreement with the experimental data in predi pressure distribution along the duct, the separated flow region, and the secondary The computational mesh that was used for the RANS flow solver was a hybr It consisted of the boundary layer mesh near the duct surface and the unstructur elements in the interior of the duct Figure 19. Fine grids were used near the wa first layer thickness of 5 × 10 ) so that the value of was less than 2 to a capture the boundary layer ( Figure 20). Several grid sizes were generated to en the simulation results were sufficiently grid-independent. Figure 21 shows how sure recovery and DC (90) changed in terms of the number of mesh elements. It that the pressure recovery and outlet flow distortion became stable and remaine unchanged for the values greater than 1.13 million mesh elements.  Appl. Sci. 2021, 11, x FOR PEER REVIEW Zhang et al. [46] used − SST turbulence model for S-duct numerical simulat results agreed well with experimental data. Fiola and Agarwal [47] compared the results of diffusing S-duct using four different turbulence models. They found SST turbulence model gave best agreement with the experimental data in pre pressure distribution along the duct, the separated flow region, and the seconda The computational mesh that was used for the RANS flow solver was a hy It consisted of the boundary layer mesh near the duct surface and the unstruc elements in the interior of the duct Figure 19. Fine grids were used near the w first layer thickness of 5 × 10 ) so that the value of was less than 2 to capture the boundary layer ( Figure 20). Several grid sizes were generated to the simulation results were sufficiently grid-independent. Figure 21 shows ho sure recovery and DC (90) changed in terms of the number of mesh elements. that the pressure recovery and outlet flow distortion became stable and rema unchanged for the values greater than 1.13 million mesh elements.   In order to generate the initial geometry, the quasi-3-D design of an S-shaped duct was first accomplished for the symmetry plane of the duct using the reported method [34]. In the quasi-3-D design, all cross-sections were considered elliptical with a constant width, and a suitable pressure distribution was applied on the upper and lower lines of the symmetry plane [34]. Figure 22 shows the suitable pressure distribution along the upper and lower lines of the symmetry plane [34]. Figure 23 shows the symmetry plane of the initial S-duct, which was designed by the quasi-3-D inverse design method. The height-to-axial-length ratio (aspect ratio) of the initially designed S-duct was equal to 0.34. Figure 24 shows the 2-D streamlines on the symmetry plane of the initial 3-D duct, indicating no separation inside the duct.
Appl. Sci. 2021, 11, x FOR PEER REVIEW In order to generate the initial geometry, the quasi-3-D design of an S-shap was first accomplished for the symmetry plane of the duct using the reported meth In the quasi-3-D design, all cross-sections were considered elliptical with a constan and a suitable pressure distribution was applied on the upper and lower lines of t metry plane [34]. Figure 22 shows the suitable pressure distribution along the upper and lower the symmetry plane [34]. Figure 23 shows the symmetry plane of the initial S-duc was designed by the quasi-3-D inverse design method. The height-to-axial-leng (aspect ratio) of the initially designed S-duct was equal to 0.34. Figure 24 shows streamlines on the symmetry plane of the initial 3-D duct, indicating no separatio the duct. The aspect ratio of the initially designed S-duct was increased by 20% to generate the secondary geometry as a high-deflected 3-D S-shaped diffuser. The secondary geometry was actually obtained by scaling the upper and lower symmetry lines of the initial duct and using elliptical cross-sections with constant width. Figure 25 shows the symmetry plane of the secondary duct, which had an aspect ratio of 0.41. The increase in aspect ratio and curvature of the duct leads to an increase in wall pressure gradients along the upper and lower lines of all 2-D planar ducts, which increases the possibility of flow separation and outlet flow distortion. The increase of aspect ratio also increases the difference between the pressure along the upper and lower lines through the first and second bends, which induces a secondary flow and increases the flow distortion at the duct outlet.      The aspect ratio of the initially designed S-duct was increased by 20% to generate the secondary geometry as a high-deflected 3-D S-shaped diffuser. The secondary geometry was actually obtained by scaling the upper and lower symmetry lines of the initial duc and using elliptical cross-sections with constant width. Figure 25 shows the symmetry plane of the secondary duct, which had an aspect ratio of 0.41. The increase in aspect ratio and curvature of the duct leads to an increase in wall pressure gradients along the uppe and lower lines of all 2-D planar ducts, which increases the possibility of flow separation and outlet flow distortion. The increase of aspect ratio also increases the difference be tween the pressure along the upper and lower lines through the first and second bends which induces a secondary flow and increases the flow distortion at the duct outlet. Figure 26 shows the pressure distributions along the upper and lower lines of the symmetry plane. The viscous flow solver numerically calculated the flow field inside the secondary 3-D S-duct. Figure 27 shows the 3-D streamlines inside the secondary duct which indicates that the increase of aspect ratio induces secondary flow and separation inside the duct and increases the flow distortion at the outlet.  Figure 26 shows the pressure distributions along the upper and lower lines of the symmetry plane. The viscous flow solver numerically calculated the flow field inside the secondary 3-D S-duct. Figure 27 shows the 3-D streamlines inside the secondary duct, which indicates that the increase of aspect ratio induces secondary flow and separation inside the duct and increases the flow distortion at the outlet.  According to Equation (4), an increase in the duct curvature increases the dim less pressure difference between the upper and lower lines of the duct, in additio increase of the corresponding pressure difference. To eliminate the separation and the secondary flow in the secondary duct with the aspect ratio of 0.41, the dimen pressure distributions on all wall lines in the high-positive-pressure-gradient were modified and then applied to the proposed 3-D design method to correct th sectional profiles.
The width of each cross-section was considered unchanged during the geom rections as a design constraint. Equation (8) was used to modify the cross-sections According to Equation (4), an increase in the duct curvature increases the dimensionless pressure difference between the upper and lower lines of the duct, in addition to the increase of the corresponding pressure difference. To eliminate the separation and reduce the secondary flow in the secondary duct with the aspect ratio of 0.41, the dimensionless pressure distributions on all wall lines in the high-positive-pressure-gradient regions were modified and then applied to the proposed 3-D design method to correct the cross-sectional profiles.
The width of each cross-section was considered unchanged during the geometry corrections as a design constraint. Equation (8) was used to modify the cross-sections because the curvature of the centerline was known and considered equal to that of the secondary duct. First, the dimensionless pressure distributions on the upper and lower symmetry lines were modified to match the corresponding dimensionless pressure distribution of the initial geometry in the region with a high positive pressure gradient. Figure 28 compares the modified dimensionless pressure distributions on the upper and lower symmetry lines with those of the initial and secondary ducts. The increase of the aspect ratio in the secondary duct increases the dimensionless pressure difference between the upper and lower symmetry lines. Figure 28 also shows that the modified dimensionless pressure distributions on the upper and lower symmetry lines in the highpositive-pressure-gradient regions match with the corresponding dimensionless pressure distributions of the initial geometry that does not have separation. In other words, the pressure loading on the symmetry plane decreases in the regions with a high positive pressure gradient. Because the curvature of the centerline was considered equal to that of the secondary duct, the decrease of the modified pressure loading on the symmetry plane should be compensated by increasing the pressure loading on the other 2-D planar planes in the high-positive-pressure-gradient regions. To do this, a correlation was needed to obtain a constraint for the dimensionless pressure distribution of each cross-section.
Appl. Sci. 2021, 11, x FOR PEER REVIEW Figure 28. Modified dimensionless pressure distribution along the upper and lower lines symmetry plane compared to the initial and secondary geometry.
If the dimensionless pressure is plotted on a plane normal to the flow of an S duct, according to Equation (12), the sum of the dimensionless pressures is zero. words, on the plane normal to the flow, the integral of the dimensionless pressur becomes zero. Figure 29 shows the dimensionless pressure of the initial geometr tion "A". If the dimensionless pressure is plotted on a plane normal to the flow of an S-shaped duct, according to Equation (12), the sum of the dimensionless pressures is zero. In other words, on the plane normal to the flow, the integral of the dimensionless pressure graph becomes zero. Figure 29 shows the dimensionless pressure of the initial geometry in section "A". For each cross-section normal to the centerline, the modified dimensionless pressure of the upper and lower points (Phi = 0, 180) was obtained from Figure 28. The modified dimensionless pressures on the other 2-D planner ducts were obtained according to Equation (12). Figure  For each cross-section normal to the centerline, the modified dimensionless pressure of the upper and lower points (Phi = 0, 180) was obtained from Figure 28. The modified dimensionless pressures on the other 2-D planner ducts were obtained according to Equation (12). Figure 30 compares the dimensionless wall pressure distributions of the initial and secondary ducts with the modified dimensionless wall pressure distributions on sections A, B, C and D as examples. The areas below all the dimensionless pressure distributions are zero, according to Equation (12). Figure 30 also shows that although the maximum pressure loadings for the modified distributions have decreased compared to those of the upper points in the secondary duct, the pressure loadings of the other points adjacent to the maximum values have increased to compensate the decrease of pressure loading on the symmetry plane.
According to Figure 30, sections "A" and "B" are located at the first bend of the S-shaped duct. In these two sections, the undesirable pressure gradient on the lower wall (ϕ = 180) causes secondary flow. Therefore, the pressure on the bottom wall decreases, and the pressure loading is transferred to the lateral points to decrease the pressure difference of the top and bottom points on the sections "A" and "B". In sections "C" and "D", which are located in the second bend of the duct, the situation is opposite. In other words, there is an undesirable pressure gradient in the upper wall of the duct (ϕ = 0) in the second bend. By reducing the pressure in the upper wall, the secondary flow is controlled.
The modified dimensionless pressure distributions were applied to the proposed 3-D inverse design method to correct the secondary duct. The design process converged to the favorable geometry only after 50 geometry corrections using the three-dimensionally modified dimensionless pressure contours ( Figure 31). Figure 32 compares the pressure contours on the symmetry plane of the initial, secondary, and modified geometries. It is clear that the difference between the pressure along the upper and lower symmetry lines has decreased through the bends of the modified geometry. Figure 33 illustrates the 2-D streamlines inside the symmetry plane and the 3-D streamlines inside the entire duct, which were computed by the RANS flow solver. It is clear that the separation and secondary flow have been eliminated from the three-dimensionally-modified duct. Figure 34 compares the Mach number contours at the outlet of the secondary and three-dimensionally-modified S-ducts with the same aspect ratio of 0.41. The uniformity of the Mach number at the outlet an S-duct can strongly affect the performance of downstream components such as an engine. Figure 34 clearly shows that the outlet Mach number of the three-dimensionally-modified S-duct is more uniform than that of the secondary duct, which is the result of modifying the dimensionless pressure contours in high-pressure regions and eliminating the separation and secondary flow inside the duct. and secondary ducts with the modified dimensionless wall pressure distributions on sections A, B, C and D as examples. The areas below all the dimensionless pressure distributions are zero, according to Equation (12). Figure 30 also shows that although the maximum pressure loadings for the modified distributions have decreased compared to those of the upper points in the secondary duct, the pressure loadings of the other points adjacent to the maximum values have increased to compensate the decrease of pressure loading on the symmetry plane. According to Figure 30, sections "A" and "B" are located at the first bend of the Sshaped duct. In these two sections, the undesirable pressure gradient on the lower wall ( = 180) causes secondary flow. Therefore, the pressure on the bottom wall decreases, contours on the symmetry plane of the initial, secondary, and modified geometries. It i clear that the difference between the pressure along the upper and lower symmetry line has decreased through the bends of the modified geometry. Figure 33 illustrates the 2-D streamlines inside the symmetry plane and the 3-D streamlines inside the entire duc which were computed by the RANS flow solver. It is clear that the separation and second ary flow have been eliminated from the three-dimensionally-modified duct.  has decreased through the bends of the modified geometry. Figure 33 illustrates streamlines inside the symmetry plane and the 3-D streamlines inside the ent which were computed by the RANS flow solver. It is clear that the separation and ary flow have been eliminated from the three-dimensionally-modified duct.  The uniformity of the total pressure distribution at the outlet of an S-duct is important for the performance of the downstream component. An expression for a distortion coefficient to quantify the flow irregularities or total pressure distortion at the duct outlet is DC (90), which is defined as follows: Max|P 02,ave − P 02,ave,90 | 1l2ρU 2 (13) where P 02,ave is the average total pressure at the duct outlet and P 02,ave,90 is the average total pressure over a 90 degree sector of the engine face. For the three-dimensionally-modified S-duct, DC (90) is equal to 0.085. In Figure 35, the total pressure contours on different cross-sections are compared for the secondary and three-dimensionally-modified S-ducts.
The total pressure loss decreased through the three-dimensionally-modified S-duct due to the modified cross-sectional profiles, which were obtained by 3-D inverse design.   Figure 34 compares the Mach number contours at the outlet of the secondary and three-dimensionally-modified S-ducts with the same aspect ratio of 0.41. The uniformity of the Mach number at the outlet an S-duct can strongly affect the performance of downstream components such as an engine. Figure 34 clearly shows that the outlet Mach number of the three-dimensionally-modified S-duct is more uniform than that of the secondary duct, which is the result of modifying the dimensionless pressure contours in high-pressure regions and eliminating the separation and secondary flow inside the duct.    Figure 34 compares the Mach number contours at the outlet of the secondary and three-dimensionally-modified S-ducts with the same aspect ratio of 0.41. The uniformity of the Mach number at the outlet an S-duct can strongly affect the performance of downstream components such as an engine. Figure 34 clearly shows that the outlet Mach number of the three-dimensionally-modified S-duct is more uniform than that of the secondary duct, which is the result of modifying the dimensionless pressure contours in high-pressure regions and eliminating the separation and secondary flow inside the duct.
(b) Three-dimensionally-modified S-duct. The uniformity of the total pressure distribution at the outlet of an S-duct is important for the performance of the downstream component. An expression for a distortion coefficient to quantify the flow irregularities or total pressure distortion at the duct outlet is DC (90), which is defined as follows: To show the capability of the proposed method, the performance of the three-dimensionallymodified S-shaped duct is compared with the results of D'Ambros et al. [18]. They performed a multi-objective optimization with two objective functions to quantify the performance of an S-Shaped duct during the optimization process. They used total pressure loss and swirl angle as the objective functions. The swirl angle is defined as follows: where V θ as the tangential velocity is calculated as: They obtained two optimized geometries considering the two objective functions. The solution with minimal total pressure loss was named opt CP and the solution with minimal swirl angle was named opt α .
x FOR PEER REVIEW 26 of 30 where , is the average total pressure at the duct outlet and , , is the average total pressure over a 90 degree sector of the engine face. For the three-dimensionally-modified S-duct, DC (90) is equal to 0.085. In Figure 35, the total pressure contours on different cross-sections are compared for the secondary and three-dimensionally-modified S-ducts. The total pressure loss decreased through the three-dimensionally-modified S-duct due to the modified cross-sectional profiles, which were obtained by 3-D inverse design.
(b) Three-dimensionally-modified S-duct. To show the capability of the proposed method, the performance of the three-dimensionally-modified S-shaped duct is compared with the results of D'Ambros et al. [18]. They performed a multi-objective optimization with two objective functions to quantify the performance of an S-Shaped duct during the optimization process. They used total pressure loss and swirl angle as the objective functions. The swirl angle is defined as follows: = where as the tangential velocity is calculated as: They obtained two optimized geometries considering the two objective functions. The solution with minimal total pressure loss was named and the solution with minimal swirl angle was named . Table 2 compares the performance of the modified S-duct with that of the secondary duct and previous study. The modified S-duct had a more uniform flow and significantly lower DC (90) at the duct outlet. The modified S-duct also had a lower pressure loss, a higher pressure recovery coefficient and minimum swirl angle. The results also show that pressure recovery and outlet flow distortion increased by 30% and decreases by 69%, respectively.
Although the aspect ratio of the three-dimensionally-modified S-shaped duct in the present work was 34% higher than that of the optimized S-shaped duct [18], it had a higher performance compared to the optimized S-shaped duct [18]. Furthermore, the S-shaped duct designed by the upgraded 3-D inverse design converged after only 50 geometry corrections while the optimized S-shaped duct in [18] converged after 1300 iterations.  Table 2 compares the performance of the modified S-duct with that of the secondary duct and previous study. The modified S-duct had a more uniform flow and significantly lower DC (90) at the duct outlet. The modified S-duct also had a lower pressure loss, a higher pressure recovery coefficient and minimum swirl angle. The results also show that pressure recovery and outlet flow distortion increased by 30% and decreases by 69%, respectively. Although the aspect ratio of the three-dimensionally-modified S-shaped duct in the present work was 34% higher than that of the optimized S-shaped duct [18], it had a higher performance compared to the optimized S-shaped duct [18]. Furthermore, the S-shaped duct designed by the upgraded 3-D inverse design converged after only 50 geometry corrections while the optimized S-shaped duct in [18] converged after 1300 iterations.

Conclusions
In this research, an upgraded BSA was three-dimensionally developed for the inverse design of 3-D S-ducts with different cross-sectional shapes. The pressure distribution on the wall of a 3-D duct is influenced by the centerline curvature, area, and cross-sectional shape. If the original BSA based on the pressure difference is used for the geometry correction of a 3-D duct, the inverse design diverges. To converge the 3-D inverse design, the displacement of the wall nodes was defined based on a new dimensionless pressure parameter to eliminate the effect of area using the streamline curvature.
The proposed method was validated by a straight duct with arbitrary cross-sectional area converging to the target geometry. Finally, the 3D inverse design was used to eliminate the current separation and reduce the distortion in a diffuser due to increasing the aspect ratio. The main results of this study are summarized as follows: The 3-D diffuser was replaced by several 2-D planar ducts. Changing the upper and lower lines of each planar duct changes the total cross-sectional area and thus affects the pressure contour of the other 2-D planar ducts.
Due to the effect of cross-sectional area on the pressure contour, the use of the pressure difference is not a suitable criterion for the displacement of control points in 3-D inverse design and causes a divergent solution.
The pressure contour of a 3-D diffuser was nondimensionalized based on the flow curvature equation. The dimensionless pressure is only a function of the duct curvature and the height of the diffuser cross-sections so that the effect of the area is eliminated.
Using the dimensionless pressure, the duct curvature is corrected in a lower number of iterations.
Dimensionless pressure is a suitable criterion for moving the control points and correcting cross-sections in the inverse design of 3-D ducts.
Increasing the duct curvature increases the difference between the pressure along the upper and lower lines in the bending areas and creates a secondary flow. By correcting the dimensionless pressure in a high-pressure-gradient region and correcting the cross-section, the pressure difference decreases, which improves duct performance.

Conflicts of Interest:
The authors declare no conflict of interests.

Abbreviations a
Half the cross-section height (m) AR Aspect ratio, height to length duct b Half