Bayesian optimization based on Gaussian processes (BO-GP) for CFD simulations.

Overview

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, using GPy and GPyOpt.

    • workDir/
      • gpList.dat
    • gpOpt.py
  • OFcase/: OpenFOAM case folder

    • system/
      • yTopParams.in (written in main_pre.py, used by blockMeshDict & controlDict).
      • blockMeshDict
      • controlDict
      • decomposeParDict
      • fvSchemes
      • fvSolution
    • 0/
      • U,p,k,omega,nut
      • *_IC files (use inflow.py to make these files).
    • constant/
      • polyMesh/ (not included)
      • transportProperties
    • jobscript
    • OFrun.sh
  • OFpost/: Post-processing the results of OFcase.

    • main_post.py
  • OFpre/: Pre-processing the OFcase

    • main_pre.py: creating yTopParams.in using 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 in png/ 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:

  1. python3.X
  2. numpy
  3. matplotlib
  4. GPy
  5. GpyOpt
  6. OpenFOAM v.7 (or v.6)
  7. bl_data/ in OFpre/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
  • To change the number of prosessors used for the OpenFOAM simulation

    • update nProcessors in the driver
    • update decomposeParDict
    • update jobScript
  • To change the parameterization of the upper wall

    • change qBound in gpOpt.py
    • update blockMeshDict
  • To change beta_t (target pressure-gradient parameter beta)

    • change beta_t in the driver
  • When you clone this repository and get errors, please try run:

    • mkdir data
    • mkdir storage
    • mkdir OFcase/constant/polyMesh/
You might also like...
CS 7301: Spring 2021 Course on Advanced Topics in Optimization in Machine Learning

CS 7301: Spring 2021 Course on Advanced Topics in Optimization in Machine Learning

MooGBT is a library for Multi-objective optimization in Gradient Boosted Trees.
MooGBT is a library for Multi-objective optimization in Gradient Boosted Trees.

MooGBT is a library for Multi-objective optimization in Gradient Boosted Trees. MooGBT optimizes for multiple objectives by defining constraints on sub-objective(s) along with a primary objective. The constraints are defined as upper bounds on sub-objective loss function. MooGBT uses a Augmented Lagrangian(AL) based constrained optimization framework with Gradient Boosted Trees, to optimize for multiple objectives.

Pyomo is an object-oriented algebraic modeling language in Python for structured optimization problems.

Pyomo is a Python-based open-source software package that supports a diverse set of optimization capabilities for formulating and analyzing optimization models. Pyomo can be used to define symbolic problems, create concrete problem instances, and solve these instances with standard solvers.

This is an implementation of the proximal policy optimization algorithm for the C++ API of Pytorch
This is an implementation of the proximal policy optimization algorithm for the C++ API of Pytorch

This is an implementation of the proximal policy optimization algorithm for the C++ API of Pytorch. It uses a simple TestEnvironment to test the algorithm

A Python step-by-step primer for Machine Learning and Optimization

early-ML Presentation General Machine Learning tutorials A Python step-by-step primer for Machine Learning and Optimization This github repository gat

Tools for mathematical optimization region

Tools for mathematical optimization region

Implementation of linesearch Optimization Algorithms in Python

Nonlinear Optimization Algorithms During my time as Scientific Assistant at the Karlsruhe Institute of Technology (Germany) I implemented various Opti

A scikit-learn based module for multi-label et. al. classification

scikit-multilearn scikit-multilearn is a Python module capable of performing multi-label learning tasks. It is built on-top of various scientific Pyth

Python-based implementations of algorithms for learning on imbalanced data.

ND DIAL: Imbalanced Algorithms Minimalist Python-based implementations of algorithms for imbalanced learning. Includes deep and representational learn

Owner
KTH Mechanics
KTH Mechanics
Bonsai: Gradient Boosted Trees + Bayesian Optimization

Bonsai is a wrapper for the XGBoost and Catboost model training pipelines that leverages Bayesian optimization for computationally efficient hyperparameter tuning.

null 24 Oct 27, 2022
A linear equation solver using gaussian elimination. Implemented for fun and learning/teaching.

A linear equation solver using gaussian elimination. Implemented for fun and learning/teaching. The solver will solve equations of the type: A can be

Sanjeet N. Dasharath 3 Feb 15, 2022
jaxfg - Factor graph-based nonlinear optimization library for JAX.

Factor graphs + nonlinear optimization in JAX

Brent Yi 134 Dec 21, 2022
A python library for Bayesian time series modeling

PyDLM Welcome to pydlm, a flexible time series modeling library for python. This library is based on the Bayesian dynamic linear model (Harrison and W

Sam 438 Dec 17, 2022
ArviZ is a Python package for exploratory analysis of Bayesian models

ArviZ (pronounced "AR-vees") is a Python package for exploratory analysis of Bayesian models. Includes functions for posterior analysis, data storage, model checking, comparison and diagnostics

ArviZ 1.3k Jan 5, 2023
Combines Bayesian analyses from many datasets.

PosteriorStacker Combines Bayesian analyses from many datasets. Introduction Method Tutorial Output plot and files Introduction Fitting a model to a d

Johannes Buchner 19 Feb 13, 2022
Case studies with Bayesian methods

Case studies with Bayesian methods

Baze Petrushev 8 Nov 26, 2022
Fourier-Bayesian estimation of stochastic volatility models

fourier-bayesian-sv-estimation Fourier-Bayesian estimation of stochastic volatility models Code used to run the numerical examples of "Bayesian Approa

null 15 Jun 20, 2022
BASTA: The BAyesian STellar Algorithm

BASTA: BAyesian STellar Algorithm Current stable version: v1.0 Important note: BASTA is developed for Python 3.8, but Python 3.7 should work as well.

BASTA team 16 Nov 15, 2022
DeepSpeed is a deep learning optimization library that makes distributed training easy, efficient, and effective.

DeepSpeed is a deep learning optimization library that makes distributed training easy, efficient, and effective. 10x Larger Models 10x Faster Trainin

Microsoft 8.4k Dec 30, 2022