ddtSchemes, How Euler and CrankNicolson descritize?
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) |
I edited my above question completely to avoid posting a new thread.
I would appreciate if anyone helps about this new question. |
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;). |
Quote:
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. |
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)... |
Quote:
-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? |
All times are GMT -4. The time now is 15:38. |