CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > General Forums > Main CFD Forum

So it's all just Taylor Expansion, Runge Kutta integration and Gauss-Seidel solvers?

Register Blogs Community New Posts Updated Threads Search

Like Tree11Likes
  • 1 Post By FMDenaro
  • 1 Post By sbaffini
  • 3 Post By flotus1
  • 2 Post By Simbelmynė
  • 2 Post By FMDenaro
  • 2 Post By sbaffini

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   October 22, 2021, 21:40
Default So it's all just Taylor Expansion, Runge Kutta integration and Gauss-Seidel solvers?
  #1
Senior Member
 
Sayan Bhattacharjee
Join Date: Mar 2020
Posts: 495
Rep Power: 8
aerosayan is on a distinguished road
I read through the whole ANSYS Fluent solver theory today. As complicated as it might seem from the outside to a student, looks like all of it comes down to using Taylor Series Expansion for linearization, Runge Kutta integrations for solving explicit problems, and using direct solvers like Gauss-Seidel or ILU factorization with multigrid acceleration for implicit problems.

That's all. That's all we require.

If someone understands these topics, they can write their own solvers with some practice and studying other open source solvers. Sure more fancy things like Krylov solvers exist, higher order schemes exist, but they're not required at all for the basic student trying to become better.

I can't say for others, but the biggest difficulty in learning CFD for me has been to understand how to convert the maths in the paper into code. I feel let down because the way CFD is taught, mainly focuses on the mathematics instead of actually writing the code. Even the standard CFD books spend 6-7 chapters explaining the maths behind CFD, then they come to Taylor Series expansion and how to actually write even the most basic FDM solver for the basic 1D linear advection equation. By the time at least I reached chapter 6-7, I didn't know what's what, and even which equations were important.

Even well known, and highly experienced professors that I know, all spend 4 months explaining the maths behind CFD, then if time permits, guide the students to write some basic solvers.

I think that is not a good way to learn CFD at all. I reject this method of teaching completely. The only way I was able to make some sense of the maths involved in CFD, was to study open source solvers. I started with how to actually write basic 1D advection-diffusion solvers, then moving onward to 2D solvers.

I don't know if I'm just stupid, I know my maths isn't strong; but it is a glaring red flag in how CFD is taught, when I can understand the code written in big opensource solvers like SU2 before I even begin to understand the mathematics written in highly respected books and papers.

Sorry for the rant. Here's a cat.
Attached Images
File Type: jpg cat.jpg (19.0 KB, 10 views)
aerosayan is offline   Reply With Quote

Old   October 23, 2021, 05:19
Default
  #2
Senior Member
 
Filippo Maria Denaro
Join Date: Jul 2010
Posts: 6,768
Rep Power: 71
FMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura about
I really don't understand your topic ... In this age I see people pushing the CFD towards the idea of being the field where there is no need to be experienced in writing simple and basic codes but only the need of learning how to set some black-box CFD code. Thus, this is the idea that I mainly fight...

On the other side, CFD cannot be the field where to learn just how programming a code.


My opinion is that CFD is the field where the language of the mathematics (the continuous field) is translated into the language of the numerics (the discrete field). Then, the language of the numerics is applied in some practical programming, by using simple tests. After this stage, some CFD code can be introduced, the students has the background both in math and in numerics to understand the meaning of the settings.
Any CFD textbook follow this education pattern.
The problem I can highlight from my experience is that the math required in CFD is often not in the backgroud students. Thus, is often required to spend time to that.
sbaffini likes this.
FMDenaro is offline   Reply With Quote

Old   October 23, 2021, 05:22
Default
  #3
Senior Member
 
sbaffini's Avatar
 
Paolo Lampitella
Join Date: Mar 2009
Location: Italy
Posts: 2,152
Blog Entries: 29
Rep Power: 39
sbaffini will become famous soon enoughsbaffini will become famous soon enough
Send a message via Skype™ to sbaffini
Few things I consider relevant on the technical side of the matter:

1) Most books do indeed have those early chapters but, with few exceptions, they barely use them in the end... like at all. Except, maybe, in an attempt to justify why certain problems need certain bcs. While, in my opinion, that's a kind of an overkill (and for most things I learned more from the discretization than the math behind it), that's a very common place to put certain stuff that is, indeed, still needed at a certain point along the way. I mean, it's still better than to look for it in some math book, where it's dispersed with other criptic stuff.

2) Most of the relevant books in the field were written, and the relative generation of professors learned, in an era when unstructured grids and other topics were not really the norm but a research topic. Also, open source codes were not out there at the time as well (more on this later). I don't know when you went to the university but, when I did (20 years ago), I kind of expected more on certain topics as well but, in retrospection, was really too early to be possible.

3) I wrote about this in some other post recently, if I recall correctly, but the role of university, in my opinion, is not to make you prolific in any specific field or activity. It is more in making you an individual that, with his own knowledge, is able to become prolific in a certain range of fields of knowledge. Today is all about 2nd order unstructured finite volumes and RANS (and I think they are going to stay for very long). But what if in 10 years it's all lattice boltzmann on uniform grids? Or high order DG? Or whatever?

4) You put it down in an easy way but, for the same reasons of the previous point, if those things were going to be part of any academic curriculum, wouldn't certainly be managed in the same way they are typically presented. Think about the unstructured gradient computation and diffusive fluxes. By itself it is a vast territory with a lot of nuances, and I ensure you that very few people have a good command of the whole thing (as some detailed recent researchs have still clarified several aspects of it). So, unless you actually are working on it, it makes very little sense to present students a list of items based on the Fluent user manual. Also, especially in certain faculties, students are gonna hunt you down on whatever inconsistency they perceive, so you're certainly not going on stage unless you know well stuff, which requires actually working on it to the very least. The same would apply to several of the topics, probably each one deserving a whole course. But in most cases you're there to become, say, an engineer, not a CFDer, so there is simply no time to do certain stuff with proficiency and in the correct way.

5) There are nonetheless books that cover certain stuff, but in the end the level is not even close to be satisfactory for a textbook, but just for a reference.

Was planning to add few personal opinions and facts, but got out of time. Maybe next time
FMDenaro likes this.

Last edited by sbaffini; October 23, 2021 at 08:45.
sbaffini is offline   Reply With Quote

Old   October 23, 2021, 12:09
Default
  #4
Senior Member
 
Sayan Bhattacharjee
Join Date: Mar 2020
Posts: 495
Rep Power: 8
aerosayan is on a distinguished road
Quote:
Originally Posted by FMDenaro View Post
I really don't understand your topic ... In this age I see people pushing the CFD towards the idea of being the field where there is no need to be experienced in writing simple and basic codes but only the need of learning how to set some black-box CFD code. Thus, this is the idea that I mainly fight...

On the other side, CFD cannot be the field where to learn just how programming a code.


My opinion is that CFD is the field where the language of the mathematics (the continuous field) is translated into the language of the numerics (the discrete field). Then, the language of the numerics is applied in some practical programming, by using simple tests. After this stage, some CFD code can be introduced, the students has the background both in math and in numerics to understand the meaning of the settings.
Any CFD textbook follow this education pattern.
The problem I can highlight from my experience is that the math required in CFD is often not in the backgroud students. Thus, is often required to spend time to that.

Disclaimer : over generalization is expected in the response below.



It should be a field where more priority is put into teaching students how to code. They should be Introduced to how to numerically solve the PDEs as early as possible, because it will enable more students to understand the continuous field mathematics clearly. I don't agree with your statement that students not having background knowledge of the maths required to learn CFD, is the reason they don't understand CFD. In college courses, Engineering Mathematics 101 to 103, they are given enough mathematical knowledge to understand PDEs/ODEs/Matrices/Vectors and more. They know more than enough. The reason they fail to understand CFD, is due to many professors not showing them how to convert the mathematics equations into discrete equations that can be solved on a computer. IMO most senor professors right now don't teach CFD (or anything), how they learned it during their educational journey. They learned CFD using simple 1D equations and writing 1D solvers. They learned CFD by solving 1D non-linear convection equations on old Fortran punchcard machines. They had no other option, because powerful machines didn't exist back then in their universities. This allowed them to understand the basics required to become better incrementally. But now, in many CFD 101 course, we start with full derivation of NS equations and don't even bother about solving any of the rudimentary equations. Only in some universities professors teach how to write simple 1D/2D solvers. It is kind of slightly hypocritical for them to expect their students to know enough to be good in CFD, before the students even started CFD. If they didn't know how to do it when they were students, their students don't have any obligations either.
aerosayan is offline   Reply With Quote

Old   October 23, 2021, 13:54
Default
  #5
Super Moderator
 
flotus1's Avatar
 
Alex
Join Date: Jun 2012
Location: Germany
Posts: 3,399
Rep Power: 46
flotus1 has a spectacular aura aboutflotus1 has a spectacular aura about
Quote:
Originally Posted by aerosayan View Post
It should be a field where more priority is put into teaching students how to code.
Is it though? If you don't go into academia, chances are high that during your whole career of dabbling with CFD, you do not touch any solver internals. I'm not saying that CFD courses at universities necessarily prepare students better for that route. Just that being able to to write a CFD solver isn't a useful skillset for most CFD engineers.
sbaffini, arjun and FMDenaro like this.
flotus1 is offline   Reply With Quote

Old   October 24, 2021, 04:38
Default
  #6
Senior Member
 
Filippo Maria Denaro
Join Date: Jul 2010
Posts: 6,768
Rep Power: 71
FMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura about
One cannot discuss in abstract about the content of a CFD course ... let me pose my specific case. I have 48hrs in my CFD course, you know that in Italy we have a 3+2 yrs academic path, the students attend the CFD course at the second semester of the second year.
They never had, before my course, any approach to the numerical solution of PDE. Now, considering that 48 hours are in total (frontal lecture + practical code programming), what should be the program of the course?
FMDenaro is offline   Reply With Quote

Old   October 24, 2021, 06:04
Default
  #7
Senior Member
 
Simbelmynė's Avatar
 
Join Date: May 2012
Posts: 546
Rep Power: 15
Simbelmynė is on a distinguished road
We have different approaches in different courses here at my university. Depending on what type of Bachelor / Master you come from these courses can be very different. As already pointed out, the purpose is to prepare the student for a) a career in academia or b) a career in industry. Then we can also divide this into categories of applied and theoretical.


In many cases we teach CFD more like an overview of capabilities, i.e. students use CFD as a tool to solve some problems. This makes sense for students that may only have a single course of CFD during their bachelor or master. Students that are interested in using CFD are then encouraged to develop their interest by taking more theoretical courses. Students that are not interested will at least have a good knowledge of the capabilities of CFD and what you can expect from a CFD consultant. Most of our students go to become industrial leaders and seeing that they will come in contact with CFD it is a good thing that they have seen "hands-on" what is possible in real industrial problems. If we focused only on how to write simple 1d and 2d codes (no multiphase and no turbulence models most likely) then it would be useless for all but a few of our students.


That being said, I totally agree that writing code is extremely important in order to actually understand the PDEs. CFD is a multidisciplinary field and the more you combine all aspects the more you understand. It also helps you to see past "this is common knowledge" type of arguments from people that have only read text books without actually trying to implement what is in them.
sbaffini and aerosayan like this.
Simbelmynė is offline   Reply With Quote

Old   October 24, 2021, 06:44
Default
  #8
Senior Member
 
Filippo Maria Denaro
Join Date: Jul 2010
Posts: 6,768
Rep Power: 71
FMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura about
I am not sure to understand the key of the discussion. When you state to educate a student in "programming a CFD code" what do you exactly mean?
FMDenaro is offline   Reply With Quote

Old   October 24, 2021, 07:13
Default
  #9
Senior Member
 
Sayan Bhattacharjee
Join Date: Mar 2020
Posts: 495
Rep Power: 8
aerosayan is on a distinguished road
Quote:
Originally Posted by FMDenaro View Post
I am not sure to understand the key of the discussion. When you state to educate a student in "programming a CFD code" what do you exactly mean?
As others have mentioned, the goal of most CFD courses seem to be more oriented towards making the students good enough to use user-friendly commercial CFD codes like ANSYS/COMSOL. There's a very small minority of students who then want to actually develop solvers. Of course no university will change their courses drastically for a small minority, but some small addition to the current course would be more than enough for beginners. The small addition would be simply to teach them how to discretize the partial differential equations (1D and simple 2D cases would be enough) and teach them how to write simple solvers. This is a small addition, which would take maybe 10 more hours, but will be more than enough for the students who actually want to develop their own solvers in future. This will also enable a better understanding of the subject for the students who want to only use commercial CFD codes.

My main issue is that CFD is always thought of as a difficult subject, while it is not. it is difficult because students don't actually understand how to convert the convert the seemingly complex mathematics into usable code. The discretization procedures are similar for almost all partial differential equations. We linearize them with Taylor Series Exapnsion then use upwinding or (if possible) central difference schemes to solve them. All of this can be easily taught by solving the 1D advection equations and diffusion equations. It wouldn't take any great effort for universities to do this, but it would be very helpful.

Someone can make the argument that students can learn it on themselves. No they can't. If they don't even know that solving 1D advection-diffusion equations is very important (since no one told them), they will try to go into 2D directly, and don't know what to do. If this can't be fit into the assigned course hours, a properly guided path should be laid out for students, that they can follow on their free time.

I don't expect any universities to change their course work.

So I will create my own course on Youtube.
aerosayan is offline   Reply With Quote

Old   October 24, 2021, 07:21
Default
  #10
Senior Member
 
Filippo Maria Denaro
Join Date: Jul 2010
Posts: 6,768
Rep Power: 71
FMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura about
Quote:
Originally Posted by aerosayan View Post
As others have mentioned, the goal of most CFD courses seem to be more oriented towards making the students good enough to use user-friendly commercial CFD codes like ANSYS/COMSOL. There's a very small minority of students who then want to actually develop solvers. Of course no university will change their courses drastically for a small minority, but some small addition to the current course would be more than enough for beginners. The small addition would be simply to teach them how to discretize the partial differential equations (1D and simple 2D cases would be enough) and teach them how to write simple solvers. This is a small addition, which would take maybe 10 more hours, but will be more than enough for the students who actually want to develop their own solvers in future. This will also enable a better understanding of the subject for the students who want to only use commercial CFD codes.

My main issue is that CFD is always thought of as a difficult subject, while it is not. it is difficult because students don't actually understand how to convert the convert the seemingly complex mathematics into usable code. The discretization procedures are similar for almost all partial differential equations. We linearize them with Taylor Series Exapnsion then use upwinding or (if possible) central difference schemes to solve them. All of this can be easily taught by solving the 1D advection equations and diffusion equations. It wouldn't take any great effort for universities to do this, but it would be very helpful.

Someone can make the argument that students can learn it on themselves. No they can't. If they don't even know that solving 1D advection-diffusion equations is very important (since no one told them), they will try to go into 2D directly, and don't know what to do. If this can't be fit into the assigned course hours, a properly guided path should be laid out for students, that they can follow on their free time.

I don't expect any universities to change their course work.

So I will create my own course on Youtube.



Well, I think your opinion is clear to me, now. And I can state that is exactly what a CFD course must do, I usually use both 1D case (such as Burgers equation) and 2D cases (such as lid-driven cavity and backward facing step) for my course. They are the required application after the theory (that is always a mix between math and numerics).

Therefore, the issue is in the CFD courses you are addressing, they simply lack of the CFD goal. I don't know the university you are referring, but that sounds strange to me... this classic test cases are in any CFD textbook.
sbaffini and aerosayan like this.
FMDenaro is offline   Reply With Quote

Old   October 24, 2021, 07:42
Default
  #11
Senior Member
 
sbaffini's Avatar
 
Paolo Lampitella
Join Date: Mar 2009
Location: Italy
Posts: 2,152
Blog Entries: 29
Rep Power: 39
sbaffini will become famous soon enoughsbaffini will become famous soon enough
Send a message via Skype™ to sbaffini
I was having a hard time following the thread (to the point of writing multiple answers which suddenly became useless with new posts).

But now that you have clarified your statement, as Filippo, I agree that this is indeed what a single or multiple CFD courses are meant to teach (I personally had 4 of them with Filippo, more than 10 years ago).

Yet, let me restate that, as mentioned by Simbelmynė and flotus1, there are universities and/or courses where CFD might still be useful, but just from a different perspective. In those cases CFD coding, or coding at all, are not meant to be part of the program or life after the degree.

But this might even depend from the single courses. I took a course related to FEM theory for structures, but coding was not part of it nor expected; yet, I was specifically teached the matrix assembly part. I'm pretty sure that, in the story of that course, probably someone, at certain point, decided to make the extra mile by himself and show up at the exam, but not me as I wasn't interested in the end.

EDIT: however, let me add that, from my experience, there is a large difference between adding 1D-2D coding as part of a single course and, say, taking dedicated courses on different topics (I had 1 on basic numerical analysis, 1 on 1D-2D PDE discretiztion and 2 on NSE discretization). That single addition to the single course is not, in my opinion, ever going to serve the purpose of making you a proficient CFD coder. There is a plethora of nuances and details to each single topic. Of course, you still need to start somewhere if you want to code, but the specific courses are out there as well.
FMDenaro and aerosayan like this.
sbaffini is offline   Reply With Quote

Reply


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 Off
Pingbacks are On
Refbacks are On



All times are GMT -4. The time now is 23:11.