This paper describes a high-fidelity sonar model and a simulation environment that implements the model. The model and simulation environment have been developed to aid in the design of a forward looking sonar for autonomous underwater vehicles (AUVs). The simulator achieves real-time visualization through ray tracing and approximation. The simulator facilitates the assessment of sonar design choices, such as beam pattern and beam location, and assessment of obstacle detection and tracking algorithms. An obstacle detection model is proposed for which the null hypothesis is estimated from the environmental model. Sonar data is generated from the simulator and compared to the expected results from the detection model demonstrating the benefits and limitations of the proposed approach.