The mathematical theory and numerical algorithms necessary to simulate the ice-manufacturing and ice-filling processes for thermal energy storage tanks are presented. They have been implemented within a computer program, entitled ICEPAC, that can be used by thermal energy storage tank designers to (a) minimise the overall dimensions of the tank needed for a given cooling capacity requirements, (b) minimise the overall tank volume left void after the ice-manufacturing process, (c) control the locations of the voids, (d) determine the optimum location(s) and dimension(s) of the ice-maker opening(s), and (e) ascertain the minimum water level required to fill the tank with ice.KEYWORDS: year 1995, calculating, energy storage, rectangular, tanks, designing, ice storage, ice makers, computer programs, sizing, algorithms