Eilmer4 - a Computational Fluid Dynamics code in D

Joakim dlang at joakim.fea.st
Sat Oct 7 03:09:58 UTC 2017


On Friday, 6 October 2017 at 23:49:33 UTC, Bastiaan Veelo wrote:
> On Friday, 6 October 2017 at 22:16:09 UTC, Peter Jacobs wrote:
>> Eilmer is a simulation code for studying high-speed 
>> compressible flows.  Early versions were written in C and then 
>> C++.  Version 4 is a complete rewrite in D, with Lua for 
>> configuration and run-time scripting.  Code and documentation 
>> may be found at http://cfcfd.mechmining.uq.edu.au/eilmer/
>>
>> This note is principally to say thank you to all of the people 
>> who have made the D programming language and its ecosystem.  
>> Being mechanical engineers, we are occasional but serious 
>> programmers.  For a number of years, we struggled with C++ and 
>> a code base of growing complexity.  In 2014, we made a serious 
>> commitment to reworking the entire code into D. In mid-2017, 
>> the new code was complete enough for general use and it is 
>> currently being used in a fourth-year course on computational 
>> fluid dynamics.  The D programming language has enhanced our 
>> programming experience and, for that, we are grateful to the 
>> many people who have built the foundation upon which we build 
>> our flow simulation code.
>>
>> Cheers,
>> Peter Jacobs and Rowan Gollan
>
> Congtatulations on a job well done. Your motivation for use of 
> the D Programming Language is the same as ours. I found your 
> paper describing the rewrite [1] very interesting, I think it 
> deserves a more prominent mention here and on the usual news 
> sites.
>
> Bastiaan
>
> [1] 
> http://cfcfd.mechmining.uq.edu.au/eilmer/pdfs/T0316-eilmer-dlang-v2.pdf

I like how you have setup instructions and docs on your site.

Two relevant quotes from the paper:

"With the recent maturing of the programming language D as a good 
alternative to C++ for statically-checked, natively-compiled 
code, we have taken the opportunity to rebuild our simulation 
code. The D programming language provides the conveniences of 
Python, the run-time performance of C++ and the ability to be 
directly linked to C language libraries. It appears that we can 
have it all and we can have it now. One good example of where the 
rebuild has resulted in significant improvements is the 
viscous-flux calculation code. In the C++ code, about 2500 lines 
were used, and this had the extra complication of requiring the 
M4 preprocessor to produce the actual C++ code (of length 5580 
lines) that was given to the compiler. The new D language code 
amounts to 733 lines."

"Conclusion
We have spent much of a year building a new compressible flow 
simulation code from scratch, in a relatively new language. So 
far, our experience with the D programming language has been 
positive, with a fairly capable simulation code being constructed 
with a few months of effort by two people. Together with some 
code redesign, the D programming language has allowed the 
construction of a code base that is much simpler than its C++ 
predecessor but is just as fast."

Mike, want to stick this on proggit and HN?


More information about the Digitalmars-d-announce mailing list