A simplified model of a primary HVAC system comprising an on-off boiler, thermal storage and solar thermal collectors is simulated in hourly resolution. The simulation passes the results to an optimization algorithm that sizes the system. The objective is to minimize total costs and reach a desired solar ratio. Results show good model performance and short simulation run time. A global bounded Nelder-Mead method is implemented to calculate optimal system configurations in two case studies. The amount of user input data is minimised to enable optimal plant configuration selection during early building design, but also to avoid the system oversize.