Radiative hydrodynamic modelling of the Lyman continuum during solar flares