This paper describes a random solid-porous model capable of simulating the structure of porous materials. To this purpose, the grain and pore size distributions as well as the void ratio of the material are required. Solids and pores are distributed at random in the model's space according to a size strategy. Herein, the model is used to simulate the retention curves of soils. The Laplace equation is used to determine the size of the pores able to saturate or dry during a wetting or drying process, respectively. The continuous path principle is used to define those elements that effectively saturate or dry during these processes. With this procedure, it is possible to simulate the main retention curves as well as the scanning curves during wetting–drying cycles. Some experimental results reported in the international literature have been used to test the model. This model can be enhanced to study the mechanical behavior of unsaturated soils. Copyright © 2012 John Wiley & Sons, Ltd.