This is a quite foundational MR which fixes #116 (closed) (Simple LES and RANS models added with
There are quite a lot of changes at different levels:
- Base fluidsim things (in
fluidsim/base/turb_model/base.py). Just interesting for fluidsim core developers.
- Implementation of a model (class
- Testing (
- Examples (
If you want to take inspiration to implement another model, you should look only at
fluidsim.base.turb_model.smagorinsky.SmagorinskyModel and the associated test class.
More work needed on this subject:
- For now, it works only for the
- The outputs do not take into account the forcing added by the turbulent model (see for example
- It would be nice to improve testing by checking that the model works as expected
- It would be nice to implement the dynamic Smagorinsky model
A question: for now the model is recomputed each time
turb_model.get_forcing is called, i.e. each time
sim.tendencies_nonlin is called (for example 4 times per time step for the RK4 time stepping scheme). Would it be sufficient to compute it once per time step?
Warning: to try this code, one must really reinstall Fluidsim from source, which means update the source (
hg pull; hg up turb_model), and then
cd lib; pip install -e .; cd .. (to install the modified version of
fluidsim_core) and then
pip install -e . (to recompile a modified extension).
One can check that everything is fine by running