Welcome back to Sports and Building Aerodynamics in the week on Computational Fluid Dynamics. In this module, we're focusing on best practice guidelines. We start again with a module question. Which statement is correct? The aerodynamic roughness length and roughness height are about the same. Or B, the aerodynamic roughness length is about one order of magnitude larger than the roughness height. Or C, the aerodynamic roughness length is about one order of magnitude smaller than the roughness height. [BLANK_AUDIO] Please hang on to your answer and we'll come back to this question later in this module. At the end of this module, you will understand best practice guidelines in CFD. This is a list of a non-complete list of some important best practice guidelines and I'm not going to read them in detail. I just provide it here for your information. And these guidelines are actually based on more generic important best practice guidelines and a list of those is indicated here. So this is definitely also recommended reading material and what I will do in the next slides is to highlight a few aspects from these best practice guidelines. For example, on computational geometry. What is important in order to keep the computational cost of a simulation within limits is to neglect details where they are expected to be unimportant. For example the stadium in a complex urban environment will be simplified to some extent, and not necessarily the stadium, but especially the surrounding buildings, will be simplified. Because in this case we're focusing on the wind flow around the stadium, and very close around the stadium, and not on the flow, the detailed flow, around every other surrounding building. Considering the size of the computational domain, there's also quite some guidelines. What is important is that the influence of the boundaries, the boundary planes that we impose. That that influence is limited. So, the domain should be sufficiently large. If you focus for example a vertical cross-section or you could see it as a 2D computational domain with a small building model inside, and you see the atmospheric boundary layer flow, flowing in from the inlet at the left side. Well then the domain should certainly be large enough, because if you make the domain too small, too low in this case, what you will then get is a real Venturi-effect and artificial acceleration which is not present in reality because there's no ceiling in atmospheric flow. There are guidelines for domain size. These are either expressed as minimum distances between the building models or sport aerodynamics models and the domain boundaries or as a so-called maximum allowed blockage ratio. Which actually refers back to the blockage ratio indeed also used in wind tunnel experiments, which we've talked about in week 2 of this MOOC. This is a nice drawing that indicates the guidelines for minimum distances between building models or any other models. And the size of the computational domain. So, you see, upstream we have a distance of five times the height of the highest building. Downstream it is fifteen times the height of the highest building. It is due to the fact that the wake of buildings is often much more extended than the upstream disturbance. On the sites we also use at least five times the, the height of the highest building. And then the height of the computational domain is at least six times the height of this highest building. Another criterion is looking at the blockage ratio, which is, again as defined in the wind tunnel, the ratio of the frontal area of the building models or any other models and the cross-section of in this case the computational domain. And it's said that this blockage ratio should below, should be below 3 to 5%, depending on the source. And this is a good guideline. However, if you have buildings for example, that are either very slender and tall, or very low and wide then you could still have some artificial acceleration and then actually, a so-called directional blockage ratio is recommended. And if you then take care that the so-called directional blockage ratio in the vertical direction, which is the height of the model divided by the height of the computation domain, and also the horizontal blockage ratio which is the width of the model divided by the width of the computation domain, if those two are lower than 17 to 22%, well then if you multiply that you'll also will get the final blockage ratio is below 3 to 5%. Concerning grid quality, well, the size of the grid is important but also the shape of the grid and the shape of the grid cells. And there's different types that can be used. 2D cell types are triangular or quadrilateral, while 3D cell types can be hexahedra, prismatic cells, pyramids and tetrahedra. There is a general guideline which is very schematically depicted here. That is that you should try to avoid extreme distortion of cells. And it can be mathematically proven indeed, that in this case the discretization error will become larger, but also that stability problems might occur and that it might not be possible to get a converged solution. So you see what is called, a bit arbitrary maybe, the good cells, acceptable cells and the cells you should try to avoid. And it is especially the case if you are in areas of large flow gradients. Another important aspect is that the stretching ratio of cells, nearby cells should be limited, for RANS simulations should be below 1.3. And sometimes below 1.2 is stated especially again in regions of interest, so the regions with the large flow gradients. But for LES because the grid size is sometimes used, or often used as a filter, it should be even less. It should be 1.1 or even below 1.05 to get a good grid stretching or acceptable grid stretching. Then for grid lines close to walls, especially the first layer close to walls, it is important that these grid lines or the grid surfaces of the cells are either parallel or perpendicular to the wall. This is not only important for the discretization error, but it is also important for the application of wall functions. Then there's some other guidelines. What you see here on the left hand side is a top view of a computational domain with two buildings in V shape there in the middle and on the right side you see a perspective view of the grid on the surfaces of these buildings. Where you see also that the grid resolution is much higher in the regions where the large flow gradients will occur. What you also see here is that the general best practice guideline of using at least ten cells, control volumes of finite elements over the length, height and width of a building and also in passages is used here. So this is a minimum, sometimes less can be sufficient, sometimes more is needed. But at least the ten cells is a good first indication. The concerning discretization schemes. Well at least second-order discretization schemes should be used, and this is a very strict guideline and a very important one. To illustrate this, for example the Journal of Fluids Engineering does not publish any results that are obtained with first-order approximations and they are very right to do so. And what can be sometimes experienced as a problem is that second-order discretization schemes will much easier yield a divergence, so, instability, of the simulations than the first-order schemes that actually apply a substantial amount of numerical, artificial diffusion which is indeed an error, that however, can help you to get a converged solution. This is actually especially the case for a less-quality grids, and certainly the case for low-quality grids. What you can do in some cases is apply first first-order schemes to start the process, the iterative process and then switch to second-order schemes. What is very important is again, as mentioned also before, the high quality of the grid. With a high quality grid it is possible, very well possible, to achieve converged solutions with second-order, and even higher-order discretization schemes. What is important there, and that is something we experience in building aerodynamics is to avoid any tetrahedral or pyramid cells. And certainly near the boundaries of the computational domain. And this is even indeed possible for a very complex geometries, like illustrated here, this is a case study that we will focus on in week 4 of this MOOC. And also, for this rather complex stadium in an urban environment, also here it was possible to avoid any tetrahedral or pyramid cells and get very good convergence behavior with the required second-order discretization schemes. An explanation of this grid technique, and time is too limited here to go into detail, but an explanation of the technique with which we generated the grid for the stadium can be found in this article. Then let's turn briefly to boundary conditions. Boundary conditions are either a representation of real boundaries, like in this case the ground surface and the surface of a building, or they are a representation of the reality, so-called beyond the finite computational domain. So it's due to the cut off of reality by the sides of this computational domain. What is particularly critical is the consistency between on the one hand the inlet conditions and boundary condition and on the other hand turbulence model that is used, turbulence modeling approach also and the grid resolution. And this is something I would like to focus on briefly in the following slides. A problem that has been often reported but is also often experienced, is that when you have a certain group of buildings for example, in building aerodynamics, in a computational domain as illustrated here, and you apply the vertical profiles of mean wind speed and turbulence intensity or turbulent kinetic energy and turbulence dissipation rate at the inlet, the profiles that you want to have, that sometimes these profiles, when they travel through the computational domain, start changing in a rather uncontrollable fashion. And especially an unintended fashion. And this is sometimes called unintended streamwise gradients or horizontal inhomogeneity. And it's a problem that is related also to the wall functions. And what is typically observed is that then this velocity profile especially near the bottom of the computational domain will start accelerating as shown in this graph here. And the turbulence intensity will drop very rapidly as it travels through the computational domain. And finally, when the profile's reach the building models you have a completely different profile that you did not want to have at this location. But these are really the profiles to which the models are being exposed. In the past different authors have observed these unintended steamwise gradients and it has also been report later on what is the reason for that. And I would like to first show you what consequences can be. Imagine what is shown here in this graph. You have two buildings parallel to each other. And we have a measurement line with six blue dots indicated, where we measure the wind speed and every measured wind speed value, we divide by the wind speed that you would have without buildings present. So by a reference wind speed, and then along this x axis, you can plot the so-called amplification factor which is shown here. So at the entrance of the passage between the buildings it's 1.2 then it goes to almost 1.4 and then it drops. If you solve this with a RANS model and a CFD code without paying appropriate attention to the consistency between inlet conditions, wall functions, turbulence model and grid resolution you get this result. And then a conclusion might be: "CFD is not suitable for solving this type of flow problem". However, this is directly related to the acceleration of this flow profile, as it travels through the computational domain towards the buildings. So if you take that deficiency into account and you solve it, you get this result. And then the conclusion is totally different being that CFD is very well suitable to predict the wind speed and the passage between those two buildings. Let's look at another example. A high rise building where on the right side we have top view of the sand erosion contours indicating amplification factors. So, this results from wind-tunnel experiments. And if we solve that CFD without taking into account these potential problems then we might find that the stagnation region which is actually upstream of the windward facade you see a desimulation is actually stuck to the facade. This is clearly an unrealistic flow field. Taking the potential inconsistency into account we find a much more realistic result where we do predict the standing vortex and the stagnation region at the right position in front of the window facade. So what's actually going on here? Well this actually has to do with so-called wall-function roughness modifications. As displayed previously, in whole functions you can insert parameters that take into account the roughness of the ground surface. Which you can do here. Which with low-Reynolds number modeling is much more difficult or even impossible. So this is an advantage of wall functions. But this is also true that most commercial CFD codes and also other CFD codes were established for so-called mechanical engineering problems and not for atmospheric flow problems. So this means that the existing wall-function roughness modifications in these codes are often based on semi-empirical information for the so-called sand-grain roughness. Which was tested, actually, in pipes and channels quite a long time ago by Nikuradse, who you can argue was a rather patient man, because he pasted sand grains nicely of equal height along the inner surface of tubes and channels. And then actually he measured the velocity profile induced by this roughness in this channel. The height of the sand grain is then the so-called sand grain roughness height and if you have a different roughness it is called equivalent sand-grain roughness height. And based on that semi-empirical and empirical information the wall functions were developed. And you see an example of a wall function here that the expresses the means speed in the tube of channel for example as a function of the distance from the wall y and also the sand-grain roughness height is indicated there. However we in atmospheric flows and in this MOOC we are dealing not with equivalent sand-grain roughness height or sand-grain roughness, we are dealing with the so-called aerodynamic roughness length. Which we discussed in the module on atmospheric boundary layer in week 1. But most commercial CDF codes and also other codes actually only provide wall functions with the first type of roughness. So we need to know the relationship between those two types of roughness where we know that this aerodynamic roughness length is actually a value that can range from a 0.0002 meter for sea surface up to about 2 meter for a very densely based city. And this 2 meter is certainly by no means an indication of the actual height of the buildings in the city. And this is again, briefly, albeit small, the Davenport/Wieringa roughness classification. Where you see these values for aerodynamic roughness length indicated for different terrain types. Which we also discussed in week 1. And then there is the equivalent sand-grain roughness height, and if you are solving atmospheric flows, with a code that has wall functions based on the sand-grain roughness height. Well then actually for, for example, this situation, where you have buildings and trees, and maybe also cars, you have to imagine what the size of the sand-grain is, or the size of the sand grains that you need to get the same type of flow behavior in the lower part of this atmospheric boundary layer. So indeed, you can imagine that this will become very, very large sand grains. But how large do they need to be? Well this is explained for example, in this article, and I will not go in detail. I will just show you very briefly what we did to derive the relationship between both. Actually very simply we demanded first-order continuity, in the first grid cell which is indicated here. So the center point of this first grid cell, we demanded this continuity between the so-called atmospheric boundary layer log law which has the aerodynamic roughness length and the wall function which has the sand-grain roughness height. And if you solve these equations you get, well based on different wall functions, you might get different expressions, but for example for the ANSYS code, ANSYS/Fluent code in the past, this is the expression, where there is also a so-called roughness constant, CS, the default value of that is 0.5. It's a difficult value to determine so generally 0.5 is used but then you see that the equivalent sand-grain roughness height is 20 times larger than the aerodynamic roughness length. What has happened often in CFD simulations is that this difference has not been noted, and that actually instead of the equivalence sand-grain roughness height which would be very large, the much smaller aerodynamic roughness length has been used, resulting in completely inaccurate computation simulations. So let's go back to the module question. Which statement is correct here? Well it's definitely that aerodynamic roughness length is about one order of magnitude smaller than roughness height. And, you see that indicated by the equation valid for the ANSYS software here. But for other commercial CFD codes, and also for other codes in general, different equations might hold because they might use different wall functions. So in this module we've learned about some of the best practice guidelines in CFD. In the next module we'll focus on what Computational Wind Engineering entails. Why Computational Wind Engineering is more complex than the routine application of CFD in aeronautics and we'll address some main concerns in CWE such as verification, validation, and specifying appropriate boundary conditions. Thank you again for watching, and we hope to see you again in the next module. [BLANK_AUDIO]