The immersed boundary method (IBM) is currently utilized in the simulation of two-dimensional axisymmetric flow in solid rocket motors. In this paper, the IBM is applied to three-dimensional flow fields, keeping the grain surface fixed. Based on the Cartesian grid, a three-dimensional Euler flow solver is developed using the finite difference method. All boundaries of the flow field are processed using the IBM, including the slip walls, mass flow inlet, pressure outlet, and rotational periodic boundary. Specific implementation of these boundary conditions and the mesh generation process are described. Using the ray-casting approach and the alternating digital tree data structure, an efficient method is proposed to determine the intersection relationship between a rectangular volume grid cell and a triangular surface mesh element. The numerical results of Taylor–Culick flow verify that the developed solver has more than one-order accuracy in space. To conduct the validation of the established method, three typical grains are selected for flow simulations, namely, the perforated cylindrical grain with burning on both the ends and the inner surface, the end-slotted end-burning grain, and the finocyl grain, respectively. The simulated results are compared with those of the zero-dimensional interior ballistics, the two-dimensional axisymmetric IBM, and the body-fitted grid method, verifying the fidelity of the developed three-dimensional flow solver.