A Framework to Simulate and Improve Terahertz Quantum Well Photodetectors