Adjoint-based calibration of inlet boundary condition for atmospheric computational fluid dynamics solvers
- 1ForWind, Center for Wind Energy Research, Carl von Ossietzky University Oldenburg, Küpkersweg 70, 26129 Oldenburg, Germany
- 2Fraunhofer Institute for Wind Energy Systems – Fraunhofer IWES, Küpkersweg 70, 26129 Oldenburg, Germany
Correspondence: Siamak Akbarzadeh (email@example.com)
A continuous adjoint solver is developed for calibration of the inlet velocity profile boundary condition (BC) for computational fluid dynamics (CFD) simulations of the neutral atmospheric boundary layer (ABL). The adjoint solver uses interior domain wind speed observations to compute the gradient of a calibration function with respect to inlet velocity speed and wind direction. The solver has been implemented in the open-source CFD package OpenFOAM coupled with the local gradient-based “CONMIN-frcg” solver of the DAKOTA optimization package. The feasibility of the optimizer output is continuously monitored during the calibration process. The inlet flow profile is considered acceptable only if it can be fitted to a logarithmic or power law function with a tolerance of 3 %. Otherwise, the optimization takes the last fitted profile and asks for a new gradient evaluation. The newly developed framework has been applied in two cases, namely the Ishihara case and Kassel domain. By using the measurements over the hill in the Ishihara case, the method was able to predict the velocity profiles upstream and downstream of the hill accurately. For the Kassel domain, despite the complexity of the site, the method managed to achieve the targeted profile within a reasonable number of the solver calls.
The wind energy industry is growing very fast and a comprehensive site assessment is a key factor in planning, installation and performance of wind farms. As a result, the interaction of the atmospheric boundary layer (ABL) flow and wind turbines is one of the most important aspects of the site assessments for wind farms. Over the last decades with the development of powerful computers the computational fluid dynamics (CFD) has become one of the leading tools for microscale simulation of the wind flow over complex terrains. However, in general, developing algorithms that capture all the physics of such complex flow regimes is an ongoing research in CFD.
In CFD simulations of atmospheric flows the correct boundary conditions (BCs) are often unknown but measurement data (wind speed, wind direction, etc.) within the area of interest is available. Using the measurement data and an inverse analysis, the unknown BCs can be obtained with an optimization algorithm. This approach is called open boundary optimization and has been successfully tried in oceanography (Seiler, 1993; Chen et al., 2013) and numerical wind prediction (NWP) models (Schneiderbauer and Pirker, 2011). Another approach is to use observations and statistical analysis (Glover et al., 2011) to calibrate the CFD model parameters (e.g., inflow and turbulence model constants).
The solution to an optimization problem can be found with different methods. However, the methods such as genetic algorithm and evolutionary strategies (Davis, 1991; Michalewicz, 1996) require a large number of function evaluations which in CFD applications can be computationally very expensive. Alternatively, the gradient-based optimizers (Ruder, 2016) use the derivative of cost function with respect to the design parameters. Then, the optimal solution can be obtained using the gradient and a relatively less cost function evaluation. Gradient computation with the finite-difference (FD) method is relatively simple. However, for a high number of design parameters it is prohibitively expensive. In the adjoint method, the sensitivity of the objective function can be calculated independently from the number of parameters, and this considerably reduces the cost of computation.
Since the first application of the adjoint method into compressible CFD models by Pironneau (1974), the adjoint-based optimization methods have been extensively used in shape and topology optimization (Jameson et al., 1998; Kämmerer et al., 2003; Li et al., 2006; Othmer and Grahs, 2005; Othmer et al., 2006). The adjoint gradient computation can be categorized into two main groups: (1) continuous adjoint and (2) discrete adjoint. In the continuous method (Jameson, 1988), the adjoint equations are first derived and then discretized. In the discrete adjoint (Giles and Pierce, 2000), using the chain rule, the adjoint solver is derived by line-by-line differentiation of the discretized original (primal) flow solver code. The discrete adjoint differentiation can also be automated using algorithmic differentiation (AD) (Griewank and Walther, 2008).
In principle, both methods can be applied to any algorithm and model which is continuously differentiable. However, the manually derived discrete adjoint differentiation of big CFD codes is laborious and error prone. Although, the AD tools can be seen as an interesting solution to this problem, their application to the codes which are written in high-level languages (e.g.,
C) is still limited in terms of memory requirement and performance. A comparison of these two adjoint approaches can be found here (Giles and Pierce, 2000; Nadarajah and Jameson, 2000, 2001).
The discrete adjoint version of OpenFOAM-based solvers has been presented before (Towara and Naumann, 2013; Towara et al., 2015). More recently a hybrid approach has also been introduced (He et al., 2018) in which some parts of the code are differentiated by finite difference, and better performance is reported in comparison to the pure discrete adjoint version of the code. Despite all these improvements, the continuous adjoint version of OpenFOAM solvers are still more popular.
The adjoint method has been well applied to different problems in atmospheric science such as wind turbine blade shape optimization (Dhert et al., 2017), wind-farm control (Goit et al., 2016; Munters and Meyers, 2017; Vali et al., 2019) and wind-farm layout optimization (King et al., 2017). Bauweraerts and Meyers (2018) have used the adjoint method and large eddy simulation (LES)-based 4D-Var data assimilation to estimate the turbulent flow field of an atmospheric boundary layer domain from lidar data. Although compared to the Reynolds Averaged Navier–Stokes (RANS) models, the LES can provide more accurate predictions of the flow field, it is still mainly used as a research tool due to its demanding computing power.
The effect of inflow boundary wind speed and its direction are significant parameters in ABL CFD simulation, but they are not often known. The focus of this paper is on the adjoint gradient-based calibration of the inlet velocity profile and inflow wind direction (WD) for a RANS-based ABL flow, which is a very common CFD solver in the wind energy industry, with only a few wind speed measurements from a metrological mast at the site. The available continuous adjoint solver of OpenFOAM CFD tool package (adjointShapeOptimizationFoam), which is for topology optimization of duct flows, is further developed to compute the gradients.
The structure of the paper is as follows: the gradient-based optimization and the theory of the adjoint method are briefly presented in Sect. 2. The derivation of the adjoint equations and its BCs from the primal flow model is explained in Sect. 3. Finally, the numerical results and the conclusions are presented in Sects. 4 and 5.
In gradient-based optimization or calibration, one needs to compute the gradient of a smooth cost function, J, with respect to the design parameters, α, at each design step,
where 𝔸 is an optimization algorithm operator that returns a perturbation Δα to the current design αn. The procedure is repeated until a convergence criterion is reached. The design parameters, α, are chosen based on the optimization problem and its parametrization.
In CFD applications, computing the term includes the differentiation of the steady-state partial differential equation (PDE) governing equation of the flow,
where R is the residual vector of the discretized flow equations that is driven to zero and ψ stands for state variables (velocity, pressure, temperature, etc.). Eq. (2) results in a linear system,
in which the term is Jacobian and represents the perturbation of flow fields. Using the chain rule, the total derivative can be then computed by
Several methods can be used to compute the gradient from Eq. (4). For instance the complex variable technique, which overcomes the problem of choosing step width in the finite-difference method, or the forward mode (tangent linearization) application of algorithmic differentiation (AD). However, all these methods are computationally expensive when the design space is large. This is due the fact that in Eq. (4) the term requires an expensive PDE simulation, which satisfies Eq. (3) for every dimension in the design space, αi. As will be shown in the following, in the adjoint method the sensitivity can be obtained without computing this expensive term.
From Eq. (3) we can write the perturbation term as
The terms in the bracket can be identified as the adjoint system of equations from which the adjoint variable, , can be introduced as
In this way, instead of solving a PDE simulation for every design variable, the adjoint system of equations needs to be solved only once. As a result, the computational cost of the gradient becomes independent of the number of design parameters (Giles et al., 2003; Mavriplis, 2007; Nielsen et al., 2010):
3.1 Flow model
The ABL flow model for cases of neutral stratification consists of steady-state Reynolds Averaged Navier–Stokes (RANS) for incompressible fluid flows (Rebollo and Lewandowski, 2014), which results in the following equations for momentum and continuity:
where (R1, R2, R3) and R4 denote the discretized flow equations, R=(R1, R2, R3, R4)T, in Eq. (2). The variables U and p are the state variables velocity vector and modified pressure, νeff stands for the sum of kinematic and turbulent viscosity, and D is the rate of strain tensor, . Throughout this work, the standard k−ϵ turbulence model with the addition of a forest model is used.
3.1.1 Inflow boundary
The properties of the inflow boundary have an important effect on the solution of the interior domain. With the increasing application of LES, hybrid RANS-LES and direct numerical simulation (DNS) methods, the inflow turbulence generation has become the subject of many research works in recent decades. For a review of such methods and their application in wind energy, we refer to Wu (2017) and Stevens and Meneveau (2017). However, due to computational cost, it is still popular in the wind energy industry to use the RANS model with an inflow boundary obtained from either an analytical formula or a one-dimensional (1-D) simulation. The idea of the latter method is to solve a zero-pressure gradient equation for a 1-D domain with periodic boundary conditions in the stream- and span-wise directions (Chang et al., 2018):
where x (horizontal) and z (vertical) are the Cartesian coordinates. The inflow profile and its turbulent characteristics are obtained from this 1-D simulation and then are mapped to the 3-D inlet boundary.
3.1.2 Forest effect
Forest canopies modify the available free volume of the terrain domain and introduce an explicit drag term to the momentum equation as below:
with density ρ, leaf-level canopy drag coefficient Cd and leaf area density A(z). The effects of the forest in the turbulence models such as k−ϵ for ABL flows have been extensively discussed in the literature and several formulas are presented to make the turbulence model consistent with the modified momentum equation. For more details, the reader may be referred to Lopes da Costa (2007).
3.2 Adjoint model
Calibration algorithms seek to maximize the agreement between simulation outputs and measurements. In the context of ABL-based model calibration, the data are often wind speed and direction at one or more locations of a potential wind-farm site. The CFD-based calibration can be formulated as a constrained optimization problem with a scalar objective function:
where R stands for the spatial residual of the flow equations with U and p the discretized velocity and pressure, respectively. and are the measured and simulated wind velocities at the same location in the domain, respectively. The variable α represents the design variables which are considered to be the velocity at inlet faces of the CFD mesh through this work.
The derivation of adjoint equations as in the preceding section is arguably the most straightforward way to introduce the adjoint equations and understand their advantages. However, the first developments for using the adjoint equations in CFD applications were done using a Lagrange multiplier argument (Hinze et al., 2008). From this point of view, the inner product of the PDE of flow equations and a new set of variables vanishes the variations of state variables, and . By introducing the adjoint variables and for adjoint velocity and adjoint pressure, respectively, , , the cost function can be reformulated to a Lagrange function as
where , and are the adjoint velocity components and Ω is the flow domain. For the sensitivities of the cost function with respect to the design parameters, we have to compute the total variation of L:
Choosing the Lagrange multipliers such that the variation with respect to the state variables vanishes, leads to
Then the sensitivity of the cost function can be given by
which excludes the state variable sensitivities.
The theory presented here is based on the work of Othmer (2008), which derives an adjoint solver for topology optimization of duct flows to reduce the pressure loss between inlet and outlet boundaries. A more detailed derivation of the model is given by Hinterberger and Olesen (2011). By neglecting the turbulent viscosity variation, assuming the “frozen turbulence” hypothesis; replacing the derivative of Eq. (9) with the forest source term; and inserting Eq. (10) into Eq. (16), this gives
Decomposition of parts into interior domain, Ω, and its boundaries, Γ, leads to reformulation of Eq. (18) as follows
JΓ and JΩ, respectively, stand for the part of the cost function which is dependent on the flow state values on the boundary and volume of the domain. Due to the definition of the cost function (Eq. 13), its direct variation comes only from the interior domain . Moreover, it does not have any derivative of the pressure field . The only derivative of the cost function is with respect to the inflow and velocity in the interior of the domain and at the locations where the measurements are available. From the latter we have
where ωi is the volume of the cell in which the measurement is located.
3.2.1 Boundary conditions
The boundary integrals of Eq. (19) can be mathematically reformulated and reduced to
where n is the unit normal vector from the boundary faces. Except for the inlet, which is the design space, the adjoint BCs should be chosen such that the above equations are held.
Generally, for an ABL CFD domain no-slip wall (zero fixed velocity) and zero-pressure gradient conditions are imposed on the ground. For a wall type of boundary in which is zero, the first integral of Eq. (24) is canceled. Then, the only way to satisfy the conditions,
is to apply a no-slip () condition on the ground. No BC can be derived on the ground for the adjoint pressure but consistent with the primal a zero gradient condition is applied.
For the top and outlet boundaries of the domain a zero gradient velocity (() and zero fixed pressure (p=0) are the common conditions for the primal system. These conditions fulfill Eq. (23) and cancel the second integral of Eq. (24). The only term that remains is the first term of Eq. (24), which needs to be zeroed out,
After decomposition into tangent and normal components it can be shown that the relations below should hold
where subscripts n and t represent the normal and in-plane components, respectively. The adjoint BCs can be summarized as
It is worth mentioning that the last term of the adjoint pressure, which includes the kinematic viscosity, in implementation is often neglected (Nilsson et al., 2014). Moreover, the adjoint variables at the inlet should not be chosen to zero out the inlet velocity perturbations because the design variables are the inlet velocities. Instead, the zero gradient condition is imposed on the inlet for both adjoint velocity and adjoint pressure to have a well-posed system. Finally, from the integral over the boundary term in Eq. (19) it is clear one needs to evaluate the following expression,
to compute the sensitivity.
3.2.2 Wind direction effect
As it was mentioned before, in ABL CFD simulations it is common to simulate first a 1-D domain with a periodic boundary to obtain the inflow boundary condition. Then the cell center velocity of the 1-D run is copied directly to its counterpart boundary face in the 3-D domain. As a requirement, the number of cells in the 1-D mesh and faces in the vertical direction of the 3-D inflow boundary should be the same (see Fig. 1). Moreover, and ideally, the face center heights in the 3-D mesh are equal to their counterpart cell height in 1-D. Although, in current work, a circular inflow–outflow boundary is considered, with some small modification in the code the method can also be applied to other boundary shapes.
The inflow wind direction (WD) effect can be expressed by a rotation angle, θ, which rotates the inflow from its default west-to-east (WD = 270∘) direction,
The adjoint solver which was explained in the previous section computes the derivative of the cost function with respect to 3-D inflow velocities at each face of the boundary:
where i and j represent the row- and column-wise position of a face on the boundary and the total number of the faces in the 3-D circular boundary is .
Using the chain rule, one can compute the sensitivity with respect to each cell of the 1-D inflow velocity as follows
Eq. (40) means the x and y gradient components of the 3-D inflow faces at the same column j are accumulated and then multiplied by cos (θ) and sin (θ), respectively, before being summed. For the sake of clarity, Eq. (40) can be rewritten as
Using the same analogy, it can be shown that the sensitivity with respect to rotation angle can be obtained by
where the dot sign stands for the inner product of the two vectors.
The adjoint solver and Eq. (32) are implemented based on the “simpleFoam” incompressible CFD solver of OpenFOAM-4.1. In this section, first the accuracy of the gradients obtained by the developed solver is tested against the 2nd-order FD method in a simple 3-D domain. Then, the inflow calibration of a real complex terrain is presented. For all the simulations in this work the general roughness length of the domain is z0=0.05 (m) and the turbulent eddies are modeled by standard k−ϵ model with canopy model by Liu et al. (1996). Moreover, an ABL wall function is used to apply the roughness-related logarithmic law near to the ground, which is consistent with Monin–Obukhov similarity theory (Chang et al., 2018).
4.1 Gradient verification
A cylindrical domain with 1000 m radius and 300 m height is chosen. The mesh of the domain has 209 000 hexahedral cells in which the inflow–outflow boundary has 49 rows and 172 columns and a total number of 8428 faces (). The topoSet utility of OpenFOAM is used to select a number of cells as forest in a box size of 300 m in x and y and 40 m in z direction. The canopy drag and leaf area density for all forest cells are Cd=0.3 and A=0.0033 m−1, respectively. The operational Reynolds number based on the free-stream velocity, forest area height and air kinematic viscosity is .
For the primal CFD simulation of a circular domain the standard “inletOutlet” BC is used which checks if the flow is flowing into the domain or out of it and switches between fixed value and zero gradient, respectively. This BC is further developed to apply the derived adjoint BCs in a similar way and based on the flow direction on the boundary.
The gradient evaluation is carried out for a simulation in which the inflow wind direction is WD = 240∘. To have some reference wind speeds the terrain is simulated assuming the wind blows from west to east (WD = 270∘). The domain and the velocity field on the planes y=0 m and z=45 m are shown in Fig. 2. The 1-D inflow boundary and the target velocity profiles in the domain are plotted in Fig. 3. The forest effect can be seen in the flow field and on the wind shear of the profile. Please note that the 30∘ difference between these two simulations is not the step size for the finite-difference computation. The finite-difference step size for gradient validation of wind direction is 0.3∘.
The gradients obtained by the developed adjoint solver are plotted against the 2nd-order FD gradients in Fig. 4. In general, the trends of the sensitivity profiles are similar. Moreover, the gradients are in excellent agreement except only for the heights between 50 and 100 m in which the maximum relative error is ϵrel=0.10. This difference can be traced back to grid resolution and the derivation of the adjoint equations and BCs which includes some simplifications such as the assumption of the frozen turbulence.
The wind direction gradients are tabulated in Table 1. The derivative of calibration cost function with respect to the change in wind direction is much higher than the change in the inflow boundary. Here also, there is a good agreement between the FD and the adjoint gradients and the relative error of wind direction sensitivity is close to that of inflow gradients. This is of course not surprising because it was shown in the previous section the sensitivity with respect to θ is obtained by mathematical operations only after the adjoint gradients are available. That said, the accuracy of the gradients computed by the adjoint solver and their signs show that they can be used for the purpose of the gradient-based calibration.
4.2 Inflow calibration
For the cases, studied in this section, the in-house terrainMesher software of the Fraunhofer IWES is used to generate the mesh. The primal flow field is simulated with an in-house CFD solver (Chang et al., 2018). The solver is a customized ABL-based version of the simpleFoam solver in the OpenFOAM package with a modified k−ϵ turbulence model which behaves like a standard model for the neutral condition.
To optimize the inlet velocity profile, the primal and adjoint solvers are coupled with the DAKOTA optimization package (Adams et al., 2017). The local gradient-based “CONMIN-frcg” solver of DAKOTA is used, which is based on the conjugate-gradient algorithm by Fletcher and Reeves (Reeves and Fletcher, 1964; Hager and Zhang, 2006). Starting from an initial guess, the algorithm updates the design parameters, αn, using the recurrence of Eq. (1) in which
and the positive step size sn is obtained by a line search, and the directions 𝔻 are generated by the following rules:
Figure 5 shows the flow chart of the calibration, in which all the steps are followed sequentially. The optimizer starts with an initial guess (both inlet velocity and WD) and repeatedly asks either for the cost function value or the gradients. The primal and the adjoint solvers provide the required information, whenever it is needed, and this process continues until a certain convergence criterion is satisfied.
As a simplistic method, the inflow boundary of a RANS ABL domain can be represented by an empirical power law function or an analytically obtained logarithmic function, which is based on the Monin–Obukhov similarity theory (MOST) (Foken, 2006). During optimization, the optimizer may ask for a cost function evaluation with a new inflow boundary, which is highly unrealistic for an ABL domain, leading to poor numerical stability or even divergence. One may assume that the inflow boundary is an analytical empirical function and, instead of the inflow velocities, calibrate the parameters of that function. Having the gradient via adjoint solver and using the chain rule, the gradient of the cost function with respect to these parameters can be easily obtained. However, the inflow boundary of a real 3-D complex terrain is neither a power law nor a logarithmic function and such parametrization may fail.
A simple approach is used in this study. This part is called the feasibility check in the optimization flow chart and is a Python script. First of all, the optimizer output is smoothed to avoid having any spikes in the inflow profile. Then it is checked whether a logarithmic, , or a power law, , function could be fitted into it. If either of these functions is fitted and its coefficient of determination is above 0.96, the smoothed inflow from optimizer (not the fitted profile!) is accepted for the CFD solver. Otherwise, the optimization takes the last fitted profile and asks for a new gradient evaluation. In this way, the inflow boundary is not necessarily a logarithmic or power law profile, and, moreover, it is not so unrealistic to be problematic for the solver. As an alternative, constraints or a penalization term can be added to the objective function. This will be explored in future works when for instance the inflow turbulence properties are also considered design parameters.
4.2.1 Ishihara case
As a case study, an ABL domain with a 3-D hill at the center is considered (see Fig. 6). The hill has the shape with h=40 m and L=100 m. The scaled wind tunnel study of the case has been presented by Ishihara et al. (1999). The domain is meshed with 2×106 hexahedral elements. The roughness value of the domain is set to be z0=0.04 m. The operational Reynolds number based on the free-stream velocity, hill height and air kinematic viscosity is .
Using Ishihara et al. (1999) wind tunnel measurements, the x component of the velocity over the hill (Ux) is used for the inflow velocity calibration. The velocity flow field at the center of the domain and the wake behind the hill can be seen in Fig. 6. Both the primal and the adjoint solvers have parallel scalability of OpenFOAM toolbox. The runtime of the adjoint solver is 60 %–70 % of the primal flow simulation, which has 30 min wall-clock time run with 24 CPU cores. It is worth noting that in the adjoint solver there is no adjoint turbulence equation to be solved.
The stopping criterion is such that the absolute error between the measurements and the simulated velocities over the hill is ϵabs<0.1 m s−1. Figure 7 shows the history of optimization and the comparison of inlet velocity profiles. The optimization has converged with 14 primal and 12 adjoint calls. The optimal velocity profile is in good agreement with the experiment. There is a small deviation starting from the height . However, the comparison of the normalized velocity profiles over the hill, shown in Fig. 8, confirms that the optimized inlet boundary is able to reproduce the experiment velocity profiles.
4.2.2 Kassel case
For the second case study, the neutral condition of “Kassel Experiment” is considered. The domain, located near Kassel in Germany, is one of the cases of the New European Wind Atlas (NEWA) project (EU-ERA-NET(Accessed September 9, 2018). There are two meteorological masts at the site including a 200 m high mast (MM200). The wind rose of the site, provided by NEWA, indicates that most of the time the wind blows from the southwest (SW) to northeast (NE).
The site is represented by a cylindrical domain with 15 km radius and 4 km height (see Fig. 9). The structured mesh is generated with the Fraunhofer IWES in-house software “terrainMesher” with 80 cells in the vertical direction. A mesh independence study is conducted to verify the suitability of a mesh of 7×106 hexahedral elements. The vicinity of the hill (zhill=428 m) where the MM200 mast is installed consists of forested area. The leaf area density of the site is obtained from the airborne lidar data and is provided by the NEWA project (Dörenkämper, 2018).
Although the wind speed measurements of the MM200 mast from the site are available, there is not enough information for wind direction at certain heights. This information is necessary for the adjoint solver in which the difference between the components of the measured and simulated velocities is a force term on the right-hand side of the adjoint momentum equation (Eq. 21). Moreover, in the calibration of the solver with real measurements, it would become difficult to discuss the source of error when there is a discrepancy between the target and the calibrated profiles. This is because, aside from the inflow calibration process, which is the aim of the current study, many other parameters (e.g., turbulence model and the accuracy of forest and ground roughness map) are involved. Instead of using the real measurements of the mast, the velocity profile near to the mast from a reference simulation is considered. The selected wind speeds can be regarded as some pseudo-measurements.
The initial guess WD is defined as 270∘, meaning wind blows from west to east. The turbulent properties of the inflow boundary are not part of the design parameters; but instead, in each new flow solver call of the optimization, the turbulent parameters of the k−ϵ model inside of the domain are initialized with the last converged solution. In this way, the turbulence model parameters are also gradually updated toward the end of the optimization when the inlet boundary velocities have reached their optimum value. The adjoint solver runtime for this case is also 60 %–70 % of the primal solver wall-clock time, which is 33 min with 120 CPU cores.
The convergence criterion is defined such that the optimization stops when the absolute difference between simulated and measured value, ϵabs, at all heights is below a certain value. Figure 10 shows the history of optimization and gradients. The optimization has called for a total number of 41 primal solver runs for cost function evaluation. In addition eight adjoint gradient evaluations were required. The optimization convergence graph shows that there is a spike both in the cost function and the wind direction. This can be explained by the fact that in early iterations the derivative of cost function with respect to the WD is much bigger than with respect to inflow. The optimizer updates the WD based on the first gradient computation. This continues for a few iterations until the cost function value, instead of decreasing, increases. Then the optimizer calls for a new gradient computation. From that point onward both the inlet velocities and the wind direction are gradually updated. The optimum WD is found as 216∘.
The initial and optimal results are compared in Fig. 11. The calibration is stopped based on a criterion, which is defined as ϵabs<0.2 m s−1. Although there is a very small deviation between target and optimized inflow profiles, the velocity profile near to the MM200 mast is in good agreement with the pseudo-measurements at all five selected heights and its error is well below the accepted threshold. Here a couple of points should also be noted. Firstly, a tighter error criterion would increase the calibration iterations and subsequently the number of CFD solver calls. Secondly, the sensitivity of wind speed at a certain point in the domain with respect to a very small change in the inflow boundary is dependent on many parameters such as terrain complexity, wind direction, CFD model, etc., and cannot be easily generalized.
In this paper, it has been shown that the ABL CFD solvers can be calibrated via adjoint-based inlet boundary optimization. Based on the frozen turbulence hypothesis and using the reference wind speeds at certain heights inside of the domain, the adjoint equations and its boundary conditions for such problems are derived. The developed solver has been coupled with the DAKOTA optimization package and applied to two 3-D terrains for a neutral stratification condition: (1) the Ishihara test case and (2) the Kassel case. For the Ishihara test case, the optimal inflow was reached with 14 primal and 12 adjoint solver calls. The calibration of the inflow and its directions for the complex terrain of Kassel was achieved after 41 primal and 8 adjoint solver calls. In both cases, an absolute error between the measurements and the simulated velocities was used as a stopping criterion.
The main conclusion remarks of the study can be summarized as follows. (a) The developed calibration framework and the adjoint solver can be successfully applied to even complex domains. (b) The feasibility check of the optimizer output is crucial. Otherwise, at some point in the calibration process, the requested inflow leads to either poor performance or even complete failure (i.e., divergence) of the CFD solver. (c) The convergence criterion can have a big impact on the total number of solver calls. One possibility is to associate the criterion with the uncertainty of the measurements, which can be explored in future work. (d) The process can be further improved to reduce the number of CFD solver calls. For instance, a quasi-Newton optimizer (e.g., BFGS, the Broyden–Fletcher–Goldfarb–Shanno algorithm) or a better parametrization could be used. (e) The presented adjoint solver has the potential to be further developed by including Coriolis force, turbulence model and thermal stratification.
The forested hill Kassel of Rödeser Berg in Germany is one of the cases of the New European Wind Atlas (NEWA) project (https://map.neweuropeanwindatlas.eu/, last access: November 2019). The “Kassel Experiment” data used in this work are available at https://windbench.net/newa-r-deser-berg-2017-blind-test (last access: November 2019).
SA conceived the presented idea, developed the theory and implemented it. HK generated the mesh and provided the settings for primal flow simulations. RB helped carry out the simulations and post-processing of the results. GS and BS supervised the work. All authors discussed the results and contributed to the final article.
The authors declare that they have no conflict of interest.
The work presented in this paper was part of the ETESIAN (FKZ 0324000D) project. The ETESIAN project was funded by the German Federal Ministry for Economic Affairs and Energy due to a decision of the German Bundestag. Moreover, the Kassel domain, which was used for the numerical results, is a test case from the NEWA project. The NEWA project was funded by the German Federal Ministry for Economic Affairs and Energy (ref. no. 0325832A/B) on the basis of a decision by the German Bundestag with further financial support from NEWA ERA-NET Plus, topic FP7-ENERGY.2013.10.1.2. The simulations were performed at the high-performance computing cluster EDDY, located at the University of Oldenburg (Germany), and funded by the Federal Ministry for Economic Affairs and Energy (Bundesministerium für Wirtschaft und Energie) under grant number 0324005.
This research has been supported by the German Federal Ministry for Economic Affairs and Energy (grant nos. FKZ0324000D, 0324005 and 0325832A/B) and the German Bundestag with further financial support from NEWA ERA-NET Plus (grant no. FP7-ENERGY.2013.10.1.2).
This paper was edited by Raúl Bayoán Cal and reviewed by four anonymous referees.
Adams, B. M., Ebeida, M. S., Eldred, M. S., Geraci, G., Jakeman, J. D., Maupin, K. A., Monschke, J. A., Swiler, L. P., Stephens, J. A., Vigil, D. M., and Wildey, T. M.: DAKOTA, a multilevel parallel object-oriented framework for design optimization, parameter estimation, uncertainty quantification, and sensitivity analysis, Tech. rep., Sandia Technical Report SAND2014-4633, Sandia National Laboratories, Albuquerque, NM, 2017. a
Chang, C.-Y., Schmidt, J., Dörenkämper, M., and Stoevesandt, B.: A consistent steady state CFD simulation method for stratified atmospheric boundary layer flows, J. Wind Eng. Indust. Aerodynam., 172, 55–67, https://doi.org/10.1016/j.jweia.2017.10.003, 2018. a, b, c
Chen, H., Miao, C., and Lv, X.: Estimation of open boundary conditions for an internal tidal model with adjoint method: a comparative study on optimization methods, Math. Probl. Eng., https://doi.org/10.1155/2013/802136, 2013. a
Davis, L.: Handbook of genetic algorithms, Van Nostrand Reinhold, New York, NY, 1991. a
Dhert, T., Ashuri, T., and Martins, J. R.: Aerodynamic shape optimization of wind turbine blades using a Reynolds-averaged Navier–Stokes model and an adjoint method, Wind Energy, 20, 909–926, https://doi.org/10.1002/we.2070, 2017. a
Dörenkämper, M.: NEWA-Rödeser Berg 2017-Blind Test, Data Source (ALS data): Hessische Verwaltung für Bodenmanagement und Geoinformation, availabl e at: https://windbench.net/newa-r-deser-berg-2017-blind-test/, last access: 9 September 2018. a
Glover, N., Guillas, S., and Malki-Epshtein, L.: Statistical calibration of CFD modelling for street canyon flows, in: Proceedings of Building Simulation 2011: 12th Conference of International Building Performance Simulation Association, 14–16 November 2011, Sydney, Australia, 1513–1520, 2011. a
Griewank, A. and Walther, A.: Evaluating derivatives: principles and techniques of algorithmic differentiation, SIAM, Philadelphia, PA, 2008. a
Hager, W. W. and Zhang, H.: A survey of nonlinear conjugate gradient methods, Pacif. J. Optimiz., 2, 35–58, 2006. a
He, P., Mader, C. A., Martins, J. R., and Maki, K. J.: An aerodynamic design optimization framework using a discrete adjoint approach with OpenFOAM, Comput. Fluids, 168, 285–303, https://doi.org/10.1016/j.compfluid.2018.04.012, 2018. a
Hinterberger, C. and Olesen, M.: Industrial application of continuous adjoint flow solvers for the optimization of automotive exhaust systems, CFD & Optimization, Antalya, Turkey, 2011. a
Hinze, M., Pinnau, R., Ulbrich, M., and Ulbrich, S.: Optimization with PDE constraints, in: vol. 23, Springer Science & Business Media, New York, NY, 2008. a
Ishihara, T., Hibi, K., and Oikawa, S.: A wind tunnel study of turbulent flow over a three-dimensional steep hill, J. Wind Eng. Indust. Aerodynam., 83, 95–107, https://doi.org/10.1016/S0167-6105(99)00064-1, 1999. a, b
Kämmerer, S., Mayer, J., Paffrath, M., Wever, U., and Jung, A.: Three-dimensional optimization of turbomachinery bladings using sensitivity analysis, ASME Turbo Expo: Power for Land, Sea, and Air, 6, 1093–1101, https://doi.org/10.1115/GT2003-38037, 2003. a
Li, H.-D., He, L., Li, Y., and Wells, R.: Blading aerodynamics design optimization with mechanical and aeromechanical constraints, ASME Turbo Expo: Power for Land, Sea, and Air, 6, 1319–1328, https://doi.org/10.1115/GT2006-90503, 2006. a
Lopes da Costa, J.: Atmospheric Flow Over Forested and Non-Forested Complex Terrain, PhD thesis, University of Porto, Porto, 2007. a
Michalewicz, Z.: Evolution strategies and other methods, in: Genetic algorithms + data structures = evolution programs, 159–177, Springer, Berlin, 1996. a
Munters, W. and Meyers, J.: An optimal control framework for dynamic induction control of wind farms and their interaction with the atmospheric boundary layer, Philos. T. Roy. Soc. A, 375, 20160100, https://doi.org/10.1098/rsta.2016.0100, 2017. a
Nadarajah, S. and Jameson, A.: A Comparison of the Continuous and Discrete AIAA CP-00-0667, Adjoint Approach to Automatic Aerodynamic Optimization, Reno, NV, 2000. a
Nadarajah, S. and Jameson, A.: Studies Of The Continuous And Discrete Adjoint Approaches To Viscous Automatic Aerodynamic Shape Optimization, in: 15th AIAA Computational Fluid Dynamics Conference, AIAA, Anaheim, CA, p. 2530, 2001. a
Nielsen, E. J., Diskin, B., and Yamaleev, N. K.: Discrete adjoint-based design optimization of unsteady turbulent flows on dynamic unstructured grids, AIAA J., 48, 1195, https://doi.org/10.2514/1.J050035, 2010. a
Nilsson, U., Lindblad, D., and Petit, O.: Description of adjointShapeOptimizationFoam and how to implement new objective functions, in: course at Chalmers University of Technology, Enero, 2014. a
Othmer, C.: A continuous adjoint formulation for the computation of topological and surface sensitivities of ducted flows, Int. J. Numer. Meth. Fluids, 58, 861–877, https://doi.org/10.1002/fld.1770, 2008. a
Othmer, C. and Grahs, T.: Approaches to fluid dynamic optimization in the car development process, in: Eurogen, FLM, Munich, 2005. a
Othmer, C., Kaminski, T., and Giering, R.: Computation of topological sensitivities in fluid dynamics: cost function versatility, in: Eccomas CFD 2006, edited by: Wesseling, P., Oñate, E., and Périaux, J., Citeseer, Delft, 2006. a
Rebollo, T. C. and Lewandowski, R.: Mathematical and numerical foundations of turbulence models and applications, Springer, New York, NY, 2014. a
Ruder, S.: An overview of gradient descent optimization algorithms, arXiv preprint arXiv:1609.04747, 2016. a
Schneiderbauer, S. and Pirker, S.: Determination of open boundary conditions for computational fluid dynamics (CFD) from interior observations, Appl. Math. Model., 35, 763–780, https://doi.org/10.1016/j.apm.2010.07.032, 2011. a
Stevens, R. J. and Meneveau, C.: Flow structure and turbulence in wind farms, Annu. Rev. Fluid Mech., 49, 311–339, https://doi.org/10.1146/annurev-fluid-010816-060206, 2017. a
Vali, M., Petrović, V., Boersma, S., van Wingerden, J.-W., Pao, L. Y., and Kühn, M.: Adjoint-based model predictive control for optimal energy extraction in waked wind farms, Control Eng. Pract., 84, 48–62, https://doi.org/10.1016/j.conengprac.2018.11.005, 2019. a
Wu, X.: Inflow turbulence generation methods, Annu. Rev. Fluid Mech., 49, 23–49, https://doi.org/10.1146/annurev-fluid-010816-060322, 2017. a