Abstract. This paper shows the results of computational fluid dynamics (CFD) studies of turbulent flow fields and their effects on a wind turbine in complex terrain. As part of the WINSENT project, a research test site comprising four meteorological masts and two research wind turbines is currently being constructed in the Swabian Alps in southern Germany. This work is an essential part of the research of the southern German wind energy research cluster WindForS. The test site in complex terrain is characterised by a densely forested escarpment and a flat plateau downstream of the slope. The met masts and wind turbines are built on this plateau. In the first part, high-resolution delayed detached eddy simulations are performed to separately investigate the effects of the forested escarpment and of thermal stratification on the flow field and accordingly on the wind turbine. In the second part, both these effects are included for a real observed case in March 2021. There, unstable conditions prevailed and the forest showed low leaf area densities due to the winter conditions. It is shown that atmospheric turbulence, forests, orographies, and thermal stratification must be considered when assessing the impact on wind turbines in complex terrain. All of these effects influence the flow field both at the turbine position and in its wake. The wind speed at the test site is accelerated by up to 60 %, which could affect the annual energy production significantly. But otherwise turbulent structures of the forest wake cross the rotor plane temporarily and thereby affect the turbine inflow. Moreover, convective conditions and upward flows caused by the orography have an impact on the turbine's power output as inclined flows result in asymmetric torque distributions. The wind turbine wake and the forest wake mix further downstream, resulting in a faster decay of the turbine wake than in neutral conditions or without forest. The paper also describes how the turbulent flow in the wake changes in the presence of thermal stratification, which is evident in order to be able to numerically represent the flow-physical changes in the diurnal cycle well.