Rigid foam modeling