Three-dimensional adaptive grid generation with applications in nonlinear fluid dynamics