Modeling the relaxation dynamics of fluids in nanoporous materials