Sustainable Systems Percolation

No preview image

1 collaborator

Default-person Rocky Iboleon (Author)

Tags

(This model has yet to be categorized with any tags)
Visible to everyone | Changeable by everyone
Model was written in NetLogo 6.2.0 • Viewed 97 times • Downloaded 3 times • Run 0 times
Download the 'Sustainable Systems Percolation ' modelDownload this modelEmbed this model

Do you have questions or comments about this model? Ask them here! (You'll first need to log in.)


WHAT IS IT?

This model shows how an oil spill can percolate down through permeable soil. It was inspired by a similar model meant to be done by hand on paper (see "Forest Fires, Oil Spills, and Fractal Geometry", Mathematics Teacher, Nov. 1998, p. 684-5).

HOW IT WORKS

The soil is modeled as a checkerboard of hard particles (gray squares) and semi-permeable spaces in between these hard particles (brown squares). (You may need to zoom in to see the individual squares.)

Oil cannot enter the solid gray squares, but it may pass through the brown squares.

Some soils are more porous ("holey") than other soils. In this model the porosity value of the soil determines the probability that the oil will be able to enter any given brown soil square.

The model represents an oil spill as a finite number of oil "particles", or simply oil drops.

The oil spill starts at the top of the view, and percolates downward.

The leading edge of the oil spill is represented by red squares, and every square that oil has passed through (or "saturated") is shown as black.

The oil drops sink downward through the soil by moving diagonally to the right or left, slipping between the hard gray particles.

HOW TO USE IT

Push the SETUP button to place the soil and start the oil spill (shown as red) at the top of the view.

Press the GO button to run the model.

The POROSITY slider controls the percent chance that oil will be able to enter each brown square, as it works its way downward.

The model can be run as long as you like; if the spill reaches the bottom of the view, the bottom row of squares is moved to the top, and the model continues to run from where it left off, starting at the top of the view. (Think of this as a camera panning downward, as necessary, to show the deeper percolation.)

The two plots show how large the leading edge of the spill is (red) and how much soil has been saturated (black).

THINGS TO NOTICE

Try different settings for the porosity. What do you notice about the pattern of affected soil? Can you find a setting where the oil just keeps sinking, and a setting where it just stops?

If percolation stops at a certain porosity, it's still possible that it would percolate further at that porosity given a wider view.

Note the plot of the size of the leading edge of oil. Does the value settle down roughly to a constant? How does this value depend on the porosity?

EXTENDING THE MODEL

Give the soil different porosity at different depths. How does it affect the flow? In a real situation, if you took soil samples, Could you reliably predict how deep an oil spill would go or be likely to go?

Currently, the model is set so that the user has no control over how much oil will spill. Try adding a feature that will allow the user to specify precisely, when s/he presses SETUP, the amount of oil that will spill on that go. For instance, a slider may be useful here, but you'd have to modify the code to accommodate this new slider. Such control over the to-be-spilled amount of oil gives the user a basis to predict how deep the oil will eventually percolate (i.e. how many empty spaces it will fill up). But then again, the depth of the spill is related to the soil's porosity. Can you predict the depth of the spill before you press GO?

NETLOGO FEATURES

This is a good example of a cellular automaton, because it uses only patches. It also uses a simple random-number generator to give a probability, which in turn determines the average large-scale behavior.

This is also a simple example of how plots can be used to reveal, graphically, the average behavior of a model as it unfolds.

In the pen-and-paper activity the soil was represented by rectangles arranged in a brickwork pattern, where each rectangular cell had two neighboring rectangular cells below it. Since NetLogo's patches are always squares in an aligned grid, our replica of the model uses a checkerboard pattern instead. Can you see how the two models would have the same behavior, despite having different ways of visualizing them?

RELATED MODELS

"Fire" is a similar model. In both cases, there is a rather sharp cutoff between halting and spreading forever.

This model qualifies as a "stochastic" or "probabilistic" one-dimension cellular automaton. For more information, see the "CA Stochastic" model.

HOW TO CITE

If you mention this model or the NetLogo software in a publication, we ask that you include the citations below.

For the model itself:

Please cite the NetLogo software as:

COPYRIGHT AND LICENSE

Copyright 1998 Uri Wilensky.

CC BY-NC-SA 3.0

This work is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License. To view a copy of this license, visit https://creativecommons.org/licenses/by-nc-sa/3.0/ or send a letter to Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA.

Commercial licenses are also available. To inquire about commercial licenses, please contact Uri Wilensky at uri@northwestern.edu.

This model was created as part of the project: CONNECTED MATHEMATICS: MAKING SENSE OF COMPLEX PHENOMENA THROUGH BUILDING OBJECT-BASED PARALLEL MODELS (OBPML). The project gratefully acknowledges the support of the National Science Foundation (Applications of Advanced Technologies Program) -- grant numbers RED #9552950 and REC #9632612.

This model was converted to NetLogo as part of the projects: PARTICIPATORY SIMULATIONS: NETWORK-BASED DESIGN FOR SYSTEMS LEARNING IN CLASSROOMS and/or INTEGRATED SIMULATION AND MODELING ENVIRONMENT. The project gratefully acknowledges the support of the National Science Foundation (REPP & ROLE programs) -- grant numbers REC #9814682 and REC-0126227. Converted from StarLogoT to NetLogo, 2001.

Comments and Questions

Please start the discussion about this model! (You'll first need to log in.)

Click to Run Model

globals [
  current-row     ;; agentset of patches in current row
  total-oil       ;; keeps track of how much ground has been saturated
                  ;; since the simulation began.

]

to setup
  clear-all
  set total-oil 0
  ;; start with all unsaturated soil

  ask patches [
    reset-color
  ]

  ;; set up top row
  set current-row patches with [pycor = max-pycor]
  ask current-row [
    if pxcor mod 2 = 1    ;number1-(floor(number1/number2))*number2, floor takes largest integer less than or equal to number
      [ set pcolor red ]  ;; This code initializes the "oil spill".  Red
                          ;; patches represent the leading edge of the spill.
  ]                       ; sets every other patch red, modify to include volume-spilled so it doesn't always setup the same
  if water-table = true [
    ask patches with [pycor <= 220 - water-depth]
    [if (pxcor + pycor) mod 2 = 1
      [ set pcolor 106 ]
      if (pxcor + pycor) mod 2 != 1
      [ set pcolor 106 - 1]]
  ]
  reset-ticks
end 

;; This procedure sets the color for the patch, according to the checkerboard pattern.

to reset-color ;; patch procedure

  ifelse (pxcor + pycor) mod 2 = 1
      [ set pcolor brown ]
      [ set pcolor gray - 1  ]
end 

to go
  if not any? current-row with [pcolor = red]
    [ stop ]
  percolate
  wrap-oil
  tick
end 

;to percolateNO
  ;ask current-row with [ pycor <= 220 and pycor > 180 ] [percolate1]
  ;ask current-row with [ pycor <= 180 and pycor > 100 ] [percolate2]
  ;ask current-row with [ pycor <= 100 and pycor > 0 ] [percolate3]
  ;ask current-row with [ pycor <= 100 ] [percolate3]
 ; ask patches at-points [[-1 -1] [1 -1]]
  ;  [if (pycor <= 220 and pycor > 180) [percolate1]]
  ;ask patches at-points [[-1 -1] [1 -1]]
   ;   [if (pycor <= 180 and pycor > 100) [percolate2]]
  ;ask patches at-points [[-1 -1] [1 -1]]
  ;[if (pycor <= 100 and pycor > 0) [percolate3]]
;end

to percolate

  ask current-row with [pcolor = red] [
    ;; oil percolates to the two patches southwest and southeast
    ask patches at-points [[-1 -1] [1 -1]]
          [ if (pcolor = brown) and (random-float 100 < porosity) and (pycor <= 220) and (pycor > 220 - Thicknesslayer1 ) ;changed it from 100 to 10 so percolation is uniform and can test modifications
            [ set pcolor red ]]
    ask patches at-points [[-1 -1] [1 -1]]
          [ if (pcolor = brown) and (random-float 100 < porosity2) and (pycor <= 220 - Thicknesslayer1) and (pycor > 220 - Thicknesslayer1 - Thicknesslayer2) ;changed it from 100 to 10 so percolation is uniform and can test modifications
            [ set pcolor red ]]
    ask patches at-points [[-1 -1] [1 -1]]
          [if (pcolor = brown) and (random-float 100 < porosity3) and (pycor <= 220 - Thicknesslayer1 - Thicknesslayer2) and (pycor > 0) ;changed it from 100 to 10 so percolation is uniform and can test modifications
            [ set pcolor red ]]
    set pcolor black
    set total-oil total-oil + 1]

  ;; advance to the next row
  set current-row patch-set [patch-at 0 -1] of current-row ;sets next current-row as one right below current current-row
end 



;to percolate1

 ; ask current-row with [pcolor = red] [
    ;; oil percolates to the two patches southwest and southeast
  ;  ask patches at-points [[-1 -1] [1 -1]]
   ;       [ if (pcolor = brown) and (random-float 100 < porosity) and (pycor <= 220) and (pycor > 180) ;changed it from 100 to 10 so percolation is uniform and can test modifications
    ;        [ set pcolor red ]]
    ;set pcolor black
    ;set total-oil total-oil + 1]

  ;; advance to the next row
  ;set current-row patch-set [patch-at 0 -1] of current-row ;sets next current-row as one right below current current-row

;end

;to percolate2

 ; ask current-row with [pcolor = red] [
    ;; oil percolates to the two patches southwest and southeast
  ;  ask patches at-points [[-1 -1] [1 -1]]
   ;       [ if (pcolor = brown) and (random-float 100 < porosity2) and (pycor <= 180) and (pycor > 100)   ;changed it from 100 to 10 so percolation is uniform and can test modifications
    ;        [ set pcolor red ]]
    ;set pcolor black
    ;set total-oil total-oil + 1]

  ;; advance to the next row
  ;set current-row patch-set [patch-at 0 -1] of current-row ;sets next current-row as one right below current current-row

;end

;to percolate3

 ; ask current-row with [pcolor = red] [
    ;; oil percolates to the two patches southwest and southeast
  ;  ask patches at-points [[-1 -1] [1 -1]]
   ;       [ if (pcolor = brown) and (random-float 100 < porosity3) and (pycor <= 100) and (pycor > 0)  ;changed it from 100 to 10 so percolation is uniform and can test modifications
    ;        [ set pcolor red ]]
    ;set pcolor black
    ;set total-oil total-oil + 1]

  ;; advance to the next row
  ;set current-row patch-set [patch-at 0 -1] of current-row ;sets next current-row as one right below current current-row

;end

;; this procedure moves the colors from the bottom row of patches up to the top row
;; and resets all the patches below the top, so that we can see the oil continue
;; to run deeper into the ground.

to wrap-oil
  if [pycor <= 220 - water-depth] of one-of current-row and water-table = true [stop]
  if [pycor = min-pycor] of one-of current-row and water-table = false
  [
    ;if water-table = true [stop] ;assume water table is at the bottom of the screen and oil reaches water table at the bottom

    ask current-row [
      ask (patch-at 0 -1)
        [ set pcolor [pcolor] of myself ]
    ]
    ask patches with [ pycor < max-pycor ] [
      reset-color
    ]
    set current-row patch-set [patch-at 0 -1] of current-row
  ]
end 


; Copyright 1998 Uri Wilensky.
; See Info tab for full copyright and license.

There is only one version of this model, created almost 3 years ago by Rocky Iboleon .

Attached files

No files

This model does not have any ancestors.

This model does not have any descendants.