Creation of a spline along desired edge. Used later for interpolation of variables.

Method for finding the position where a specified field assumes a given value using the bisection method.

Calculation of Local Nusselt Number $\left(\text{Nu} := \frac{S}{T0-T1}\vec{n}\cdot \nabla T \right)$ along a given surface.

Calculation of Local Darcy frictionfactor $\text{f}_D := -\frac{8\nu}{(\hat{u}/2)^2}\vec{n}\cdot \nabla u_1$

This method is used for finding the position(s) of deatachment at a wall. Deattachment (or reattachment) occurs exactly at the point(s) where the friction factor is equal to zero $f_d(\vec{x})=0$

Now we calculate for each Session where Re = {400,700,100} for each ER = {1.5,2.0,2.5} the friction coefficient and Nusselt number

First we compare our results with the ones given in the benchmark Biswas, G., M. Breuer, and F. Durst. “Backward-Facing Step Flows for Various Expansion Ratios at Low and Moderate Reynolds Numbers.” Journal of Fluids Engineering 126, no. 3 (July 12, 2004): 362–74. https://doi.org/10.1115/1.1760532.

In particular we compare results for $\text{Re} = 700$

Points of separation are obtained by finding the positions where the value of the gradient of velocityX normal to the wall changes its sign.

Comparison of reattachment lengths for the primary vortex for ER =1.9423