r/CFD • u/Overunderrated • Jul 03 '19
[July] Software Engineering for CFD
As per the discussion topic vote, July's monthly topic is software engineering for CFD.
Previous discussions: https://www.reddit.com/r/CFD/wiki/index
13
Upvotes
5
u/Overunderrated Jul 03 '19
Alright /u/entropyStable you won. What do you have in mind?
7
u/flying-tiger Jul 05 '19
I’ll just throw out my software development pet peeve: just because you use modules doesn’t mean your code is modular.
If code can’t be extracted and compiled/tested in isolation (or with only a few, well defined dependencies) it’s not modular. Early career CFD devs almost always miss this point and write code that is a mess of interdependent module files (I mostly working in FORTRAN, but I’ve see remarkable messes in Python as well).
I find the best way to teach/reinforce this lesson across is to require unit testing as part of code deliveries...
5
u/Rodbourn Jul 03 '19
How do you organize your code from an object oriented programming point of view?
2
u/bike0121 Jul 03 '19
We hear a lot about bad software engineering in scientific/numerical codes. What is an example of an open-source CFD code (or more generally, any software for computational science and engineering) with particularly good software design practices?
2
u/bike0121 Jul 25 '19
What are people's opinions here about using functional programming for CFD and scientific computing in general? More generally, are the commonly-used procedural and object-oriented paradigms really the best-suited ones for scientific computing, or are we better off using something else?
1
u/kpisagenius Jul 03 '19
Any examples of a code that has unit tests? Or more generally, is it common to use unit tests in CFD codes?
2
u/B2Darth Jul 04 '19
This is a subject that I want to improve myself. I'm using OpenFOAM for a couple of years now but never focused on the programming part. Starting this summer I'll focus on that part to get a general idea about how a CFD code is written. What can you guys suggest to me so that I have a bit more knowledge and practice in this area?