JFM notebooks for Effects of pressure gradient histories on skin friction and mean flow of high Reynolds number turbulent boundary layers over smooth and rough walls

Model for predicting skin friction from effects of pressure gradient histories on skin-friction and mean flow of high Reynolds number turbulent boundary layers over smooth and rough walls
This code presents the work given in the paper to calulate the skin friction assuming the ZPG conditions along with the pressure gradient history. The model is based on the parameter which is defined as the following -
It is based on the weighted average of the pressure gradient and the local conditions at the measurement station. Furthermore, we can predict skin friction based on the following equation -
We can assume the last two terms to be negligible at matched since this work found to be independent of the pressure gradient history. This model uses a calibration based on the smooth wall data to predict the rough wall data, this function is based on the relationship between and . An iterative function is then used to solve for the , and .
This first cell imports the required functions for the model
This next cell imports the date required for the model as well as defines the velocity and angle of attack arrays along with the symbols used for plotting.
This cell defines some common functions required for the code. The first is the functional fit assumed between the difference in PI and the . The next function defines the fit used for the wake fit based on Lewkowicz, A. 1982. The next two define the musker function for which we use the average value of a found from the fitting of the 500mm pressure gradient cases. For a smooth wall, the velocity profile is defined as using fit_composite_yplus, which combines Musker with the normal outer region func. Finally, a weight function is defined to be linear; however, it can be varied to use the error function if required.
The following cell produces a calibration function using the smooth wall data between the and and then plots the result. We calibrate the function by calculating from the composite velocity profile.
The next cell is the important cell which defines the model and gives the error function for which we minimise. We have two versions of the function non where is provided from HWA data and one where we assume the velocity profile based on .
This cell runs the model and plots the results of the skin friction prediction. The user can choose to plot other variables as desired. Both versions with and without provide the depending on the function type.