22
33## Prerequisites
44
5- - You need the Python dependencies : ` pip install -r requirements.txt `
5+ - You need the ` foamBO ` package : ` pip install foamBO `
66- You need an OpenFOAM version. Set ` FOAMBO_OPENFOAM ` to its installation folder.
77 ` ${FOAMBO_OPENFOAM}/etc/bashrc ` will be sourced in cases' ` Allrun ` .
88
@@ -28,26 +28,27 @@ I describe the workflow in two cases:
2828> If you're going with option 1, you can skip setting up the cluster. If you intend to adopt option 2, I
2929> recommend you still go through option 1
3030>
31- > This toolkit relies on [ ax-platform] ( https://ax.dev ) to do the optimization, so we support what they support.
31+ > This toolkit relies on [ ax-platform] ( https://ax.dev ) to do the optimization, so we support what they support + a few custom things .
3232>
3333> Here are few nice words about [ Bayesian Optimization] ( https://ax.dev/docs/bayesopt.html ) . If you want to extend
3434> these tools, you might want to take a look at the [ Service and Developer APIs] ( https://ax.dev/docs/api.html )
3535
36- > Also, Python scripts are [ Hydra Applications] ( https://hydra.cc/docs/intro/ ) , so you can load different configurations
36+ > Also, ` foamBO ` , ` foamDash ` and ` validateBO ` scripts are [ Hydra Applications] ( https://hydra.cc/docs/intro/ ) ,
37+ > so you can load different configurations
3738> and/or override config values from the command line.
3839
3940## Features we're exploring
4041
4142- Zero-code configuration for running parameter variations.
4243 - As long as you're able to do stuff through Bash.
4344- Unattended algorithm selection for the trial generation strategy and Bayesian optimization.
44- - Easy to expand ; especially for metric evaluation; it's just a --new Python function--.
45+ - Ease of use ; especially for metric evaluation; it's just a --new Python function--.
4546
4647## The example problem
4748
4849To illustrate the somewhat complex workflow of running optimization studies with this toolkit, I picked
4950the ` pitzDaily ` case from the standard tutorials (the one that works with ` simpleFOAM ` /` RAS ` ). The case
50- can be ran both in serial and in parallel with 2 processors.
51+ can run both in serial and in parallel with 2 processors.
5152
5253![ ] ( pitzDaily/pitzDaily.png )
5354
@@ -59,7 +60,7 @@ Our objectives are:
5960- Execution Time, extracted straight from the solver log files
6061- Continuity Errors, also extracted from log files
6162
62- > Note that we are not particularly interested in the results of the study;
63+ > Note that we are ** not** particularly interested in the results of the study;
6364> All we care about is demonstrating how to optimize this problem with Bayesian algorithms.
6465
6566
@@ -106,17 +107,14 @@ All subsequent operations are supposed to run on the head node.
106107> If you don't want to use the cluster, please adapt the paths to your local machine.
107108> Don't forget to clone https://github.com/FoamScience/OpenFOAM-Multi-Objective-Optimization
108109
109- I've only tested the scripts with Python 3.8, so I recommend you use that version too. Just to avoid any
110- surprises.
111-
112110The best option is to get [ Miniconda] ( https://docs.conda.io/en/latest/miniconda.html ) and:
113111``` bash
114112# Remember /axc on the head node, would be slurm-cluster/var/axc on your machine
115113cd /axc/multiOptOF
116- conda create -n of-opt python=3.8 pip
114+ conda create -n of-opt python=3.12 pip
117115conda activate of-opt
118116# This will install a load of packages
119- pip install -r requirements.txt
117+ pip install foambo
120118```
121119
122120## Local runs
@@ -131,10 +129,11 @@ for reference.
131129
132130### Design parameters
133131
134- The configuration file has at least three important sections:
132+ The configuration file has at least four important sections:
135133- ` problem ` : where you describe your problem inputs
136134- ` meta ` : where you describe control settings for the optimization procedure
137- - ` visualize ` : which an optional section for when you run ` foamDash.py `
135+ - ` validate ` : where you optionally configure how the cross-validation of fitted models should be performed by ` validateBO `
136+ - ` visualize ` : where you optionally configure how trials are visualized when you run ` foamDash `
138137
139138The first thing is ` problem.template_case ` which points to the case you want to use as a base template.
140139This case is then cloned each time with the help of PyFOAM. ` meta.case_subdirs_to_clone ` specifies
0 commit comments