Thermodynamic optimisation of irreversible solar heatengines