IllinoisRocstar / AccelerateCFD_CE

Community Edition of AccelerateCFD platform for creating reduced order models from high fidelity CFD
Other
47 stars 17 forks source link

AccelerateCFD

Welcome to AccelerateCFD

This is a community edition of Illinois Rocstar LLC's AccelerateCFD. This guide contains information about all the modules of this software as well as talks about installation and other platform requirements. A tutorial is also included with this guide.

AccelerateCFD uses Proper Orthogonal Decomposition (POD) principle to reduce the full order CFD flow into a reduced order model which runs several magnitudes faster and reconstructs the flow fields.

AccelerateCFD_Community_Edition is provided under GNU General Public License version 3. For more info, please see the LICENSE file. OpenFOAM is Copyright (C) 2011-2017 OpenFOAM Foundation. Eigen 3.3.7 is included in podBasisCalc and podPrecompute utility folders. User does not need to build or install that as it is a header only library.

Version

Version 0.3.0 (View CHANGELOG Here.)

AccelerateCFD_Community_Edition follows semantic versioning. The versions will be major.minor.patch. We will:

Modules

There are five modules to this software.

podBasisCalc

Platform Requirements

AccelerateCFD works on Linux plateform with following installed:

Installation & Getting Started

Clone or download all the folders anywhere in your computer (i.e /home/Community_AccelerateCFD/). To clone AccelerateCFD_Community_Edition, use following command.

$ git clone https://github.com/IllinoisRocstar/AccelerateCFD_CE.git

If you download the tab.gz file, extract it first. Open the terminal and navigate to the software directory.

First step is to compile the modules. Follow the procedure below.

$ ACFD_Source_Path=/full/path/to/AccelerateCFD
$ cd ${ACFD_Source_Path}
$ mkdir build && cd build
$ cmake ..
$ make -j($nproc) && make install

This will install all utilities in the OpenFOAM applications bin directory (i.e /home/username/OpenFOAM/OpenFOAM-x.0/platforms/linux64GccDPInt32Opt/bin). If user wants to install these utilities in custom location, comment out line #7 to #10 in CMakeLists.txt file and specify custom install location using,

$ cmake -DCMAKE_INSTALL_PREFIX=/custom/install/path ..
$ make -j($nproc) && make install

Running Test Case Example

Once you have successfully completed all steps mentioned above in installation and getting started, let's run an example case with AccelerateCFD software. This case is a flow over cylinder example at Reynolds number = 100. The case is already set up with mesh file and other parameters.

Navigate to the case directory and run blockMesh utility to build the mesh.

$ cd ${ACFD_Source_Path}/SampleCase
$ blockMesh

If user wants run the case in parallel, please edit system/decomposeParDict for "numberOfSubdomains" equal to number of processors. Type the following commands to decompose the mesh and run the case..

$ decomposePar
$ mpirun -np <number of processors> pisoFoam -parallel

Once the parallel run in finished, user does not need to reconstruct the case as AccelerateCFD utilities works on decomposed case in parallel.

If user wants to run the case using just one processor, run the case using "pisoFoam" command.

$ pisoFoam

After the serial/parallel calculations are over, user can go ahead and calculate the basis. Run podBasisCalc to calculate basis vectors. This will store all the basis vectors in last time directory of case. podBasisCalc utility provides users with an option to specify number of basis to write in last time directory (i.e for writing basis up to 50, use podBasisCalc 50). If user want to write all the basis in last time step folder, use 0 (i.e podBasisCalc 0). Another optional argument with podBasisCalc provides users with ability to define custom time range for snapshots selection using -time argument. This argument is also available with podPrecompute and podFlowReconstuct.

$ podBasisCalc <number of basis to write> -time <start>:<end>

To run podBasisCalc in parallel

$ mpirun -np <number of processors> podBasisCalc <number of basis to write> -time <start>:<end> -parallel

Let the process finish and you will see that last time directory has several basis written as sigma_0, sigma_1, etc... Now, if you notice in the main case directory, there will be a CSV file named "podEnergy.csv". Open the file and you will see that for this case, only first 5-6 POD bases vectors has cummulative energy of above 99%. This suggests that any basis vectors after that contains very small length scales (Try visualizing them in paraView). This can be used to decide number of POD basis to use to run reduced order model. A utility plotPOD.py is included to help users visualize energy content of POD modes.

For this case, using this utility provides following plot. This plot reinforces selection of 5 or 6 POD bases for current ROM.

Navigate to the constant folder of CFD case directory open podDict to edit.

$ cd constant/
$ gedit podDict

podDict is a way of interacting with AccelerateCFD. You can give these 5 predefined inputs by changing them here. These inputs will be different for each case.

After saving and closing podDict file, let's pre-computed some data. User needs to make sure that if the optional -time argument was used during calculation of basis, it needs to be used for podPrecompute and podFlowReconstruct as well.

$ cd ..
$ podPrecompute -time <start>:<end>

To run podPrecompute in parallel,

$ mpirun -np <number of processors> podPrecompute -time <start>:<end> -parallel

This will generate bunch of CSV files in case directory. DO NOT CHANGE ANYTHING IN THOSE FILES. To calculate the time varying coefficients, run podROM as per below. Note that podROM utility runs on single processor. Additionally user can define one optional argument with this program to use certain number of basis for computation of time varying coefficients instead of number of basis specified in podDict. This allows users to test stability of their ROM with various number of basis. Note that maximum number for this argument must not be more than number of basis specified in podDict file.

$ ./podROM <# of basis>

Once the process completes, you will see an additional CSV file which contains values of time varying coefficients of ROM. Finally, as we have POD basis and time varying coefficients, we are ready to reconstruct velocity fields.

$ podFlowReconstruct -time <start>:<end>

To run podFlowReconstruct in parallel,

$ mpirun -np <number of processors> podFlowReconstruct -time <start>:<end> -parallel

Now every time directory in CFD case has a new vector file named "Urom". This is the reconstructed velocity. If you have noticed, the calculations done by "podPrecompute" , "podROM", and "podReconstruct" took much less time than full LES CFD calculation would have taken. Compare both full order (U) and reconstructed (Urom) velocities in Paraview.

AccelerateCFD has a post process utility which allows users to get some additional information such as full order time coefficients to compare against reduced order model time coefficients calculated using podROM utility. We will keep adding additional post processing functionality as needed and as requested by our user community.

To initiate calculation of full order time varying coefficients (here called as "aPOD"), user needs to run following command. This will output "aPOD.csv" file.

$ podPostProcess get_aPOD

For parallel run,

$ mpirun -np <number of processors> podPostProcess get_aPOD -parallel

Contact/Feedback/Issues