In order to expand the engineering application area of nonlinear standing waves in acoustic resonators, a new numerical algorithm is proposed for simulating nonlinear standing waves in resonators. It also can be used to overcome the shortages of the existing numerical methods, which restrict the solution to the nonlinear standing waves in cylindrical resonators and exponential resonators. The numerical algorithm is constructed based on the Navier-Stokes equations in the resonators with variable cross-section for an unsteady compressible thermoviscous fluid without truncation, and the space conservation law. The numerical algorithm-finite volume method for solving the nonlinear standing waves in acoustic resonators by piston driving is built based on the semi-implicit method for pressure-linked equations-consistent algorithm and staggered grid technique. Simulations for solving the nonlinear standing waves in cylindrical resonators, exponential resonators and conical resonators are carried out. By comparison with the existing experimental results and numerical simulation results, the accuracy of the developed finite volume algorithm is verified. Some new physical results are obtained, including unsteady velocity, density and temperature. The shock-like pressure wave shapes are found in cylindrical resonators, simultaneously, and the results show that the sharp velocity spikes appear in the cylindrical resonators. High amplitude acoustic pressures are generated in exponential resonators and conical resonators. Shock-like pressure waves and the sharp velocity spikes are not found. The strong dependence of the physical properties of nonlinear standing waves on resonator shape is demonstrated through the simulative results.