|
[Sponsors] |
February 20, 2020, 16:29 |
OpenFOAM performance
|
#1 |
Senior Member
anonymous
Join Date: Jan 2016
Posts: 416
Rep Power: 14 |
Hi!
I'm just curious if anyone can provide some data about the performance profile of any OpenFOAM solver? I mean the time spent for the different functions. Now I'm interested in the equation formulation. So as i know for example let's assume some useless equation: Code:
solve(fvm::laplacian(T)+fvc::div(U)+fvc::div(k)+fvc::div(someVariable)) Is it really feasible to create the equation system this way? I just made a really dummy code in c++ to check the difference between four loop and add one by one and between a single loop but add four times. As i expected the results are clear. One loop, four addition wins. The second method is 2x faster. (In the code the clock starts after the vectors are initialized with some data.) So are there any tests about it? I know this is a "small part" of the code but the difference is huge. |
|
February 21, 2020, 01:04 |
|
#2 |
Senior Member
Herpes Free Engineer
Join Date: Sep 2019
Location: The Home Under The Ground with the Lost Boys
Posts: 932
Rep Power: 12 |
The performance questions are tricky. The outcome from a performance analysis is difficult to generalise, as you have attempted to deduce some insight from another piece of code (which is good by itself).
The steps you have elaborated in your post are mostly discarded by the compiler, which operates in a more clever way than a human can do. For OpenFOAM, or any other CFD software, the bottleneck is not CPU, not the number of floating-point opers. You can confidently assume that the floating-point oper cost for OpenFOAM is free. The bottleneck is memory and caching. But the most important challenge is the maintenance, for which the code must be maintainable, for which it must be expressive and intuitive for human readers. My suggestion is that trust compiler and do not worry about the performance, which is good for OpenFOAM. I personally saw a 1.5 billion cell two-phase simulation for the Japan earthquake, and the weak scaling is virtually resembling to the ideal curve. At least these are my opinions.
__________________
The OpenFOAM community is the biggest contributor to OpenFOAM: User guide/Wiki-1/Wiki-2/Code guide/Code Wiki/Journal Nilsson/Guerrero/Holzinger/Holzmann/Nagy/Santos/Nozaki/Jasak/Primer Governance Bugs/Features: OpenFOAM (ESI-OpenCFD-Trademark) Bugs/Features: FOAM-Extend (Wikki-FSB) Bugs: OpenFOAM.org How to create a MWE New: Forkable OpenFOAM mirror |
|
February 21, 2020, 04:10 |
|
#3 |
Senior Member
anonymous
Join Date: Jan 2016
Posts: 416
Rep Power: 14 |
You call the constructor of fvc::grad so it will create this object. Then add it to the previous one, loop through the vectors, etc. I'm not an expert in programming but correct me if I'm wrong.
I know that the memory access for the CPU is problematic in these kind of software, but looping through the same vector multiple times and access its data multiple times while you could use it once, I think it is the same what you are talking about. Memory... That's why I'm interested if are there any tests about that. |
|
February 21, 2020, 04:45 |
|
#4 |
Senior Member
Herpes Free Engineer
Join Date: Sep 2019
Location: The Home Under The Ground with the Lost Boys
Posts: 932
Rep Power: 12 |
>> You call the constructor of fvc::grad so it will create this object. Then add it to the previous one, loop through the vectors.
That's what is coded, but that's not what the machine instructions that compiler and linker assemble. Even if you would code it differently, the compiler would produce the same instructions. I had raised this question once in stackexchange, and the top answer was telling me like "don't worry, compilers are smarter than you, a lot smarter". So those are my opinions. Somebody else may provide more tangible insight.
__________________
The OpenFOAM community is the biggest contributor to OpenFOAM: User guide/Wiki-1/Wiki-2/Code guide/Code Wiki/Journal Nilsson/Guerrero/Holzinger/Holzmann/Nagy/Santos/Nozaki/Jasak/Primer Governance Bugs/Features: OpenFOAM (ESI-OpenCFD-Trademark) Bugs/Features: FOAM-Extend (Wikki-FSB) Bugs: OpenFOAM.org How to create a MWE New: Forkable OpenFOAM mirror |
|
February 21, 2020, 12:51 |
|
#5 |
Senior Member
anonymous
Join Date: Jan 2016
Posts: 416
Rep Power: 14 |
<Deleted post>
Last edited by simrego; February 22, 2020 at 03:39. |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Is anyone using OpenFOAM to simulate the performance of rocket motors with openfoam? | Fengwei | OpenFOAM | 1 | October 25, 2013 01:06 |
New OpenFOAM Forum Structure | jola | OpenFOAM | 2 | October 19, 2011 06:55 |
Parallel performance OpenFoam Vs Fluent | prapanj | Main CFD Forum | 0 | March 26, 2009 05:43 |
64bitrhel5 OF installation instructions | mirko | OpenFOAM Installation | 2 | August 12, 2008 18:07 |
Intelbs MPI and performance tools in OpenFOAM | hplum | OpenFOAM | 16 | December 16, 2007 14:58 |