Giter Club home page Giter Club logo

elastictube1d's Introduction

preCICE example for FSI: 1D elastic tube

First Step: Choose a version

This tutorial comes in two distinct versions, one written in C++ and one in Python. The code for each are located in the folders cxx and python respectively.

Choose a version, then navigate down to the corresponding sections for Python and C++ instructions.


Python version

This version is realized using the Python API for preCICE. Check this entry in the preCICE wiki for more information on this example.

Requirements

Note: these requirements are specific to the Python variant of the code. If you wish to run the C++ version, you require different packages (see this section).

How to run

  1. Clone this repository:

    $ git clone https://github.com/precice/elastictube1d.git
  2. Navigate into the python directory and execute the Allrun script to run both solver participants directly:

    $ cd python/ && ./Allrun
  3. After the script exits, you can view the output .vtk files in the VTK folder located in the root directory.

  4. To clean up the log files and vtk files created during a run, execute the Allclean script.

    $ ./Allclean

Optional: Visualization and video output can be triggered via the options --enable-plot and --write-video of FluidSolver.py. If you want to use Allrun, you can set these options via environment variables:

  • $ ENABLE_PLOT=1 ./Allrun: plots the simulation over time
  • $ ENABLE_PLOT=1 WRITE_VIDEO=1 ./Allrun: plots the simulation over time and creates a video.

C++ version

Check this preCICE wiki page for a detailed description of this tutorial. For more information see [1]. Elastictube scenario taken from [2].

Requirements

  • preCICE

  • LAPACK. On Ubuntu-like Linux distributions, you can also install via executing:

    $ sudo apt-get install liblapack-dev

How to run

  1. Clone this repository:

    $ git clone https://github.com/precice/elastictube1d.git
  2. Navigate into the cxx directory and build the Makefiles:

    $ cd cxx/ && cmake .

    Note: if cmake cannot find libprecice.so, please make sure that you are linking to preCICE correctly.

  3. Make the tutorial:

    $ make all
  4. After successful compilation, you can now launch preset configuration by calling the Allrun script located in the current folder:

    $ ./Allrun

    Results will be stored as .vtk files in the cxx/Postproc folder.

  5. To quickly clean the folder of log files and results from previous runs, execute Allclean:

    $ ./Allclean

Optional: You can visualize the results with the Postproc/fluid.py script:

$ python Postproc/fluid.py <quantity> Postproc/<prefix>

Note the required arguments specifying which quantity to plot (pressure, velocity or diameter) and a name prefix for the target vtk files. For example, to plot the diameter using the default prefix for vtk files, we execute:

$ python Postproc/fluid.py diameter Postproc/out_fluid_

An image of this diameter plot can be found in the cxx/example folder.

Alternative:: If you wish to run the parallel versions of each solver, run the Allrun_parallel script instead. Note that no vtk output is generated for this solver configuration!

Note: The tutorial can also be run manually by launching both participants by hand. See this preCICE wiki page for instructions.


References

[1] M. Mehl, B. Uekermann, H. Bijl, D. Blom, B. Gatzhammer, and A. van Zuijlen. Parallel coupling numerics for partitioned fluid-structure interaction simulations. CAMWA, 2016.
[2] J. Degroote, P. Bruggeman, R. Haelterman, and J. Vierendeels. Stability of a coupling technique for partitioned solvers in FSI applications. Computers & Structures, 2008.

elastictube1d's People

Contributors

benjaminrodenberg avatar eder-k avatar fsimonis avatar gertjanvanzwieten avatar ishaandesai avatar makish avatar richahert avatar saumij avatar uekerman avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.