In this dissertation, different aspects of turbulent transport and thermally driven flows over complex terrain are investigated. Two publications concentrate on the vertical heat and moisture exchange in the convective boundary layer over mountainous terrain. To study this, Large-Eddy Simulation (LES) is used. Both turbulent and advective transport mechanisms are evaluated over the simple orography of a quasi-two-dimensional, periodic valley with prescribed surface fluxes. Here, terrain elevation varies along only one of the horizontal coordinate axes. Even a relatively shallow orography, possibly unresolved in existing numerical weather prediction models, modifies the domain-averaged moisture and temperature profiles. For the analysis, the flow is decomposed into a local turbulent part, a local mean circulation, and a large-scale part. An analysis of the turbulent kinetic energy and turbulent heat and moisture flux budgets shows that the thermal circulation significantly contributes to the vertical transport. It is found that thermal upslope winds are important for the moisture transport from the valley to the mountain tops. In total, moisture export out of the valley is mostly accomplished by the mean circulation. On the temperature distribution, which is horizontally relatively homogeneous, the thermal circulation has a weaker impact. If an upper-level wind is present, it interacts with the thermal circulation. This weakens the vertical transport of moisture and thus reduces its export out of the valley. The heat transport is less affected by the upper-level wind because of its weaker dependence on the thermal circulation. These findings were corroborated in a more realistic experiment simulating the full diurnal cycle using radiation forcing and an interactive land surface model. Based on these results, coherent turbulent structures in the convective boundary layer over non-flat terrain are studied in further detail. A conditional sampling method based on the concentration of a decaying passive tracer is implemented in order to identify the boundary-layer plumes objectively. Conditional sampling allows to quantify the contribution of plume structures to the vertical transport of heat and moisture. In case of the idealized valley, vertical transport by coherent structures is the dominant contribution to the turbulent components of both heat and moisture flux. It is comparable in magnitude to the advective transport by the mean slope-wind circulation, although it is more important for heat than for moisture transport. A set of less idealized simulations considers the flow over three-dimensional terrain. In this case, conditional sampling is carried out by using a simple domain-decomposition approach. We demonstrate that thermal updrafts are generally more frequent on hill tops than over the surroundings, but they are less persistent on the windward sides when large-scale winds are present in the free atmosphere. The tools for flow decomposition and budget analysis are also applied in another idealized case with a quasi-two-dimensional valley featuring the stable boundary layer. Here, the formation of a low stratus cloud is investigated. The main driver for the cloud formation is radiative cooling due to outgoing longwave radiation. Despite a purely horizontal flow, the advection terms in the prognostic equations for heat and moisture produce vertical mixing across the upper cloud edge leading to a loss of cloud water content. However, this behavior is not due to any kind of thermally-driven circulation. Instead, this spurious mixing is caused by the diffusive error of the advection scheme in regions where the sloping surfaces of the terrain-following vertical coordinate intersect the cloud top. It is shown that the intensity of the (spurious) numerical diffusion strongly depends on the horizontal resolution, the order of advection, and the choice of the scalar advection scheme. A LES with 4 m horizontal resolution serves as a reference. For horizontal resolutions of a few hundred meters, carried out with a model setup as it is used in Numerical Weather Prediction, a strong reduction of the simulated liquid-water path is observed. In order to keep the (spurious) numerical diffusion at coarser resolutions small, at least a fifth-order advection scheme should be used. In the present case, a WENO scalar advection scheme turns out to increase the numerical diffusion along a sharp cloud edge compared to an upwind scheme. Furthermore, the choice of the vertical coordinate has a strong impact on the simulated liquid-water path over orography. With a modified definition of the terrain-following sigma coordinate, it is possible to produce cloud water where the classical sigma coordinate does not allow any cloud formation.