Simulating the physical properties of dark matter and gas inside the cosmic web