cuspaceflight / firefish

CFD simulation software for Martlet 3
Apache License 2.0
5 stars 4 forks source link

add OpenFOAM case directory wrapper and examples #9

Closed rjw57 closed 8 years ago

rjw57 commented 8 years ago

The first bit of CFD functionality(!) The idea of this PR is to provide a simple programmatic interface to the OpenFOAM system. Ideally we'll be able to write little Python scripts to set up cases or run them.

This first PR sets up the infrastructure to create a case directory, load and save the OpenFOAM data files within it and run OpenFOAM tools. This is exposed in the cusfsim.case module. Tests and documentation are provided.

In addition to the API tests, a full example is also included. This is a transliteration of the OpenFOAM lid-driven cavity flow example and provides an indication of the sort of Python scripts we can write. Instead of the configuration being split over multiple files, a single script can create he configuration and, in the fullness of time, the script may be able to vary parameters.

This PR is an instance of "example driven development" in that I wrote the examples/openfoam_cavity_tutorial.py script first with the API I thought would be convenient. I then fleshed out the cusfsim.case module to implement it.

The example is documented in the sphinx documentation function-by-function and is also run as part of the travis test procedure.

rjw57 commented 8 years ago

Pinging @jb803 to take a look at this since @boyuanxiao and I have been merging away this evening...

jb803 commented 8 years ago

Looks good - will try and get supersonic wedge up and running in the cusfsim.case framework