A penalty formulation for the throughflow modeling of turbomachinery