HW 4 for CS 4220
You may (and probably should) talk about problems with the each other, with the TAs, and with me, providing attribution for any good ideas you might get. Your final write-up should be your own.
The Darcy friction coefficient
Here
where
In this problem, we consider the computation of
darcy_params (generic function with 1 method)
darcy_resid (generic function with 1 method)
As a test case, we consider flow through a 10 cm pipe with roughness height of 0.1 mm (so the roughness factor is
Note that
for . Using properties of logs, show that for , satisfies
Answer:
Using the previous result, give an interval where
changes sign (so is guaranteed to have a solution in this interval). Verify the sign change for our test setting with Reynolds number of .
Answer:
darcy_bounds (generic function with 1 method)
test_darcy1 (generic function with 1 method)
FAIL: Returned interval [1.0, 1.0] does not bracket (values -5.565874087171682 and -5.565874087171682)
Using the lower bound in the previous step as a starting guess, run the fixed point iteration
and plot vs on a semilog scale. Run the calculation for 100 steps for Reynolds numbers , , and . What do you observe about the convergence?
Answer:
Subtract the fixed point equation from the fixed point iteration equation and use that
to get an error iteration of the form
Answer:
Numerically verify that the rate of convergence from part 4 agrees with the rates of convergence seen in the part 3. You will want to use that if
, then can be estimated from three successive iterates , , and .
ρ_darcy_fp (generic function with 1 method)
ρ_darcy_est (generic function with 1 method)
compare_ρ_darcy (generic function with 1 method)
ρ = -0.13093207192511372; relative difference in estimate: 8.637548121685171
ρ = -0.049681483020707885; relative difference in estimate: 21.128223619717375
ρ = -0.007568843300858971; relative difference in estimate: 133.1205843813033
Write a Newton iteration for finding a zero of
(with the lower bound from part 2 as an initial guess). Plot the residuals on a semilog scale for Reynolds number to illustrate quadratic convergence.
Answer: Fill in Newton iteration is given below, then add the requested plot.
darcy (generic function with 1 method)
Not a problem, but we can use the previous codes to show on a log-log plot the behavior of
and its upper and lower bounds for Reynolds numbers between and .
plot_bounds (generic function with 1 method)