Diffusion in Cylindrical Coordinateschris/APM52615/EnglandP3.pdfCylindrical Coordinates Differential...
Transcript of Diffusion in Cylindrical Coordinateschris/APM52615/EnglandP3.pdfCylindrical Coordinates Differential...
Brian England
Objective Process of whiskey maturation & Current Efforts to
improve
Comparison Goals
Modeling nonlinear Diffusion Cylindrical Coordinates
Initial and Boundary Conditions
Methodologies and Computational Results Finite Difference
Finite Volume
Function Space
Final Comparison and Conclusion
Maturation of Whiskey Driven by two processes
Diffusion of Oak barrel goodness Short time scales
Chemical reaction Long time scales
Current Efforts Diffusion
Wooden inserts , tastes more processed and is lacking
Chemical Reactions Pressure vessels / burners to shift % yields and reaction rates
Much better and they’re improving on this front
Comparison Goal General Comparisons
Accuracy
Stability
Computational Efficiency
I will primarily deal with Computational Efficiency
Validate a methodology for utilization in future work
Modeling Nonlinear Diffusion What makes the Diffusion Nonlinear?
Changes in differential operators
Best coordinate system Ellipsoidal
Much more Complex
Cylindrical Coordinates Easier & exact solution are readily available
Cylindrical Coordinates Differential Operator Adjustments
Gradient
Divergence
Curl
Laplacian
1, ,
U U UU
r r z
1 1r zrF F F
Fr r r z
1 1, ,z r z r
rFFF F F FF
r z z r r r
2 2
2 2 2
1 1rU U UU
r r r r z
Initial and Boundary Conditions First Comparisons
Boundary Conditions
Chosen to ensure an equilibrium
Initial Condition
(0, , , ) 0U r z
( ,1, , ) cos sin2
U t z z
( , , , 1) cosU t r r
Finite Difference Approach General PDE
Centered Difference Spatial Discretizations
Forward Euler in Time
2 2 2
2 2 2 2
1 1U U U U U
t r r r r z
21, , , , 1, ,
22
i j k i j k i j kU U UU
r r
1, , 1, ,
2
i j k i j kU UU
r r
1( , ) ( ) ( , )n nUf U r U U t f U r
t
Stability The discretization
Requirement for Stability
For our PDE, the largest linearized coefficient is the most restrictive
21 1 1
2 2
2( )
n n nn n i i iU U UU U
U U tt x x
2
2
xt
2 4
2 2 2
min
1 1
2
U rt
r r
Good news (->Stability) Can get away with ~ dR = 0.05 & dt = 0.000625
Wall Clock time = 36.68 Seconds
Tolerance set to Flux/function values of 0.01
Finite Volume Method More work apriori!
Approach PDE with Gauss’ Law & Integral Form
Our PDE in Integral Form
The Integral Form allows us to represent the average value of our function
V V
UdV K U dV
t
1
V V V
U UdV UdV V UdV V
t t t V t
Final Exact Formulation
Utilizing Gauss’ Law
Making appropriate substitutions
We obtain the final form 6
1i
i
i S
U KU dS
t V
V S
FdV F dS
V S
K U dV K U dS
Finite Volume Approximations Difference in time
Differences on the boundaries
Calculation of Fluxes
1n n
Net Flux
KU U t
V
1
n n
i iU UU
r r
1 1( / 2)( ) ( / 2)( )r i i i iNet Radial
S r dr U U r dr U U
1 12rj j i
Net Azimuthal
SU U U
r
1 12Z j j iNet Axial
S U U U
Cell Volume & Surface Integrals Volume
Axial Surface
Radial Surfaces
Azimuthal Surfaces
2 21
2out inV r r z r z r
2 21
2Z out inS r r r r
S r z
rS r z
Items of Note Method is fully conservative
Only approximations lie in the derivative at the cell surfaces
When proper substitutions of the volume / surfaces is performed, it’s almost identical to finite difference
What benefits are there?
We’re still approximating derivatives
Leads to order of accuracies
Computations is about the same
Results Same scenario as finite difference
Stability – Required dt = 0.0001
1/6th the dt
There may have been corner issues
Wall Clock 359 Seconds 10 times as long
Even if the dt was matched, this method would still be slower For now
Function Space Methods Rely on Eigen function products
Coefficients are solved via inner products
Integrals are approximated by function evaluations at collocation points
Our Problem - Diffusion Equation in Cylindrical Coordinates
Choice of Eigenfunctions
Radial - Bessel functions of the first kind
Azimuthal – Trigonometric
Axial – Trigonometric
Temporal - Exponential
Exact Solution Fundamental Technique
Principle of Superposition
Handle a separate problem for each boundary and initial state for a steady state solution and transient
( , , ,1) ( , )topU t r f r
( , , , 1) ( , )botU t r f r
( ,1, , ) ( , )LatU t z f z
(0, , , ) ( , , )LatU r z f r z
General Solution Step by step “Separation of Variables”
First Time
Which Gives
Separating and solving
Letting
( , , , ) ( ) ( , , )U t r z T t r z
2( )( , , ) ( ) ( , , )
T tr z T t r z
t
( ) tT t e 2 2 2
2 2 2 2
1 10
r r r r z
( , , ) ( ) ( ) ( )r z R r Z z
2 2 2
2 2 2 2
1 ( ) 1 ( ) 1 ( ) 1 ( )
( ) ( ) ( ) ( )
R r R r Z z
rR r r R r r r Z z z
General Solution You can show that our ODE’s
Provides
General Solution – depends on our BC-s
2
2
1 ( )
( )
Z zm
Z z z
22
2
1 ( )
( )l
22 2 2
2
( ) ( )( ) ( ) 0
R r R rr r m r l R r
r r
Solution Primary Case - Initial Conditions with homogenous BC=0
l = is an integer greater than or equal to 0.
, is the nth root of the Bessel function of the first kind of order L
m is an integer greater than or equal to 0.
Finally
2
0 0 0
2
0 0 0
( , , , ) cos in2
cos2
lmn
lmn
t
lmn l
l m n
t
lmn l
l m n
U t r z A e mz J m r S l
B e mz J m r Cos l
,l nk
2
,lmn l nk m
Constants The constants are solved via
1 2 12
1 0 0
1 2 12 2 2 2
1 0 0
(0, , , ) cos sin2
cos sin2
l
lmn
l
U r z mz J m r l rdrd dz
A
mz J m r l rdrd dz
1 2 12
1 0 0
1 2 12 2 2 2
1 0 0
(0, , , ) cos cos2
cos cos2
l
lmn
l
U r z mz J m r l rdrd dz
B
mz J m r l rdrd dz
Collocation Points Azimuthal Fourier
Evenly distributed
Axial fourier Chebyshev nodal locations
Radial – Bessel Roots of m’th order Bessel function
Best used in tabular form to save on computations
2 /j N
2 1cos
2j
z
jx
N
Collocation Methods Numerous Integration techniques
Quadrature at collocation points for A and B
Standard – Gaussian Quadrature
Radial and Axial Weights
Polynomial Approximations
Azimuthal Weights
Trigonometric Approximation
We’ll use nodal locations, i,j,k, to calculate weights
1 2 1
1 0 01 1 1
( , , ) ( , , )ijk i j k
i j k
f r z rdrd dz w f r z
Separation of Variables Through some integration and appropriate initial
conditions we can state
We can now approach each integral with our approximation
1 2 12
0 0 01 0 0
12 2
0
( )cos ( )sin ( )2
l
lmn
l
Z z mz dz l d R r J m r rdr
AJ m r rdr
1 2 12
0 0 01 0 0
12 2
0
( )cos ( )cos ( )2
l
lmn
l
Z z mz dz l d R r J m r rdr
BJ m r rdr
Weight Calculation (Axial) A bit of matrix manipulation and brute force
With fixed nodes
1 inverse and done!
11
11 2 1 2
2 2 2 2 11 2 1 1
1 1 1 1 11 2 1
1 1 ... 1 1 1
... 2
... ... ... ... ... ... 1 1...
... ( 1)
...
N Nn
N N N N
N N N
N N N N
N N N
c
x x x x c
x x x x c N
x x x x c N
Weight Calculation (Azimuthal) Trigonometric Gaussian Quadrature
Maximal Trigonometric Degree of Exactness
New Quadrature Methodologies
“Trigonometric Orthogonal Systems and Quadrature Formulae with Maximal Trigonometric Degree of Exactness”
Gradimir V. Milovanovic
Easier assumption
Requires proper initial conditions
1
sin( ) ( )i i
i
n d w f
11
11 2 1 2
2 2 2 2 11 2 1 1
1 1 1 1 11 2 1
1 1 ... 1 1 1
sin sin ... sin sin 2
... ... ... ... ... ... ...
sin sin ... sin sin ( 1)
sin sin ... sin sin
N N
N N N N
N N N
N N N N
N N N
w
x x x x w
x x x x w N
x x x x w N
1
1n
Weight Calculation (Radial) Requires Bessel functions
21 1
*
0 00 0
1 1 1( )
! ( 1) 2 ! ( 1) 2 1
m mm n
n N
m m
xJ r dr J dr
m m n m m n m n
1
01
( ) ( )n i n i
i
J r dr w f r
*0 1 0 2 0 1 0 1 1
*1 1 1 2 1 1 1 2 2
*1 1 1 2 1 1 1 1 1
1 2 1
( ) ( ) ... ( ) ( )
( ) ( ) ... ( ) ( )
... ... ... ... ... ... ...
( ) ( ) ... ( ) ( )
( ) ( ) ... ( ) ( )
N N
N N
N N N N N N N N
N N N N N N N
J x J x J x J x w J
J x J x J x J x w J
J x J x J x J x w J
J x J x J x J x w J
*
N
Conclusion Function Space methods
Very time consuming apriori
Didn’t get to finish
Expectation of fast convergence
Approximation lies only with initial / boundary conditions
Exact solution for all time after (for the given approx)