Crystallization Directed

Crystallization Directed preview image

1 collaborator

Uri_dolphin3 Uri Wilensky (Author)

Tags

atoms 

Tagged by Reuven M. Lerner over 11 years ago

chemistry and physics 

Tagged by Reuven M. Lerner over 11 years ago

crystallization 

Tagged by Reuven M. Lerner over 11 years ago

materials science 

Tagged by Reuven M. Lerner over 11 years ago

metals 

Tagged by Reuven M. Lerner over 11 years ago

Model group CCL | Visible to everyone | Changeable by group members (CCL)
Model was written in NetLogo 5.0.4 • Viewed 371 times • Downloaded 83 times • Run 0 times
Download the 'Crystallization Directed' 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?

Some metal applications require that a metal's grains form specific patterns. To achieve this, the metal is only cooled from certain sides. This can be done in several ways. For example, when molds are made of metal, wires are used to heat up the mold where they want the metal to crystallize last. For molds made of sand, pieces of metal are put where the liquid metal should crystallize first. The inserted metal (known as a heat sink), works to quickly suck the heat out of the liquid metal.

HOW IT WORKS

This model represents the cross-section of a block of liquid metal cooling in a metal mold. The surrounding mold quickly sucks the heat out of the liquid metal. However, you can select some of the sides to be heated, which prevents heat from escaping out of those sides. By selecting which sides of the metal are heated, you can control the shapes of the resulting grains. (Note that the actual number of atoms is small compared to a real metal sample and the metal is only two-dimensional.)

The information below assumes you have already read and understood the original Crystallization Basic model.

HOW TO USE IT

Buttons

SETUP: Resets the simulation, and sets the metal to the correct size.
GO-ONCE: Runs the simulation for one time step.
GO: Runs the simulation continuously until either the GO button is pressed again, or all of the atoms are frozen.

Sliders

WIDTH: How many atoms wide the metal is.
HEIGHT: How many atoms high the metal is.
ROOM-TEMP: Varies the temperature of the room.
INIT-METAL-TEMP: Varies the initial temperature of the metal.
MELTING-TEMP: Varies the temperature at which the metal solidifies.

Monitors

AVE-METAL-TEMP: Monitors the average temperature of all the atoms.
TIME: Keeps track of the time that has elapsed during each run.

Switches

HEAT-TOP?: Prevents the top side of the metal from starting to cool.
HEAT-LEFT?: Prevents the left side of the metal from starting to cool.
HEAT-RIGHT?: Prevents the right side of the metal from starting to cool.
HEAT-BOTTOM?: Prevents the bottom side of the metal from starting to cool.
HISTOGRAM?: Turns the histogram plotting on and off. Turning off the histogram speeds up the model.

Graphs

AVERAGE METAL TEMPERATURE: Plots the average temperature of all the metal over time.
NUMBER SOLIDIFIED: Plots how many metal atoms are below the melting temperature over time.
TEMPERATURES: Histograms how many atoms are in each temperature range. (Note that the colors of the histogram match the actual colors of the atoms.)

THINGS TO TRY

Set HEAT-TOP? and HEAT-RIGHT? to On and HEAT-BOTTOM? and HEAT-LEFT? to Off. Predict which atom will be the last to solidify. Now run the model and see if your prediction was correct.

A contractor asks you to create a piece of metal for her that only has horizontal grain boundaries, and no vertical ones. Find settings for HEAT-TOP?, HEAT-RIGHT?, HEAT-BOTTOM?, and HEAT-LEFT? that result in approximately these sorts of grain boundaries.

Set HEAT-TOP? and HEAT-BOTTOM? to Off and HEAT-LEFT? and HEAT-RIGHT to On. Run the model to completion. How do these settings affect the grain boundaries? How would these grain boundaries affect the properties of the metal?

EXTENDING THE MODEL

In this model, heating a side simply results in the room temperature having no affect on that side. However, in real applications, heated sides still cool the metal, but at a slower rate. Change the cool-turtles procedure so heated sides factor into how atoms are cooled.

As mentioned in the above, molds made of sand use inserted pieces of metal to control which side of the metal should crystallize first. The inserted metal (known as a heat sink), works to quickly suck the heat out of the liquid metal. Change the model so instead of just having heated sides, there are also cooled sides that cause a faster cooling rate.

NETLOGO FEATURES

In the setup procedure, a turtle is created on every patch within the requested dimensions. This is achieved by asking every patch satisfying certain conditions to sprout 1.

Note how we can draw a multi-colored histogram. The histogram primitive can only draw in one color at a time, but we work around this by calling it over and over again, plotting only one bar each time, changing the pen color each time.

RELATED MODELS

Crystallization Basic
Crystallization Moving

CREDITS AND REFERENCES

Original implementation: Carrie Hobbs, for the Center for Connected Learning and Computer-Based Modeling.

HOW TO CITE

If you mention this model in a publication, we ask that you include these citations for the model itself and for the NetLogo software:

COPYRIGHT AND LICENSE

Copyright 2002 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 http://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 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.

Comments and Questions

Click to Run Model

turtles-own [
  temp                 ;; this turtle's temperature
  neighboring-turtles  ;; agentset of surrounding turtles
  sides-exposed        ;; number of sides exposed to cooling walls  (between 0 and 4)
]

globals [
  ave-metal-temp   ;; shows average temperature of all metal
  num-frozen       ;; keeps track of how many atoms are frozen
  temp-range       ;; for histogram
  colors           ;; used both to color turtles, and for histogram
  pens             ;; keeps track of all the histogram's pen names
]

to setup
  clear-all
  set colors sentence (white - 1) [cyan sky blue violet magenta red]
  set pens []
  set temp-range (init-metal-temp - melting-temp) / (length colors - 1)
  let ymax (height + 1) / 2
  let xmax (width + 1) / 2
  ;; create turtles everywhere inside the given box range
  ask patches [
    if ((abs pycor) < ymax) and ((abs pxcor) < xmax)
    [
      sprout 1
      [
        set shape "T"
        set temp init-metal-temp
        set-color
      ]
    ]
  ]
  ;; set sides of box for cooling
  ask patches [
    if      (heat-top? and (pycor = ymax) and (abs pxcor <= xmax)) or
      (heat-left? and (pxcor = (- xmax)) and (abs pycor <= ymax)) or
          (heat-right? and (pxcor = xmax) and (abs pycor <= ymax)) or
    (heat-bottom? and (pycor = (- ymax)) and (abs pxcor <= xmax))
    [ set pcolor 16 ]
  ]
  ask turtles [
    set neighboring-turtles (turtles at-points [[-1  1] [ 0  1] [1  1]
                                                [-1  0] [ 0  0] [1  0]
                                                [-1 -1] [ 0 -1] [1 -1]])
    set sides-exposed (count patches at-points [[-1  1] [ 0  1] [1  1]
                                                [-1  0] [ 0  0] [1  0]
                                                [-1 -1] [ 0 -1] [1 -1]]
                       with [(not any? turtles-here) and (pcolor = black)])
  ]
  set ave-metal-temp init-metal-temp
  reset-ticks
end 

to go
  ;; stop if all turtles are below melting temp
  if (max ([temp] of turtles) < melting-temp) [ stop ]
  ;; otherwise...
  set num-frozen 0
  ask turtles [ cool-turtles ]
  ask turtles [ set-color ]
  ask turtles [ rotate ]
  set ave-metal-temp (mean [temp] of turtles)
  tick
end 


;; turtle procedure -- if metal is liquid and it is next to a solid,
;; change its heading to that of the solid; otherwise, just rotate
;; randomly

to rotate
  if (temp >= melting-temp) [
    let frozen-neighbors (neighboring-turtles with [temp <= melting-temp])
    ifelse (any? frozen-neighbors)
      [ set heading ([heading] of (one-of frozen-neighbors)) ]
      [ rt random-float 360 ]
  ]
end 


;; turtle procedure -- sets turtle's temp to ave temp of all
;; neighboring turtles and patches added turtle's own temp in twice so
;; it changes more slowly

to cool-turtles
  let total-temp ((sum [temp] of neighboring-turtles) +
                  (room-temp * sides-exposed) + temp)
  set temp (total-temp / (count neighboring-turtles + sides-exposed + 1))
end 

;; turtle procedure

to set-color
  ; create index ranging from 1 to 8 for all melting colors
  let index (floor ((temp - melting-temp) / temp-range)) + 1
  ifelse (index < 1 ) [
    set color white - 1
    set num-frozen (num-frozen + 1)
  ]
  [
    if index >= length colors
      [ set index (length colors) - 1 ]
    set color item index colors
  ]
end 


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

There are 10 versions of this model.

Uploaded by When Description Download
Uri Wilensky over 11 years ago Updated to NetLogo 5.0.4 Download this version
Uri Wilensky about 12 years ago Updated version tag Download this version
Uri Wilensky about 12 years ago Updated to version from NetLogo 5.0.3 distribution Download this version
Uri Wilensky almost 13 years ago Updated to NetLogo 5.0 Download this version
Uri Wilensky over 14 years ago Updated from NetLogo 4.1 Download this version
Uri Wilensky over 14 years ago Updated from NetLogo 4.1 Download this version
Uri Wilensky over 14 years ago Updated from NetLogo 4.1 Download this version
Uri Wilensky over 14 years ago Updated from NetLogo 4.1 Download this version
Uri Wilensky over 14 years ago Model from NetLogo distribution Download this version
Uri Wilensky over 14 years ago Crystallization Directed Download this version

Attached files

File Type Description Last updated
Crystallization Directed.png preview Preview for 'Crystallization Directed' over 11 years ago, by Uri Wilensky Download

This model does not have any ancestors.

This model does not have any descendants.