  Recent observations of the HDO/H$_2$O ratio toward protostars in isolated and
clustered environments show an apparent dichotomy, where isolated sources show
higher D/H ratios than clustered counterparts. Establishing which physical and
chemical processes create this differentiation can provide insights into the
chemical evolution of water during star formation and the chemical diversity
during the star formation process and in young planetary systems. Methods: The
evolution of water is modeled using 3D physicochemical models of a dynamic
star-forming environment. The physical evolution during the protostellar
collapse is described by tracer particles from a 3D MHD simulation of a
molecular cloud region. Each particle trajectory is post-processed using
RADMC-3D to calculate the temperature and radiation field. The chemical
evolution is simulated using a three-phase grain-surface chemistry model and
the results are compared with interferometric observations of H$_2$O, HDO, and
D$_2$O in hot corinos toward low-mass protostars. Results: The physicochemical
model reproduces the observed HDO/H$_2$O and D$_2$O/HDO ratios in hot corinos,
but shows no correlation with cloud environment for similar identical
conditions. The observed dichotomy in water D/H ratios requires variation in
the initial conditions (e.g., the duration and temperature of the prestellar
phase). Reproducing the observed D/H ratios in hot corinos requires a
prestellar phase duration $t\sim$1-3 Myr and temperatures in the range $T \sim$
10-20 K prior to collapse. This work demonstrates that the observed
differentiation between clustered and isolated protostars stems from
differences in the molecular cloud or prestellar core conditions and does not
arise during the protostellar collapse itself.
