• No se han encontrado resultados

CAPÍTULO 2. ERP EN LA NUBE

2.2 ERP en la nube – Software As A Service

The first phase of the modelling effort concerned the use of the Kawasaki site exchange model [141] for a baseline mass transfer approximation. The Kawasaki exchange model is reminiscent of the Ising model for ferromagnetic lattice simulations. Using a ferromagnetism model such as this is somewhat unorthodox; however, the lattice-gas characteristics of the Kawasaki exchange model [92] certainly indicates otherwise. Further, a probability of cell

152 7. PHOTOBIOREACTOR MODELLING

FIGURE7.1: A visualisation of a simulated photobioreactor at a very late time step. Cubes represent algal cells.

division dependent on exponential decay of illumination intensity was used. This used the lateral distance from the closest of the left and right vessel walls. Additionally, a weak gravitational force was also used, which has been previously researched in the context of sedimentation simulation [92].

The Kawasaki model itself depends on energy minimisation and stochasticity. Essentially, the species in a lattice would diffuse until they make contact with other identical species. Contact between identical species is considered a bond, which requires energy to break. Exchanges occur between two neighbour species should a decrease in local energy result. Otherwise, a temperature parameter along with a random deviate and Metropolis probability is used to decide whether to accept an exchange, regardless of the bonds that may be broken as a result. A visualisation of this with a relatively low temperature is shown in Figure7.2.

FIGURE7.2: The canonical Kawasaki exchange model.

To facilitate some additional inquiry into the movement of cells, a site has an age counter, which is incremented should it be exchanged with a neighbouring cell. This results in the coloured lattice sites shown in Figure7.2,

7.2. CONVENTIONAL ABM 153

which are normalised and spread across the hue parameter of the HSV colour space where red is close to zero. To conserve computing effort required (and allow compatibility with parallel MOL), both the species state variable (empty or occupied) and age counter are stored within the same 32-bit integer. The most significant byte is used for the state variable, and the first three bytes as the age counter. Empty lattice sites are denoted by 32 zero-bits.

Computing cell division is based loosely on the illumination upon the lattice sites, which shall be known as thecellshenceforth. For modelling light penetration into the vessel, a standard exponential absorption function was used in the spirit of the Lambert-Beer law from the study of optics [155,20]. Scatterance is another aspect to hydrological optics, in tandem with photo absorption [144], however, in this work, focus is given to absorption in the medium by a constant attenuance exponent (β). The equation describing the cell division probabilityP(split)is given in Equation7.1.

P(split) =γe−βf2 (7.1)

Here,fis the lattice width fraction of the site to the closest wall (shown in Equation7.2,wis the width of the lattice). Theγvariable is a simple amplitude variable, and finally,βcontrols the slope of the decay.

f = 1− 1−2x w (7.2)

Gravitational bias is introduced by widening the probability that a cell will exchange into the site below it, should that site be chosen for a potential exchange; as well as narrowing the probability that the cell will exchange into a site above it. The motivation behind this is that in the interest of energy minimisation, a site below a cell is regarded as a drop in energy, andvice-versawith the upper site. At this point, 2-dimensional lattices are used for explanation purposes.

To simulate heavier cells due to nutrient absorption, the gravitational bias was modified to accept influence from the cell age counter, which was assumed to be proportional to nutrient absorption. This assumption, while somewhat arbitrary, gives the effect of older cells sinking to the bottom of the vessel. The immediate effects of this on the original Kawasaki site-exchange model is sedimentation, which is clearly seen when multiple species are present in the lattice [92]. Figure7.3shows the effects of a weak gravity force in the Kawasaki model [92] with multiple species in the lattice.

(a) An early timestep screenshot. (b) A later timestep screenshot.

154 7. PHOTOBIOREACTOR MODELLING

Larger sytems and more temporally distant system states can be attained by usingGraphical Processing Units (GPUs). The use of NVIDIA’sCUDAis discussed in Chapters2,3and4. Due to the larger neighbourhood of cells that must stay in synchronisation, a “checkerboard update” is used to ensure that threads do not cause race conditions. In the Kawasaki exchange model, cells in the lattice must be able to read/write in the Von Neumann neighbourhood of Manhattan distancer= 1from the cell index, and at least read from the extended Von Neumann neighbourhood of Manhattan distancer= 2[92]. This imposes some restrictions on the order the lattice cells are processed. Sequential simulations typically overcome this problem by performing Monte Carlo updates of cell sites. This work follows a similar path, except random order updates are performed in a 3x3 grid around each one lattice site, and the CUDA thread grid is divided into a smaller lattice able to process1/3of the lattice at a time. This ensures that there is a gap of two cells between each concurrently running thread. The process for this simulation is outlined in Algorithm15.

initialise sites empty withP(empty) = 0.5 for alltime-stepsdo

for all3x3 blocks in latticedo

for all9 sitesiin each block, random orderdo choose a random neighbour sitej

compute energy change ifi, jexchanged ifenergy fallsthen

accept change and do exchange else

compute Metropolis probabilityp add gravitational bias

obtain random probabilityr1

accept change conditionally onr1< p compute cell division probabilityP(split)

obtain random probabilityr2 divide onr2< q

end if end for end for end for

ALGORITHM15: A GPU-parallel Kawasaki model algorithm with simple cell division.

An interesting effect of the Kawasaki model is that of multiple species. By increasing the number of species, it is possible to see the effects of competing growth. This was accomplished by “inoculating” the bioreactor vessel at the edges with different species. This data was incorporated into the 32-bit integer by reserving a few of the most significant bits. The ability to do this may be of interest, considering the very important task of ensuring that a bioreactor is not contaminated with foreign algal or bacterial strains. Being able to observe the effects of a foreign strain could be useful for detection purposes. Results of this are shown in Figure7.4.

Some qualitative and quantitative results gathered from the simulation described by Algorithm15are shown in Figures7.6and7.5. By gathering such data, it is possible to gain a sense of the simulation dynamics and more clearly notice limitations and shortcomings when compared to expected growth rates given certain lighting conditions.

7.2. CONVENTIONAL ABM 155

(a) Two competing species at an early timestep. (b) Two competing species at at apparent equlibrium.

FIGURE7.4: Competing species in a Kawasaki site-exchange model.

FIGURE7.5: Visualisation of culture growth stagnation at illumination exponent values of0,20,50, and100in order from left to right for sample runs. It is interesting to note that although50and100appear similar, they have different spatial densities.

156 7. PHOTOBIOREACTOR MODELLING

(a) Average age of the cells, by frame, for a sample run withT= 0.4andβ= 15.

(b) A plot of the fill fraction against frame number for differing values of the decay exponent parameterβ. The data in this plot have been average over 100 independent runs for each frame.

(c) Average density of each column in one sample run. (d) A typical bioreactor nearing full capacity. In this sample run, the influence of gravity was set 10 times higher to make the effects more clear.

FIGURE7.6: Qualitative and quantitative results gathered from the first phase in agent-based modelling of the algal photobioreactor.

7.2. CONVENTIONAL ABM 157

The average ages of cells during a typical simulation run is shown in Figure7.6(a). Due to the small inoculation at either side of the vessel, it is expected that the first thousand frames have low ages. This is followed by a period of rapid growth, where cells are constantly moving, and ages are increasing rapidly. Finally, when the vessel is near capacity, ages reach approximately 125 and stagnate as less movement is possible. The temperature parameter was at a constant0.4during this experiment.

A fill fraction plot by timestep for the vessel is shown in Figure7.6(b). The data was averaged over100

independent runs, and for three different values of theβillumination exponent (0,50and100). The exponential drastically reduces the probability of a cell division towards the centre of the tank for values less than50.

In Figure7.6(c), the column density is shown on the lattice as an average, and maximum. These were averaged over a single sample run. As can be seen clearly, density is much less in the centre, even at the maximum measured. The variability in the data is due to the stochasticity of the algorithm. Averaging the results over separate runs as well will yield a smoother curve, however this was simply intended to cast light on the spatial configuration of cells.

Figure7.5shows the states in which the photobioreactor’s growth stagnates due to insufficient illumination. The different values ofβused to generate these images wereβ= 0,β= 20,β = 50andβ= 100. Smaller values ofβ(left two images) cause more cell division in the centre of the tank, whereas larger values cast darkness over the centre of the tank. While cells are able to survive in the centre of the tank, the probability that they divide is much lower.

Though there seems to be a growth rate attained which is loosely reminiscent of actual growth rates, important factors such as photoinhibition and mutual cell shading are ignored in this prototype. Cells do shade one another from the source of illumination to some extent, which is difficult to model in a discrete lattice simulation. In this case, an exponential light decay was used through the medium, assuming constant density. This may not always be the case. Instantaneous differences, particularly when the culture is relatively young, may have a significant impact on culture growth rates.

Documento similar