Skip to content

SOLVERLAB a library for numerical analysts focusing on PDE discretization using MATLAB-style functions, based on MEDcoupling and PETSc.

License

Notifications You must be signed in to change notification settings

SalomePlatform/solverlab

Repository files navigation

logo

SOLVERLAB

Introduction

SOLVERLAB is a geometrical and numerical C++/Python library designed for numerical analysts who work on the discretisation of partial differential equations on general shapes and meshes and would rather focus on high-level scripting.

The goal is to provide simple MATLAB style functions for the generation and manipulation of meshes, fields and matrices. The library is based on MEDcoupling, and C++/python library of the SALOME project for the handling of meshes and fields, and on the C++ library PETSC for the handling of matrices and linear solvers.

SOLVERLAB includes PDE systems arising from the modeling of nuclear reactor cores which involves fluid dynamics, heat and neutron diffusion as well as solid elasticity.

It is a simple environment meant at students and researchers for teaching and promote new numerical methods on general geometries with unstructured meshes.

The main research objectives of SOLVERLAB are the study of :

  • Numerical schemes for compressible flows at low Mach numbers on general meshes
  • Well balanced schemes for stiff source terms (heat source, phase change, pressure losses)
  • Numerical handling of flow inversion, phase disappearance and counter-currents in two phase flows
  • Numerical handling of stiff porosity or cross section functions
  • Schemes that preserve the phasic volume fraction α ∈ [0, 1]
  • Convergence of finite volume methods
  • New preconditioners for implicit methods for two phase flows
  • The coupling of fluid models or multiphysics coupling (eg thermal hydraulics and neutronics or thermal hydraulics and solid thermics)

The library is currently maintained and distributed by the SALOME developpement team on various linux distributions (Ubuntu, CentOS, Fedora, Debian) and on Windows-10. The corresponding binary files can be found here.

Examples of use

User guide of the CoreFlows module

The user guide is organized as follows :

Run SOLVERLAB from SALOME

The easiest way to run SOLVERLAB is to launch the SOLVERLAB module of the SALOME platform :

  • download the binary file corresponding to your operating system here.
  • after downloading the appropriate tar.gz archive, untar it in a folder mySALOME (for example).
  • run the file mySALOME/salome in a terminal to launch SALOME
  • In the SALOME window, either
    • click on the SOLVERLAB icon logo to launch SOLVERLAB module window
    • or use the SALOME python shell to run SOLVERLAB python scripts.

The new GUI of SOLVERLAB is based on the library PACKAGESPY developped in the framework of SALOME.

Use of SOLVERLAB in a terminal/console

Running Python scripts

If you are not in the SALOME console you first need to load the SOLVERLAB environment in your terminal using the command

  • source /path/to/SOLVERLAB_install/env_SOLVERLAB.sh

Then to run SOLVERLAB with your Python code main.py , simply type in your terminal or your SALOME console

  • python3 main.py

Launching SOLVERLAB graphic interface from a terminal

If you are not in a SALOME console you first need to load the SALOME environment in your terminal using the command

  • source /path/to/SALOME/env_launch.sh

Then to use the Graphical User Interface of SOLVERLAB, simply type in your terminal

  • python3 $SOLVERLABGUI -g

Running C++ scripts

If performance or parallelism is an issue for your simulations and python is too slow for your needs, you can link your C++ or Fortran code with SOLVERLAB librairies :

  • Set C++ libraries path: export LD_LIBRARY_PATH=/path/to/SOLVERLAB_install/lib
  • To know how to include the right libraries for compilation, see the makefiles of the examples. They include the list
    -lmedC -lmedloader -lmedcoupling -lbase -lmesh -llinearsolver, plus -lmpi if you are using a parallel version of SOLVERLAB.

SOLVERLAB environment variables

The SOLVERLAB environment variables consist in :

  • SOLVERLAB C++ library path: /path/to/SOLVERLAB_install/lib
  • SOLVERLAB Python library paths: /path/to/SOLVERLAB_install/lib/SOLVERLAB:/path/to/SOLVERLAB_install/bin/SOLVERLAB
  • PETSc, SLEPc and HDF5 library path: ${PETSC_DIR}/${PETSC_ARCH}/lib
  • MED library path: ${MEDFILE_ROOT_DIR}/lib
  • MEDCOUPLING library path: ${MEDCOUPLING_ROOT_DIR}/lib

Standalone compilation from sources

However the SALOME binary file can be very large (up to 5GB). Compilation of SOLVERLAB from source files can provide a faster alternative using less disk and memory space.

In order to build SOLVERLAB on your system you will need

  • the package CMAKE,
  • a C++ compiler such as g++
  • optionally Python3 to run python language scripts
  • optionally ParaView for data visualisation.

Detailed instructions for compilation and use of standalone SOLVERLAB can be found in the page Standalone compilation from sources.

About

SOLVERLAB a library for numerical analysts focusing on PDE discretization using MATLAB-style functions, based on MEDcoupling and PETSc.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •