Experience with the implementation of related algorithms indicated that the memory required for modeling large systems would be prohibitive. We therefore looked for ways to conserve and reduce memory usage. There are several tactics that we used in this implementation:
This is accomplished in the C implementation by representing the medium as a three dimensional array of pointers. At each active site, the pointer references a data structure with the necessary velocity and mass data. At the inactive sites, the pointer is NULL; no additional storage is required at the inactive sites. For a low porosity medium, the memory savings are very large.
= 1.
This assumption simplifies evaluation of equations 1-5 such that at each active site we need only store the density of each fluid component, and a single velocity vector. Without this assumption, we must store all 19 values associated with the velocity distribution, ni, at each site.
Rather than keeping an entire second data volume in which to accumulate the newly calculated data, we exploit the fact that the algorithm only uses nearest neighbors at each site. Thus we only need an additional buffer of three planes of data at any one time.
Assuming that floating point numbers and C pointers each take four bytes, these memory optimizations yield savings of over 94% of memory usage in the one component case for systems of useful sizes. The memory savings are even greater when more fluid components are used or when larger floating point representations are used.