NebulaSEM

NebulaSEM: A high-order discontinuous Galerkin spectral element code for atmospheric modeling - Published in JOSS (2024)

https://github.com/dshawul/nebulasem

Science Score: 100.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
    Found CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
    Found 5 DOI reference(s) in README and JOSS metadata
  • Academic publication links
    Links to: joss.theoj.org, zenodo.org
  • Committers with academic emails
    1 of 11 committers (9.1%) from academic institutions
  • Institutional organization owner
  • JOSS paper metadata
    Published in Journal of Open Source Software

Scientific Fields

Materials Science Physical Sciences - 40% confidence
Last synced: 4 months ago · JSON representation ·

Repository

Finite Volume (FV) and high-order Discontinuous Galerkin (DG) solver

Basic Info
  • Host: GitHub
  • Owner: dshawul
  • License: bsd-2-clause
  • Language: C++
  • Default Branch: master
  • Homepage:
  • Size: 28.2 MB
Statistics
  • Stars: 26
  • Watchers: 3
  • Forks: 9
  • Open Issues: 2
  • Releases: 1
Created about 11 years ago · Last pushed over 1 year ago
Metadata Files
Readme License Citation

README.md

NebulaSEM APIdoc JOSS DOI DOI

NebulaSEM

NebulaSEM is an experimental finite volume (FV) and discontinuous Galerkin spectral element (dGSEM) code for solving partial differential equations (PDEs) of fluid dynamics. It comes with solvers for compressible and incompressible flow, and also provides infrastructure for writing PDE solvers easily with support for adaptive mesh refinement (AMR). The primary focus of the software is research in a high-order non-hydrostatic dynamical core for atmospheric simulations. Several examples are provided to demonstrate this capability.

Build and install

Clone the repository

git clone https://github.com/dshawul/NebulaSEM.git

To build and install NebulaSEM

mkdir build && cd build
cmake -DCMAKE_BUILD_TYPE=release -DCMAKE_INSTALL_PREFIX=.. ..
make && make install

Additional options to enable fine-grained parallelization on CPUs and GPUs

-DUSE_ACC=ON
-DUSE_OMP=ON

This will install tools for pre-processing, solution and post-processing. The tool mesh generates the grid, prepare does various pre- and post-processing, and several other binaries for solving PDEs e.g. euler, convection etc

Requirements

  • METIS for domain decomposition
  • OpenMPI or other MPI library compatible with your C++ compiler
  • CMake for makefile generation
  • GCC or other C++ compiler with at least C++17 standard support

Optional packages - DOxygen for API documentation - ParaView for visualization - NVHPC or other OpenACC compiler

Documentation

The API documentation built with Doxygen can be found here. Also READMEs are provided for writing new solvers under apps/ directory, and for setting up test cases under examples/ directory.

Testing

A testing script test.sh is provided. By default it runs the lid-driven test case under examples/cavity using the binaries installed with the make install command.

To run a test case, execute the test.sh script specifying the number of MPI ranks, if greater than, 1 and the test case name.

./test.sh -n 2 -c examples/atmo/advection-leveque/bubble

If the binaries are installed other than $PWD/bin, pass the installation location to it using the --bin-path option

./test.sh -n 2 --bin-path /usr/local/bin -c examples/atmo/advection-leveque/bubble

The path to the test case should point to the grid file, in this case bubble, not to the directory itself.

Usage: ./test.sh [options]

   -n,--np       Number of MPI processes to launch.
   -c,--case     Path to grid file name that is under a test case directory.
   -b,--bin-path Path to binaries: mesh, prepare and solvers.
   -s,--steps    Number of time steps, which overwrites the one in control file.
   -h,--help     Display this help message.

Lid-driven cavity flow

This test case uses the Pressure Implicit Splitting of Operators (PISO) solver for incompressible flow at low Reynolds number i.e. no turbulence.

$ ./test.sh -n 1 -c examples/cavity-amr/cavity

This will generate a run-examples-cavity-amr directory in which you can find the results including VTK files for visualization by Paraview.

Here are images of the decomposition using METIS with 12 mpi ranks, and the magnitude of velocity plots.

Pitz-Daily test case

Another test case, namely the Pitz and Daily, solved using LES is shown below. You can see the formation of eddies at the backward facing step and later convection towards the outlet.

The same test case simulated with the k-e turbulence model is shown below. It is a Reynolds-average turbulence scheme so only mean state is displayed.

Rising thermal bubble

This is a popular test case for numerical weather prediction models that solve the Euler equations using explicit time-stepping unlike other CFD applications that often use implicit solvers. Moreover this test cases uses discontinuous Galerkin method (spectral-element version) on hexahedral grids, and adaptive mesh refinement. Thanks to my postdoc supervisor Francis X. Giraldo, from whom I learned this stuff!

A thermal bubble of Gaussian distribution rises up due to buoyancy, while deforming on the way, and collides with the top boundary.

A note about MPI/OpenMP/OpenACC parallelization

NebulaSEM is able to exploit multi-core CPUs either using a pure MPI approach or a hybrid MPI+OpenMP approach. CFD codes often utilize a pure MPI approach because that scales better than OpenMP. However, when extreme scalability on supercomputers is required, the hybrid MPI + OpenMP parallelization can become beneficial by reducing inter-process communication. To compile NebulaSEM for a hybrid MPI+OpenMP

mkdir build-omp && cd build-omp
cmake -DCMAKE_BUILD_TYPE=release -DCMAKE_INSTALL_PREFIX=.. -DUSE_OMP=ON ..
make && make install

The number of threads for OpenMP is controlled by the OMP_NUM_THREADS environment variables. Then we can run the lid-driven cavity flow as usual specifying only 1 MPI rank and 2 OpenMP threads for a pure OpenMP approach as:

$ export OMP_NUM_THREADS=2
$ ./test.sh -n 1 -c examples/cavity/cavity

Or 2 mpi ranks + 2 openmp threads per rank for a hybrid MPI+OpenMP approach

$ export OMP_NUM_THREADS=2
$ ./test.sh -n 2 -c examples/cavity/cavity

Or 2 mpi ranks with 1 threads per rank for a pure MPI approach

$ export OMP_NUM_THREADS=1
$ ./test.sh -n 2 -c examples/cavity/cavity

Note that to obtain significant speedups from either MPI or OpenMP, the problem size should be large enough. For the lid-driven cavity flow we can increase the problem size to 100x100 by editing examples/cavity/vaity diff -8{0 1 2 3 4 5 6 7} linear 3{20 20 1} +8{0 1 2 3 4 5 6 7} linear 3{100 100 1} Run single MPI rank run $ export OMP_NUM_THREADS=1 $ ./test.sh -n 1 -c examples/cavity/cavity ... 9018 [0] Time 5.000000 9025 [0] SYMM-FULL-SSOR-PCG :Iterations 1 Initial Residual 1.47888e-11 Final Residual 1.14971e-11 9027 [0] SYMM-FULL-SSOR-PCG :Iterations 1 Initial Residual 1.44703e-11 Final Residual 1.12991e-11 9073 [0] Exiting application run with 1 processes Takes about 9073 milliseconds.

Run 2-mpi ranks $ ./test.sh -n 2 -c examples/cavity/cavity .... 4623 [0] Time 5.000000 4626 [0] SYMM-FULL-SSOR-PCG :Iterations 1 Initial Residual 3.55206e-11 Final Residual 3.16645e-11 4628 [0] SYMM-FULL-SSOR-PCG :Iterations 1 Initial Residual 3.38580e-11 Final Residual 3.00837e-11 4672 [0] Exiting application run with 2 processes Takes about 4672 milliseconds for a speedup of 1.94x out of 2 which is good.


Lets do the same with the OpenMP implementation. Make sure to use the build-omp binaries by doing: cd build-omp && make install We can now run the test case with 1 mpi rank $ export OMP_NUM_THREADS=2 $ ./test.sh -n 1 -c examples/cavity/cavity .... 6686 [0] Time 5.000000 6691 [0] SYMM-FULL-SSOR-PCG :Iterations 1 Initial Residual 1.47888e-11 Final Residual 1.14971e-11 6693 [0] SYMM-FULL-SSOR-PCG :Iterations 1 Initial Residual 1.44703e-11 Final Residual 1.12991e-11 6739 [0] Exiting application run with 1 processes It took about 6739 milliseconds. It is slower than the MPI implementation but still faster than the serial implementation with a speedup of 1.34x times.

Contribution

Users are welcome to suggest and implement new features such as new solvers, turbulence models, new test cases, as well as report bugs or issues they encounter. Please feel free to open an issue on this repository describing your desired change/bug-fix. Pull requests are also welcome!

Owner

  • Name: Daniel Shawul
  • Login: dshawul
  • Kind: user

JOSS Publication

NebulaSEM: A high-order discontinuous Galerkin spectral element code for atmospheric modeling
Published
April 30, 2024
Volume 9, Issue 96, Page 6448
Authors
Daniel S. Abdi ORCID
Cooperative Institute for Research in Environmental Sciences
Editor
Hauke Schulz ORCID
Tags
discontinuos Galerking spectral element finite volume atmospheric modelling global circulation model computational fluid dynamics adaptive mesh refinement C++ expression templates

Citation (CITATION.cff)

cff-version: "1.2.0"
authors:
- family-names: Abdi
  given-names: Daniel S.
  orcid: "https://orcid.org/0000-0003-0671-2941"
contact:
- family-names: Abdi
  given-names: Daniel S.
  orcid: "https://orcid.org/0000-0003-0671-2941"
doi: 10.5281/zenodo.11088210
message: If you use this software, please cite our article in the
  Journal of Open Source Software.
preferred-citation:
  authors:
  - family-names: Abdi
    given-names: Daniel S.
    orcid: "https://orcid.org/0000-0003-0671-2941"
  date-published: 2024-04-30
  doi: 10.21105/joss.06448
  issn: 2475-9066
  issue: 96
  journal: Journal of Open Source Software
  publisher:
    name: Open Journals
  start: 6448
  title: "NebulaSEM: A high-order discontinuous Galerkin spectral
    element code for atmospheric modeling"
  type: article
  url: "https://joss.theoj.org/papers/10.21105/joss.06448"
  volume: 9
title: "NebulaSEM: A high-order discontinuous Galerkin spectral element
  code for atmospheric modeling"

GitHub Events

Total
  • Watch event: 3
Last Year
  • Watch event: 3

Committers

Last synced: 5 months ago

All Time
  • Total Commits: 437
  • Total Committers: 11
  • Avg Commits per committer: 39.727
  • Development Distribution Score (DDS): 0.254
Past Year
  • Commits: 14
  • Committers: 1
  • Avg Commits per committer: 14.0
  • Development Distribution Score (DDS): 0.0
Top Committers
Name Email Commits
Daniel Abdi d****i@n****v 326
dshawul d****l@y****m 80
Daniel Abdi d****i@D****l 12
U-Daniel-pc\dshawul d****l@D****) 8
Lucas Esclapez 1****z 3
Antonio Cervone a****e@g****m 2
Daniel Abdi d****i@c****r 2
Hauke Schulz 4****s 1
Daniel Abdi d****l@D****) 1
Daniel Abdi d****i@c****r 1
Daniel Abdi d****i@d****l 1
Committer Domains (Top 20 + Academic)

Issues and Pull Requests

Last synced: 4 months ago

All Time
  • Total issues: 5
  • Total pull requests: 6
  • Average time to close issues: 5 days
  • Average time to close pull requests: about 4 hours
  • Total issue authors: 3
  • Total pull request authors: 3
  • Average comments per issue: 2.0
  • Average comments per pull request: 0.17
  • Merged pull requests: 6
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 1
  • Pull requests: 0
  • Average time to close issues: N/A
  • Average time to close pull requests: N/A
  • Issue authors: 1
  • Pull request authors: 0
  • Average comments per issue: 0.0
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • dshawul (2)
  • capitalaslash (2)
  • esclapez (1)
Pull Request Authors
  • esclapez (6)
  • capitalaslash (4)
  • observingClouds (2)
Top Labels
Issue Labels
Pull Request Labels