An optimal power flow (OPF) methodology is developed to investigate the provision of a demand hydrogen as a means to maximise wind power generation in relation to a constrained electricity network. The use of excess wind energy to generate hydrogen for use as a transport fuel is investigated. Hydrogen demand is included in the objective function of the OPF, and a techno-economic analysis is presented. We conclude that using this method to generate hydrogen increases the utilisation of wind energy and allows for a hydrogen demand to be met at or near to the point of use. The OPF algorithm that has been developed optimises the amount of wind energy utilised, as well as minimising the amount of hydrogen demand not met. The cost at which the hydrogen is produced was found to be dependent on the operating methodology, component capital investment costs, level of hydrogen demand, and storage constraint.