"Each local authority has a duty (in respect of persons over 18) to make arrangements to provide residential accommodation to persons who are in need of care and attention which is not otherwise available to them, and to make welfare arrangements for certain people." [from DH website]
The following case from Category:After-care is of particular relevance:
DH Ordinary residence page