### Build and Install CADET-Core Source: https://cadet.github.io/v5.1.0/getting_started/build_linux Compiles the CADET-Core source code using the `make` command and then installs the compiled binaries and libraries to the specified installation prefix. Assumes CMake configuration has already been completed. ```bash make make install ``` -------------------------------- ### Install Distro Default LAPACK/BLAS on Debian/Ubuntu Source: https://cadet.github.io/v5.1.0/getting_started/build_linux Installs the default LAPACK and BLAS implementations provided by the distribution on Debian-based systems, serving as an alternative to Intel MKL for linear algebra. ```bash sudo apt -y install liblapack3 liblapack-dev libblas3 libblas-dev ``` -------------------------------- ### Install Intel MKL on Debian/Ubuntu Source: https://cadet.github.io/v5.1.0/getting_started/build_linux Installs the Intel Math Kernel Library (MKL) on Debian-based systems, which can be used for optimized linear algebra operations during the CADET-Core build process. ```bash sudo apt -y install intel-mkl ``` -------------------------------- ### Configure Visual Studio Debugger for CADET-Core Source: https://cadet.github.io/v5.1.0/developer_guide/debugging This JSON configuration file sets up the Visual Studio debugger to launch and debug the CADET-Core executable. It specifies the project, target, and arguments for running a simulation with the debugger attached. Ensure 'path_to_setup_file/model.h5' is replaced with the actual path to your simulation setup file. ```json { "version": "0.2.1", "defaults": {}, "configurations": [ { "type": "default", "project": "CMakeLists.txt", "projectTarget": "cadet-cli.exe (Install) (bin/cadet-cli.exe)", "name": "CoreDebug.txt", "args": [ "path_to_setup_file/model.h5>" ] } ] } ``` -------------------------------- ### Importing Libraries and Specifying CADET-CLI Path Source: https://cadet.github.io/v5.1.0/_sources/developer_guide/cadet_python.rst This snippet shows the initial setup for a CADET-Python simulation. It involves importing necessary libraries and defining the file path to the CADET-Core executable ('cadet-cli'), which is essential for running simulations. ```Python3 import os import sys sys.path.insert(0, os.path.abspath('../..')) from cadet import Cadet ``` -------------------------------- ### Configure CADET-Core Build with MKL Sequential (CMake) Source: https://cadet.github.io/v5.1.0/getting_started/build_linux Configures the CADET-Core build process using CMake, specifying the installation prefix and enabling the sequential Intel MKL for optimized linear algebra operations. Assumes MKL is installed and `MKLROOT` is set. ```bash export MKLROOT=/opt/intel/mkl cmake -DCMAKE_INSTALL_PREFIX="../install" -DBLA_VENDOR=Intel10_64lp_seq ../ ``` -------------------------------- ### JSON Representation of CADET-Database Model Setup Source: https://cadet.github.io/v5.1.0/_sources/developer_guide/testing.rst Example of a JSON file format used to define model setups within CADET-Database. This structure is translated from HDF5 files and specifies the configuration for a model, focusing on the output required for reference tests. ```json [ { "name": "HDF5_USE_STATIC_LIBRARIES", "value": "1", "type": "STRING" }, { "name": "BUILD_SHARED_LIBS", "value": "0", "type": "STRING" } ] ``` -------------------------------- ### Set Up and Run Simulator (Python) Source: https://cadet.github.io/v5.1.0/getting_started/tutorials/breakthrough Configures the simulator to translate the `Process` configuration into the API of the target simulator. The `Cadet` simulator is instantiated, and the `simulate` method is called with the configured `Process` object to obtain simulation results. ```python from CADETProcess.simulator import Cadet process_simulator = Cadet() simulation_results = process_simulator.simulate(process) ``` -------------------------------- ### Install CADET-Process using pip Source: https://cadet.github.io/v5.1.0/getting_started/installation_frontend This command installs the CADET-Process package, which is recommended for users due to its object-oriented model builder and automatic parameter validation. It is installed via pip within a conda shell. ```bash pip install CADET-Process ``` -------------------------------- ### Install CADET-Python using pip Source: https://cadet.github.io/v5.1.0/getting_started/installation_frontend This command installs the CADET-Python package, recommended for CADET-Core developers. It provides a Python API for configuring models according to interface specifications and is installed via pip within a conda shell. ```bash pip install CADET-Python ``` -------------------------------- ### Solver Configuration - General Settings Source: https://cadet.github.io/v5.1.0/interface/solver Parameters for general solver configuration, including threading and solution time points. ```APIDOC ## Group /input/solver ### Description General solver configuration parameters. ### Parameters #### Request Body - **NTHREADS** (int) - Required - Number of used threads. Must be greater than or equal to 1. - **USER_SOLUTION_TIMES** (double[]) - Optional - Vector with timepoints at which the solution is evaluated. Unit: s. Must be greater than or equal to 0. Length is arbitrary. - **CONSISTENT_INIT_MODE** (int) - Optional - Consistent initialization mode. Defaults to 1. Valid values are: 0 (None), 1 (Full), 2 (Once, full), 3 (Lean), 4 (Once, lean), 5 (Full once, then lean), 6 (None once, then full), 7 (None once, then lean). Length is 1. - **CONSISTENT_INIT_MODE_SENS** (int) - Optional - Consistent initialization mode for parameter sensitivities. Defaults to 1. Valid values are: 0 (None), 1 (Full), 2 (Once, full), 3 (Lean), 4 (Once, lean), 5 (Full once, then lean), 6 (None once, then full), 7 (None once, then lean). Length is 1. ### Request Example ```json { "NTHREADS": 4, "USER_SOLUTION_TIMES": [0.0, 10.0, 20.0], "CONSISTENT_INIT_MODE": 1, "CONSISTENT_INIT_MODE_SENS": 0 } ``` ### Response #### Success Response (200) - **message** (string) - Indicates successful configuration update. ``` -------------------------------- ### Install CADET-Core using Conda Source: https://cadet.github.io/v5.1.0/master/index Installs CADET-Core and its dependencies using the conda package manager from the conda-forge channel. This is the recommended method for users with a working conda installation. ```bash conda install -c conda-forge cadet ``` -------------------------------- ### Configure Multi-Component Langmuir Adsorption Model Source: https://cadet.github.io/v5.1.0/developer_guide/cadet_python Sets up a multi-component Langmuir adsorption model, specifying whether the process is kinetic or equilibrium-controlled and defining component-specific adsorption parameters (kA, kD, qMAX). This configuration is essential for simulating systems where substances bind to a solid phase. ```python model.root.input.model.unit_001.adsorption_model = 'MULTI_COMPONENT_LANGMUIR' model.root.input.model.unit_001.nbound = [1] model.root.input.model.unit_001.adsorption.is_kinetic = True # Kinetic binding model.root.input.model.unit_001.adsorption.mcl_ka = [1.0,] # m^3 / (mol * s) (mobile phase) model.root.input.model.unit_001.adsorption.mcl_kd = [1.0,] # 1 / s (desorption) ``` -------------------------------- ### Install CADET-Core using Mamba Source: https://cadet.github.io/v5.1.0/master/index Installs CADET-Core using mamba, a faster dependency solver for conda environments. This can be an alternative to the standard conda installation for quicker package resolution. ```bash mamba install -c conda-forge cadet ``` -------------------------------- ### Build CADET-Core using Command Prompt Source: https://cadet.github.io/v5.1.0/getting_started/build_windows Commands to build CADET-Core from the Windows Command Prompt. This includes creating build directories, integrating vcpkg, setting environment variables for MKLROOT (and optionally TBBROOT), configuring the build with CMake, and finally compiling using MSBuild. Requires Visual Studio and vcpkg to be installed. ```batch if not exist CADET-Core\build mkdir CADET-Core\build cd CADET-Core\build vcpkg integrate install set MKLROOT="C:/Program Files (x86)/Intel/oneAPI/mkl/latest" cmake -DCMAKE_INSTALL_PREFIX=..\out\install\aRELEASE -G "Visual Studio 17 2022" -A x64 -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE="%VCPKG_ROOT%/scripts/buildsystems/vcpkg.cmake" -DVCPKG_TARGET_TRIPLET=x64-windows-static -DENABLE_STATIC_LINK_LAPACK=ON -DENABLE_STATIC_LINK_DEPS=ON -DBLA_VENDOR=Intel10_64lp_seq --fresh ../ msbuild.exe INSTALL.vcxproj /p:Configuration=Release;Platform=x64 ``` ```batch set TBBROOT="C:/Program Files (x86)/Intel/oneAPI/tbb/latest" cmake -DCMAKE_INSTALL_PREFIX=..\out\install\aRELEASE -G "Visual Studio 17 2022" -A x64 -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE="%VCPKG_ROOT%/scripts/buildsystems/vcpkg.cmake" -DVCPKG_TARGET_TRIPLET=x64-windows-static -DENABLE_STATIC_LINK_LAPACK=ON -DENABLE_STATIC_LINK_DEPS=ON -DBLA_VENDOR=Intel10_64lp --fresh ../ ``` -------------------------------- ### Solver Configuration Source: https://cadet.github.io/v5.1.0/_sources/interface/unit_operations/multi_channel_transport_model.rst Configures the sparse direct solver to be used. Options include DENSE, UMFPACK, and SUPERLU. ```APIDOC ## Solver Configuration ### Description Configures the sparse direct solver to be used. Options include DENSE, UMFPACK, and SUPERLU. SUPERLU offers fast LU decomposition but requires it to be enabled during compilation and the SuperLU library to be installed. ### Method Not applicable (Configuration Parameter) ### Endpoint Not applicable (Configuration Parameter) ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body - **solver** (string) - Required - Specifies the sparse direct solver. Allowed values: `DENSE`, `UMFPACK`, `SUPERLU`. ### Request Example ```json { "solver": "SUPERLU" } ``` ### Response #### Success Response (200) - **message** (string) - Confirmation of the solver setting. #### Response Example ```json { "message": "Solver set to SUPERLU." } ``` ``` -------------------------------- ### Configure Langmuir Adsorption Model in CADET Source: https://cadet.github.io/v5.1.0/_sources/getting_started/tutorials/breakthrough.rst Sets up a Langmuir adsorption model for a unit operation. This involves initializing the Langmuir class, specifying whether to use the rapid-equilibrium assumption (False for dynamic binding in this case), and defining component-specific parameters like adsorption rate, desorption rate, and capacity. ```python # Define the Langmuir adsorption model ladsorption = Langmuir() # Set model parameters for each component ladsorption.set_params(component_names=["A", "B"], adsorption_rate=[0.1, 0.05], desorption_rate=[0.01, 0.005], capacity=[1.0, 1.0]) ``` -------------------------------- ### Install Fedora Dependencies for CADET-Core Source: https://cadet.github.io/v5.1.0/getting_started/build_linux Installs the required and recommended packages for building CADET-Core on Fedora systems. This includes CMake, GCC, Git, Eigen, HDF5, LAPACK, SuperLU, and SuiteSparse. ```bash sudo dnf install cmake gcc-c++ git eigen3-devel hdf5-devel lapack-devel sudo dnf install SuperLU-devel suitesparse-devel ``` -------------------------------- ### Initialize Component System in CADET Source: https://cadet.github.io/v5.1.0/_sources/getting_started/tutorials/breakthrough.rst Sets up the primary component system for the simulation. The ComponentSystem ensures consistent component counts across all parts of the process and enables automatic legend generation for plots by allowing components to be named. ```python from examples.breakthrough import * # noqa # Define the component system system = ComponentSystem() system.add_component(name="A", id=0) system.add_component(name="B", id=1) ``` -------------------------------- ### Configure Time Sections and Continuity in CADET Source: https://cadet.github.io/v5.1.0/developer_guide/cadet_python Sets the start and end times for simulation sections and defines the continuity of transitions between sections. `section_times` should start at 0.0 and `section_continuity` indicates whether transitions are continuous. ```python model.root.input.solver.sections.section_times = [0.0, 1200,] # s model.root.input.solver.sections.section_continuity = [] ``` -------------------------------- ### Configure Inlet Model - Python Source: https://cadet.github.io/v5.1.0/getting_started/tutorials/breakthrough Sets up an Inlet pseudo unit operation, acting as a system source. It defines arbitrary concentration profiles using piecewise cubic polynomials for each component. In this example, a constant inlet concentration of 1 mM is set. ```python from CADETProcess.processModel import Inlet inlet = Inlet(component_system, name='inlet') inlet.flow_rate = 6.683738370512285e-8 # m^3 / s inlet.c = [[1.0, 0, 0, 0]] # mol / m^3 ```