|
[Sponsors] |
July 27, 2018, 15:12 |
DDES model OpenFoam
|
#1 |
New Member
Davide
Join Date: Jun 2017
Posts: 17
Rep Power: 9 |
Dear Fomers,
I am a newbie and I am struggling to understand how to set up a simulation in OpenFoam with a DDES model. In the tutorials i found motorbike tutorial ($FOAM_TUTORIALS/incompressible/pisoFoam/LES/motorBike/) which uses DDES but still i am ecountering troubles. In the tutorial folder i can see a bashfile "Allrun" and two folders : "lesfiles" and "motorbike". The first folder contains only these files set for a LES case : fvSchemes turbulenceProperties controlDict fvSolution The second one basically is like a case with a RANS model where only the mesh is missing. To what I understood the bashfile called "Allrun" both creates the mesh and starts the simulation. After running the "Allrun" file a new folder appears which is called "motorbikeLES". After several hours I had to stop the Allrun process so I don't know exactly what was it doing. I don't get how I can set up my own case with a DDES model, especially which are the folders required and I don't get if the "Allrun" bash file is necessary or I could start my simulation without it. Thanks a lot in advance for anyone who will help Best regards Davide |
|
July 28, 2018, 13:58 |
|
#2 |
Member
Robin Kamenicky
Join Date: Mar 2016
Posts: 74
Rep Power: 11 |
Hi David,
I have had a look at the bash scripts motorBike/Allrun, motorBike/motorBike/Allrun and also motorBike/lesFiles/Allrun and tried to comment it a bit more. I hope it helps. Have a look. motorBike/Allrun Code:
#!/bin/sh cd ${0%/*} || exit 1 # Run from this directory # Source tutorial run functions . $WM_PROJECT_DIR/bin/tools/RunFunctions cloneParallelCase() #Function to clone a case { if [ -d $2 ] #If directory called by second function parameter exists then echo "Case already cloned: remove case directory $2 to clone" else echo "Cloning $2 case from $1 in parallel mode" mkdir $2 # Make a directory called by second function parameter cpfiles="processor* system constant" #Following code is to copy directories processor* system/ constant/ from a directory passed to the function by first parameter to the directory passed to the function by second parameter for f in $cpfiles do cp -r $1/$f $2 done fi } # Do the Spalart-Allmaras steady-state case (cd motorBike && foamRunTutorials) #Command executed in subshell runs the motorBike case using motorBike/motorBike/Allrun if ! isTest $@ #if isTest is falls. $@ stands for all parameters from $1 passed to the isTest function. isTest is a function from RunFunctions script. then # Clone the steady-state case to the LES case cloneParallelCase motorBike motorBikeLES #Call the function cloneParallelCase where $1 is motorBike and $2 is motorBikeLES # Do the LES case cp lesFiles/Allrun motorBikeLES/ #The lesFiles/Allrun needs to be checked since it is copied in to motorBikeLES (cd motorBikeLES && foamRunTutorials) #running the motorBikeLES/Allrun in subshell fi Code:
#!/bin/sh cd ${0%/*} || exit 1 # Run from this directory # Source tutorial run functions . $WM_PROJECT_DIR/bin/tools/RunFunctions # copy motorbike surface from resources directory cp $FOAM_TUTORIALS/resources/geometry/motorBike.obj.gz constant/triSurface/ # Make dummy 0 directory mkdir 0 #blockMesh needs the 0 directory, does not matter what is inside runApplication blockMesh #run blockMesh cp system/decomposeParDict.hierarchical system/decomposeParDict #copy decomposeParDict needed to decomposition and subsequent parallel run runApplication decomposePar #decomposition for parallel run cp system/decomposeParDict.ptscotch system/decomposeParDict runParallel snappyHexMesh -overwrite #meshing with snappyHexMesh find . -type f -iname "*level*" -exec rm {} \; ls -d processor* | xargs -I {} rm -rf ./{}/0 #remove from processors 0 directory since it is dummy ls -d processor* | xargs -I {} cp -r 0.orig ./{}/0 #copy to processors 0.orig as 0/ runParallel renumberMesh -overwrite #renumber the processors after decomposition to make the simulation more efficient runParallel potentialFoam -initialiseUBCs #initiate U velocity BCs with potentialFoam in parallel runParallel `getApplication` #run pisoFoam in parallel Code:
#!/bin/sh # Source tutorial run functions . $WM_PROJECT_DIR/bin/tools/RunFunctions # Set-up the LES case cp ../lesFiles/fvS* ../lesFiles/controlDict system/ #Copy fvSchemes, fvSolution and controlDict to system/ cp ../lesFiles/turbulenceProperties constant/ #Copy turbulenceProperties to constant/ ls -d processor* | xargs -I {} rm -rf ./{}/0 #Remove 0/ from processor* ls -d processor* | xargs -I {} mv ./{}/500 ./{}/0 #Rename 500/ to 0/ in processor* ls -d processor* | xargs -I {} rm -rf ./{}/0/uniform #Remove processor*/0/uniform runParallel pisoFoam #Run pisoFoam in parallel runApplication reconstructParMesh -constant -mergeTol 1e-6 #Reconstract mesh runApplication reconstructPar #Reconstract fields
Everything is done in parallel. Let me know if you have some further questions. It might seems to be quite complex because you run the RANS to initiate LES simulation. You can also make a case without initiating it with LES, if you are able to give good ICs and BCs Robin |
|
July 28, 2018, 14:44 |
|
#3 |
New Member
Davide
Join Date: Jun 2017
Posts: 17
Rep Power: 9 |
Dear Robin
Thanks a lot for your reply, it has been extremely enlightening. As far as I understand if I want to perform a DDES simulation (presuming I can provide appropiate BC) i just need to replace the files in lesproperties with the ones in motorbike/motorbike, provide a valid mesh and adjust the files in 0 in order to match with the mesh. Another possible approach would be to perform RANS and then provide the results as a starting point for the LES simulation. The Allrun bash script automates this process. Am I right? Thanks again for your avaibility, you have been extremely useful. Best regards Davide |
|
July 28, 2018, 15:13 |
|
#4 | ||
Member
Robin Kamenicky
Join Date: Mar 2016
Posts: 74
Rep Power: 11 |
Hi Davide,
I am glad it helps Quote:
In this case it has been provided also particular setup in fvSchemes, fvSolution, controlDict, however those files from lesFiles are not inevitable. Despite that I would definitely recommend to use them. So regarding to your words. You need to do it in opposite way copy files from lesFiles to motoBike/motorBike on they particular place. Quote:
Kind regards, Robin |
|||
July 28, 2018, 20:36 |
|
#5 | |
New Member
Davide
Join Date: Jun 2017
Posts: 17
Rep Power: 9 |
Quote:
Anyway I managed to start one simulation with the DDES model. Thanks for all the help provided! Super kind and useful |
||
Tags |
ddes, hrl, set up |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Using oneEqEddy model in openFoam 4 | THohman | OpenFOAM Pre-Processing | 1 | February 11, 2017 10:31 |
Wrong flow in ratating domain problem | Sanyo | CFX | 17 | August 15, 2015 07:20 |
about Subgrid-scale model | impecca | OpenFOAM Running, Solving & CFD | 4 | December 20, 2013 11:36 |
New OpenFOAM Forum Structure | jola | OpenFOAM | 2 | October 19, 2011 07:55 |
Cross-compiling OpenFOAM 1.7.0 on Linux for Windows 32 and 64bits with Mingw-w64 | wyldckat | OpenFOAM Announcements from Other Sources | 3 | September 8, 2010 07:25 |