hips
|
HiPS [2] [3] [4] is an open-source C++ library for stochastic scalar mixing. It can be used both as a standalone mixing model and as a subgrid mixing model in turbulent flow simulations. HiPS is designed to support applications in the transported PDF (TPDF) framework, as well as other particle-based or hybrid CFD methods.
HiPS is designed for Linux-based systems, including macOS and the Linux subsystem for Windows.
build
directory.cmake ..
make
make install
make docs
The default CMake configuration is suitable for users who do not require examples, tests, or documentation immediately. CMake configuration options can be modified by editing the top-level CMakeLists.txt
, the CMakeCache.txt
(generated in the build
directory after running CMake once), or by specifying them on the command line during step 2:
The following project-specific CMake variables can be set by the user:
CMake variable | Default | Description |
---|---|---|
CMAKE_INSTALL_PREFIX | Top-level project directory | Installation location |
REACTIONS_ENABLED | OFF | Enable support for chemical reactions |
HIPS_BUILD_EXAMPLES | ON | Build HiPS examples |
HIPS_BUILD_DOCS | OFF | Build HiPS documentation with Doxygen |
HIPS_BUILD_TESTS | OFF | Build HiPS tests using the Catch2 library |
The REACTIONS_ENABLED
flag determines if HiPS supports chemical reactions. If set to ON
, additional libraries like Cantera or Sundials are required. For simple mixing without reactions, set this flag to OFF
.
This section outlines how to run simulations using the HiPS library, assuming prior familiarity with the model as described in the Overview and associated publication.
HiPS can be used in two primary modes:
To use HiPS in a simulation:
hips
object with the required physical parameters.set_tree()
for each time step (typical in CFD coupling).set_varData()
.calculateSolution(tRun, shouldWriteData)
.get_varData()
.Two constructor options are available:
Use this for standalone simulations when the tree structure is fixed.
Pair this with a per-time-step call to:
Function | Purpose |
---|---|
set_varData(...) | Provide scalar values (e.g., species, temperature) to each parcel. |
calculateSolution(...) | Perform mixing and optional reaction from current time to tRun . |
get_varData() | Retrieve updated parcel values. |
HiPS can write output internally during the simulation, controlled by:
setOutputIntervalEddy(int interval)
: every N eddy events.setOutputIntervalTime(double interval)
: every Δt seconds.By default, output is written every 1000 eddy events. Output is only written if shouldWriteData = true
is passed to calculateSolution()
.
get_varData()
returns the scalar values of all parcels after mixing and reaction. This is typically called at the end of each time step to extract results for post-processing or for coupling with an external solver.
Documented example files are available on the Examples page.