Buckingham Pi method (dimensional analysis)

This notebook has been written in Mathematica by 

Mark J. McCready
Professor of Chemical Engineering
University of Notre Dame
Notre Dame IN 46556
USA

mjm@nd.edu
http://www.chemeprof.com

It is copyrighted to the extent allowed by whatever laws pertain to the World Wide Web and the Internet.

I would hope that as a professional courtesy that this notice remain visible to other users. 
There is no charge for copying and dissemination   

Version:  5/30/16
More recent versions of this notebook should be available at the web site:
http://www.nd.edu/~mjm/dimensional.analysis.nb

Physical Motivation

Why do dimensional analysis?

We do not know how to attach significance to the numerical value of something unless it is in comparison to another thing that has the same dimensions.  For example, 1 is much less that 10^4, but if it is 1 ton of sand versus 10^6 grains of sand, we change our mind.  Thus we need to have the same dimensions (and units) for our comparison.    

A generalization of this kind of comparison is that we need to measure the effects of two different things that act similarly.  If we are determining the "filling" effect of our favorite foods,  we might compare a 15 inch thin crust pepperoni pizza to 1 lb of spaghetti with meat sauce.  They are different foods, but they both can satisfy a significant appetite.
  
A systematic way of building into our problems these comparisons of like quantities and perhaps more importantly, generalizations that involve comparisons of say forces associated with gravity compared to forces associated with a moving fluid, say inertia is called dimensional analysis.  The idea is that by making quantities dimensionless, we will be making these comparisons between different "things" that have the same effect.

A problem that we care about  is pipeflow.  Flow in a pipe can be caused by a pressure difference, Δp.  Pressure has the same dimensions as ρ v2, which is a measure of the force associated with the inertia of the fluid.  Thus the ratio Δp/ρ v2 measures force due to pressure to force associated with fluid inertia.  Engineers think about their systems in terms of these comparisons so they will be important.  The particular ratio that we are describing is giving us an idea how difficult it is to pump the fluid in question.

Examination of simulated data

Let is create some simulated data and plot it:

We need secret forumulas

dp=2* 0.079 (d v ρ/μ)^(-.25) ρ v^2  /d

re= (d v ρ/μ)

Here are the calculated data.

data1=Table[{v RandomReal[{0.94`,1.04`}],dp}/. {μ->0.01`,ρ->1,d->2.54`,v->i},{i,0,100,4}];

ListPlot[data1,AxesLabel->{"v, cm/s","ΔP/L,dyne/\!\(\*SuperscriptBox[\(cm\), \(3\)]\)"}]

data2=Table[{v RandomReal[{0.94`,1.04`}],dp}/. {μ->1,ρ->1,d->2.54`,v->i},{i,0,100,4}];

ListPlot[data2,AxesLabel->{"v, cm/s","ΔP/L,dyne/\!\(\*SuperscriptBox[\(cm\), \(3\)]\)"},PlotStyle->{RGBColor[1,0,1],RGBColor[1,0.5`,0.5`],RGBColor[0,0,1]}]

data3=Table[{v RandomReal[{0.94`,1.04`}],dp}/. {μ->0.1`,ρ->1,d->2.54`,v->i},{i,0,100,4}];

ListPlot[data3,AxesLabel->{"v, cm/s","ΔP/L,dyne/\!\(\*SuperscriptBox[\(cm\), \(3\)]\)"},PlotStyle->{RGBColor[1,0.5`,0.5`],RGBColor[0,0,1]}]

data4=Table[{v RandomReal[{0.94`,1.04`}],dp}/. {μ->0.01`,ρ->1,d->5,v->i},{i,0,100,4}];

ListPlot[data4,AxesLabel->{"v, cm/s","ΔP/L,dyne/\!\(\*SuperscriptBox[\(cm\), \(3\)]\)"},PlotStyle->{RGBColor[1,0.5`,0.5`],RGBColor[0,0,1]}]

Here is a plot of it

ListPlot[{data1,data2,data3,data4},AxesLabel->{"v, cm/s","ΔP/L,dyne/\!\(\*SuperscriptBox[\(cm\), \(3\)]\)"}]

We see that the pressure drop increases with velocity (duh).  We might even realize that it is roughly as (v^2).

Do we need to take data for every situation?  
Can we collapse the data onto one curve? 

We can resolve these issues by doing dimensional analysis.

Procedure for doing dimensional analysis.

How to do pipe flow.  Note that this is a different approach than Middleman.  Of course it yields the same answer.

The variables associated with pipe flow are Δp, D, L, v,μ, ρ.  They have dimensions:

Δp [=]  m/(l θ2)

D [=] l

L [=] l

v [=] l/θ

μ [=] m/(l θ)

ρ [=] m/l3

Note that the dimensional time is given by θ.  There are 3 fundamental dimensions associated with these variables and there will be 6 - 3 = 3 dimensionless groups.  This is surmised because we are doing this as part of linear algebra and we need to solve some linear algebraic equations.  The only equations that seem obvious are that the groupings of variables are dimensionless ( i.e., some sum=0).  There are only three equations but 6 variables.  

A dimensionless group must be of the form

Δpa  Db  Lc  vd  μe  ρf   

where a, b, c, d, e, f satisfy equations that make the group dimensionless.  This gives for mass

mass:   a + e + f=0,

length:	-a +b +c +d -e -3f = 0

time:	-2a -d -e  = 0

To solve these.  First write down the equations as a matrix

eqs = {{a,0,0,0,e,f},{-a,b,c,d,-e,-3f},{-2a,0,0,-d,-e,0}}

From this we expect that there certainly is not one unique solution.  You can solve this system for 3 of the variables in terms of the other three.  This will give us three dimensionless groups.

It turns out that I need to put the coefficients into equations to solve them so I use a "dot" product and set it equal to 0.  The "[[1]]"  after eqs is telling Mathematica to take the first, second or third set of coefficients.

one =eqs[[1]].{1,1,1,1,1,1} == 0

two=eqs[[2]].{1,1,1,1,1,1} == 0

three=eqs[[3]].{1,1,1,1,1,1} == 0

Now I solve these equations

Solve[{one,two,three},{b,d,f}]

I choose the three to solve for by checking some choices and then deciding.

Now reconstruct our dimensionless group

Δpa  Db  Lc  vd  μe  ρf    =   Δpa  D-c-e  Lc  v-2a -e  μe  ρ-a -e

Now rearrange this into:

(Δp/ρv2)a  (L/D)c  (μ/ρ v D)e 

Each of the groups that we have made is dimensionless.  This has to be true because we know that the entire thing is dimensionless and the solution is true for any values of a, c and e.  (Check what would happen if each group had some dimension and the values of a, c, and e were changed)  Thus we have found three groups and we have an answer.

Of course, L has the same dimensions as D so how do we know that a good group is
μ/ρ v D  as opposed to μ/ρ v L ??  The answer is physical intuition and possible experiment.  

The way we actually end up using this result is to define

Reynolds number 

Re = ρ v D/μ

and friction factor

f = Δp D/2 L ρv2

where the D/L has been incorporated into the friction factor and we need only two groups.  For most problems this does not happen and you will need all three.  L/D is separately important in this problem if the flow distance has not been long enough for the velocity profile to reach a configuration that does not change with distance.  

The reason that it happened this time is that Δp is inherently proportional to L.  If you consider two identical lengths of pipe that have the same Re, the pressure drop is the same.  If they are attached end to end, then the ΔP must be two times this value.  Since ΔP is really proportional to L, we can conveniently think of the new variable, Δp/L which I'll call dpdx.  Now if we redo the analysis we have

Redo the analysis with ΔP/L as a single variable

dpdx [=]  m/(l2 θ2)

D [=] l

v [=] l/θ

μ [=] m/(l θ)

ρ [=] m/l3

There are 3 fundamental dimensions associated with these variables and there will be 5 -3 = 2 dimensionless groups. 
A dimensionless group must be of the form

dpdxa  Db   vc  μd  ρe   

where a, b, c, d, e satisfy equations that make the group dimensionless.  This gives for mass

mass:    a + d + e=0,

length:	 -2 a +b +c  -d -3e = 0

time:      -2a -c -d  = 0

Now to solve these I will use Mathematica .  First I write down the equations as a matrix

eqs2 = {{a,0,0,d,e},{-2 a,b,c,-d,-3e},{-2a,0,-c,-d,0}}

From this we expect that there certainly is not one unique solution.  You can solve this system for 3 of the variables in terms of the other three.  This will give us three dimensionless groups.

It turns out that I need to put the coefficients into equations to solve them so I use a "dot" product and set it equal to 0.  The "[[1]]"  after eqs is telling Mathematica to take the first, second or third set of coefficients.

one =eqs2[[1]].{1,1,1,1,1} == 0

two=eqs2[[2]].{1,1,1,1,1} == 0

three=eqs2[[3]].{1,1,1,1,1} == 0

Solve[{one,two,three},{b,e,c}]

Now reconstruct our dimensionless group

dpdxa  Db   vc  μd  ρe    =   Δpa  Da-d   v-2a -d  μd  ρ-a -d

Now rearrange this into:

(dpdx D/ρv2)a   (μ/ρ v D)d

This is equivalent to the answer obtained above.  We observe that in a fully-developed pipe flow, nothing except for the pressure is changing with distance in the flow direction.  Thus is make sense to describe a pressure change in terms of this distance and then not have a flow direction length in the problem.