~fluidity-core/fluidity/sea-ice-branch

« back to all changes in this revision

Viewing changes to tests/mphase_wen_yu_drag_correlation/c_against_re.py

  • Committer: Simon Mouradian
  • Date: 2012-10-19 10:35:59 UTC
  • mfrom: (3520.32.371 fluidity)
  • Revision ID: simon.mouradian06@imperial.ac.uk-20121019103559-y36qa47phc69q8sc
mergeĀ fromĀ trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# Plots the drag coefficient against the particle Reynolds number.
 
2
from math import sqrt, pi
 
3
from numpy import *
 
4
import pylab
 
5
from fluidity_tools import stat_parser
 
6
 
 
7
C_wen_yu = zeros(200000)
 
8
C_stokes = zeros(200000)
 
9
particle_Re = arange(0.001, 1000, 0.005)
 
10
for i in range(0, len(particle_Re)):
 
11
   # Drag coefficients for the Wen & Yu and Stokes drag correlations respectively.
 
12
   C_wen_yu[i] = (24.0/particle_Re[i])*(1.0 + 0.15*particle_Re[i]**0.687)
 
13
   C_stokes[i] = (24.0/particle_Re[i])
 
14
   
 
15
s = stat_parser("./mphase_wen_yu_drag_correlation.stat")
 
16
numerical_particle_Re_wen_yu = s["Tephra"]["ParticleReynoldsNumber"]["max"][-1]
 
17
numerical_C_wen_yu = s["Tephra"]["DragCoefficient"]["max"][-1]
 
18
 
 
19
pylab.loglog(particle_Re, C_stokes, "-r", label="Stokes drag correlation")
 
20
pylab.loglog(particle_Re, C_wen_yu, "-g", label="Wen & Yu drag correlation")
 
21
pylab.loglog(numerical_particle_Re_wen_yu, numerical_C_wen_yu, "*b", label="Numerical result")
 
22
pylab.legend(loc=1)
 
23
pylab.xlabel("ParticleReynoldsNumber")
 
24
pylab.ylabel("DragCoefficient")
 
25
 
 
26
pylab.show()
 
 
b'\\ No newline at end of file'