We present a simple way to construct three-dimensional initial conditions for relativistic heavy-ion collisions based on the Glauber collision geometry. Local energy and momentum conservation conditions are imposed to set non-trivial constraints on our parametrizations of longitudinal profiles for the system's initial energy density and flow velocity. After calibrating parameters with charged hadron rapidity distributions in central $\mathrm{Au}+\mathrm{Au}$ collisions, we test model predictions for particle rapidity distributions in $d+\text{Au}$ and peripheral $\mathrm{Au}+\mathrm{Au}$ collisions in the Beam Energy Scan program at the Relativistic Heavy-Ion Collider. Simulations and comparisons with measurements are also made for $\mathrm{Pb}+\mathrm{Pb}$ collisions at Super Proton Synchrotron energies. We demonstrate that elliptic flow measurements in heavy-ion collisions at $\sqrt{s}\ensuremath{\sim}10$ GeV can set strong constraints on the dependence of quark-gluon plasma shear viscosity on temperature and net baryon chemical potential.