BO-GP
Bayesian optimization based on Gaussian processes (BO-GP) for CFD simulations.
The BO-GP codes are developed using GPy and GPyOpt. The optimizer is non-intrusive and can be linked to any CFD solver.
Reference:
Y. Morita, S. Rezaeiravesh, N. Tabatabaeia, R. Vinuesaa, K. Fukagata, P. Schlatter, Applying Bayesian Optimization with Gaussian Process Regression to Computational Fluid Dynamics Problems, Journal of Computational Physics, 2021.
Exmaple: Turbulent boundary layer (TBL) with non-zero pressure gradient.
See Section 5 in the above reference. The flow is simulated using OpenFOAM.
Questions/Remarks:
Questions can be forwarded to [email protected], [email protected], and [email protected].
List of included files and folders:
-
driver_BOGP.py: main driver for running the example, i.e. BO-GP of pessure-gradient TBL simulated by OpenFOAM. -
gpOptim/: Bayesian optimization codes based on Gaussian processes, usingGPyandGPyOpt.workDir/gpList.dat
gpOpt.py
-
OFcase/:OpenFOAMcase foldersystem/yTopParams.in(written inmain_pre.py, used byblockMeshDict&controlDict).blockMeshDictcontrolDictdecomposeParDictfvSchemesfvSolution
0/- U,p,k,omega,nut
- *_IC files (use
inflow.pyto make these files).
constant/polyMesh/(not included)transportProperties
jobscriptOFrun.sh
-
OFpost/: Post-processing the results ofOFcase.main_post.py
-
OFpre/: Pre-processing theOFcasemain_pre.py: creatingyTopParams.inusing the latest parameter sample.inflow/inflow_gen.py: Creating inflow conditions for RANS of TBL with pressure gradient using DNS data for the TBL with zero-pressure gradient.
-
figs/: To save figures produced when running the optimization.make_movie.sh: make movie inpng/from pdf files.
-
data/: Created when running the BO-GP. -
storage/: Created when running the BO-GP.
Settings & inputs (to run the example):
- In
driver_BOGP_example.py: U_infty, delta99_in, Nx, Ny, Nz, t, loop params, path, beta_t etc. /gpOptim/gpOpt.py: number of parameters, range of parameters, tolerance, GP kernel, xi, etc.
Requirements:
python3.XnumpymatplotlibGPyGpyOptOpenFOAMv.7 (or v.6)bl_data/inOFpre/inflow/(DNS data from here)
How to test the example for different settings:
-
To change the structure of the geometry
- create the new inflow from precursor using
OFpre/inflow/inflow_gen.py(precursor results required) - update the
blockMeshDict - update the driver accordingly
- create the new inflow from precursor using
-
To change the number of prosessors used for the OpenFOAM simulation
- update
nProcessorsin the driver - update
decomposeParDict - update
jobScript
- update
-
To change the parameterization of the upper wall
- change
qBoundingpOpt.py - update
blockMeshDict
- change
-
To change beta_t (target pressure-gradient parameter beta)
- change
beta_tin the driver
- change
-
When you clone this repository and get errors, please try run:
mkdir datamkdir storagemkdir OFcase/constant/polyMesh/