Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

Navier Stokes - Ernst-Otto-Fischer Teaching Code

License

NotificationsYou must be signed in to change notification settings

TUM-I5/NS-EOF

Repository files navigation

General Information

This code has been tested under Ubuntu 22.04 or higher. Other Linux distributions will probably work.However, we do not recommend using Windows or MacOS.If you do not have Linux installed on your computer, please use WSL, Virtual Machine, Docker or similar.

Dependencies

Build Essentials

On Ubuntu, start with the installation of all required build essentials:apt install build-essential gcc g++ pkg-config

MPI (recommended OpenMPI)

  • Under Ubuntu you can simply runapt install libopenmpi-dev to install OpenMPI.

PETSc

  • Please installPETSc on your system.
  • We recommend to useapt install petsc-dev to install.

CMake

  • Runapt install cmake to install CMake on your system.

Docker

A prebuilt Docker image is available inDockerhub.

To use the prebuilt image, we do recommended that you first clone NS-EOF, then navigate into the NS-EOF checkoutand run the Docker container interactively by mapping the NS-EOF directory into the container (here, we usework as our mapping point):

docker run -it -v${PWD}:/work --rm --privileged tumi5/ns-eof /bin/bash

Navigate into thework directory and continue with the steps below.

Build and Test

As build system configurator we use CMake. To compile the code execute the following commands in this directory:

  • Create a build directory:mkdir build. You can also choose any other name for your build directory.
  • Switch to this directory:cd build
  • Run CMake:cmake .. (for an overview of all available options, useccmake ..)
  • For aDebug build, runcmake .. -DCMAKE_BUILD_TYPE=Debug
  • Run Make:make (ormake -j to compile with multiple cores).
  • Run Tests: Some basic unit tests have been implemented (make test). Feel free to add your own test cases inside theTests folder.

Running a Simulation

  • Run the code in serial via./NS-EOF-Runner path/to/your/configuration
    • Example:./NS-EOF-Runner ../ExampleCases/Cavity2D.xml
  • Run the code in parallel viampirun -np nproc ./NS-EOF-Runner path/to/your/configuration
    • Example:mpirun -np 4 ./NS-EOF-Runner ../ExampleCases/Cavity2DParallel.xml

Adding New Source Files

You can add new source files by just creating them somewhere within theSource folder. CMake automatically detects these files and adds them to the build.

Development Hints & FAQ

It does not compile and everything seems fine?

Make sure to usemake clean before you usemake. Sometimes there are build artifacts from previous build processes that spoil your current compilation process.make clean takes care of deleting everything that should not be there and allows the compiler to start from scratch.

Sometimes it is also helpful to delete thebuild folder and create a new one, following the steps from the compilation section above.

How can I see all the compiler flags the generated Makefile is using?

Instead of usingmake, runVERBOSE=1 make. You can also runmake -n to invoke a dry run where you see what the Makefile would do in case of compilation.

How can I see the test output?

Instead of usingmake test, runctest --verbose.

WARNING! There are options you set that were not used! There are 2 unused database options.

Just ignore these warnings. If you run the code in serial, PETSc does not require the two parameters for parallel runs and vice versa.

About

Navier Stokes - Ernst-Otto-Fischer Teaching Code

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

[8]ページ先頭

©2009-2025 Movatter.jp