11-09-2016, 09:59 AM
Stokes’ First Problem. [ P1STOKE ]
From the author’s Engineering Collection, included in the ETSII4 module (ETI4 on the CL Library)
This program calculates the velocity at a point placed at a distance Y from the bottom and an instant t in an unsteady viscous boundary layer flow. The bottom is suddenly imposed at t=0 a constant velocity U0 and the fluid has a kinematic viscosity "nu". Vertical distances (y) are measured from the bottom (y=0) up.
The expression for the instant velocity at a distance y can be related to the cumulative probability function of a normal distribution as follows:
U(y,t) = 2 U0 [ 1- F( y / sqr(2 nu t) )
Example: for U0 = 1 m/s, nu = 10 m^2/s; Y = 0.5 m and t = 2 s
the result is: U(Y,T) = 0.911 m/s
The original version of this program used a polynomial approximation to calculate F, with an accuracy limited to 4 to 6 decimal places, depending on the value of the argument. A modern version based on the ERF implementation on the SandMath brings that to at least 8 decimal places and a much faster execution – thanks to MCODE and the improved algorithm used.
U(y,t) = U0 [ 1 – erf { [ y / 2 sqr( nu t) ] }
Below you can see the program listing using the new approach. Note that R00-R03 are used by ERF:
From the author’s Engineering Collection, included in the ETSII4 module (ETI4 on the CL Library)
This program calculates the velocity at a point placed at a distance Y from the bottom and an instant t in an unsteady viscous boundary layer flow. The bottom is suddenly imposed at t=0 a constant velocity U0 and the fluid has a kinematic viscosity "nu". Vertical distances (y) are measured from the bottom (y=0) up.
The expression for the instant velocity at a distance y can be related to the cumulative probability function of a normal distribution as follows:
U(y,t) = 2 U0 [ 1- F( y / sqr(2 nu t) )
Example: for U0 = 1 m/s, nu = 10 m^2/s; Y = 0.5 m and t = 2 s
the result is: U(Y,T) = 0.911 m/s
The original version of this program used a polynomial approximation to calculate F, with an accuracy limited to 4 to 6 decimal places, depending on the value of the argument. A modern version based on the ERF implementation on the SandMath brings that to at least 8 decimal places and a much faster execution – thanks to MCODE and the improved algorithm used.
U(y,t) = U0 [ 1 – erf { [ y / 2 sqr( nu t) ] }
Below you can see the program listing using the new approach. Note that R00-R03 are used by ERF:
Code:
01 LBL “P1STK”
02 “U0=?”
03 PROMPT
04 STO 04
05 “NU=?”
06 PROMPT
07 STO 05
08 LBL 00
09 “Y=?”
10 PROMPT
11 “T=?”
12 PROMPT
13 RCL 05
14 *
15 ST+ X
16 SQRT
17 /
18 ERF
19 CHS
20 1
21 +
22 RCL 04
23 *
24 “U=”
25 ARCL X
26 PROMPT
27 GTO 00
28 END