CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > OpenFOAM Programming & Development

ddtSchemes, How Euler and CrankNicolson descritize?

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Display Modes
Old   February 6, 2014, 07:12
Default ddtSchemes, How Euler and CrankNicolson descritize?
  #1
ooo
Member
 
Join Date: Feb 2012
Posts: 49
Rep Power: 5
ooo is on a distinguished road
I want to solve( ddt(U) == F ) in which both U and F are volVectorField.
I get three different results when i use these three approaches!
I expect that all of them should be same

1) forAll(U, cellI) U[cellI] += runTime.deltaTValue()*F[cellI];
2) solve(fvm::ddt(U)==F); //Euler descritization
3) solve(fvm::ddt(U)==F); //CrankNicolson descritization

Do you know why they don't give same result? Because i think all of them do this : ( Unew = Uold + F*dt)

Last edited by ooo; February 10, 2014 at 12:39.
ooo is offline   Reply With Quote

Old   February 10, 2014, 12:41
Default
  #2
ooo
Member
 
Join Date: Feb 2012
Posts: 49
Rep Power: 5
ooo is on a distinguished road
I edited my above question completely to avoid posting a new thread.
I would appreciate if anyone helps about this new question.
ooo is offline   Reply With Quote

Old   February 10, 2014, 17:57
Default
  #3
Senior Member
 
Wouter van der Meer
Join Date: May 2009
Location: Elahuizen, Netherlands
Posts: 128
Rep Power: 8
wouter is on a distinguished road
hello ooo,
I just followed a CFD course (on youTube) and found out there are a lot of ways to look at and use the meshdata. Every way has his own advantages and disadvantages. Your question is answered on this wiki link
http://en.wikipedia.org/wiki/Crank%E...icolson_method

hope this helps
Wouter
NB. as you can read in the first line I am an expert, because I read a book.
wouter is offline   Reply With Quote

Old   February 10, 2014, 18:07
Default
  #4
ooo
Member
 
Join Date: Feb 2012
Posts: 49
Rep Power: 5
ooo is on a distinguished road
Quote:
Originally Posted by wouter View Post
hello ooo,
I just followed a CFD course (on youTube) and found out there are a lot of ways to look at and use the meshdata. Every way has his own advantages and disadvantages. Your question is answered on this wiki link
http://en.wikipedia.org/wiki/Crank%E...icolson_method

hope this helps
Wouter
NB. as you can read in the first line I am an expert, because I read a book.
Thank you for your answer.
But the point is that in the right hand side of my equation, there is an independent value of U, therefore the time descritizations should not be different to each other in this equation.So i wonder why these three approaches give me different results.
ooo is offline   Reply With Quote

Old   February 11, 2014, 03:55
Default
  #5
New Member
 
Lorenzo A. Ricciardi
Join Date: Mar 2011
Posts: 27
Rep Power: 6
lichmaster is on a distinguished road
Euler and Crank-Nicholson must give different results if F is time dependent, as the first one basically should perform as your method 1 while the second one is a blend of Forward Euler and Backwards Euler.

As to why method 1 and 2 are not the same (I don't remember exactly and don't have time to check right now) it should be a dimensional issue: Euler should work with volume integrated fields, thus if you have a constant F field but different mesh volumes, your actual "F" term will be F*volume. Try to print the dimensions of U, F and ddt(U)...
lichmaster is offline   Reply With Quote

Old   February 11, 2014, 07:35
Default
  #6
ooo
Member
 
Join Date: Feb 2012
Posts: 49
Rep Power: 5
ooo is on a distinguished road
Quote:
Originally Posted by lichmaster View Post
Euler and Crank-Nicholson must give different results if F is time dependent, as the first one basically should perform as your method 1 while the second one is a blend of Forward Euler and Backwards Euler.

As to why method 1 and 2 are not the same (I don't remember exactly and don't have time to check right now) it should be a dimensional issue: Euler should work with volume integrated fields, thus if you have a constant F field but different mesh volumes, your actual "F" term will be F*volume. Try to print the dimensions of U, F and ddt(U)...
Thank you very much for your reply.

-About the dimension, my F field has the dimension of (m/s2).Also the dimension of the ddt(U) is (m/s2).Is there any problem here? because in both 1 and 2, the rhs and lhs seem have the same dimension.

-About the difference between euler and crankNicolson, i know their mathematical formula, but im confused with my algorithm :
In each time step :
*I solve the momentum equation
*use the computed velocity to compute F (by some formulas...),
*Solving (ddt(u)=F) to recompute U.
So, If it is descritized like this :
(Unew-Uold)/dt = Fnew (Implicit euler)
(Unew-Uold)/dt = 0.5*(Fnew+Fold) (crankNicolson)

The confusing part for me is the term (Fnew). Because in an implicit descritization, the RHS is descritized in the same time step, and in general we should not have Fnew! but the point is that i should use the value of F which was calculated in a line before of this equation in the same time step!
If it is going to use the known F, then it is not the implicit method anymore!
So again the same question comes up that how (ddt(U)=F) is descritized in my algorithm?
ooo is offline   Reply With Quote

Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -4. The time now is 15:45.