We present a Computational Fluid Dynamics (CFD) modeling strategy for onshore windfarms aimed at predicting and optimizing the production of farms using a CFD model that includes me-teorological data assimilation, complex terrain and wind turbine effects. The model involves the solutionof the Reynolds-Averaged Navier-Stokes (RANS) equations together with a κ-ε turbulence model spe-cially designed for the Atmospheric Boundary Layer (ABL). The model involves automatic meshing andgeneration of boundary conditions with atmospheric boundary layer shape for the entering wind flow.As the integration of the model up to the ground surface is still not viable for complex terrains, a specificlaw of the wall including roughness effects is implemented. The wake effects and the aerodynamic be-havior of the wind turbines are described using the actuator disk model, upon which a volumetric forceis included in the momentum equations. The placement of the wind turbines and a mesh refinement forthe near wakes is done by means of a Chimera method. The model is implemented in Alya, a HighPerformance Computing (HPC) multi physics parallel solver based on finite elements and developed atBarcelona Supercomputing Center.