Virial functional and dynamics for nonlinear Schrödinger equations of local interactions