This repository contains the solvers and test cases for the DLpisoFoam solver. This solver is based on the OpenFOAM v8 version and is developed to solve the incompressible Navier-Stokes equations using the PISO algorithm. The main goal of this solver is to enhance the pressure-velocity coupling with a Deep Learning surrogate model. The solver is currently being developed in two versions:
1 - DLpisoFoam-alg1 and DLpisoFoam-alg2: the solvers developed in https://github.com/pauloacs/Solving-Poisson-s-Equation-through-DL-for-CFD-apllications. These solvers use the U_to_p surrogate model in surrogate_models/u_to_p/.
2 - DLpisoFoam-deltas: this solver is currently implemented. It makes use of the deltau_to_delta surrogate models in https://github.com/pauloacs/Solving-Poisson-s-Equation-through-DL-for-CFD-apllications. This solver use the deltau_to_delta surrogate model in surrogate_models/deltau_to_delta/.
Here you can find the DLpisoFoam solvers as well as test cases where those can be used. A DockerFile and everything that is needed to build the docker image is also provided here to ease the installation of the solver.
There are two ways to use DLpisoFoam:
This is the easiest option as the setup of the environment is automated. To ensure reproducibility, a Docker container with the solver is provided. If you already have Docker installed, you can build your own docker image locally by running:
$ docker build dlpisofoam .
or pull the container with the following command:
$ docker pull pauloacs/dlpisofoam:latest
Using
$ docker run -it -v $(pwd):/home/repo --rm <image_name> bash
This will create a Docker container and launch a shell.
To set up the environment locally, follow these steps:
- Create a Python conda virtual environment by running the following command:
$ conda env create -f env_311.yml
- Install the surrogate model Python packages:
$ python -m pip install .
- Make sure the required environment variables for the CFD solver are properly set by running:
$ ./prep_env311.sh
Note: You may need to create your own prep_env311.sh
file with the correct path to your conda environment.
- Finally, install the CFD solvers. For example, to install DLpisoFoam_deltas, navigate to the
source/DLpisoFoam_deltas
directory and run the following commands:
$ wclean
$ wmake
To run your first tutorial, navigate to the directory of the solver you want to test. For example, if you want to run DLpisoFoam_deltas, follow these steps:
- Change to the
test_case_deltaU_deltaP/
directory:
$ cd test_case_deltaU_deltaP/
- Run the DLpisoFoam_deltas solver:
$ DLpisoFoam_deltas