|
[Sponsors] |
![]() |
![]() |
#1 |
Senior Member
-
Join Date: Oct 2021
Location: -
Posts: 139
Rep Power: 4 ![]() |
Hello Everyone
I want to make my own CFD code. But I think my coding level is not enough. So I need to learn and practice CFD coding. Is there any bible book that treats coding example mainly? If there is example code and solution, it would be better because before making code, I want to solve a problem by using pen with less number of mesh for first iteration. Thank you ![]() |
|
![]() |
![]() |
![]() |
![]() |
#2 |
Senior Member
|
There is no book on CFD coding as such. You will find several with some accompanying code but none of them has any actual practical relevance, they are didactic as they should be.
However, the idea of a bible for the coding of X is wrong, in my opinion. There are general principles that you can use which go beyond coding per se, but still depend from the scope of the code. In fact, coding for didactic purposes is very different from coding in general, which is very different from coding math software in a commercial setting. All of this, then, must be contextualized within the programming language in use, which might have its own idiosyncracies. If you need to learn CFD coding for the first time, focus on getting it right first. |
|
![]() |
![]() |
![]() |
![]() |
#3 |
Senior Member
|
Of course, there are some common sense things to always have in mind, once you have your stuff working:
1) CFD coding is pretty much synonimous of coding for performances BUT, math coding as a business requires a balance between different needs. Code readability and maintainability are equally important (a clever, imperscrutable trick to gain a 1% speedup is almost always a bad idea), as well as code length (less code is always better) and its general organization (too long to delve in it here, but many small independent pieces are always better than few monolithic, interlinked pieces) 2) Coding for performances really means: a) access memory in a friendly manner (e.g., column major in Fortran); b) access memory as little as possible; c) organize memory in an access friendly manner (SoA, not AoS); d) keep your cpu busy, possibly trough vectorization; e) pick up the correct algorithm (almosy always with linear or log-linear cost, not higher) 3) Try to use external libraries with parsimony and common sense 4) Respect your programming language as much as possible and always write standard conforming code It really makes no sense to go beyond this generic common sense stuff at the beginning. A fully working CFD code has so much stuff in it that you soon realize it cannot live with rules written in stone. You actually need a formal thinking framework that will serve as guidance for each decision to be taken along the way |
|
![]() |
![]() |
![]() |
![]() |
#4 | |
New Member
maverickwhites
Join Date: Jul 2024
Posts: 1
Rep Power: 0 ![]() |
Quote:
1. Numerical Heat Transfer and Fluid Flow by Suhas V. Patankar - Covers CFD basics with examples and solutions. 2. Computational Fluid Dynamics: The Basics with Applications by John D. Anderson Jr. - Offers fundamental concepts and practical coding exercises. 3. An Introduction to Computational Fluid Dynamics: The Finite Volume Method by H.K. Versteeg and W. Malalasekera - Detailed introduction with examples and problem solutions. |
||
![]() |
![]() |
![]() |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
New Book Proposal: Project-based Finite Element Method | Dr Youssef Hafez | Main CFD Forum | 1 | January 1, 2023 11:45 |
Book recommendation for pipe flow having incomprehensible fluid in ANSYS Fluent | Rimzy | FLUENT | 3 | September 27, 2019 05:24 |
book recommendation: hydrodynamics | thomas | Main CFD Forum | 0 | February 15, 2008 01:28 |
Book recommendation need for all speed flows | jinwon park | Main CFD Forum | 0 | February 6, 2008 11:34 |
Book recommendation? | Jason | Main CFD Forum | 1 | June 5, 2002 23:45 |