Wittawach Prasitsom
To do List
- Please visit Research Tools/Fortran Compiler for basic Fortran compiler options. - YMC 25/07/06
Questions
1. The following link that you ask me for downloading the article is not work. When i click on the article's topic, it ask for the user name and password. --Yo
http://www2.warwick.ac.uk/fac/sci/eng/staff/ymc/research/comp/
The above link only works within the University of Warwick, not at home.
If you can access to any local university which has the licence to the electronic journal, then you can use the above link. For example, I can download the files in Japan, because this Japanese University has the site licence.
In other words, the journal website will check whether the site you are connecting from has the site licence of the journal. - YMC 12/07/06
Project Progress
First Derivative
Second-order Central Difference (CD) Scheme
1. The follwing link are the PDF file for my step-by-step to generate modified wave number graph for 2nd order central difference with nonuniform grid. In order to make sure that my code is correct, could you please check the equation (**) whether it is correct for nonuniform grid or not? --10/July/2006 (Yo)
2nd order modified wave number
Excellent! At last, you've got the formulae right. Well done!
Just a simple suggestion, instead of du(j), you could use dxdxi(j) - easy to remember.
You can make it a bit more clearly as follows
ufscd(k)=Uniform_formular*(1/dxdxi(j)),
When you apply other schemes, for example, fourth order central scheme or compact scheme, the only part you need to change is Uniform_formular, nothing else.
So, it is best to separate the Uniform_formular from the rest. Got it!
Now you can apply fourth order central difference method, and then compact schemes.
Do not delete anything on this page, all this can be useful when you write the thesis, so don't delete. Good luck! - YMC 12/07/06
Fourth-order Central Difference (CD) Scheme
Pade Scheme
6th order compact scheme
If you have done 2nd CD, 4th CD, and Pade, then the last one is 6th order compact scheme, rather similar to the Pade one. - YMC 16/07/06
Second Derivative
The next one is to calculate the second order derivative - All you have done so far is for the first derivative. - YMC16/07/06
Project Progress
The following links are the modified wave number for 4th order central difference, Pade scheme, and Pade 6 scheme---Yo 16/07/06
Red line indicates the modified wave number from EXACT solution
Green line indicates the modified wave number from the UNIFORM grid
Blue line indcates the modified wave number from the NONUNIFORM grid
4th Order Central Difference
Pade Scheme
Well Done! Now you know how to calculate the modified wave numbers on non-uniform grids (NUG).
-
But as I told you before, there are two important things you need to remember about the NUG.
One is the grid spacing is not constant, so you need to compare at a location with the same grid spacing. You have to find the location.
Two is the function (sin(kx)) has a different value at that location, so you have to change (move) the sign function so that the function value is the same as the uniform grid one.
Make sure that the location where you compare different wave numbers has the same grid spacing and the same function value.
-
When the above is ready, then change the gamma parameter in the NUG, and compare the modified wave numbers.
-
Try different NUG (other than tanh and sihn) - YMC 17/07/06
Check Up
I am trying to writing the code to approximate the second derivative by using the second-order central difference. Could you please check my step-by-step of calculation iif the grid transformation function is hyperbolic-tangent with control parameter equals to 2 ---Yo (20/07/06)
Step-by-step to approximate the second derivative
Please check against the formulae (4) & (5) in my AIAA paper (2003). And when you write a program, try to write as easy to reas as possible.
For example, for the first derivative,
PI=...... (You need to define)
PI2=PI*2.0E0
GAMMA=2.0E0 (Use GAMMA in the program.)
DX=PI2/NX
DXI=...... (You need to define)
DFDXI=(F(I+1)-F(I-1))/(2*DXI) - use the finite difference formular for uniform grid
DXDXI=(X(I+1)-X(I-1))/(2*DXI) - use the central difference formular on uniform grid)
DFDX=DFDXI/DXDXI
For the second derivative,
First, define
D2FDXI2=(F(I+1)-2*F(I)+F(I-1))/(DXI)**2 - use the finite difference formular for uniform grid
D2XDXI2=(X(I+1)-2*X(I)+X(I-1))/(DXI)**2 - use the central difference formular on uniform grid)
and then
D2FDX2=D2FDXI2/(DXDXI)**2-DFDXI*D2XDXI2/(DXDXI)**
And use GAMMA instead of 2 because it is much easier later to change the value of GAMMA. - YMC 25/07/06
PROBLEM-28/07/06
I have tried the fomulas that you provided where
fscd(i) = ((uf(i+1)-uf(i-1))/(2*dx))
sscd(i) = (uf(i+1)-(2*uf(i))+uf(i-1))/(dx**2)
usscd(i) = (sscd(i)/(dydx(i)**2))-(dy2dx(i)*fscd(i)/(dydx(i)**2))
Where usscd(i) is the Numerical solution for second derivative for non-uniform grid
fscd(i) is the Numerical solution for first derivative for uniform grid
sscd(i) is the Numerical solution for the second derivativec for uniform grid
dydx(i) is the first derivative (analytically) of the transformation which is,
dydx(i) = pi*(GAMMA-GAMMA*tanh(GAMMA*x(i))**2)/tanh(GAMMA*pi)
dy2dx(i) is the second derivative (analytically) of the transformation which is,
dy2dx(i) = -(2*GAMMA)*pi*tanh(GAMMA*x(i))*
((GAMMA-GAMMA*tanh(GAMMA*x(i))**2)/tanh(GAMMA*pi))
The domain size from [-pi,pi] , the number of grid point is 100. and GAMMA = 2.0E0
I have got the problem that the error near the boundary is very large. Could you please check the fomular for me? I have checked it many times but cannot find where is the mistake.
The following link shows the error that was encountered where the red line indicates the analytic solution and green line indicate the approximation solution
Second derivative approximation with second order central difference
Report
The following link is for the data analysis part.-----11/08/06
My final work for the data analysis part---21/08/06--YO
Yo at /users/es/espfrg