CFD Online Logo CFD Online URL
Home > Forums > Main CFD Forum

The Blasius equation in Python

Register Blogs Members List Search Today's Posts Mark Forums Read

LinkBack Thread Tools Display Modes
Old   May 3, 2011, 14:49
Default The Blasius equation in Python
New Member
Join Date: May 2011
Posts: 1
Rep Power: 0
javiergra24 is on a distinguished road
Hi everybody

I'm writing a script in Python to solve the Blasius equation but it does not work, numerical results does not match with data I've seen in fluid mechanics books.

Please anyone could help me? Thank you very much

Script is

import sys, pylab, numpy
from pylab import *
from numpy import *
import matplotlib.pyplot as plt


e = []
f = []
g = []
h = []

fvec=0; gvec=0; hvec=0.3219


while etavec <= 10:

fvec = fvec + gvec * deta
gvec = gvec + hvec * deta
hvec = hvec -(1/2) * fvec * hvec * deta
etavec = etavec + deta
print etavec,fvec,gvec

numpy.savetxt("blasius.dat", transpose((e,f,g,h)),delimiter=' ')

xticklines = getp(gca(), 'xticklines')
yticklines = getp(gca(), 'yticklines')
xgridlines = getp(gca(), 'xgridlines')
ygridlines = getp(gca(), 'ygridlines')
xticklabels = getp(gca(), 'xticklabels')
yticklabels = getp(gca(), 'yticklabels')
#lines1 = pylab.plot(e,f)
lines2 = pylab.plot(e,g)
lines3 = pylab.plot(e,h)
#pylab.setp(lines1, color='b', linewidth=3.0)
pylab.setp(lines2, color='r', linewidth=3.0)
pylab.setp(lines3, color='k', linewidth=3.0)
setp(xticklines, 'linewidth', 3)
setp(yticklines, 'linewidth', 3)
setp(xgridlines, 'linestyle', '--')
setp(ygridlines, 'linestyle', '--')
setp(yticklabels, fontsize='xx-large')
setp(xticklabels, fontsize='xx-large')
ylabel('$f(\eta) \quad \partial_{\eta} f(\eta) \quad \partial_{\eta \eta}f(\eta)$',fontsize=30)
#legend( (lines1, lines2, lines3), ('$\f(\eta)$', '$\partial_{\eta} f(\eta)$', '$\partial_{\eta \eta}f(\eta)$'))

javiergra24 is offline   Reply With Quote


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Calculation of the Governing Equations Mihail CFX 7 September 7, 2014 06:27
blasius equation varunjain89 Main CFD Forum 15 June 25, 2012 09:42
Blasius equation help :( johnt447 Main CFD Forum 0 March 18, 2011 18:57
Constant velocity of the material Sas CFX 15 July 13, 2010 08:56
mass flow in is not equal to mass flow out saii CFX 2 September 18, 2009 08:07

All times are GMT -4. The time now is 15:07.