Filtration of metal melts is a common practice used in order to produce materials that meet high requirements with respect to strength and toughness. Numerical simulations of the filtration process not only help to investigate the involved mechanisms but can also contribute to process optimization. Owing to the presence of a wide range of spatial and temporal scales which have to be resolved, these simulations are generally carried out on extremely refined computational grids with high temporal resolution using massively parallelized computation. However, the amount of data resulting from such computations can easily exceed dozens of terabytes, which imposes a severe hindrance on the storage, visualization, and analysis of the solutions. A promising approach for addressing this problem is in situ data compression, where data is already compressed during the simulation run on the supercomputer rather than as a post-processing step. In this article, a detailed numerical simulation is described for the liquid metal flow through a foam-like filter structure using the lattice Boltzmann method. A novel in situ data compression procedure is investigated that, while lossy, can achieve arbitrary precision to meet an error bound specified by the user. The efficiency and accuracy of the algorithm are evaluated by statistical analysis and by comparing the trajectories of tracer particles in uncompressed and compressed flow fields. The results demonstrate that, depending on the desired accuracy, compression rates of as low as 20% of the original data size can be achieved.