Software
I release the methods I develop as open-source code, so that they can be used and checked by both academic and industrial users. Most of the projects extend OpenFOAM. All code is on GitHub.
In industrial use: the semiImplicitSlip mesh-motion library, developed during my postdoc to simulate transients in hydraulic turbines, is used by the R&D department of Vattenfall to study the transient operation of their hydropower systems.
Reinforcement learning and flow control
TensorforceFoam
An intrusive deep reinforcement learning (DRL) framework for OpenFOAM, built on TensorFlow and the Tensorforce package. Intrusive means the DRL agent is integrated directly into the CFD environment, so no external information exchange is needed during DRL episodes. Parallel environments for expensive CFD cases are handled through MPI (mpi4py).
agentJet
An OpenFOAM boundary condition that deploys a trained DRL policy as a jet actuator directly inside the CFD solver. The saved TensorFlow policy is evaluated through the TensorFlow C++ API (cppflow), so no Python coupling is needed at run time. At each control period the flow state is sampled at probe locations, and the policy returns a jet velocity that is ramped smoothly from the previous action.
Hydraulic turbines and mesh motion
semiImplicitSlip
A mesh-motion library for OpenFOAM with a robust semi-implicit algorithm for slipping mesh points along curved surfaces: an explicit step based on the general slip condition followed by an implicit step based on a Dirichlet condition, with Laplacian smoothing to spread the deformation into the domain. A solid-body rotation can be added on top, for example to model the runner of a Kaplan turbine during transient operation.
Francis-99 transients
Open case files and code for CFD simulation of the transient operation of a Francis turbine in OpenFOAM.
OpenFOAM-Swirl-Number
A pipeline for computing the swirl number, the ratio of the axial flux of angular momentum to the axial flux of axial momentum, in OpenFOAM. Modular function objects extract and transform the velocity field and integrate the momentum fluxes over a sampled cross-section. A Python script then computes and plots the swirl number over time.
Teaching
OSCFD
Test codes and examples for the PhD course CFD with Open-Source Software at Chalmers University of Technology, complementing lectures on memory management in C++ and OpenFOAM. They range from standalone C++ examples (dynamic allocation, copy semantics, smart pointers) to OpenFOAM applications that examine autoPtr and tmp.