Numerical simulations of storm-surge–wave actions on coastal highways and levees are very important research topics for coastal engineering. In a large-scale region hydrodynamic model, highways and levees are often complicated in geometry and much smaller in size compared to the grid spacing. The immersed-boundary method (IBM) allows for those complicated geometries to be modeled in a less expensive way. It can allow very small geometries to be modeled in a large-scale simulation, without requiring them to be explicitly on the grid. It can also allow for complicated geometries not collocated on the grid points. CaFunwave is a project that uses the Cactus Framework for modeling a solitary coastal wave impinging on a coastline and is the wave solver in this research. The IBM allows for a levee with different geometries to be implemented on a simple Cartesian grid in the CaFunwave package. The IBM has not been often used previously for these types of applications. Implementing an infinite-height levee using the IBM into the Cactus project CaFunwave involves introducing immersed-boundary (IB) forcing terms into the standard two-dimensional (2D) depth-averaged shallow water equation set. These forcing terms cause the 2D solitary wave to experience a virtual force at the grid points surrounding the IB levee. In this paper, the levee was implemented and tested using two different IBMs. The first method was a feedback-forcing method, which proved to be more effective at modeling the levee than the second method, the direct-forcing method. In this study, the results of the two methods are presented and discussed. The effect of levee shape on the flow is also investigated and discussed in this paper.