Basic questions on CFD theory
Hi all,
I've done beginner level work with CFX and OpenFOAM, but I'm still trying to wrap my head around some of the basic concepts related to how these solvers actually work. What exactly is going on in the solver when it iterates to find a solution? I realize this question is so dependent on the type of analysis being conducted that it nearly renders the question invalid, but bear with me. Is it 'iterating' in the sense of how any nonlinear solver might proceed, e.g., NewtonRaphson iteration in the simplest case or something as sophisticated as Excel's solver, or is the solution at each iteration a valid solution, just not the 'particular' solution requested (as manifested in the tolerance/residual parameters). I do wish to pursue a Master's degree in this stuff, but until then, does anybody have any advice on how to tackle the theory on your own? I'm struggling with the disconnect between really great material that describes the theory (John Anderson Intro to CFD, CFX modeling guide, this forum), vs the actual, seemingly insurmountable difficulties of, well, actually implementing it in a computer program. My proficiencies are in programming and use of potential flow codes for large marine structures (AQWA/WAMIT). Thanks. CThib 
Hi friend,
what actually goes on inside a program depends on the type of solver you are using, that's true...but the basic concept is almost always the same. Take the simplest PDE as a model for a fluid flow: linear scalar advection, du/dt+du/dx=0 You probably know from Andersons book that such a problem is discretized in space and time, and solved in an appropriate way. Discretizing turns the above PDE into an algebraic equation, sth like (u(n+1)_iu(n)_i)/delta t =(  u(n)_i+1+u(n)_i) / delta x where the ns denote the time level, and the is the spatial position. So what your solver does is solve this equation for u(n+1) (the solution at the next time, or the end time) in an appropriate way. That's the magic behind CFD, and all schemes / models /codes etc differ in the way (accuracy, efficiency, "elegance") they do it. I hope this helps, if not, just keep asking, I'm happy to answer to the best of my knowledge! Cfd Newbie 
Quote:

Quote:
Hey leflix, I admit my basic cfd course has been a while, but I'm 99.9% sure that an upwind spatial scheme with the Euler time integrator I used is stable for reasonable CFL  a central scheme would be unconditionally unstable, but an upwind is certainly not ;) Cheers! 
Quote:
you are 100% right about the fact that upwind scheme is stable (under CFL condition) but unfortunately for you the scheme you just proposed to Cthib is not he upwind scheme but the forward scheme. And this one is unconditionally unstable. I think a simple refresh of your basic CFD courses will be enough ;) 
Bah, you are so right, darn typo! but instead of changing my wonderfully unstable scheme, I 'll change the problem to fit it by changing the direction of the advection... :) no, just kidding. Thanks for correcting me, the scheme should read:
(u(n+1)_iu(n)_i)/delta t =(u(n)_i1+u(n)_i1) / delta x so an upwind formulation, not a downwind one.... 
Quote:
not exactly again !!! ;) (u(n+1)_iu(n)_i)/delta t =(u(n)_i  u(n)_i1) / delta x please cfdnewbie you should take some vacancies :) no but this is a typo for sure ! 
haha, I guess I will let you do the math, and focus more explaining the conceptual ideas :)

ok let's do that ! ;)

Hi friends,
Thank you both for the replies, sorry it took me so long to acknowledge you. "Upwind" refers to the direction in which the solution propogates? 
Hi CThib,
check this post: http://www.cfdonline.com/Forums/mai...gschemes.html as well as: http://www.cfdonline.com/Wiki/Appro...grids__Common you should understand some stuffs... 
Thank you very much leflix, your post in that thread explains it perfectly.

Dear friend.
Remember that CFD softawares, solves the Navier stokes equation, but it uses some scheme to operate the non linearities. It is very complicate to explain here, but it is not hard to understand. The most importat to say is that, program solve and "standard" type of equation, which has, a transtive part, convective, diffusive and a soruce term, there you have. In the other hand you have the algorithm to solve it, the normalyy use the TDMA instead of Newtow raphsonj and there a lot of reason to choose it. I DO recommend you to read the book of patankar or malalasekera before starting yu master degree. I am finising my master degree on CFD, and before starting it I was working on it. I f you want I can share with you a digital copy of patankar book. from my point of view it is the most omplete an easy to understand. Good luck, and forgive me for my english mistakes!!! 
All times are GMT 4. The time now is 02:57. 