Skip to content

Commit

Permalink
Documentation updates
Browse files Browse the repository at this point in the history
  • Loading branch information
Romit-Maulik committed May 23, 2020
1 parent d095067 commit 0edd72b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
4 changes: 3 additions & 1 deletion ML_LES/ML_LES/ML_LES_Model/ML_LES.C
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,9 @@ void ML_LES<BasicTurbulenceModel>::correct()
LESeddyViscosity<BasicTurbulenceModel>::correct(); // For changing mesh - coming from turbulenceModel.C through virtual shit

int num_inputs = 9;
int num_outputs = 1;
int num_outputs = 1;
// The following lines may cause problems with ICPC compilers
// convert to "float mean_array [10] = {....};"
float mean_array [num_inputs+num_outputs] = {4.948654692193851069e-05,-1.416845935576197153e-03,1.695804398322601982e-04,-4.909234209068177434e-05,7.200956380997814788e-04,-3.949331152012949186e-07,1.155548212380012041e-01,-1.447936297672789625e-05,-1.249577196433397854e-05,4.991843687885162174e-03};
float std_array [num_inputs+num_outputs] = {5.156828074413144503e-02,4.477068164228664160e-01,7.504360316118742491e-02,5.840131322144209713e-02,8.381264536219842909e-02,5.977095870302145258e-02,3.844051667887211921e-02,5.081242374826853286e-03,7.321494585983414141e-03,1.157813043774712919e-02};

Expand Down
6 changes: 1 addition & 5 deletions ML_RANS/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,7 @@ Now all that is left to do is to run `wclean && wmake libso .` from the `OF_Mode

The original framework in this project required a minor modification to `simpleFoam` to switch turbulence model deployment at each iteration towards steady-state. This is because the machine learning framework has been trained to _predict_ the steady-state turbulent eddy viscosity. To that end, we modify `simpleFoam` to `simpleFoam_ML` to make an eddy-viscosity prediction at `t=0` and then solve only pressure and velocity equations after. Once again, recommended reading for understanding this may be found in [OpenFOAM programming tutorial by Tommaso Lucchini](https://www.google.com/url?sa=t&rct=j&q=&esrc=s&source=web&cd=14&cad=rja&uact=8&ved=2ahUKEwjKy6-XvqXpAhVIQ80KHYisDikQFjANegQICRAB&url=http%3A%2F%2Fwww.tfd.chalmers.se%2F~hani%2Fkurser%2FOS_CFD_2009%2FprogrammingTutorial.pdf&usg=AOvVaw2H5hYleW_cI6CN0inVnBWQ).

To create a new version of `simpleFoam` that predicts the eddy viscosity only once and then solves solely pressure and velocity, we have followed the steps in the previous link and have created a new solver saved in `simpleFOAM_ML/`. You may incorporate this model into OpenFOAM as follows:
1. From `ML_RANS/` copy `simpleFOAM_ML` to `$WM_PROJECT_DIR` by running `cp -r simpleFoam_ML/ $WM_PROJECT_DIR/applications/solvers/simpleFoam_ML`.
2. Compile this new solver using `cd $WM_PROJECT_DIR/applications/solvers/simpleFoam_ML && wclean && wmake`
3. Test that the new solver is compiled and ready to use with `simpleFoam_ML -help`

To create a new version of `simpleFoam` that predicts the eddy viscosity only once and then solves solely pressure and velocity, we have followed the steps in the previous link and have created a new solver saved in `simpleFOAM_ML/`. You may incorporate this model into OpenFOAM by running `wclean && wmake` from the `simpleFoam_ML` directory. Validate that your solver works fine by running `simpleFoam_ML -help`.
## Step 5: Deploy for test case

Finally, now that a new solver and a new turbulence model are ready to deploy. We can run a case to test them. This case is provided in `Testing/`. To run the case successfully, we have made a few changes to incorporate the new solver and the neural network model. These are
Expand Down

0 comments on commit 0edd72b

Please sign in to comment.