Here, some aspects related to the software modeling are shown. The program has been developed using the main concepts of the object oriented programming. The main class is Grid, which represents the full domain of simulation. A Grid is composed by a matrix of Cell objects and some aspects of the Composite pattern can be applied here. The BaseCell class is an abstraction representing a small portion of the space containing the particle distribution function. Below, a class diagram is presented containing the main classes of the system. It is a little bit overloaded, but it is a good overview to understand the basic abstractions of the program.

Among the concrete classes derived from the BaseCell, the first one that deserves an explanation is the SCCell. This class implements the basic algorithm of the Lattice Boltzmann method, for the case of one component and one phase. The next one is the WallCell, which implements the bounce back algorithm, corresponding to a wall in the real world. There are the SourceCell and the OpenCell, two classes that models the inlet and the outlet of the simulation. The SourceCell and OpenCell are connected with the Boundary abstraction. This was done in order to support different implementations of the boundaries.

The MCCell class implements multiple components and therefore has many instances of SCCell objects. Many Force objects can be attached to a SCCell object in order to simulate effects of gravity, multiphase and multicomponent. MovingCell is a class modeled for moving elements (particles and wall). NullCell represents a cell that doesn't require any computation. It is the null object pattern. To finish this brief explanation, the Grid class is associated with other support classes: GridSimulation, GridConfig and TracersField.