Accurate prediction of atmospheric boundary layer (ABL) flow and its interactions with wind turbines is of great importance for optimizing the design and efficiency of wind farms. This study first focuses on recent efforts to develop and validate a large-eddy simulation (LES) framework for wind-energy applications. The subgrid-scale turbulent fluxes of momentum and heat are parameterized using tuning-free dynamic models. The turbine-induced forces are parameterized using two types of models: an actuator disk model that allows for non-uniform force distribution and includes rotational effects, and an actuator line model. The LES framework is validated against wind-tunnel measurements collected inside and above a large model wind farm. Further, this framework is used to study wind-farm effects. Comparison of simulations of flow through both aligned and staggered wind farms shows important effects of farm layout on the flow structure and wind-turbine performance. We also investigate the impacts of wind farms on a stable ABL and a convective ABL.