A method of compartmentalization has been developed to address the safety concerns of urban areas from coastal flooding, especially in situations where reinforcing the first line of defence (dunes, levees, etc.) is challenging due to, for instance, environmental limitations. Various compartmentalization options can be considered and evaluated in order to govern the flooding. Each option should be modelled with a suited numerical tool to better define the alternatives, determine the minimum height of the elements that bound the compartments and verify their effectiveness for the preliminary design, e.g. for the environmental screening stage. The methodology is demonstrated for a real case study, the flooding of Lido di Volano that occurred on November 22, 2022, using a simplified shallow water equations model designed for GPU computing to simulate large-scale flooding scenarios. Two compartmentalization schemes have been identified, both of which involve raising the existing road level. The maximum water levels in different zones of the study area are assessed as a function of crest height. These schemes have proven to be effective in protecting the urban settlement from flooding. Overall, the proposed method of compartmentalization, supported by a real case study analysis, offers a systematic approach to enhance the safety and the resilience of urban coastal areas. This type of solution capitalises on the experience of the local managers and technicians and may represent a shared solution among the coastal governance actors.