├── LICENSE ├── README.md ├── cases ├── Chapter_4 │ └── waveFlume_2D │ │ ├── 0.orig │ │ ├── U │ │ ├── alpha.water │ │ └── p_rgh │ │ ├── allClean │ │ ├── constant │ │ ├── dynamicMeshDict │ │ ├── g │ │ ├── probeDefinitions │ │ ├── transportProperties │ │ ├── turbulenceProperties │ │ └── waveProperties.input │ │ ├── myVars │ │ ├── preRun │ │ ├── solverRun │ │ └── system │ │ ├── blockMeshDict │ │ ├── controlDict │ │ ├── decomposeParDict │ │ ├── fvSchemes │ │ ├── fvSolution │ │ ├── setFieldsDict │ │ └── snappyHexMeshDict ├── Chapter_5 │ ├── Ito_2D │ │ ├── 0.orig │ │ │ ├── U │ │ │ ├── alpha.water │ │ │ ├── p_rgh │ │ │ └── pointDisplacement │ │ ├── CoExtract.sh │ │ ├── allClean │ │ ├── allRun │ │ ├── constant │ │ │ ├── dynamicMeshDict │ │ │ ├── g │ │ │ ├── probeDefinitions │ │ │ ├── transportProperties │ │ │ ├── turbulenceProperties │ │ │ └── waveProperties.input │ │ ├── motionExtract.sh │ │ ├── myVars │ │ └── system │ │ │ ├── blockMeshDict │ │ │ ├── controlDict │ │ │ ├── decomposeParDict │ │ │ ├── fvSchemes │ │ │ ├── fvSolution │ │ │ └── setFieldsDict │ ├── Paredes_3D │ │ ├── free │ │ │ ├── 0.orig │ │ │ │ ├── U │ │ │ │ ├── alpha.water │ │ │ │ ├── p_rgh │ │ │ │ └── pointDisplacement │ │ │ ├── Coextract.sh │ │ │ ├── allClean │ │ │ ├── constant │ │ │ │ ├── dynamicMeshDict │ │ │ │ ├── g │ │ │ │ ├── probeDefinitions │ │ │ │ ├── transportProperties │ │ │ │ ├── turbulenceProperties │ │ │ │ └── waveProperties.input │ │ │ ├── motionExtract.sh │ │ │ ├── myVars │ │ │ ├── parRun │ │ │ ├── postRun │ │ │ ├── preRun │ │ │ ├── solverClean │ │ │ ├── solverRun │ │ │ └── system │ │ │ │ ├── blockMeshDict │ │ │ │ ├── controlDict │ │ │ │ ├── decomposeParDict │ │ │ │ ├── fvSchemes │ │ │ │ ├── fvSolution │ │ │ │ ├── setFieldsDict │ │ │ │ └── snappyHexMeshDict │ │ └── moored │ │ │ ├── 0.orig │ │ │ ├── U │ │ │ ├── alpha.water │ │ │ ├── p_rgh │ │ │ └── pointDisplacement │ │ │ ├── CoExtract.sh │ │ │ ├── allClean │ │ │ ├── constant │ │ │ ├── dynamicMeshDict │ │ │ ├── g │ │ │ ├── probeDefinitions │ │ │ ├── transportProperties │ │ │ ├── turbulenceProperties │ │ │ └── waveProperties.input │ │ │ ├── moorExtract.sh │ │ │ ├── motionExtract.sh │ │ │ ├── myVars │ │ │ ├── parRun │ │ │ ├── postRun │ │ │ ├── preRun │ │ │ ├── solverClean │ │ │ ├── solverRun │ │ │ └── system │ │ │ ├── blockMeshDict │ │ │ ├── controlDict │ │ │ ├── decomposeParDict │ │ │ ├── fvSchemes │ │ │ ├── fvSolution │ │ │ ├── setFieldsDict │ │ │ └── snappyHexMeshDict │ └── README.md ├── Chapter_6 │ └── OC6_III │ │ ├── pitchL35 │ │ ├── 0.orig │ │ │ ├── U │ │ │ ├── epsilon │ │ │ ├── include │ │ │ │ ├── boundaryConditions │ │ │ │ └── fixedInlet │ │ │ ├── k │ │ │ ├── nut │ │ │ └── p │ │ ├── ALgeometry.sh │ │ ├── allClean │ │ ├── constant │ │ │ ├── RASProperties │ │ │ ├── transportProperties │ │ │ └── turbulenceProperties │ │ ├── myVars │ │ ├── parRun │ │ ├── postRun │ │ ├── preRun │ │ ├── runClean │ │ ├── scripts │ │ │ └── ALgeometry.py │ │ ├── solverRun │ │ └── system │ │ │ ├── blockMeshDict │ │ │ ├── controlDict │ │ │ ├── decomposeParDict │ │ │ ├── elementData │ │ │ ├── fvOptions │ │ │ ├── fvSchemes │ │ │ ├── fvSolution │ │ │ ├── sampling │ │ │ ├── snappyHexMeshDict │ │ │ └── topoSetDict │ │ ├── pitchL37 │ │ ├── 0.orig │ │ │ ├── U │ │ │ ├── epsilon │ │ │ ├── include │ │ │ │ ├── boundaryConditions │ │ │ │ └── fixedInlet │ │ │ ├── k │ │ │ ├── nut │ │ │ └── p │ │ ├── ALgeometry.sh │ │ ├── allClean │ │ ├── constant │ │ │ ├── RASProperties │ │ │ ├── transportProperties │ │ │ └── turbulenceProperties │ │ ├── myVars │ │ ├── parRun │ │ ├── postRun │ │ ├── preRun │ │ ├── runClean │ │ ├── scripts │ │ │ └── ALgeometry.py │ │ ├── solverRun │ │ └── system │ │ │ ├── blockMeshDict │ │ │ ├── controlDict │ │ │ ├── decomposeParDict │ │ │ ├── elementData │ │ │ ├── fvOptions │ │ │ ├── fvSchemes │ │ │ ├── fvSolution │ │ │ ├── sampling │ │ │ ├── snappyHexMeshDict │ │ │ └── topoSetDict │ │ ├── resources │ │ └── foilData │ │ │ ├── Cd_OC6_Station1.txt │ │ │ ├── Cd_OC6_Station10.txt │ │ │ ├── Cd_OC6_Station11.txt │ │ │ ├── Cd_OC6_Station12.txt │ │ │ ├── Cd_OC6_Station13.txt │ │ │ ├── Cd_OC6_Station14.txt │ │ │ ├── Cd_OC6_Station15.txt │ │ │ ├── Cd_OC6_Station16.txt │ │ │ ├── Cd_OC6_Station17.txt │ │ │ ├── Cd_OC6_Station18.txt │ │ │ ├── Cd_OC6_Station19.txt │ │ │ ├── Cd_OC6_Station2.txt │ │ │ ├── Cd_OC6_Station20.txt │ │ │ ├── Cd_OC6_Station3.txt │ │ │ ├── Cd_OC6_Station4.txt │ │ │ ├── Cd_OC6_Station5.txt │ │ │ ├── Cd_OC6_Station6.txt │ │ │ ├── Cd_OC6_Station7.txt │ │ │ ├── Cd_OC6_Station8.txt │ │ │ ├── Cd_OC6_Station9.txt │ │ │ ├── Cl_OC6_Station1.txt │ │ │ ├── Cl_OC6_Station10.txt │ │ │ ├── Cl_OC6_Station11.txt │ │ │ ├── Cl_OC6_Station12.txt │ │ │ ├── Cl_OC6_Station13.txt │ │ │ ├── Cl_OC6_Station14.txt │ │ │ ├── Cl_OC6_Station15.txt │ │ │ ├── Cl_OC6_Station16.txt │ │ │ ├── Cl_OC6_Station17.txt │ │ │ ├── Cl_OC6_Station18.txt │ │ │ ├── Cl_OC6_Station19.txt │ │ │ ├── Cl_OC6_Station2.txt │ │ │ ├── Cl_OC6_Station20.txt │ │ │ ├── Cl_OC6_Station3.txt │ │ │ ├── Cl_OC6_Station4.txt │ │ │ ├── Cl_OC6_Station5.txt │ │ │ ├── Cl_OC6_Station6.txt │ │ │ ├── Cl_OC6_Station7.txt │ │ │ ├── Cl_OC6_Station8.txt │ │ │ └── Cl_OC6_Station9.txt │ │ ├── steadyL11a │ │ ├── 0.orig │ │ │ ├── U │ │ │ ├── epsilon │ │ │ ├── include │ │ │ │ ├── boundaryConditions │ │ │ │ └── fixedInlet │ │ │ ├── k │ │ │ ├── nut │ │ │ └── p │ │ ├── ALgeometry.sh │ │ ├── allClean │ │ ├── constant │ │ │ ├── RASProperties │ │ │ ├── transportProperties │ │ │ └── turbulenceProperties │ │ ├── myVars │ │ ├── parRun │ │ ├── postRun │ │ ├── preRun │ │ ├── runClean │ │ ├── scripts │ │ │ └── ALgeometry.py │ │ ├── solverRun │ │ └── system │ │ │ ├── blockMeshDict │ │ │ ├── controlDict │ │ │ ├── decomposeParDict │ │ │ ├── elementData │ │ │ ├── fvOptions │ │ │ ├── fvSchemes │ │ │ ├── fvSolution │ │ │ ├── sampling │ │ │ ├── snappyHexMeshDict │ │ │ └── topoSetDict │ │ ├── steadyL11b │ │ ├── 0.orig │ │ │ ├── U │ │ │ ├── epsilon │ │ │ ├── include │ │ │ │ ├── boundaryConditions │ │ │ │ └── fixedInlet │ │ │ ├── k │ │ │ ├── nut │ │ │ └── p │ │ ├── ALgeometry.sh │ │ ├── allClean │ │ ├── constant │ │ │ ├── RASProperties │ │ │ ├── transportProperties │ │ │ └── turbulenceProperties │ │ ├── myVars │ │ ├── parRun │ │ ├── postRun │ │ ├── preRun │ │ ├── runClean │ │ ├── scripts │ │ │ └── ALgeometry.py │ │ ├── solverRun │ │ └── system │ │ │ ├── blockMeshDict │ │ │ ├── controlDict │ │ │ ├── decomposeParDict │ │ │ ├── elementData │ │ │ ├── fvOptions │ │ │ ├── fvSchemes │ │ │ ├── fvSolution │ │ │ ├── sampling │ │ │ ├── snappyHexMeshDict │ │ │ └── topoSetDict │ │ ├── surgeL25 │ │ ├── 0.orig │ │ │ ├── U │ │ │ ├── epsilon │ │ │ ├── include │ │ │ │ ├── boundaryConditions │ │ │ │ └── fixedInlet │ │ │ ├── k │ │ │ ├── nut │ │ │ └── p │ │ ├── ALgeometry.sh │ │ ├── allClean │ │ ├── constant │ │ │ ├── RASProperties │ │ │ ├── transportProperties │ │ │ └── turbulenceProperties │ │ ├── myVars │ │ ├── parRun │ │ ├── postRun │ │ ├── preRun │ │ ├── runClean │ │ ├── scripts │ │ │ └── ALgeometry.py │ │ ├── snappyHexMeshDict │ │ ├── solverRun │ │ └── system │ │ │ ├── blockMeshDict │ │ │ ├── controlDict │ │ │ ├── decomposeParDict │ │ │ ├── elementData │ │ │ ├── fvOptions │ │ │ ├── fvSchemes │ │ │ ├── fvSolution │ │ │ ├── sampling │ │ │ ├── snappyHexMeshDict │ │ │ └── topoSetDict │ │ └── surgeL27 │ │ ├── 0.orig │ │ ├── U │ │ ├── epsilon │ │ ├── include │ │ │ ├── boundaryConditions │ │ │ └── fixedInlet │ │ ├── k │ │ ├── nut │ │ └── p │ │ ├── ALgeometry.sh │ │ ├── allClean │ │ ├── constant │ │ ├── RASProperties │ │ ├── transportProperties │ │ └── turbulenceProperties │ │ ├── myVars │ │ ├── parRun │ │ ├── postRun │ │ ├── preRun │ │ ├── runClean │ │ ├── scripts │ │ └── ALgeometry.py │ │ ├── solverRun │ │ └── system │ │ ├── blockMeshDict │ │ ├── controlDict │ │ ├── decomposeParDict │ │ ├── elementData │ │ ├── fvOptions │ │ ├── fvSchemes │ │ ├── fvSolution │ │ ├── sampling │ │ ├── snappyHexMeshDict │ │ └── topoSetDict ├── Chapter_7 │ ├── coupled │ │ ├── 0.orig │ │ │ ├── U │ │ │ ├── alpha.water │ │ │ ├── include │ │ │ │ ├── boundaryConditions │ │ │ │ ├── logLawInlet │ │ │ │ └── logLawOutlet │ │ │ ├── k │ │ │ ├── nut │ │ │ ├── omega │ │ │ ├── p_rgh │ │ │ └── pointDisplacement │ │ ├── ALgeometry.sh │ │ ├── allClean │ │ ├── coExtract.sh │ │ ├── constant │ │ │ ├── dynamicMeshDict │ │ │ ├── g │ │ │ ├── transportProperties │ │ │ ├── triSurface │ │ │ │ └── floater.stl │ │ │ ├── turbulenceProperties │ │ │ └── waveProperties.input │ │ ├── moorExtract.sh │ │ ├── motionExtract.sh │ │ ├── myVars │ │ ├── parRun │ │ ├── postRun │ │ ├── preRun │ │ ├── runClean │ │ ├── scripts │ │ │ └── ALgeometry.py │ │ ├── solverRun │ │ └── system │ │ │ ├── blockMeshDict │ │ │ ├── controlDict │ │ │ ├── decomposeParDict │ │ │ ├── decomposeParDict_pre │ │ │ ├── decomposeParDict_solver │ │ │ ├── elementData │ │ │ ├── fvOptions │ │ │ ├── fvSchemes │ │ │ ├── fvSolution │ │ │ ├── sampling │ │ │ ├── setExprFieldsDict │ │ │ ├── snappyHexMeshDict │ │ │ └── topoSetDict │ ├── floater.FCStd │ ├── floater_only │ │ ├── no_pitch0 │ │ │ ├── 0.orig │ │ │ │ ├── U │ │ │ │ ├── alpha.water │ │ │ │ ├── include │ │ │ │ │ └── boundaryConditions │ │ │ │ ├── k │ │ │ │ ├── nut │ │ │ │ ├── omega │ │ │ │ ├── p_rgh │ │ │ │ └── pointDisplacement │ │ │ ├── allClean │ │ │ ├── coExtract.sh │ │ │ ├── constant │ │ │ │ ├── dynamicMeshDict │ │ │ │ ├── g │ │ │ │ ├── probeDefinitions_old │ │ │ │ ├── transportProperties │ │ │ │ ├── triSurface │ │ │ │ │ └── floater.stl │ │ │ │ ├── turbulenceProperties │ │ │ │ ├── waveProperties │ │ │ │ └── waveProperties.input │ │ │ ├── moorExtract.sh │ │ │ ├── motionExtract.sh │ │ │ ├── myVars │ │ │ ├── parRun │ │ │ ├── postRun │ │ │ ├── preRun │ │ │ ├── runClean │ │ │ ├── solverRun │ │ │ └── system │ │ │ │ ├── blockMeshDict │ │ │ │ ├── controlDict │ │ │ │ ├── decomposeParDict_pre │ │ │ │ ├── decomposeParDict_solver │ │ │ │ ├── fvSchemes │ │ │ │ ├── fvSolution │ │ │ │ └── snappyHexMeshDict │ │ └── with_pitch0 │ │ │ ├── 0.orig │ │ │ ├── U │ │ │ ├── alpha.water │ │ │ ├── include │ │ │ │ └── boundaryConditions │ │ │ ├── k │ │ │ ├── nut │ │ │ ├── omega │ │ │ ├── p_rgh │ │ │ └── pointDisplacement │ │ │ ├── allClean │ │ │ ├── coExtract.sh │ │ │ ├── constant │ │ │ ├── dynamicMeshDict │ │ │ ├── g │ │ │ ├── probeDefinitions_old │ │ │ ├── transportProperties │ │ │ ├── triSurface │ │ │ │ ├── floater.stl │ │ │ │ └── floater_org.stl │ │ │ ├── turbulenceProperties │ │ │ ├── waveProperties │ │ │ └── waveProperties.input │ │ │ ├── moorExtract.sh │ │ │ ├── motionExtract.sh │ │ │ ├── myVars │ │ │ ├── parRun │ │ │ ├── postRun │ │ │ ├── preRun │ │ │ ├── runClean │ │ │ ├── solverRun │ │ │ └── system │ │ │ ├── blockMeshDict │ │ │ ├── controlDict │ │ │ ├── decomposeParDict │ │ │ ├── decomposeParDict_pre │ │ │ ├── decomposeParDict_solver │ │ │ ├── fvSchemes │ │ │ ├── fvSolution │ │ │ └── snappyHexMeshDict │ ├── resources │ │ └── foilData │ │ │ ├── DU21_A17 │ │ │ ├── DU25_A17 │ │ │ ├── DU30_A17 │ │ │ ├── DU35_A17 │ │ │ ├── DU40_A17 │ │ │ └── NACA64_A17 │ └── turbine_only │ │ ├── 0.orig │ │ ├── U │ │ ├── include │ │ │ ├── boundaryConditions │ │ │ ├── logLawField │ │ │ ├── logLawInlet │ │ │ └── logLawOutlet │ │ ├── k │ │ ├── nut │ │ ├── omega │ │ └── p │ │ ├── ALgeometry.sh │ │ ├── allClean │ │ ├── coExtract.sh │ │ ├── constant │ │ ├── transportProperties │ │ └── turbulenceProperties │ │ ├── myVars │ │ ├── parRun │ │ ├── postRun │ │ ├── preRun │ │ ├── runClean │ │ ├── scripts │ │ └── ALgeometry.py │ │ ├── solverRun │ │ └── system │ │ ├── blockMeshDict │ │ ├── controlDict │ │ ├── decomposeParDict │ │ ├── decomposeParDict_pre │ │ ├── decomposeParDict_solver │ │ ├── elementData │ │ ├── fvOptions │ │ ├── fvSchemes │ │ ├── fvSolution │ │ ├── sampling │ │ ├── snappyHexMeshDict │ │ └── topoSetDict ├── README.md └── Tests │ ├── prescribed_ALM │ ├── harmonic_actuatorLine │ │ ├── 0.orig │ │ │ ├── U │ │ │ ├── alpha.water │ │ │ ├── epsilon │ │ │ ├── include │ │ │ │ ├── fixedInlet │ │ │ │ └── initialConditions │ │ │ ├── k │ │ │ ├── nut │ │ │ └── p_rgh │ │ ├── ALgeometry.sh │ │ ├── allClean │ │ ├── constant │ │ │ ├── RASProperties │ │ │ ├── g │ │ │ ├── transportProperties │ │ │ └── turbulenceProperties │ │ ├── preRun │ │ ├── scripts │ │ │ └── ALgeometry.py │ │ ├── solverClean │ │ ├── solverRun │ │ └── system │ │ │ ├── blockMeshDict │ │ │ ├── controlDict │ │ │ ├── decomposeParDict │ │ │ ├── extrudeMeshDict │ │ │ ├── fvOptions │ │ │ ├── fvSchemes │ │ │ ├── fvSolution │ │ │ ├── snappyHexMeshDict │ │ │ └── topoSetDict │ ├── harmonic_turbine │ │ ├── 0.orig │ │ │ ├── U │ │ │ ├── epsilon │ │ │ ├── include │ │ │ │ ├── fixedInlet │ │ │ │ └── initialConditions │ │ │ ├── k │ │ │ ├── nuTilda │ │ │ ├── nut │ │ │ └── p │ │ ├── ALgeometry.sh │ │ ├── allClean │ │ ├── constant │ │ │ ├── RASProperties │ │ │ ├── transportProperties │ │ │ └── turbulenceProperties │ │ ├── preRun │ │ ├── scripts │ │ │ └── ALgeometry.py │ │ ├── solverClean │ │ ├── solverRun │ │ └── system │ │ │ ├── blockMeshDict │ │ │ ├── controlDict │ │ │ ├── decomposeParDict │ │ │ ├── elementData │ │ │ ├── fvOptions │ │ │ ├── fvOptions_purePitch │ │ │ ├── fvSchemes │ │ │ ├── fvSolution │ │ │ ├── snappyHexMeshDict │ │ │ └── topoSetDict │ └── resources │ │ └── foilData │ │ ├── DU21_A17 │ │ ├── DU25_A17 │ │ ├── DU30_A17 │ │ ├── DU35_A17 │ │ ├── DU40_A17 │ │ ├── NACA0012_2e6 │ │ ├── NACA0012_5e6 │ │ ├── NACA0020_2.7e5 │ │ ├── NACA0021_1.6e5 │ │ ├── NACA0021_3.6e5 │ │ ├── NACA0021_multiRe_Re │ │ ├── NACA0021_multiRe_cd │ │ ├── NACA0021_multiRe_cl │ │ ├── NACA0021_multiRe_cm │ │ ├── NACA64_A17 │ │ ├── S826_1e5 │ │ ├── S826_1e5_Ostavan │ │ └── S826_1e5_upstroke │ └── rigidBody_ALM │ └── extruded_Cylinder │ ├── 0.orig │ ├── U │ ├── alpha.water │ ├── epsilon │ ├── include │ │ ├── fixedInlet │ │ └── initialConditions │ ├── k │ ├── nut │ ├── p_rgh │ └── pointDisplacement │ ├── ALgeometry.sh │ ├── Coextract.sh │ ├── RBextract.sh │ ├── allClean │ ├── constant │ ├── RASProperties │ ├── dynamicMeshDict │ ├── g │ ├── polyMesh │ │ ├── boundary │ │ ├── cellZones │ │ ├── faces │ │ ├── neighbour │ │ ├── owner │ │ ├── points │ │ └── sets │ │ │ └── turbine │ ├── transportProperties │ └── turbulenceProperties │ ├── myVars │ ├── preRun │ ├── scripts │ └── ALgeometry.py │ ├── solverClean │ ├── solverRun │ └── system │ ├── blockMeshDict │ ├── controlDict │ ├── decomposeParDict │ ├── elementData │ ├── extrudeMeshDict │ ├── fvOptions │ ├── fvSchemes │ ├── fvSolution │ ├── setFieldsDict │ └── topoSetDict ├── libraries ├── floatingSixDoFRigidBodyMotion │ ├── Make │ │ ├── files │ │ └── options │ ├── README.md │ ├── doc │ │ └── sixDofRigidBodyMotionDoc.H │ ├── pointPatchFields │ │ └── derived │ │ │ ├── sixDoFRigidBodyDisplacement │ │ │ ├── sixDoFRigidBodyDisplacementPointPatchVectorField.C │ │ │ └── sixDoFRigidBodyDisplacementPointPatchVectorField.H │ │ │ └── uncoupledSixDoFRigidBodyDisplacement │ │ │ ├── uncoupledSixDoFRigidBodyDisplacementPointPatchVectorField.C │ │ │ └── uncoupledSixDoFRigidBodyDisplacementPointPatchVectorField.H │ ├── sixDoFRigidBodyMotion │ │ ├── constraints │ │ │ ├── axis │ │ │ │ ├── sixDoFRigidBodyMotionAxisConstraint.C │ │ │ │ └── sixDoFRigidBodyMotionAxisConstraint.H │ │ │ ├── line │ │ │ │ ├── sixDoFRigidBodyMotionLineConstraint.C │ │ │ │ └── sixDoFRigidBodyMotionLineConstraint.H │ │ │ ├── orientation │ │ │ │ ├── sixDoFRigidBodyMotionOrientationConstraint.C │ │ │ │ └── sixDoFRigidBodyMotionOrientationConstraint.H │ │ │ ├── plane │ │ │ │ ├── sixDoFRigidBodyMotionPlaneConstraint.C │ │ │ │ └── sixDoFRigidBodyMotionPlaneConstraint.H │ │ │ ├── point │ │ │ │ ├── sixDoFRigidBodyMotionPointConstraint.C │ │ │ │ └── sixDoFRigidBodyMotionPointConstraint.H │ │ │ └── sixDoFRigidBodyMotionConstraint │ │ │ │ ├── sixDoFRigidBodyMotionConstraint.C │ │ │ │ ├── sixDoFRigidBodyMotionConstraint.H │ │ │ │ └── sixDoFRigidBodyMotionConstraintNew.C │ │ ├── restraints │ │ │ ├── constantLoad │ │ │ │ ├── constantLoad.C │ │ │ │ └── constantLoad.H │ │ │ ├── gyroscopicMoment │ │ │ │ ├── gyroscopicMoment.C │ │ │ │ └── gyroscopicMoment.H │ │ │ ├── linearAxialAngularSpring │ │ │ │ ├── linearAxialAngularSpring.C │ │ │ │ └── linearAxialAngularSpring.H │ │ │ ├── linearDamper │ │ │ │ ├── linearDamper.C │ │ │ │ └── linearDamper.H │ │ │ ├── linearSpring │ │ │ │ ├── linearSpring.C │ │ │ │ └── linearSpring.H │ │ │ ├── linearSpringDamper │ │ │ │ ├── linearSpringDamper.C │ │ │ │ └── linearSpringDamper.H │ │ │ ├── mooringLine │ │ │ │ ├── catenaryShape │ │ │ │ │ ├── catenaryShape.C │ │ │ │ │ └── catenaryShape.H │ │ │ │ ├── mooringLine.C │ │ │ │ ├── mooringLine.H │ │ │ │ └── write1DFvMesh │ │ │ │ │ ├── write1DFvMesh.C │ │ │ │ │ └── write1DFvMesh.H │ │ │ ├── sixDoFRigidBodyMotionRestraint │ │ │ │ ├── sixDoFRigidBodyMotionRestraint.C │ │ │ │ ├── sixDoFRigidBodyMotionRestraint.H │ │ │ │ └── sixDoFRigidBodyMotionRestraintNew.C │ │ │ ├── sphericalAngularDamper │ │ │ │ ├── sphericalAngularDamper.C │ │ │ │ └── sphericalAngularDamper.H │ │ │ ├── sphericalAngularSpring │ │ │ │ ├── sphericalAngularSpring.C │ │ │ │ └── sphericalAngularSpring.H │ │ │ ├── tabulatedAxialAngularSpring │ │ │ │ ├── tabulatedAxialAngularSpring.C │ │ │ │ └── tabulatedAxialAngularSpring.H │ │ │ └── turbineAL │ │ │ │ ├── turbineAL.C │ │ │ │ └── turbineAL.H │ │ ├── sixDoFRigidBodyMotion.C │ │ ├── sixDoFRigidBodyMotion.H │ │ ├── sixDoFRigidBodyMotionI.H │ │ ├── sixDoFRigidBodyMotionIO.C │ │ ├── sixDoFRigidBodyMotionState.C │ │ ├── sixDoFRigidBodyMotionState.H │ │ ├── sixDoFRigidBodyMotionStateI.H │ │ └── sixDoFRigidBodyMotionStateIO.C │ ├── sixDoFRigidBodyMotionSolver │ │ ├── sixDoFRigidBodyMotionSolver.C │ │ └── sixDoFRigidBodyMotionSolver.H │ └── sixDoFSolvers │ │ ├── CrankNicolson │ │ ├── CrankNicolson.C │ │ └── CrankNicolson.H │ │ ├── Newmark │ │ ├── Newmark.C │ │ └── Newmark.H │ │ ├── sixDoFSolver │ │ ├── sixDoFSolver.C │ │ ├── sixDoFSolver.H │ │ ├── sixDoFSolverI.H │ │ └── sixDoFSolverNew.C │ │ └── symplectic │ │ ├── symplectic.C │ │ └── symplectic.H └── floatingTurbinesFoam │ ├── Allwclean │ ├── Allwmake │ ├── README.md │ └── src │ ├── Make │ ├── files │ └── options │ ├── fvOptions │ ├── actuatorLineSource │ │ ├── actuatorLineElement │ │ │ ├── actuatorLineElement.C │ │ │ ├── actuatorLineElement.H │ │ │ ├── addedMassModel │ │ │ │ ├── addedMassModel.C │ │ │ │ └── addedMassModel.H │ │ │ ├── dynamicStallModels │ │ │ │ ├── LeishmanBeddoes │ │ │ │ │ ├── LeishmanBeddoes.C │ │ │ │ │ └── LeishmanBeddoes.H │ │ │ │ ├── LeishmanBeddoes3G │ │ │ │ │ ├── LeishmanBeddoes3G.C │ │ │ │ │ └── LeishmanBeddoes3G.H │ │ │ │ ├── LeishmanBeddoesSD │ │ │ │ │ ├── LeishmanBeddoesSD.C │ │ │ │ │ └── LeishmanBeddoesSD.H │ │ │ │ ├── LeishmanBeddoesSGC │ │ │ │ │ ├── LeishmanBeddoesSGC.C │ │ │ │ │ └── LeishmanBeddoesSGC.H │ │ │ │ └── dynamicStallModel │ │ │ │ │ ├── dynamicStallModel.C │ │ │ │ │ └── dynamicStallModel.H │ │ │ └── profileData │ │ │ │ ├── profileData.C │ │ │ │ └── profileData.H │ │ ├── actuatorLineSource.C │ │ └── actuatorLineSource.H │ ├── axialFlowTurbineALSource │ │ ├── axialFlowTurbineALSource.C │ │ └── axialFlowTurbineALSource.H │ ├── crossFlowTurbineALSource │ │ ├── crossFlowTurbineALSource.C │ │ └── crossFlowTurbineALSource.H │ └── turbineALSource │ │ ├── turbineALSource.C │ │ └── turbineALSource.H │ └── interpolations │ ├── interpolateUtils.C │ └── interpolateUtils.H └── other ├── job_submission_scripts ├── README.md ├── postJob.pbs ├── preJob.pbs ├── solverJob_multiNode.pbs └── solverJob_singleNode.pbs └── postProcessing ├── AL_geometry_extractor ├── ALgeometry.sh └── scripts │ └── ALgeometry.py ├── README.md ├── turbine ├── bladeStation.m ├── distribution.m ├── distributionAverage.m └── hubLoads.m └── waves ├── computeWavelength ├── computeLambda.m ├── dispersionRelation.m └── main.m └── extractSurfaceElevation ├── averagePhase.m ├── main.m ├── surfaceElevation_2nd.m └── wave_data └── SE_2nd_order.dat /cases/Chapter_4/waveFlume_2D/allClean: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Source tutorial run functions 4 | . $WM_PROJECT_DIR/bin/tools/CleanFunctions 5 | 6 | cleanCase0 -------------------------------------------------------------------------------- /cases/Chapter_4/waveFlume_2D/constant/dynamicMeshDict: -------------------------------------------------------------------------------- 1 | /*--------------------------------*- C++ -*----------------------------------*\ 2 | | ========= | | 3 | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | 4 | | \\ / O peration | Version: 1.5 | 5 | | \\ / A nd | Web: http://www.OpenFOAM.org | 6 | | \\/ M anipulation | | 7 | \*---------------------------------------------------------------------------*/ 8 | FoamFile 9 | { 10 | version 2.0; 11 | format ascii; 12 | class dictionary; 13 | object motionProperties; 14 | } 15 | // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 16 | 17 | dynamicFvMesh staticFvMesh; 18 | 19 | // ************************************************************************* // 20 | -------------------------------------------------------------------------------- /cases/Chapter_4/waveFlume_2D/constant/g: -------------------------------------------------------------------------------- 1 | /*--------------------------------*- C++ -*----------------------------------*\ 2 | | ========= | | 3 | | \\ / F ield | OpenFOAM Extend Project: Open Source CFD | 4 | | \\ / O peration | Version: 1.6-ext | 5 | | \\ / A nd | Web: www.extend-project.de | 6 | | \\/ M anipulation | | 7 | \*---------------------------------------------------------------------------*/ 8 | FoamFile 9 | { 10 | version 2.0; 11 | format ascii; 12 | class uniformDimensionedVectorField; 13 | location "constant"; 14 | object g; 15 | } 16 | // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 17 | 18 | dimensions [0 1 -2 0 0 0 0]; 19 | value ( 0 -9.81 0 ); 20 | 21 | // ************************************************************************* // 22 | -------------------------------------------------------------------------------- /cases/Chapter_4/waveFlume_2D/constant/turbulenceProperties: -------------------------------------------------------------------------------- 1 | /*--------------------------------*- C++ -*----------------------------------*\ 2 | | ========= | | 3 | | \\ / F ield | OpenFOAM Extend Project: Open Source CFD | 4 | | \\ / O peration | Version: 1.6-ext | 5 | | \\ / A nd | Web: www.extend-project.de | 6 | | \\/ M anipulation | | 7 | \*---------------------------------------------------------------------------*/ 8 | FoamFile 9 | { 10 | version 2.0; 11 | format ascii; 12 | class dictionary; 13 | location "constant"; 14 | object turbulenceProperties; 15 | } 16 | // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 17 | 18 | simulationType laminar; 19 | 20 | // ************************************************************************* // 21 | -------------------------------------------------------------------------------- /cases/Chapter_4/waveFlume_2D/myVars: -------------------------------------------------------------------------------- 1 | // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 2 | // This file is used to define global variables// 3 | // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 4 | 5 | wave_period 8.0; 6 | rel_depth 0.4; // Water depth / wavelength 7 | steepness 0.005; // Wave height / wavelength 8 | wave_length #calc "pow($wave_period,2)*tanh(2*M_PI*$rel_depth)*9.81/(2*M_PI)"; // Remember wave_length is a function of period and depth, so it cannot be arbitrarely chosen! 9 | 10 | water_depth #calc "$rel_depth*$wave_length"; 11 | wave_height #calc "$steepness*$wave_length"; 12 | 13 | Lg $wave_length; // Generation zone length 14 | La #calc "2*$wave_length"; // Absorption zone length 15 | Lp #calc "2*$wave_length"; // Propagation zone length 16 | height_y #calc "2*$wave_height"; // Height above MWL 17 | 18 | ref_level 3; // Refinement level at free surface 19 | CPH 10; // cells per wave height 20 | aspect_ratio #calc "sqrt(3.0)"; 21 | aspect_ratio_max 4; -------------------------------------------------------------------------------- /cases/Chapter_4/waveFlume_2D/preRun: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Source tutorial run functions 4 | . $WM_PROJECT_DIR/bin/tools/RunFunctions 5 | 6 | restore0Dir 7 | 8 | #Run blockMesh 9 | runApplication blockMesh 10 | 11 | #Run snappy 12 | runApplication snappyHexMesh -overwrite 13 | 14 | #Correct BCs 15 | sed -i 's/symmetry/empty/g' 0/U 16 | sed -i 's/symmetry/empty/g' 0/p_rgh 17 | sed -i 's/symmetry/empty/g' 0/alpha.water 18 | sed -i 's/symmetry/empty/g' constant/polyMesh/boundary 19 | 20 | cp -fr 0/polyMesh/points constant/polyMesh/points 21 | 22 | # Create the wave probes 23 | runApplication waveGaugesNProbes 24 | 25 | # Compute the wave parameters 26 | runApplication setWaveParameters 27 | 28 | # Create the wave probes 29 | runApplication waveGaugesNProbes 30 | 31 | # Define relaxation zones (only needed if you want to visualize the resulting layout) 32 | runApplication relaxationZoneLayout 33 | 34 | # Set the alpha field according to wave theory 35 | runApplication setWaveField 36 | 37 | # Set the alpha field according to setFieldsDict 38 | #runApplication setFields -------------------------------------------------------------------------------- /cases/Chapter_4/waveFlume_2D/solverRun: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Source tutorial run functions 4 | . $WM_PROJECT_DIR/bin/tools/RunFunctions 5 | 6 | # Set application name 7 | application="mpirun --oversubscribe -np 16 waveFoam -parallel" 8 | 9 | # Prepare for parallelisation 10 | runApplication decomposePar 11 | 12 | # Run the application 13 | runApplication $application 14 | 15 | # Recontruct case 16 | runApplication reconstructPar 17 | 18 | # Reconstruct logs 19 | runApplication foamLog log.mpirun -------------------------------------------------------------------------------- /cases/Chapter_4/waveFlume_2D/system/decomposeParDict: -------------------------------------------------------------------------------- 1 | /*--------------------------------*- C++ -*----------------------------------*\ 2 | | ========= | | 3 | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | 4 | | \\ / O peration | Version: v2012 | 5 | | \\ / A nd | Website: www.openfoam.com | 6 | | \\/ M anipulation | | 7 | \*---------------------------------------------------------------------------*/ 8 | FoamFile 9 | { 10 | version 2.0; 11 | format ascii; 12 | class dictionary; 13 | object decomposeParDict; 14 | } 15 | // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 16 | 17 | numberOfSubdomains 16; // number of CPUs 18 | 19 | method scotch; 20 | 21 | // ************************************************************************* // 22 | -------------------------------------------------------------------------------- /cases/Chapter_5/Ito_2D/CoExtract.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | file=log.mpirun 4 | printf 'Time \t Delta t \t Co \t ICo \n' > Co.dat 5 | my_output="$(awk '/Courant Number/{Co=$6;getline;ICo=$7;getline;DTIME=$3;getline;TIME=$3;printf("%8.6f\t%8.6f\t%8.6f\t%8.6f\n",TIME,DTIME,Co,ICo);}' $file)" 6 | echo "$my_output" >> Co.dat -------------------------------------------------------------------------------- /cases/Chapter_5/Ito_2D/allClean: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Source tutorial run functions 4 | . $WM_PROJECT_DIR/bin/tools/CleanFunctions 5 | 6 | cleanCase0 -------------------------------------------------------------------------------- /cases/Chapter_5/Ito_2D/allRun: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | 4 | # Source tutorial run functions 5 | . $WM_PROJECT_DIR/bin/tools/RunFunctions 6 | 7 | restore0Dir 8 | 9 | #Run blockMesh 10 | runApplication blockMesh 11 | 12 | # Compute the wave parameters 13 | runApplication setWaveParameters 14 | 15 | # Define relaxation zones (only needed if you want to visualize the resulting layout) 16 | runApplication relaxationZoneLayout 17 | 18 | # Set application name 19 | application="mpirun --oversubscribe -np 16 waveDyMFoam -parallel" 20 | 21 | # Set the alpha field 22 | runApplication setFields 23 | 24 | # Prepare for parallelisation 25 | runApplication decomposePar 26 | 27 | # Run the application 28 | runApplication $application 29 | 30 | # Recontruct case 31 | runApplication reconstructPar 32 | 33 | # Reconstruct logs 34 | runApplication foamLog log.mpirun 35 | -------------------------------------------------------------------------------- /cases/Chapter_5/Ito_2D/constant/g: -------------------------------------------------------------------------------- 1 | /*--------------------------------*- C++ -*----------------------------------*\ 2 | | ========= | | 3 | | \\ / F ield | OpenFOAM Extend Project: Open Source CFD | 4 | | \\ / O peration | Version: 1.6-ext | 5 | | \\ / A nd | Web: www.extend-project.de | 6 | | \\/ M anipulation | | 7 | \*---------------------------------------------------------------------------*/ 8 | FoamFile 9 | { 10 | version 2.0; 11 | format ascii; 12 | class uniformDimensionedVectorField; 13 | location "constant"; 14 | object g; 15 | } 16 | // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 17 | 18 | dimensions [0 1 -2 0 0 0 0]; 19 | value ( 0 -9.81 0 ); 20 | 21 | // ************************************************************************* // 22 | -------------------------------------------------------------------------------- /cases/Chapter_5/Ito_2D/constant/transportProperties: -------------------------------------------------------------------------------- 1 | /*--------------------------------*- C++ -*----------------------------------*\ 2 | | ========= | | 3 | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | 4 | | \\ / O peration | Version: 2.1.0 | 5 | | \\ / A nd | Web: www.OpenFOAM.org | 6 | | \\/ M anipulation | | 7 | \*---------------------------------------------------------------------------*/ 8 | FoamFile 9 | { 10 | version 2.0; 11 | format ascii; 12 | class dictionary; 13 | location "constant"; 14 | object transportProperties; 15 | } 16 | // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 17 | 18 | phases (water air); 19 | 20 | water 21 | { 22 | transportModel Newtonian; 23 | nu nu [0 2 -1 0 0 0 0] 1e-06; 24 | rho rho [1 -3 0 0 0 0 0] 1000; 25 | } 26 | 27 | air 28 | { 29 | transportModel Newtonian; 30 | nu nu [0 2 -1 0 0 0 0] 1.48e-05; 31 | rho rho [1 -3 0 0 0 0 0] 1; 32 | } 33 | 34 | sigma 0.00; 35 | 36 | 37 | // ************************************************************************* // 38 | -------------------------------------------------------------------------------- /cases/Chapter_5/Ito_2D/constant/turbulenceProperties: -------------------------------------------------------------------------------- 1 | /*--------------------------------*- C++ -*----------------------------------*\ 2 | | ========= | | 3 | | \\ / F ield | OpenFOAM Extend Project: Open Source CFD | 4 | | \\ / O peration | Version: 1.6-ext | 5 | | \\ / A nd | Web: www.extend-project.de | 6 | | \\/ M anipulation | | 7 | \*---------------------------------------------------------------------------*/ 8 | FoamFile 9 | { 10 | version 2.0; 11 | format ascii; 12 | class dictionary; 13 | location "constant"; 14 | object turbulenceProperties; 15 | } 16 | // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 17 | 18 | simulationType laminar; 19 | 20 | // ************************************************************************* // 21 | -------------------------------------------------------------------------------- /cases/Chapter_5/Ito_2D/myVars: -------------------------------------------------------------------------------- 1 | // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 2 | // This file is used to define global variables// 3 | // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 4 | 5 | cyl_a 0.0762; //Cylinder radius, 3 inches 6 | y0 #calc "$cyl_a/3"; //Initial displacement, 1 inch 7 | relaxation_length #calc "5*$cyl_a"; // Length of the relaxation zones 8 | water_depth #calc "1.2192+$y0"; // 4 feet + initial displacement, since mean water level is at -y0 9 | tank_length 1.2192; //4 feet 10 | domain_length #calc "$tank_length+2*$relaxation_length"; //4 feet + relaxation zones 11 | domain_height #calc "4*$cyl_a"; 12 | 13 | // Front/back locations 14 | zmin -0.1; 15 | zmax 0.1; -------------------------------------------------------------------------------- /cases/Chapter_5/Ito_2D/system/decomposeParDict: -------------------------------------------------------------------------------- 1 | /*--------------------------------*- C++ -*----------------------------------*\ 2 | | ========= | | 3 | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | 4 | | \\ / O peration | Version: v2012 | 5 | | \\ / A nd | Website: www.openfoam.com | 6 | | \\/ M anipulation | | 7 | \*---------------------------------------------------------------------------*/ 8 | FoamFile 9 | { 10 | version 2.0; 11 | format ascii; 12 | class dictionary; 13 | object decomposeParDict; 14 | } 15 | // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 16 | 17 | numberOfSubdomains 16; // number of CPUs 18 | 19 | method scotch; 20 | 21 | // ************************************************************************* // 22 | -------------------------------------------------------------------------------- /cases/Chapter_5/Paredes_3D/free/0.orig/alpha.water: -------------------------------------------------------------------------------- 1 | /*--------------------------------*- C++ -*----------------------------------*\ 2 | | ========= | | 3 | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | 4 | | \\ / O peration | Version: v2012 | 5 | | \\ / A nd | Website: www.openfoam.com | 6 | | \\/ M anipulation | | 7 | \*---------------------------------------------------------------------------*/ 8 | FoamFile 9 | { 10 | version 2.0; 11 | format ascii; 12 | class volScalarField; 13 | location "0"; 14 | object alpha.water; 15 | } 16 | // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 17 | 18 | dimensions [0 0 0 0 0 0 0]; 19 | 20 | internalField uniform 0; 21 | 22 | boundaryField 23 | { 24 | "(inlet|outlet|front|back|bottom|cylinder)" 25 | { 26 | type zeroGradient; 27 | } 28 | atmosphere 29 | { 30 | type inletOutlet; 31 | inletValue uniform 0; 32 | value uniform 0; 33 | } 34 | } 35 | 36 | 37 | // ************************************************************************* // 38 | -------------------------------------------------------------------------------- /cases/Chapter_5/Paredes_3D/free/0.orig/pointDisplacement: -------------------------------------------------------------------------------- 1 | /*--------------------------------*- C++ -*----------------------------------*\ 2 | | ========= | | 3 | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | 4 | | \\ / O peration | Version: v2012 | 5 | | \\ / A nd | Website: www.openfoam.com | 6 | | \\/ M anipulation | | 7 | \*---------------------------------------------------------------------------*/ 8 | FoamFile 9 | { 10 | version 2.0; 11 | format ascii; 12 | class pointVectorField; 13 | object pointDisplacement; 14 | } 15 | // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 16 | 17 | dimensions [0 1 0 0 0 0 0]; 18 | 19 | internalField uniform (0 0 0); 20 | 21 | boundaryField 22 | { 23 | #includeEtc "caseDicts/setConstraintTypes" 24 | 25 | "(inlet|outlet|front|back|bottom|atmosphere)" 26 | { 27 | type fixedValue; 28 | value $internalField; 29 | } 30 | 31 | cylinder 32 | { 33 | type calculated; 34 | value $internalField; 35 | } 36 | 37 | } 38 | -------------------------------------------------------------------------------- /cases/Chapter_5/Paredes_3D/free/Coextract.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | file=log.mpirun 4 | printf 'Time \t Delta t \t Co \t ICo \n' > Co.dat 5 | my_output="$(awk '/Courant Number/{Co=$6;getline;ICo=$7;getline;DTIME=$3;getline;TIME=$3;printf("%8.6f\t%8.6f\t%8.6f\t%8.6f\n",TIME,DTIME,Co,ICo);}' $file)" 6 | echo "$my_output" >> Co.dat -------------------------------------------------------------------------------- /cases/Chapter_5/Paredes_3D/free/allClean: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Source tutorial run functions 4 | . $WM_PROJECT_DIR/bin/tools/CleanFunctions 5 | 6 | cleanCase0 -------------------------------------------------------------------------------- /cases/Chapter_5/Paredes_3D/free/constant/g: -------------------------------------------------------------------------------- 1 | /*--------------------------------*- C++ -*----------------------------------*\ 2 | | ========= | | 3 | | \\ / F ield | OpenFOAM Extend Project: Open Source CFD | 4 | | \\ / O peration | Version: 1.6-ext | 5 | | \\ / A nd | Web: www.extend-project.de | 6 | | \\/ M anipulation | | 7 | \*---------------------------------------------------------------------------*/ 8 | FoamFile 9 | { 10 | version 2.0; 11 | format ascii; 12 | class uniformDimensionedVectorField; 13 | location "constant"; 14 | object g; 15 | } 16 | // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 17 | 18 | dimensions [0 1 -2 0 0 0 0]; 19 | value ( 0 0 -9.81 ); 20 | 21 | // ************************************************************************* // 22 | -------------------------------------------------------------------------------- /cases/Chapter_5/Paredes_3D/free/constant/turbulenceProperties: -------------------------------------------------------------------------------- 1 | /*--------------------------------*- C++ -*----------------------------------*\ 2 | | ========= | | 3 | | \\ / F ield | OpenFOAM Extend Project: Open Source CFD | 4 | | \\ / O peration | Version: 1.6-ext | 5 | | \\ / A nd | Web: www.extend-project.de | 6 | | \\/ M anipulation | | 7 | \*---------------------------------------------------------------------------*/ 8 | FoamFile 9 | { 10 | version 2.0; 11 | format ascii; 12 | class dictionary; 13 | location "constant"; 14 | object turbulenceProperties; 15 | } 16 | // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 17 | 18 | simulationType laminar; 19 | 20 | // ************************************************************************* // 21 | -------------------------------------------------------------------------------- /cases/Chapter_5/Paredes_3D/free/myVars: -------------------------------------------------------------------------------- 1 | // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 2 | // This file is used to define global variables// 3 | // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 4 | 5 | cyl_R 0.2575; //Cylinder radius 6 | cyl_L 0.401; //Cylinder height 7 | cyl_draft -0.172; 8 | 9 | relaxation_length 3.0; // Length of the relaxation zones 10 | water_depth 0.9; // Water depth 11 | tank_length 6.0; // Free computational domain length 12 | domain_length #calc "$tank_length+2*$relaxation_length"; //Tank + relaxation zones 13 | domain_width 2.5; 14 | domain_height $water_depth; 15 | 16 | cyl_angle #calc "8.898*M_PI/180";//initial inclination angle of the cylinder, in radians 17 | cyl_com -0.0932; // z position of the centre of mass 18 | cyl_down #calc "fabs($cyl_draft-($cyl_com))"; // Distance from cog to cylinder base 19 | cyl_up #calc "$cyl_L-$cyl_down"; // Distance from cog to cylinder top 20 | cyl_center #calc "$cyl_draft + $cyl_L/2"; 21 | 22 | 23 | // For blockmesh 24 | x1 #calc "-$domain_length/2"; 25 | x2 #calc "$domain_length/2"; 26 | 27 | y1 #calc "-$domain_width"; 28 | y2 $domain_width; 29 | 30 | z1 #calc "-$water_depth"; 31 | z2 $domain_height; -------------------------------------------------------------------------------- /cases/Chapter_5/Paredes_3D/free/parRun: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | 4 | # Source tutorial run functions 5 | . $WM_PROJECT_DIR/bin/tools/RunFunctions 6 | 7 | nProc=$(getNumberOfProcessors) 8 | 9 | #Decompose case again 10 | runApplication decomposePar 11 | 12 | # Renumber meshto get a more diagonal system 13 | renumber_application="mpirun --oversubscribe -np $nProc renumberMesh -overwrite -parallel" 14 | runApplication $renumber_application 15 | mv log.mpirun log.renumberMesh -------------------------------------------------------------------------------- /cases/Chapter_5/Paredes_3D/free/postRun: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Source tutorial run functions 4 | . $WM_PROJECT_DIR/bin/tools/RunFunctions 5 | 6 | # Recontruct case 7 | runApplication reconstructPar 8 | 9 | # Reconstruct logs 10 | runApplication foamLog log.mpirun 11 | 12 | #Extract rigid body data 13 | ./RBextract.sh -------------------------------------------------------------------------------- /cases/Chapter_5/Paredes_3D/free/preRun: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Source tutorial run functions 4 | . $WM_PROJECT_DIR/bin/tools/RunFunctions 5 | 6 | # Get number of processors from decomposePar dict 7 | nProc=$(getNumberOfProcessors) 8 | 9 | restore0Dir 10 | 11 | #Run blockMesh 12 | runApplication blockMesh 13 | 14 | #Decompose mesh for snappyHex 15 | runApplication decomposePar 16 | 17 | #Run snappyMesh 18 | mesh_application="mpirun --oversubscribe -np $nProc snappyHexMesh -overwrite -parallel" 19 | runApplication $mesh_application 20 | mv log.mpirun log.snappyHexMesh 21 | #### runApplication snappyHexMesh -overwrite 22 | 23 | #Reconstruct mesh 24 | #This is needed, see https://www.cfd-online.com/Forums/openfoam-meshing/239688-cannot-find-patchfield-entry.html 25 | runApplication reconstructParMesh -mergeTol 1e-06 -latestTime -constant 26 | 27 | #Remove parallel files 28 | rm -rf processor* 29 | rm -rf log.decomposePar 30 | 31 | # Compute the wave parameters 32 | runApplication setWaveParameters 33 | 34 | # Define relaxation zones (only needed if you want to visualize the resulting layout) 35 | runApplication relaxationZoneLayout 36 | 37 | # Set the alpha field 38 | runApplication setFields 39 | 40 | # copy "points" file from 0/polyMesh to constant/polyMesh 41 | cp -fr 0/polyMesh/points constant/polyMesh/points -------------------------------------------------------------------------------- /cases/Chapter_5/Paredes_3D/free/solverClean: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Source tutorial run functions 4 | . $WM_PROJECT_DIR/bin/tools/CleanFunctions 5 | 6 | cleanTimeDirectories 7 | rm -rf processor* -------------------------------------------------------------------------------- /cases/Chapter_5/Paredes_3D/free/solverRun: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | 4 | # Source tutorial run functions 5 | . $WM_PROJECT_DIR/bin/tools/RunFunctions 6 | 7 | nProc=$(getNumberOfProcessors) 8 | 9 | # Set solver name 10 | 11 | solver="mpirun --oversubscribe -np $nProc waveDyMFoam -parallel" 12 | 13 | # Run the solver 14 | runApplication $solver 15 | mv log.mpirun log.waveDyMFoam -------------------------------------------------------------------------------- /cases/Chapter_5/Paredes_3D/free/system/decomposeParDict: -------------------------------------------------------------------------------- 1 | /*--------------------------------*- C++ -*----------------------------------*\ 2 | | ========= | | 3 | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | 4 | | \\ / O peration | Version: v2012 | 5 | | \\ / A nd | Website: www.openfoam.com | 6 | | \\/ M anipulation | | 7 | \*---------------------------------------------------------------------------*/ 8 | FoamFile 9 | { 10 | version 2.0; 11 | format ascii; 12 | class dictionary; 13 | object decomposeParDict; 14 | } 15 | // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 16 | 17 | numberOfSubdomains 20; // number of CPUs 18 | 19 | method scotch; 20 | 21 | // ************************************************************************* // 22 | -------------------------------------------------------------------------------- /cases/Chapter_5/Paredes_3D/moored/0.orig/alpha.water: -------------------------------------------------------------------------------- 1 | /*--------------------------------*- C++ -*----------------------------------*\ 2 | | ========= | | 3 | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | 4 | | \\ / O peration | Version: v2012 | 5 | | \\ / A nd | Website: www.openfoam.com | 6 | | \\/ M anipulation | | 7 | \*---------------------------------------------------------------------------*/ 8 | FoamFile 9 | { 10 | version 2.0; 11 | format ascii; 12 | class volScalarField; 13 | location "0"; 14 | object alpha.water; 15 | } 16 | // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 17 | 18 | dimensions [0 0 0 0 0 0 0]; 19 | 20 | internalField uniform 0; 21 | 22 | boundaryField 23 | { 24 | "(inlet|outlet|front|back|bottom|cylinder)" 25 | { 26 | type zeroGradient; 27 | } 28 | atmosphere 29 | { 30 | type inletOutlet; 31 | inletValue uniform 0; 32 | value uniform 0; 33 | } 34 | } 35 | 36 | 37 | // ************************************************************************* // 38 | -------------------------------------------------------------------------------- /cases/Chapter_5/Paredes_3D/moored/0.orig/pointDisplacement: -------------------------------------------------------------------------------- 1 | /*--------------------------------*- C++ -*----------------------------------*\ 2 | | ========= | | 3 | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | 4 | | \\ / O peration | Version: v2012 | 5 | | \\ / A nd | Website: www.openfoam.com | 6 | | \\/ M anipulation | | 7 | \*---------------------------------------------------------------------------*/ 8 | FoamFile 9 | { 10 | version 2.0; 11 | format ascii; 12 | class pointVectorField; 13 | object pointDisplacement; 14 | } 15 | // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 16 | 17 | dimensions [0 1 0 0 0 0 0]; 18 | 19 | internalField uniform (0 0 0); 20 | 21 | boundaryField 22 | { 23 | #includeEtc "caseDicts/setConstraintTypes" 24 | 25 | "(inlet|outlet|front|back|bottom|atmosphere)" 26 | { 27 | type fixedValue; 28 | value $internalField; 29 | } 30 | 31 | cylinder 32 | { 33 | type calculated; 34 | value $internalField; 35 | } 36 | 37 | } 38 | -------------------------------------------------------------------------------- /cases/Chapter_5/Paredes_3D/moored/CoExtract.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | file=log.mpirun 4 | printf 'Time \t Delta t \t Co \t ICo \n' > Co.dat 5 | my_output="$(awk '/Courant Number/{Co=$6;getline;ICo=$7;getline;DTIME=$3;getline;TIME=$3;printf("%8.6f\t%8.6f\t%8.6f\t%8.6f\n",TIME,DTIME,Co,ICo);}' $file)" 6 | echo "$my_output" >> Co.dat -------------------------------------------------------------------------------- /cases/Chapter_5/Paredes_3D/moored/allClean: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Source tutorial run functions 4 | . $WM_PROJECT_DIR/bin/tools/CleanFunctions 5 | 6 | cleanCase0 -------------------------------------------------------------------------------- /cases/Chapter_5/Paredes_3D/moored/constant/g: -------------------------------------------------------------------------------- 1 | /*--------------------------------*- C++ -*----------------------------------*\ 2 | | ========= | | 3 | | \\ / F ield | OpenFOAM Extend Project: Open Source CFD | 4 | | \\ / O peration | Version: 1.6-ext | 5 | | \\ / A nd | Web: www.extend-project.de | 6 | | \\/ M anipulation | | 7 | \*---------------------------------------------------------------------------*/ 8 | FoamFile 9 | { 10 | version 2.0; 11 | format ascii; 12 | class uniformDimensionedVectorField; 13 | location "constant"; 14 | object g; 15 | } 16 | // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 17 | 18 | dimensions [0 1 -2 0 0 0 0]; 19 | value ( 0 0 -9.81 ); 20 | 21 | // ************************************************************************* // 22 | -------------------------------------------------------------------------------- /cases/Chapter_5/Paredes_3D/moored/constant/turbulenceProperties: -------------------------------------------------------------------------------- 1 | /*--------------------------------*- C++ -*----------------------------------*\ 2 | | ========= | | 3 | | \\ / F ield | OpenFOAM Extend Project: Open Source CFD | 4 | | \\ / O peration | Version: 1.6-ext | 5 | | \\ / A nd | Web: www.extend-project.de | 6 | | \\/ M anipulation | | 7 | \*---------------------------------------------------------------------------*/ 8 | FoamFile 9 | { 10 | version 2.0; 11 | format ascii; 12 | class dictionary; 13 | location "constant"; 14 | object turbulenceProperties; 15 | } 16 | // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 17 | 18 | simulationType laminar; 19 | 20 | // ************************************************************************* // 21 | -------------------------------------------------------------------------------- /cases/Chapter_5/Paredes_3D/moored/moorExtract.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | ## FILE TO READ 4 | file=log.waveDyMFoam 5 | 6 | ## CREATE HEADER, WRITE IT ON 'RB_DATA.dat' 7 | printf 'Time \t F1x \t F1y \t F1z \t F2x \t F2y \t F2z \t F3x \t F3y \t F3z \n' > MOORING_DATA.dat 8 | 9 | ## SEARCH FOR THE DESIRED KEYWORDS 10 | ## SAVE THE DATA ON 'my_output' 11 | my_output="$(awk ' 12 | /Time/{TIME=$3; next} 13 | /Restraint catenaryLine1/{F1x=$6; F1y=$7; F1z=$8; next} 14 | /Restraint catenaryLine2/{F2x=$6; F2y=$7; F2z=$8; next} 15 | /Restraint catenaryLine3/{F3x=$6; F3y=$7; F3z=$8; 16 | printf("%8.6f\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\n", 17 | TIME,F1x,F1y,F1z,F2x,F2y,F2z,F3x,F3y,F3z);}' $file)" 18 | 19 | ## PRINT 'my_output' 20 | echo "$my_output" >> temp.dat 21 | 22 | ## REMOVE PARENTHESES FROM 'my_output' 23 | sed -e 's/(//g' -e 's/)//g' temp.dat >> MOORING_DATA.dat 24 | rm temp.dat -------------------------------------------------------------------------------- /cases/Chapter_5/Paredes_3D/moored/parRun: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | 4 | # Source tutorial run functions 5 | . $WM_PROJECT_DIR/bin/tools/RunFunctions 6 | 7 | nProc=$(getNumberOfProcessors) 8 | 9 | #Decompose case again 10 | runApplication decomposePar 11 | 12 | # Renumber meshto get a more diagonal system 13 | renumber_application="mpirun --oversubscribe -np $nProc renumberMesh -overwrite -parallel" 14 | runApplication $renumber_application 15 | mv log.mpirun log.renumberMesh -------------------------------------------------------------------------------- /cases/Chapter_5/Paredes_3D/moored/postRun: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Source tutorial run functions 4 | . $WM_PROJECT_DIR/bin/tools/RunFunctions 5 | 6 | # Recontruct case 7 | runApplication reconstructPar 8 | 9 | # Reconstruct logs 10 | runApplication foamLog log.mpirun 11 | 12 | #Extract rigid body data 13 | ./RBextract.sh -------------------------------------------------------------------------------- /cases/Chapter_5/Paredes_3D/moored/preRun: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Source tutorial run functions 4 | . $WM_PROJECT_DIR/bin/tools/RunFunctions 5 | 6 | # Get number of processors from decomposePar dict 7 | nProc=$(getNumberOfProcessors) 8 | 9 | restore0Dir 10 | 11 | #Run blockMesh 12 | runApplication blockMesh 13 | 14 | #Decompose mesh for snappyHex 15 | runApplication decomposePar 16 | 17 | #Run snappyMesh 18 | mesh_application="mpirun --oversubscribe -np $nProc snappyHexMesh -overwrite -parallel" 19 | runApplication $mesh_application 20 | mv log.mpirun log.snappyHexMesh 21 | #### runApplication snappyHexMesh -overwrite 22 | 23 | #Reconstruct mesh 24 | #This is needed, see https://www.cfd-online.com/Forums/openfoam-meshing/239688-cannot-find-patchfield-entry.html 25 | runApplication reconstructParMesh -mergeTol 1e-06 -latestTime -constant 26 | 27 | #Remove parallel files 28 | rm -rf processor* 29 | rm -rf log.decomposePar 30 | 31 | # Compute the wave parameters 32 | runApplication setWaveParameters 33 | 34 | # Define relaxation zones (only needed if you want to visualize the resulting layout) 35 | runApplication relaxationZoneLayout 36 | 37 | # Set the alpha field 38 | runApplication setFields 39 | 40 | # copy "points" file from 0/polyMesh to constant/polyMesh 41 | cp -fr 0/polyMesh/points constant/polyMesh/points -------------------------------------------------------------------------------- /cases/Chapter_5/Paredes_3D/moored/solverClean: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Source tutorial run functions 4 | . $WM_PROJECT_DIR/bin/tools/CleanFunctions 5 | 6 | cleanTimeDirectories 7 | rm -rf processor* -------------------------------------------------------------------------------- /cases/Chapter_5/Paredes_3D/moored/solverRun: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | 4 | # Source tutorial run functions 5 | . $WM_PROJECT_DIR/bin/tools/RunFunctions 6 | 7 | nProc=$(getNumberOfProcessors) 8 | 9 | # Set solver name 10 | 11 | solver="mpirun --oversubscribe -np $nProc waveDyMFoam -parallel" 12 | 13 | # Run the solver 14 | runApplication $solver 15 | mv log.mpirun log.waveDyMFoam -------------------------------------------------------------------------------- /cases/Chapter_5/Paredes_3D/moored/system/decomposeParDict: -------------------------------------------------------------------------------- 1 | /*--------------------------------*- C++ -*----------------------------------*\ 2 | | ========= | | 3 | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | 4 | | \\ / O peration | Version: v2012 | 5 | | \\ / A nd | Website: www.openfoam.com | 6 | | \\/ M anipulation | | 7 | \*---------------------------------------------------------------------------*/ 8 | FoamFile 9 | { 10 | version 2.0; 11 | format ascii; 12 | class dictionary; 13 | object decomposeParDict; 14 | } 15 | // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 16 | 17 | numberOfSubdomains 20; // number of CPUs 18 | 19 | method scotch; 20 | 21 | // ************************************************************************* // 22 | -------------------------------------------------------------------------------- /cases/Chapter_6/OC6_III/pitchL35/0.orig/include/boundaryConditions: -------------------------------------------------------------------------------- 1 | /*--------------------------------*- C++ -*----------------------------------*\ 2 | | ========= | | 3 | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | 4 | | \\ / O peration | Version: 3.0.x | 5 | | \\ / A nd | Web: www.OpenFOAM.org | 6 | | \\/ M anipulation | | 7 | \*---------------------------------------------------------------------------*/ 8 | #include "$FOAM_CASE/myVars" //Include global variables 9 | 10 | flowVelocity ($Ux 0 0); 11 | pressure 0; 12 | turbulentKE #calc "1.5*pow($I*$Ux,2)" ; // 2% turbulence 13 | 14 | //https://www.cfd-online.com/Wiki/Turbulence_intensity 15 | //https://www.openfoam.com/documentation/guides/latest/doc/guide-turbulence-ras-k-epsilon.html 16 | //https://www.cfd-online.com/Wiki/Turbulence_free-stream_boundary_conditions 17 | 18 | turbulentEpsilon #calc "pow(0.09,0.75)*pow($turbulentKE,1.5)/$span"; // Was 2e-6 or 0.01; Guess ~ 0.09*k**(3/2)/l 19 | 20 | // ************************************************************************* // 21 | -------------------------------------------------------------------------------- /cases/Chapter_6/OC6_III/pitchL35/0.orig/include/fixedInlet: -------------------------------------------------------------------------------- 1 | /*--------------------------------*- C++ -*----------------------------------*\ 2 | | ========= | | 3 | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | 4 | | \\ / O peration | Version: 3.0.x | 5 | | \\ / A nd | Web: www.OpenFOAM.org | 6 | | \\/ M anipulation | | 7 | \*---------------------------------------------------------------------------*/ 8 | 9 | inlet 10 | { 11 | type fixedValue; 12 | value $internalField; 13 | } 14 | 15 | // ************************************************************************* // 16 | -------------------------------------------------------------------------------- /cases/Chapter_6/OC6_III/pitchL35/ALgeometry.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Source tutorial run functions 3 | . $WM_PROJECT_DIR/bin/tools/RunFunctions 4 | 5 | rm -rf turbineGeometry 6 | #rm log.foamListTimes 7 | runApplication foamListTimes 8 | 9 | region='turbine' 10 | components=('blade1' 'blade2' 'blade3' 'tower') 11 | 12 | python3.8 scripts/ALgeometry.py $region "${components[@]}" -------------------------------------------------------------------------------- /cases/Chapter_6/OC6_III/pitchL35/allClean: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Source tutorial run functions 4 | . $WM_PROJECT_DIR/bin/tools/CleanFunctions 5 | 6 | cleanCase0 -------------------------------------------------------------------------------- /cases/Chapter_6/OC6_III/pitchL35/constant/RASProperties: -------------------------------------------------------------------------------- 1 | /*--------------------------------*- C++ -*----------------------------------*\ 2 | | ========= | | 3 | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | 4 | | \\ / O peration | Version: 3.0.x | 5 | | \\ / A nd | Web: www.OpenFOAM.org | 6 | | \\/ M anipulation | | 7 | \*---------------------------------------------------------------------------*/ 8 | FoamFile 9 | { 10 | version 2.0; 11 | format ascii; 12 | class dictionary; 13 | object RASProperties; 14 | } 15 | // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 16 | 17 | RASModel kEpsilon; 18 | 19 | turbulence on; 20 | 21 | printCoeffs on; 22 | 23 | // ************************************************************************* // 24 | -------------------------------------------------------------------------------- /cases/Chapter_6/OC6_III/pitchL35/constant/transportProperties: -------------------------------------------------------------------------------- 1 | /*--------------------------------*- C++ -*----------------------------------*\ 2 | | ========= | | 3 | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | 4 | | \\ / O peration | Version: 3.0.x | 5 | | \\ / A nd | Web: www.OpenFOAM.org | 6 | | \\/ M anipulation | | 7 | \*---------------------------------------------------------------------------*/ 8 | FoamFile 9 | { 10 | version 2.0; 11 | format ascii; 12 | class dictionary; 13 | object transportProperties; 14 | } 15 | // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 16 | 17 | transportModel Newtonian; 18 | 19 | nu nu [0 2 -1 0 0 0 0] 1.5e-5; 20 | 21 | // ************************************************************************* // 22 | -------------------------------------------------------------------------------- /cases/Chapter_6/OC6_III/pitchL35/constant/turbulenceProperties: -------------------------------------------------------------------------------- 1 | /*--------------------------------*- C++ -*----------------------------------*\ 2 | | ========= | | 3 | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | 4 | | \\ / O peration | Version: 3.0.x | 5 | | \\ / A nd | Web: www.OpenFOAM.org | 6 | | \\/ M anipulation | | 7 | \*---------------------------------------------------------------------------*/ 8 | FoamFile 9 | { 10 | version 2.0; 11 | format ascii; 12 | class dictionary; 13 | location "constant"; 14 | object turbulenceProperties; 15 | } 16 | // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 17 | 18 | simulationType RAS; 19 | 20 | RAS 21 | { 22 | #include "RASProperties" 23 | } 24 | 25 | // ************************************************************************* // 26 | -------------------------------------------------------------------------------- /cases/Chapter_6/OC6_III/pitchL35/parRun: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | 4 | # Source tutorial run functions 5 | . $WM_PROJECT_DIR/bin/tools/RunFunctions 6 | 7 | nProc=$(getNumberOfProcessors) 8 | 9 | #Decompose case again 10 | runApplication decomposePar 11 | 12 | # Renumber meshto get a more diagonal system 13 | renumber_application="mpirun --oversubscribe -np $nProc renumberMesh -overwrite -parallel" 14 | runApplication $renumber_application 15 | mv log.mpirun log.renumberMesh 16 | 17 | 18 | -------------------------------------------------------------------------------- /cases/Chapter_6/OC6_III/pitchL35/postRun: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Source tutorial run functions 4 | . $WM_PROJECT_DIR/bin/tools/RunFunctions 5 | 6 | # Recontruct case 7 | runApplication reconstructPar 8 | 9 | # Reconstruct logs 10 | runApplication foamLog log.pimpleFoam 11 | 12 | # Compute Q criteria 13 | runApplication postProcess -func Q 14 | 15 | #Extract turbine geometry 16 | ./ALgeometry.sh 17 | 18 | #Extract probes data 19 | cat postProcessing/alongwind/*/data_p.xy >> p_alongwind.dat 20 | cat postProcessing/alongwind/*/data_U.xy >> U_alongwind.dat 21 | cat postProcessing/crosswind/*/data_p.xy >> p_crosswind.dat 22 | cat postProcessing/crosswind/*/data_U.xy >> U_crosswind.dat 23 | 24 | cd postProcessing/crosswind/ 25 | find . -mindepth 1 -maxdepth 1 -name '*' -type d -printf '%f\n' | sort -n> times.dat 26 | mv times.dat ../../times.dat -------------------------------------------------------------------------------- /cases/Chapter_6/OC6_III/pitchL35/preRun: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Source tutorial run functions 4 | . $WM_PROJECT_DIR/bin/tools/RunFunctions 5 | 6 | # Get number of processors from decomposePar dict 7 | nProc=$(getNumberOfProcessors) 8 | 9 | restore0Dir 10 | 11 | #Run blockMesh 12 | runApplication blockMesh 13 | 14 | #Decompose mesh for snappyHex 15 | runApplication decomposePar 16 | 17 | #Run snappyMesh 18 | mesh_application="mpirun --oversubscribe -np $nProc snappyHexMesh -overwrite -parallel" 19 | runApplication $mesh_application 20 | mv log.mpirun log.snappyHexMesh 21 | #### runApplication snappyHexMesh -overwrite 22 | 23 | #Reconstruct mesh 24 | #This is needed, see https://www.cfd-online.com/Forums/openfoam-meshing/239688-cannot-find-patchfield-entry.html 25 | runApplication reconstructParMesh -mergeTol 1e-06 -latestTime -constant 26 | 27 | #Remove parallel files 28 | rm -rf processor* 29 | rm -rf log.decomposePar 30 | 31 | # Run topoSet 32 | runApplication topoSet 33 | 34 | # copy "points" file from 0/polyMesh to constant/polyMesh 35 | cp -fr 0/polyMesh/points constant/polyMesh/points -------------------------------------------------------------------------------- /cases/Chapter_6/OC6_III/pitchL35/runClean: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Source tutorial run functions 4 | . $WM_PROJECT_DIR/bin/tools/CleanFunctions 5 | 6 | cleanTimeDirectories 7 | rm -rf processor* -------------------------------------------------------------------------------- /cases/Chapter_6/OC6_III/pitchL35/solverRun: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | 4 | # Source tutorial run functions 5 | . $WM_PROJECT_DIR/bin/tools/RunFunctions 6 | 7 | nProc=$(getNumberOfProcessors) 8 | 9 | # Set solver name 10 | 11 | solver="mpirun --oversubscribe -np $nProc pimpleFoam -parallel" 12 | 13 | # Run the solver 14 | runApplication $solver 15 | mv log.mpirun log.pimpleFoam -------------------------------------------------------------------------------- /cases/Chapter_6/OC6_III/pitchL35/system/decomposeParDict: -------------------------------------------------------------------------------- 1 | /*--------------------------------*- C++ -*----------------------------------*\ 2 | | ========= | | 3 | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | 4 | | \\ / O peration | Version: 3.0.x | 5 | | \\ / A nd | Web: www.OpenFOAM.org | 6 | | \\/ M anipulation | | 7 | \*---------------------------------------------------------------------------*/ 8 | FoamFile 9 | { 10 | version 2.0; 11 | format ascii; 12 | class dictionary; 13 | object decomposeParDict; 14 | } 15 | 16 | // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 17 | 18 | numberOfSubdomains 20; 19 | 20 | method scotch; 21 | 22 | // ************************************************************************* // 23 | -------------------------------------------------------------------------------- /cases/Chapter_6/OC6_III/pitchL35/system/sampling: -------------------------------------------------------------------------------- 1 | // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 2 | // This file is used to define sampling options// 3 | // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 4 | 5 | crosswind 6 | { 7 | type sets; 8 | libs ("libsampling.so"); 9 | writeControl timeStep; 10 | outputInterval 250; 11 | interpolationScheme cellPoint; 12 | setFormat raw; 13 | sets 14 | ( 15 | data 16 | { 17 | type uniform; 18 | axis y; 19 | start (#calc "2.3*$D" #calc "-1.6*$D" $hub_h); 20 | end (#calc "2.3*$D" #calc "1.6*$D" $hub_h); 21 | nPoints 50; 22 | } 23 | ); 24 | fields (U p); 25 | } 26 | 27 | alongwind 28 | { 29 | type sets; 30 | libs ("libsampling.so"); 31 | writeControl timeStep; 32 | outputInterval 250; 33 | interpolationScheme cellPoint; 34 | setFormat raw; 35 | sets 36 | ( 37 | data 38 | { 39 | type uniform; 40 | axis x; 41 | start (#calc "0.9*$D" 0.9 $hub_h); 42 | end (#calc "2.3*$D" 0.9 $hub_h); 43 | nPoints 50; 44 | } 45 | ); 46 | fields (U p); 47 | } -------------------------------------------------------------------------------- /cases/Chapter_6/OC6_III/pitchL37/0.orig/include/boundaryConditions: -------------------------------------------------------------------------------- 1 | /*--------------------------------*- C++ -*----------------------------------*\ 2 | | ========= | | 3 | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | 4 | | \\ / O peration | Version: 3.0.x | 5 | | \\ / A nd | Web: www.OpenFOAM.org | 6 | | \\/ M anipulation | | 7 | \*---------------------------------------------------------------------------*/ 8 | #include "$FOAM_CASE/myVars" //Include global variables 9 | 10 | flowVelocity ($Ux 0 0); 11 | pressure 0; 12 | turbulentKE #calc "1.5*pow($I*$Ux,2)" ; // 2% turbulence 13 | 14 | //https://www.cfd-online.com/Wiki/Turbulence_intensity 15 | //https://www.openfoam.com/documentation/guides/latest/doc/guide-turbulence-ras-k-epsilon.html 16 | //https://www.cfd-online.com/Wiki/Turbulence_free-stream_boundary_conditions 17 | 18 | turbulentEpsilon #calc "pow(0.09,0.75)*pow($turbulentKE,1.5)/$span"; // Was 2e-6 or 0.01; Guess ~ 0.09*k**(3/2)/l 19 | 20 | // ************************************************************************* // 21 | -------------------------------------------------------------------------------- /cases/Chapter_6/OC6_III/pitchL37/0.orig/include/fixedInlet: -------------------------------------------------------------------------------- 1 | /*--------------------------------*- C++ -*----------------------------------*\ 2 | | ========= | | 3 | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | 4 | | \\ / O peration | Version: 3.0.x | 5 | | \\ / A nd | Web: www.OpenFOAM.org | 6 | | \\/ M anipulation | | 7 | \*---------------------------------------------------------------------------*/ 8 | 9 | inlet 10 | { 11 | type fixedValue; 12 | value $internalField; 13 | } 14 | 15 | // ************************************************************************* // 16 | -------------------------------------------------------------------------------- /cases/Chapter_6/OC6_III/pitchL37/ALgeometry.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Source tutorial run functions 3 | . $WM_PROJECT_DIR/bin/tools/RunFunctions 4 | 5 | rm -rf turbineGeometry 6 | #rm log.foamListTimes 7 | runApplication foamListTimes 8 | 9 | region='turbine' 10 | components=('blade1' 'blade2' 'blade3' 'tower') 11 | 12 | python3.8 scripts/ALgeometry.py $region "${components[@]}" -------------------------------------------------------------------------------- /cases/Chapter_6/OC6_III/pitchL37/allClean: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Source tutorial run functions 4 | . $WM_PROJECT_DIR/bin/tools/CleanFunctions 5 | 6 | cleanCase0 -------------------------------------------------------------------------------- /cases/Chapter_6/OC6_III/pitchL37/constant/RASProperties: -------------------------------------------------------------------------------- 1 | /*--------------------------------*- C++ -*----------------------------------*\ 2 | | ========= | | 3 | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | 4 | | \\ / O peration | Version: 3.0.x | 5 | | \\ / A nd | Web: www.OpenFOAM.org | 6 | | \\/ M anipulation | | 7 | \*---------------------------------------------------------------------------*/ 8 | FoamFile 9 | { 10 | version 2.0; 11 | format ascii; 12 | class dictionary; 13 | object RASProperties; 14 | } 15 | // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 16 | 17 | RASModel kEpsilon; 18 | 19 | turbulence on; 20 | 21 | printCoeffs on; 22 | 23 | // ************************************************************************* // 24 | -------------------------------------------------------------------------------- /cases/Chapter_6/OC6_III/pitchL37/constant/transportProperties: -------------------------------------------------------------------------------- 1 | /*--------------------------------*- C++ -*----------------------------------*\ 2 | | ========= | | 3 | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | 4 | | \\ / O peration | Version: 3.0.x | 5 | | \\ / A nd | Web: www.OpenFOAM.org | 6 | | \\/ M anipulation | | 7 | \*---------------------------------------------------------------------------*/ 8 | FoamFile 9 | { 10 | version 2.0; 11 | format ascii; 12 | class dictionary; 13 | object transportProperties; 14 | } 15 | // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 16 | 17 | transportModel Newtonian; 18 | 19 | nu nu [0 2 -1 0 0 0 0] 1.5e-5; 20 | 21 | // ************************************************************************* // 22 | -------------------------------------------------------------------------------- /cases/Chapter_6/OC6_III/pitchL37/constant/turbulenceProperties: -------------------------------------------------------------------------------- 1 | /*--------------------------------*- C++ -*----------------------------------*\ 2 | | ========= | | 3 | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | 4 | | \\ / O peration | Version: 3.0.x | 5 | | \\ / A nd | Web: www.OpenFOAM.org | 6 | | \\/ M anipulation | | 7 | \*---------------------------------------------------------------------------*/ 8 | FoamFile 9 | { 10 | version 2.0; 11 | format ascii; 12 | class dictionary; 13 | location "constant"; 14 | object turbulenceProperties; 15 | } 16 | // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 17 | 18 | simulationType RAS; 19 | 20 | RAS 21 | { 22 | #include "RASProperties" 23 | } 24 | 25 | // ************************************************************************* // 26 | -------------------------------------------------------------------------------- /cases/Chapter_6/OC6_III/pitchL37/parRun: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | 4 | # Source tutorial run functions 5 | . $WM_PROJECT_DIR/bin/tools/RunFunctions 6 | 7 | nProc=$(getNumberOfProcessors) 8 | 9 | #Decompose case again 10 | runApplication decomposePar 11 | 12 | # Renumber meshto get a more diagonal system 13 | renumber_application="mpirun --oversubscribe -np $nProc renumberMesh -overwrite -parallel" 14 | runApplication $renumber_application 15 | mv log.mpirun log.renumberMesh 16 | 17 | 18 | -------------------------------------------------------------------------------- /cases/Chapter_6/OC6_III/pitchL37/postRun: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Source tutorial run functions 4 | . $WM_PROJECT_DIR/bin/tools/RunFunctions 5 | 6 | # Recontruct case 7 | runApplication reconstructPar 8 | 9 | # Reconstruct logs 10 | runApplication foamLog log.pimpleFoam 11 | 12 | # Compute Q criteria 13 | runApplication postProcess -func Q 14 | 15 | #Extract turbine geometry 16 | ./ALgeometry.sh 17 | 18 | #Extract probes data 19 | cat postProcessing/alongwind/*/data_p.xy >> p_alongwind.dat 20 | cat postProcessing/alongwind/*/data_U.xy >> U_alongwind.dat 21 | cat postProcessing/crosswind/*/data_p.xy >> p_crosswind.dat 22 | cat postProcessing/crosswind/*/data_U.xy >> U_crosswind.dat 23 | 24 | cd postProcessing/crosswind/ 25 | find . -mindepth 1 -maxdepth 1 -name '*' -type d -printf '%f\n' | sort -n> times.dat 26 | mv times.dat ../../times.dat -------------------------------------------------------------------------------- /cases/Chapter_6/OC6_III/pitchL37/preRun: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Source tutorial run functions 4 | . $WM_PROJECT_DIR/bin/tools/RunFunctions 5 | 6 | # Get number of processors from decomposePar dict 7 | nProc=$(getNumberOfProcessors) 8 | 9 | restore0Dir 10 | 11 | #Run blockMesh 12 | runApplication blockMesh 13 | 14 | #Decompose mesh for snappyHex 15 | runApplication decomposePar 16 | 17 | #Run snappyMesh 18 | mesh_application="mpirun --oversubscribe -np $nProc snappyHexMesh -overwrite -parallel" 19 | runApplication $mesh_application 20 | mv log.mpirun log.snappyHexMesh 21 | #### runApplication snappyHexMesh -overwrite 22 | 23 | #Reconstruct mesh 24 | #This is needed, see https://www.cfd-online.com/Forums/openfoam-meshing/239688-cannot-find-patchfield-entry.html 25 | runApplication reconstructParMesh -mergeTol 1e-06 -latestTime -constant 26 | 27 | #Remove parallel files 28 | rm -rf processor* 29 | rm -rf log.decomposePar 30 | 31 | # Run topoSet 32 | runApplication topoSet 33 | 34 | # copy "points" file from 0/polyMesh to constant/polyMesh 35 | cp -fr 0/polyMesh/points constant/polyMesh/points -------------------------------------------------------------------------------- /cases/Chapter_6/OC6_III/pitchL37/runClean: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Source tutorial run functions 4 | . $WM_PROJECT_DIR/bin/tools/CleanFunctions 5 | 6 | cleanTimeDirectories 7 | rm -rf processor* -------------------------------------------------------------------------------- /cases/Chapter_6/OC6_III/pitchL37/solverRun: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | 4 | # Source tutorial run functions 5 | . $WM_PROJECT_DIR/bin/tools/RunFunctions 6 | 7 | nProc=$(getNumberOfProcessors) 8 | 9 | # Set solver name 10 | 11 | solver="mpirun --oversubscribe -np $nProc pimpleFoam -parallel" 12 | 13 | # Run the solver 14 | runApplication $solver 15 | mv log.mpirun log.pimpleFoam -------------------------------------------------------------------------------- /cases/Chapter_6/OC6_III/pitchL37/system/decomposeParDict: -------------------------------------------------------------------------------- 1 | /*--------------------------------*- C++ -*----------------------------------*\ 2 | | ========= | | 3 | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | 4 | | \\ / O peration | Version: 3.0.x | 5 | | \\ / A nd | Web: www.OpenFOAM.org | 6 | | \\/ M anipulation | | 7 | \*---------------------------------------------------------------------------*/ 8 | FoamFile 9 | { 10 | version 2.0; 11 | format ascii; 12 | class dictionary; 13 | object decomposeParDict; 14 | } 15 | 16 | // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 17 | 18 | numberOfSubdomains 20; 19 | 20 | method scotch; 21 | 22 | // ************************************************************************* // 23 | -------------------------------------------------------------------------------- /cases/Chapter_6/OC6_III/pitchL37/system/sampling: -------------------------------------------------------------------------------- 1 | // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 2 | // This file is used to define sampling options// 3 | // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 4 | 5 | crosswind 6 | { 7 | type sets; 8 | libs ("libsampling.so"); 9 | writeControl timeStep; 10 | outputInterval 250; 11 | interpolationScheme cellPoint; 12 | setFormat raw; 13 | sets 14 | ( 15 | data 16 | { 17 | type uniform; 18 | axis y; 19 | start (#calc "2.3*$D" #calc "-1.6*$D" $hub_h); 20 | end (#calc "2.3*$D" #calc "1.6*$D" $hub_h); 21 | nPoints 50; 22 | } 23 | ); 24 | fields (U p); 25 | } 26 | 27 | alongwind 28 | { 29 | type sets; 30 | libs ("libsampling.so"); 31 | writeControl timeStep; 32 | outputInterval 250; 33 | interpolationScheme cellPoint; 34 | setFormat raw; 35 | sets 36 | ( 37 | data 38 | { 39 | type uniform; 40 | axis x; 41 | start (#calc "0.9*$D" 0.9 $hub_h); 42 | end (#calc "2.3*$D" 0.9 $hub_h); 43 | nPoints 50; 44 | } 45 | ); 46 | fields (U p); 47 | } -------------------------------------------------------------------------------- /cases/Chapter_6/OC6_III/steadyL11a/0.orig/include/boundaryConditions: -------------------------------------------------------------------------------- 1 | /*--------------------------------*- C++ -*----------------------------------*\ 2 | | ========= | | 3 | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | 4 | | \\ / O peration | Version: 3.0.x | 5 | | \\ / A nd | Web: www.OpenFOAM.org | 6 | | \\/ M anipulation | | 7 | \*---------------------------------------------------------------------------*/ 8 | #include "$FOAM_CASE/myVars" //Include global variables 9 | 10 | flowVelocity ($Ux 0 0); 11 | pressure 0; 12 | turbulentKE #calc "1.5*pow($I*$Ux,2)" ; // 2% turbulence 13 | 14 | //https://www.cfd-online.com/Wiki/Turbulence_intensity 15 | //https://www.openfoam.com/documentation/guides/latest/doc/guide-turbulence-ras-k-epsilon.html 16 | //https://www.cfd-online.com/Wiki/Turbulence_free-stream_boundary_conditions 17 | 18 | turbulentEpsilon #calc "pow(0.09,0.75)*pow($turbulentKE,1.5)/$span"; // Was 2e-6 or 0.01; Guess ~ 0.09*k**(3/2)/l 19 | 20 | // ************************************************************************* // 21 | -------------------------------------------------------------------------------- /cases/Chapter_6/OC6_III/steadyL11a/0.orig/include/fixedInlet: -------------------------------------------------------------------------------- 1 | /*--------------------------------*- C++ -*----------------------------------*\ 2 | | ========= | | 3 | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | 4 | | \\ / O peration | Version: 3.0.x | 5 | | \\ / A nd | Web: www.OpenFOAM.org | 6 | | \\/ M anipulation | | 7 | \*---------------------------------------------------------------------------*/ 8 | 9 | inlet 10 | { 11 | type fixedValue; 12 | value $internalField; 13 | } 14 | 15 | // ************************************************************************* // 16 | -------------------------------------------------------------------------------- /cases/Chapter_6/OC6_III/steadyL11a/ALgeometry.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Source tutorial run functions 3 | . $WM_PROJECT_DIR/bin/tools/RunFunctions 4 | 5 | rm -rf turbineGeometry 6 | #rm log.foamListTimes 7 | runApplication foamListTimes 8 | 9 | region='turbine' 10 | components=('blade1' 'blade2' 'blade3' 'tower') 11 | 12 | python3.8 scripts/ALgeometry.py $region "${components[@]}" -------------------------------------------------------------------------------- /cases/Chapter_6/OC6_III/steadyL11a/allClean: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Source tutorial run functions 4 | . $WM_PROJECT_DIR/bin/tools/CleanFunctions 5 | 6 | cleanCase0 -------------------------------------------------------------------------------- /cases/Chapter_6/OC6_III/steadyL11a/constant/RASProperties: -------------------------------------------------------------------------------- 1 | /*--------------------------------*- C++ -*----------------------------------*\ 2 | | ========= | | 3 | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | 4 | | \\ / O peration | Version: 3.0.x | 5 | | \\ / A nd | Web: www.OpenFOAM.org | 6 | | \\/ M anipulation | | 7 | \*---------------------------------------------------------------------------*/ 8 | FoamFile 9 | { 10 | version 2.0; 11 | format ascii; 12 | class dictionary; 13 | object RASProperties; 14 | } 15 | // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 16 | 17 | RASModel kEpsilon; 18 | 19 | turbulence on; 20 | 21 | printCoeffs on; 22 | 23 | // ************************************************************************* // 24 | -------------------------------------------------------------------------------- /cases/Chapter_6/OC6_III/steadyL11a/constant/transportProperties: -------------------------------------------------------------------------------- 1 | /*--------------------------------*- C++ -*----------------------------------*\ 2 | | ========= | | 3 | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | 4 | | \\ / O peration | Version: 3.0.x | 5 | | \\ / A nd | Web: www.OpenFOAM.org | 6 | | \\/ M anipulation | | 7 | \*---------------------------------------------------------------------------*/ 8 | FoamFile 9 | { 10 | version 2.0; 11 | format ascii; 12 | class dictionary; 13 | object transportProperties; 14 | } 15 | // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 16 | 17 | transportModel Newtonian; 18 | 19 | nu nu [0 2 -1 0 0 0 0] 1.5e-5; 20 | 21 | // ************************************************************************* // 22 | -------------------------------------------------------------------------------- /cases/Chapter_6/OC6_III/steadyL11a/constant/turbulenceProperties: -------------------------------------------------------------------------------- 1 | /*--------------------------------*- C++ -*----------------------------------*\ 2 | | ========= | | 3 | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | 4 | | \\ / O peration | Version: 3.0.x | 5 | | \\ / A nd | Web: www.OpenFOAM.org | 6 | | \\/ M anipulation | | 7 | \*---------------------------------------------------------------------------*/ 8 | FoamFile 9 | { 10 | version 2.0; 11 | format ascii; 12 | class dictionary; 13 | location "constant"; 14 | object turbulenceProperties; 15 | } 16 | // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 17 | 18 | simulationType RAS; 19 | 20 | RAS 21 | { 22 | #include "RASProperties" 23 | } 24 | 25 | // ************************************************************************* // 26 | -------------------------------------------------------------------------------- /cases/Chapter_6/OC6_III/steadyL11a/parRun: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | 4 | # Source tutorial run functions 5 | . $WM_PROJECT_DIR/bin/tools/RunFunctions 6 | 7 | nProc=$(getNumberOfProcessors) 8 | 9 | #Decompose case again 10 | runApplication decomposePar 11 | 12 | # Renumber meshto get a more diagonal system 13 | renumber_application="mpirun --oversubscribe -np $nProc renumberMesh -overwrite -parallel" 14 | runApplication $renumber_application 15 | mv log.mpirun log.renumberMesh 16 | 17 | 18 | -------------------------------------------------------------------------------- /cases/Chapter_6/OC6_III/steadyL11a/postRun: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Source tutorial run functions 4 | . $WM_PROJECT_DIR/bin/tools/RunFunctions 5 | 6 | # Recontruct case 7 | runApplication reconstructPar 8 | 9 | # Reconstruct logs 10 | runApplication foamLog log.pimpleFoam 11 | 12 | # Compute Q criteria 13 | runApplication postProcess -func Q 14 | 15 | #Extract turbine geometry 16 | ./ALgeometry.sh 17 | 18 | #Extract probes data 19 | cat postProcessing/alongwind/*/data_p.xy >> p_alongwind.dat 20 | cat postProcessing/alongwind/*/data_U.xy >> U_alongwind.dat 21 | cat postProcessing/crosswind/*/data_p.xy >> p_crosswind.dat 22 | cat postProcessing/crosswind/*/data_U.xy >> U_crosswind.dat 23 | 24 | cd postProcessing/crosswind/ 25 | find . -mindepth 1 -maxdepth 1 -name '*' -type d -printf '%f\n' | sort -n> times.dat 26 | mv times.dat ../../times.dat -------------------------------------------------------------------------------- /cases/Chapter_6/OC6_III/steadyL11a/preRun: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Source tutorial run functions 4 | . $WM_PROJECT_DIR/bin/tools/RunFunctions 5 | 6 | # Get number of processors from decomposePar dict 7 | nProc=$(getNumberOfProcessors) 8 | 9 | restore0Dir 10 | 11 | #Run blockMesh 12 | runApplication blockMesh 13 | 14 | #Decompose mesh for snappyHex 15 | runApplication decomposePar 16 | 17 | #Run snappyMesh 18 | mesh_application="mpirun --oversubscribe -np $nProc snappyHexMesh -overwrite -parallel" 19 | runApplication $mesh_application 20 | mv log.mpirun log.snappyHexMesh 21 | #### runApplication snappyHexMesh -overwrite 22 | 23 | #Reconstruct mesh 24 | #This is needed, see https://www.cfd-online.com/Forums/openfoam-meshing/239688-cannot-find-patchfield-entry.html 25 | runApplication reconstructParMesh -mergeTol 1e-06 -latestTime -constant 26 | 27 | #Remove parallel files 28 | rm -rf processor* 29 | rm -rf log.decomposePar 30 | 31 | # Run topoSet 32 | runApplication topoSet 33 | 34 | # copy "points" file from 0/polyMesh to constant/polyMesh 35 | cp -fr 0/polyMesh/points constant/polyMesh/points -------------------------------------------------------------------------------- /cases/Chapter_6/OC6_III/steadyL11a/runClean: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Source tutorial run functions 4 | . $WM_PROJECT_DIR/bin/tools/CleanFunctions 5 | 6 | cleanTimeDirectories 7 | rm -rf processor* -------------------------------------------------------------------------------- /cases/Chapter_6/OC6_III/steadyL11a/solverRun: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | 4 | # Source tutorial run functions 5 | . $WM_PROJECT_DIR/bin/tools/RunFunctions 6 | 7 | nProc=$(getNumberOfProcessors) 8 | 9 | # Set solver name 10 | 11 | solver="mpirun --oversubscribe -np $nProc pimpleFoam -parallel" 12 | 13 | # Run the solver 14 | runApplication $solver 15 | mv log.mpirun log.pimpleFoam -------------------------------------------------------------------------------- /cases/Chapter_6/OC6_III/steadyL11a/system/decomposeParDict: -------------------------------------------------------------------------------- 1 | /*--------------------------------*- C++ -*----------------------------------*\ 2 | | ========= | | 3 | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | 4 | | \\ / O peration | Version: 3.0.x | 5 | | \\ / A nd | Web: www.OpenFOAM.org | 6 | | \\/ M anipulation | | 7 | \*---------------------------------------------------------------------------*/ 8 | FoamFile 9 | { 10 | version 2.0; 11 | format ascii; 12 | class dictionary; 13 | object decomposeParDict; 14 | } 15 | 16 | // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 17 | 18 | numberOfSubdomains 20; 19 | 20 | method scotch; 21 | 22 | // ************************************************************************* // 23 | -------------------------------------------------------------------------------- /cases/Chapter_6/OC6_III/steadyL11a/system/sampling: -------------------------------------------------------------------------------- 1 | // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 2 | // This file is used to define sampling options// 3 | // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 4 | 5 | crosswind 6 | { 7 | type sets; 8 | libs ("libsampling.so"); 9 | writeControl timeStep; 10 | outputInterval 250; 11 | interpolationScheme cellPoint; 12 | setFormat raw; 13 | sets 14 | ( 15 | data 16 | { 17 | type uniform; 18 | axis y; 19 | start (#calc "2.3*$D" #calc "-1.6*$D" $hub_h); 20 | end (#calc "2.3*$D" #calc "1.6*$D" $hub_h); 21 | nPoints 50; 22 | } 23 | ); 24 | fields (U p); 25 | } 26 | 27 | alongwind 28 | { 29 | type sets; 30 | libs ("libsampling.so"); 31 | writeControl timeStep; 32 | outputInterval 250; 33 | interpolationScheme cellPoint; 34 | setFormat raw; 35 | sets 36 | ( 37 | data 38 | { 39 | type uniform; 40 | axis x; 41 | start (#calc "0.9*$D" 0.9 $hub_h); 42 | end (#calc "2.3*$D" 0.9 $hub_h); 43 | nPoints 50; 44 | } 45 | ); 46 | fields (U p); 47 | } -------------------------------------------------------------------------------- /cases/Chapter_6/OC6_III/steadyL11b/0.orig/include/boundaryConditions: -------------------------------------------------------------------------------- 1 | /*--------------------------------*- C++ -*----------------------------------*\ 2 | | ========= | | 3 | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | 4 | | \\ / O peration | Version: 3.0.x | 5 | | \\ / A nd | Web: www.OpenFOAM.org | 6 | | \\/ M anipulation | | 7 | \*---------------------------------------------------------------------------*/ 8 | #include "$FOAM_CASE/myVars" //Include global variables 9 | 10 | flowVelocity ($Ux 0 0); 11 | pressure 0; 12 | turbulentKE #calc "1.5*pow($I*$Ux,2)" ; // 2% turbulence 13 | 14 | //https://www.cfd-online.com/Wiki/Turbulence_intensity 15 | //https://www.openfoam.com/documentation/guides/latest/doc/guide-turbulence-ras-k-epsilon.html 16 | //https://www.cfd-online.com/Wiki/Turbulence_free-stream_boundary_conditions 17 | 18 | turbulentEpsilon #calc "pow(0.09,0.75)*pow($turbulentKE,1.5)/$span"; // Was 2e-6 or 0.01; Guess ~ 0.09*k**(3/2)/l 19 | 20 | // ************************************************************************* // 21 | -------------------------------------------------------------------------------- /cases/Chapter_6/OC6_III/steadyL11b/0.orig/include/fixedInlet: -------------------------------------------------------------------------------- 1 | /*--------------------------------*- C++ -*----------------------------------*\ 2 | | ========= | | 3 | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | 4 | | \\ / O peration | Version: 3.0.x | 5 | | \\ / A nd | Web: www.OpenFOAM.org | 6 | | \\/ M anipulation | | 7 | \*---------------------------------------------------------------------------*/ 8 | 9 | inlet 10 | { 11 | type fixedValue; 12 | value $internalField; 13 | } 14 | 15 | // ************************************************************************* // 16 | -------------------------------------------------------------------------------- /cases/Chapter_6/OC6_III/steadyL11b/ALgeometry.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Source tutorial run functions 3 | . $WM_PROJECT_DIR/bin/tools/RunFunctions 4 | 5 | rm -rf turbineGeometry 6 | #rm log.foamListTimes 7 | runApplication foamListTimes 8 | 9 | region='turbine' 10 | components=('blade1' 'blade2' 'blade3' 'tower') 11 | 12 | python3.8 scripts/ALgeometry.py $region "${components[@]}" -------------------------------------------------------------------------------- /cases/Chapter_6/OC6_III/steadyL11b/allClean: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Source tutorial run functions 4 | . $WM_PROJECT_DIR/bin/tools/CleanFunctions 5 | 6 | cleanCase0 -------------------------------------------------------------------------------- /cases/Chapter_6/OC6_III/steadyL11b/constant/RASProperties: -------------------------------------------------------------------------------- 1 | /*--------------------------------*- C++ -*----------------------------------*\ 2 | | ========= | | 3 | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | 4 | | \\ / O peration | Version: 3.0.x | 5 | | \\ / A nd | Web: www.OpenFOAM.org | 6 | | \\/ M anipulation | | 7 | \*---------------------------------------------------------------------------*/ 8 | FoamFile 9 | { 10 | version 2.0; 11 | format ascii; 12 | class dictionary; 13 | object RASProperties; 14 | } 15 | // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 16 | 17 | RASModel kEpsilon; 18 | 19 | turbulence on; 20 | 21 | printCoeffs on; 22 | 23 | // ************************************************************************* // 24 | -------------------------------------------------------------------------------- /cases/Chapter_6/OC6_III/steadyL11b/constant/transportProperties: -------------------------------------------------------------------------------- 1 | /*--------------------------------*- C++ -*----------------------------------*\ 2 | | ========= | | 3 | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | 4 | | \\ / O peration | Version: 3.0.x | 5 | | \\ / A nd | Web: www.OpenFOAM.org | 6 | | \\/ M anipulation | | 7 | \*---------------------------------------------------------------------------*/ 8 | FoamFile 9 | { 10 | version 2.0; 11 | format ascii; 12 | class dictionary; 13 | object transportProperties; 14 | } 15 | // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 16 | 17 | transportModel Newtonian; 18 | 19 | nu nu [0 2 -1 0 0 0 0] 1.5e-5; 20 | 21 | // ************************************************************************* // 22 | -------------------------------------------------------------------------------- /cases/Chapter_6/OC6_III/steadyL11b/constant/turbulenceProperties: -------------------------------------------------------------------------------- 1 | /*--------------------------------*- C++ -*----------------------------------*\ 2 | | ========= | | 3 | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | 4 | | \\ / O peration | Version: 3.0.x | 5 | | \\ / A nd | Web: www.OpenFOAM.org | 6 | | \\/ M anipulation | | 7 | \*---------------------------------------------------------------------------*/ 8 | FoamFile 9 | { 10 | version 2.0; 11 | format ascii; 12 | class dictionary; 13 | location "constant"; 14 | object turbulenceProperties; 15 | } 16 | // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 17 | 18 | simulationType RAS; 19 | 20 | RAS 21 | { 22 | #include "RASProperties" 23 | } 24 | 25 | // ************************************************************************* // 26 | -------------------------------------------------------------------------------- /cases/Chapter_6/OC6_III/steadyL11b/parRun: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | 4 | # Source tutorial run functions 5 | . $WM_PROJECT_DIR/bin/tools/RunFunctions 6 | 7 | nProc=$(getNumberOfProcessors) 8 | 9 | #Decompose case again 10 | runApplication decomposePar 11 | 12 | # Renumber meshto get a more diagonal system 13 | renumber_application="mpirun --oversubscribe -np $nProc renumberMesh -overwrite -parallel" 14 | runApplication $renumber_application 15 | mv log.mpirun log.renumberMesh 16 | 17 | 18 | -------------------------------------------------------------------------------- /cases/Chapter_6/OC6_III/steadyL11b/postRun: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Source tutorial run functions 4 | . $WM_PROJECT_DIR/bin/tools/RunFunctions 5 | 6 | # Recontruct case 7 | runApplication reconstructPar 8 | 9 | # Reconstruct logs 10 | runApplication foamLog log.pimpleFoam 11 | 12 | # Compute Q criteria 13 | runApplication postProcess -func Q 14 | 15 | #Extract turbine geometry 16 | ./ALgeometry.sh 17 | 18 | #Extract probes data 19 | cat postProcessing/alongwind/*/data_p.xy >> p_alongwind.dat 20 | cat postProcessing/alongwind/*/data_U.xy >> U_alongwind.dat 21 | cat postProcessing/crosswind/*/data_p.xy >> p_crosswind.dat 22 | cat postProcessing/crosswind/*/data_U.xy >> U_crosswind.dat 23 | 24 | cd postProcessing/crosswind/ 25 | find . -mindepth 1 -maxdepth 1 -name '*' -type d -printf '%f\n' | sort -n> times.dat 26 | mv times.dat ../../times.dat -------------------------------------------------------------------------------- /cases/Chapter_6/OC6_III/steadyL11b/preRun: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Source tutorial run functions 4 | . $WM_PROJECT_DIR/bin/tools/RunFunctions 5 | 6 | # Get number of processors from decomposePar dict 7 | nProc=$(getNumberOfProcessors) 8 | 9 | restore0Dir 10 | 11 | #Run blockMesh 12 | runApplication blockMesh 13 | 14 | #Decompose mesh for snappyHex 15 | runApplication decomposePar 16 | 17 | #Run snappyMesh 18 | mesh_application="mpirun --oversubscribe -np $nProc snappyHexMesh -overwrite -parallel" 19 | runApplication $mesh_application 20 | mv log.mpirun log.snappyHexMesh 21 | #### runApplication snappyHexMesh -overwrite 22 | 23 | #Reconstruct mesh 24 | #This is needed, see https://www.cfd-online.com/Forums/openfoam-meshing/239688-cannot-find-patchfield-entry.html 25 | runApplication reconstructParMesh -mergeTol 1e-06 -latestTime -constant 26 | 27 | #Remove parallel files 28 | rm -rf processor* 29 | rm -rf log.decomposePar 30 | 31 | # Run topoSet 32 | runApplication topoSet 33 | 34 | # copy "points" file from 0/polyMesh to constant/polyMesh 35 | cp -fr 0/polyMesh/points constant/polyMesh/points -------------------------------------------------------------------------------- /cases/Chapter_6/OC6_III/steadyL11b/runClean: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Source tutorial run functions 4 | . $WM_PROJECT_DIR/bin/tools/CleanFunctions 5 | 6 | cleanTimeDirectories 7 | rm -rf processor* -------------------------------------------------------------------------------- /cases/Chapter_6/OC6_III/steadyL11b/solverRun: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | 4 | # Source tutorial run functions 5 | . $WM_PROJECT_DIR/bin/tools/RunFunctions 6 | 7 | nProc=$(getNumberOfProcessors) 8 | 9 | # Set solver name 10 | 11 | solver="mpirun --oversubscribe -np $nProc pimpleFoam -parallel" 12 | 13 | # Run the solver 14 | runApplication $solver 15 | mv log.mpirun log.pimpleFoam -------------------------------------------------------------------------------- /cases/Chapter_6/OC6_III/steadyL11b/system/decomposeParDict: -------------------------------------------------------------------------------- 1 | /*--------------------------------*- C++ -*----------------------------------*\ 2 | | ========= | | 3 | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | 4 | | \\ / O peration | Version: 3.0.x | 5 | | \\ / A nd | Web: www.OpenFOAM.org | 6 | | \\/ M anipulation | | 7 | \*---------------------------------------------------------------------------*/ 8 | FoamFile 9 | { 10 | version 2.0; 11 | format ascii; 12 | class dictionary; 13 | object decomposeParDict; 14 | } 15 | 16 | // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 17 | 18 | numberOfSubdomains 20; 19 | 20 | method scotch; 21 | 22 | // ************************************************************************* // 23 | -------------------------------------------------------------------------------- /cases/Chapter_6/OC6_III/steadyL11b/system/sampling: -------------------------------------------------------------------------------- 1 | // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 2 | // This file is used to define sampling options// 3 | // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 4 | 5 | crosswind 6 | { 7 | type sets; 8 | libs ("libsampling.so"); 9 | writeControl timeStep; 10 | outputInterval 250; 11 | interpolationScheme cellPoint; 12 | setFormat raw; 13 | sets 14 | ( 15 | data 16 | { 17 | type uniform; 18 | axis y; 19 | start (#calc "2.3*$D" #calc "-1.6*$D" $hub_h); 20 | end (#calc "2.3*$D" #calc "1.6*$D" $hub_h); 21 | nPoints 50; 22 | } 23 | ); 24 | fields (U p); 25 | } 26 | 27 | alongwind 28 | { 29 | type sets; 30 | libs ("libsampling.so"); 31 | writeControl timeStep; 32 | outputInterval 250; 33 | interpolationScheme cellPoint; 34 | setFormat raw; 35 | sets 36 | ( 37 | data 38 | { 39 | type uniform; 40 | axis x; 41 | start (#calc "0.9*$D" 0.9 $hub_h); 42 | end (#calc "2.3*$D" 0.9 $hub_h); 43 | nPoints 50; 44 | } 45 | ); 46 | fields (U p); 47 | } -------------------------------------------------------------------------------- /cases/Chapter_6/OC6_III/surgeL25/0.orig/include/boundaryConditions: -------------------------------------------------------------------------------- 1 | /*--------------------------------*- C++ -*----------------------------------*\ 2 | | ========= | | 3 | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | 4 | | \\ / O peration | Version: 3.0.x | 5 | | \\ / A nd | Web: www.OpenFOAM.org | 6 | | \\/ M anipulation | | 7 | \*---------------------------------------------------------------------------*/ 8 | #include "$FOAM_CASE/myVars" //Include global variables 9 | 10 | flowVelocity ($Ux 0 0); 11 | pressure 0; 12 | turbulentKE #calc "1.5*pow($I*$Ux,2)" ; // 2% turbulence 13 | 14 | //https://www.cfd-online.com/Wiki/Turbulence_intensity 15 | //https://www.openfoam.com/documentation/guides/latest/doc/guide-turbulence-ras-k-epsilon.html 16 | //https://www.cfd-online.com/Wiki/Turbulence_free-stream_boundary_conditions 17 | 18 | turbulentEpsilon #calc "pow(0.09,0.75)*pow($turbulentKE,1.5)/$span"; // Was 2e-6 or 0.01; Guess ~ 0.09*k**(3/2)/l 19 | 20 | // ************************************************************************* // 21 | -------------------------------------------------------------------------------- /cases/Chapter_6/OC6_III/surgeL25/0.orig/include/fixedInlet: -------------------------------------------------------------------------------- 1 | /*--------------------------------*- C++ -*----------------------------------*\ 2 | | ========= | | 3 | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | 4 | | \\ / O peration | Version: 3.0.x | 5 | | \\ / A nd | Web: www.OpenFOAM.org | 6 | | \\/ M anipulation | | 7 | \*---------------------------------------------------------------------------*/ 8 | 9 | inlet 10 | { 11 | type fixedValue; 12 | value $internalField; 13 | } 14 | 15 | // ************************************************************************* // 16 | -------------------------------------------------------------------------------- /cases/Chapter_6/OC6_III/surgeL25/ALgeometry.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Source tutorial run functions 3 | . $WM_PROJECT_DIR/bin/tools/RunFunctions 4 | 5 | rm -rf turbineGeometry 6 | #rm log.foamListTimes 7 | runApplication foamListTimes 8 | 9 | region='turbine' 10 | components=('blade1' 'blade2' 'blade3' 'tower') 11 | 12 | python3.8 scripts/ALgeometry.py $region "${components[@]}" -------------------------------------------------------------------------------- /cases/Chapter_6/OC6_III/surgeL25/allClean: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Source tutorial run functions 4 | . $WM_PROJECT_DIR/bin/tools/CleanFunctions 5 | 6 | cleanCase0 -------------------------------------------------------------------------------- /cases/Chapter_6/OC6_III/surgeL25/constant/RASProperties: -------------------------------------------------------------------------------- 1 | /*--------------------------------*- C++ -*----------------------------------*\ 2 | | ========= | | 3 | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | 4 | | \\ / O peration | Version: 3.0.x | 5 | | \\ / A nd | Web: www.OpenFOAM.org | 6 | | \\/ M anipulation | | 7 | \*---------------------------------------------------------------------------*/ 8 | FoamFile 9 | { 10 | version 2.0; 11 | format ascii; 12 | class dictionary; 13 | object RASProperties; 14 | } 15 | // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 16 | 17 | RASModel kEpsilon; 18 | 19 | turbulence on; 20 | 21 | printCoeffs on; 22 | 23 | // ************************************************************************* // 24 | -------------------------------------------------------------------------------- /cases/Chapter_6/OC6_III/surgeL25/constant/transportProperties: -------------------------------------------------------------------------------- 1 | /*--------------------------------*- C++ -*----------------------------------*\ 2 | | ========= | | 3 | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | 4 | | \\ / O peration | Version: 3.0.x | 5 | | \\ / A nd | Web: www.OpenFOAM.org | 6 | | \\/ M anipulation | | 7 | \*---------------------------------------------------------------------------*/ 8 | FoamFile 9 | { 10 | version 2.0; 11 | format ascii; 12 | class dictionary; 13 | object transportProperties; 14 | } 15 | // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 16 | 17 | transportModel Newtonian; 18 | 19 | nu nu [0 2 -1 0 0 0 0] 1.5e-5; 20 | 21 | // ************************************************************************* // 22 | -------------------------------------------------------------------------------- /cases/Chapter_6/OC6_III/surgeL25/constant/turbulenceProperties: -------------------------------------------------------------------------------- 1 | /*--------------------------------*- C++ -*----------------------------------*\ 2 | | ========= | | 3 | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | 4 | | \\ / O peration | Version: 3.0.x | 5 | | \\ / A nd | Web: www.OpenFOAM.org | 6 | | \\/ M anipulation | | 7 | \*---------------------------------------------------------------------------*/ 8 | FoamFile 9 | { 10 | version 2.0; 11 | format ascii; 12 | class dictionary; 13 | location "constant"; 14 | object turbulenceProperties; 15 | } 16 | // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 17 | 18 | simulationType RAS; 19 | 20 | RAS 21 | { 22 | #include "RASProperties" 23 | } 24 | 25 | // ************************************************************************* // 26 | -------------------------------------------------------------------------------- /cases/Chapter_6/OC6_III/surgeL25/parRun: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | 4 | # Source tutorial run functions 5 | . $WM_PROJECT_DIR/bin/tools/RunFunctions 6 | 7 | nProc=$(getNumberOfProcessors) 8 | 9 | #Decompose case again 10 | runApplication decomposePar 11 | 12 | # Renumber meshto get a more diagonal system 13 | renumber_application="mpirun --oversubscribe -np $nProc renumberMesh -overwrite -parallel" 14 | runApplication $renumber_application 15 | mv log.mpirun log.renumberMesh 16 | 17 | 18 | -------------------------------------------------------------------------------- /cases/Chapter_6/OC6_III/surgeL25/postRun: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Source tutorial run functions 4 | . $WM_PROJECT_DIR/bin/tools/RunFunctions 5 | 6 | # Recontruct case 7 | runApplication reconstructPar 8 | 9 | # Reconstruct logs 10 | runApplication foamLog log.pimpleFoam 11 | 12 | # Compute Q criteria 13 | runApplication postProcess -func Q 14 | 15 | #Extract turbine geometry 16 | ./ALgeometry.sh 17 | 18 | #Extract probes data 19 | cat postProcessing/alongwind/*/data_p.xy >> p_alongwind.dat 20 | cat postProcessing/alongwind/*/data_U.xy >> U_alongwind.dat 21 | cat postProcessing/crosswind/*/data_p.xy >> p_crosswind.dat 22 | cat postProcessing/crosswind/*/data_U.xy >> U_crosswind.dat 23 | 24 | cd postProcessing/crosswind/ 25 | find . -mindepth 1 -maxdepth 1 -name '*' -type d -printf '%f\n' | sort -n> times.dat 26 | mv times.dat ../../times.dat -------------------------------------------------------------------------------- /cases/Chapter_6/OC6_III/surgeL25/preRun: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Source tutorial run functions 4 | . $WM_PROJECT_DIR/bin/tools/RunFunctions 5 | 6 | # Get number of processors from decomposePar dict 7 | nProc=$(getNumberOfProcessors) 8 | 9 | restore0Dir 10 | 11 | #Run blockMesh 12 | runApplication blockMesh 13 | 14 | #Decompose mesh for snappyHex 15 | runApplication decomposePar 16 | 17 | #Run snappyMesh 18 | mesh_application="mpirun --oversubscribe -np $nProc snappyHexMesh -overwrite -parallel" 19 | runApplication $mesh_application 20 | mv log.mpirun log.snappyHexMesh 21 | #### runApplication snappyHexMesh -overwrite 22 | 23 | #Reconstruct mesh 24 | #This is needed, see https://www.cfd-online.com/Forums/openfoam-meshing/239688-cannot-find-patchfield-entry.html 25 | runApplication reconstructParMesh -mergeTol 1e-06 -latestTime -constant 26 | 27 | #Remove parallel files 28 | rm -rf processor* 29 | rm -rf log.decomposePar 30 | 31 | # Run topoSet 32 | runApplication topoSet 33 | 34 | # copy "points" file from 0/polyMesh to constant/polyMesh 35 | cp -fr 0/polyMesh/points constant/polyMesh/points -------------------------------------------------------------------------------- /cases/Chapter_6/OC6_III/surgeL25/runClean: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Source tutorial run functions 4 | . $WM_PROJECT_DIR/bin/tools/CleanFunctions 5 | 6 | cleanTimeDirectories 7 | rm -rf processor* -------------------------------------------------------------------------------- /cases/Chapter_6/OC6_III/surgeL25/solverRun: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | 4 | # Source tutorial run functions 5 | . $WM_PROJECT_DIR/bin/tools/RunFunctions 6 | 7 | nProc=$(getNumberOfProcessors) 8 | 9 | # Set solver name 10 | 11 | solver="mpirun --oversubscribe -np $nProc pimpleFoam -parallel" 12 | 13 | # Run the solver 14 | runApplication $solver 15 | mv log.mpirun log.pimpleFoam -------------------------------------------------------------------------------- /cases/Chapter_6/OC6_III/surgeL25/system/decomposeParDict: -------------------------------------------------------------------------------- 1 | /*--------------------------------*- C++ -*----------------------------------*\ 2 | | ========= | | 3 | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | 4 | | \\ / O peration | Version: 3.0.x | 5 | | \\ / A nd | Web: www.OpenFOAM.org | 6 | | \\/ M anipulation | | 7 | \*---------------------------------------------------------------------------*/ 8 | FoamFile 9 | { 10 | version 2.0; 11 | format ascii; 12 | class dictionary; 13 | object decomposeParDict; 14 | } 15 | 16 | // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 17 | 18 | numberOfSubdomains 20; 19 | 20 | method scotch; 21 | 22 | // ************************************************************************* // 23 | -------------------------------------------------------------------------------- /cases/Chapter_6/OC6_III/surgeL25/system/sampling: -------------------------------------------------------------------------------- 1 | // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 2 | // This file is used to define sampling options// 3 | // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 4 | 5 | crosswind 6 | { 7 | type sets; 8 | libs ("libsampling.so"); 9 | writeControl timeStep; 10 | outputInterval 250; 11 | interpolationScheme cellPoint; 12 | setFormat raw; 13 | sets 14 | ( 15 | data 16 | { 17 | type uniform; 18 | axis y; 19 | start (#calc "2.3*$D" #calc "-1.6*$D" $hub_h); 20 | end (#calc "2.3*$D" #calc "1.6*$D" $hub_h); 21 | nPoints 50; 22 | } 23 | ); 24 | fields (U p); 25 | } 26 | 27 | alongwind 28 | { 29 | type sets; 30 | libs ("libsampling.so"); 31 | writeControl timeStep; 32 | outputInterval 250; 33 | interpolationScheme cellPoint; 34 | setFormat raw; 35 | sets 36 | ( 37 | data 38 | { 39 | type uniform; 40 | axis x; 41 | start (#calc "0.9*$D" 0.9 $hub_h); 42 | end (#calc "2.3*$D" 0.9 $hub_h); 43 | nPoints 50; 44 | } 45 | ); 46 | fields (U p); 47 | } -------------------------------------------------------------------------------- /cases/Chapter_6/OC6_III/surgeL27/0.orig/include/boundaryConditions: -------------------------------------------------------------------------------- 1 | /*--------------------------------*- C++ -*----------------------------------*\ 2 | | ========= | | 3 | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | 4 | | \\ / O peration | Version: 3.0.x | 5 | | \\ / A nd | Web: www.OpenFOAM.org | 6 | | \\/ M anipulation | | 7 | \*---------------------------------------------------------------------------*/ 8 | #include "$FOAM_CASE/myVars" //Include global variables 9 | 10 | flowVelocity ($Ux 0 0); 11 | pressure 0; 12 | turbulentKE #calc "1.5*pow($I*$Ux,2)" ; // 2% turbulence 13 | 14 | //https://www.cfd-online.com/Wiki/Turbulence_intensity 15 | //https://www.openfoam.com/documentation/guides/latest/doc/guide-turbulence-ras-k-epsilon.html 16 | //https://www.cfd-online.com/Wiki/Turbulence_free-stream_boundary_conditions 17 | 18 | turbulentEpsilon #calc "pow(0.09,0.75)*pow($turbulentKE,1.5)/$span"; // Was 2e-6 or 0.01; Guess ~ 0.09*k**(3/2)/l 19 | 20 | // ************************************************************************* // 21 | -------------------------------------------------------------------------------- /cases/Chapter_6/OC6_III/surgeL27/0.orig/include/fixedInlet: -------------------------------------------------------------------------------- 1 | /*--------------------------------*- C++ -*----------------------------------*\ 2 | | ========= | | 3 | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | 4 | | \\ / O peration | Version: 3.0.x | 5 | | \\ / A nd | Web: www.OpenFOAM.org | 6 | | \\/ M anipulation | | 7 | \*---------------------------------------------------------------------------*/ 8 | 9 | inlet 10 | { 11 | type fixedValue; 12 | value $internalField; 13 | } 14 | 15 | // ************************************************************************* // 16 | -------------------------------------------------------------------------------- /cases/Chapter_6/OC6_III/surgeL27/ALgeometry.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Source tutorial run functions 3 | . $WM_PROJECT_DIR/bin/tools/RunFunctions 4 | 5 | rm -rf turbineGeometry 6 | #rm log.foamListTimes 7 | runApplication foamListTimes 8 | 9 | region='turbine' 10 | components=('blade1' 'blade2' 'blade3' 'tower') 11 | 12 | python3.8 scripts/ALgeometry.py $region "${components[@]}" -------------------------------------------------------------------------------- /cases/Chapter_6/OC6_III/surgeL27/allClean: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Source tutorial run functions 4 | . $WM_PROJECT_DIR/bin/tools/CleanFunctions 5 | 6 | cleanCase0 -------------------------------------------------------------------------------- /cases/Chapter_6/OC6_III/surgeL27/constant/RASProperties: -------------------------------------------------------------------------------- 1 | /*--------------------------------*- C++ -*----------------------------------*\ 2 | | ========= | | 3 | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | 4 | | \\ / O peration | Version: 3.0.x | 5 | | \\ / A nd | Web: www.OpenFOAM.org | 6 | | \\/ M anipulation | | 7 | \*---------------------------------------------------------------------------*/ 8 | FoamFile 9 | { 10 | version 2.0; 11 | format ascii; 12 | class dictionary; 13 | object RASProperties; 14 | } 15 | // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 16 | 17 | RASModel kEpsilon; 18 | 19 | turbulence on; 20 | 21 | printCoeffs on; 22 | 23 | // ************************************************************************* // 24 | -------------------------------------------------------------------------------- /cases/Chapter_6/OC6_III/surgeL27/constant/transportProperties: -------------------------------------------------------------------------------- 1 | /*--------------------------------*- C++ -*----------------------------------*\ 2 | | ========= | | 3 | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | 4 | | \\ / O peration | Version: 3.0.x | 5 | | \\ / A nd | Web: www.OpenFOAM.org | 6 | | \\/ M anipulation | | 7 | \*---------------------------------------------------------------------------*/ 8 | FoamFile 9 | { 10 | version 2.0; 11 | format ascii; 12 | class dictionary; 13 | object transportProperties; 14 | } 15 | // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 16 | 17 | transportModel Newtonian; 18 | 19 | nu nu [0 2 -1 0 0 0 0] 1.5e-5; 20 | 21 | // ************************************************************************* // 22 | -------------------------------------------------------------------------------- /cases/Chapter_6/OC6_III/surgeL27/constant/turbulenceProperties: -------------------------------------------------------------------------------- 1 | /*--------------------------------*- C++ -*----------------------------------*\ 2 | | ========= | | 3 | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | 4 | | \\ / O peration | Version: 3.0.x | 5 | | \\ / A nd | Web: www.OpenFOAM.org | 6 | | \\/ M anipulation | | 7 | \*---------------------------------------------------------------------------*/ 8 | FoamFile 9 | { 10 | version 2.0; 11 | format ascii; 12 | class dictionary; 13 | location "constant"; 14 | object turbulenceProperties; 15 | } 16 | // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 17 | 18 | simulationType RAS; 19 | 20 | RAS 21 | { 22 | #include "RASProperties" 23 | } 24 | 25 | // ************************************************************************* // 26 | -------------------------------------------------------------------------------- /cases/Chapter_6/OC6_III/surgeL27/parRun: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | 4 | # Source tutorial run functions 5 | . $WM_PROJECT_DIR/bin/tools/RunFunctions 6 | 7 | nProc=$(getNumberOfProcessors) 8 | 9 | #Decompose case again 10 | runApplication decomposePar 11 | 12 | # Renumber meshto get a more diagonal system 13 | renumber_application="mpirun --oversubscribe -np $nProc renumberMesh -overwrite -parallel" 14 | runApplication $renumber_application 15 | mv log.mpirun log.renumberMesh 16 | 17 | 18 | -------------------------------------------------------------------------------- /cases/Chapter_6/OC6_III/surgeL27/postRun: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Source tutorial run functions 4 | . $WM_PROJECT_DIR/bin/tools/RunFunctions 5 | 6 | # Recontruct case 7 | runApplication reconstructPar 8 | 9 | # Reconstruct logs 10 | runApplication foamLog log.pimpleFoam 11 | 12 | # Compute Q criteria 13 | runApplication postProcess -func Q 14 | 15 | #Extract turbine geometry 16 | ./ALgeometry.sh 17 | 18 | #Extract probes data 19 | cat postProcessing/alongwind/*/data_p.xy >> p_alongwind.dat 20 | cat postProcessing/alongwind/*/data_U.xy >> U_alongwind.dat 21 | cat postProcessing/crosswind/*/data_p.xy >> p_crosswind.dat 22 | cat postProcessing/crosswind/*/data_U.xy >> U_crosswind.dat 23 | 24 | cd postProcessing/crosswind/ 25 | find . -mindepth 1 -maxdepth 1 -name '*' -type d -printf '%f\n' | sort -n> times.dat 26 | mv times.dat ../../times.dat -------------------------------------------------------------------------------- /cases/Chapter_6/OC6_III/surgeL27/preRun: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Source tutorial run functions 4 | . $WM_PROJECT_DIR/bin/tools/RunFunctions 5 | 6 | # Get number of processors from decomposePar dict 7 | nProc=$(getNumberOfProcessors) 8 | 9 | restore0Dir 10 | 11 | #Run blockMesh 12 | runApplication blockMesh 13 | 14 | #Decompose mesh for snappyHex 15 | runApplication decomposePar 16 | 17 | #Run snappyMesh 18 | mesh_application="mpirun --oversubscribe -np $nProc snappyHexMesh -overwrite -parallel" 19 | runApplication $mesh_application 20 | mv log.mpirun log.snappyHexMesh 21 | #### runApplication snappyHexMesh -overwrite 22 | 23 | #Reconstruct mesh 24 | #This is needed, see https://www.cfd-online.com/Forums/openfoam-meshing/239688-cannot-find-patchfield-entry.html 25 | runApplication reconstructParMesh -mergeTol 1e-06 -latestTime -constant 26 | 27 | #Remove parallel files 28 | rm -rf processor* 29 | rm -rf log.decomposePar 30 | 31 | # Run topoSet 32 | runApplication topoSet 33 | 34 | # copy "points" file from 0/polyMesh to constant/polyMesh 35 | cp -fr 0/polyMesh/points constant/polyMesh/points -------------------------------------------------------------------------------- /cases/Chapter_6/OC6_III/surgeL27/runClean: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Source tutorial run functions 4 | . $WM_PROJECT_DIR/bin/tools/CleanFunctions 5 | 6 | cleanTimeDirectories 7 | rm -rf processor* -------------------------------------------------------------------------------- /cases/Chapter_6/OC6_III/surgeL27/solverRun: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | 4 | # Source tutorial run functions 5 | . $WM_PROJECT_DIR/bin/tools/RunFunctions 6 | 7 | nProc=$(getNumberOfProcessors) 8 | 9 | # Set solver name 10 | 11 | solver="mpirun --oversubscribe -np $nProc pimpleFoam -parallel" 12 | 13 | # Run the solver 14 | runApplication $solver 15 | mv log.mpirun log.pimpleFoam -------------------------------------------------------------------------------- /cases/Chapter_6/OC6_III/surgeL27/system/decomposeParDict: -------------------------------------------------------------------------------- 1 | /*--------------------------------*- C++ -*----------------------------------*\ 2 | | ========= | | 3 | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | 4 | | \\ / O peration | Version: 3.0.x | 5 | | \\ / A nd | Web: www.OpenFOAM.org | 6 | | \\/ M anipulation | | 7 | \*---------------------------------------------------------------------------*/ 8 | FoamFile 9 | { 10 | version 2.0; 11 | format ascii; 12 | class dictionary; 13 | object decomposeParDict; 14 | } 15 | 16 | // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 17 | 18 | numberOfSubdomains 20; 19 | 20 | method scotch; 21 | 22 | // ************************************************************************* // 23 | -------------------------------------------------------------------------------- /cases/Chapter_6/OC6_III/surgeL27/system/sampling: -------------------------------------------------------------------------------- 1 | // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 2 | // This file is used to define sampling options// 3 | // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 4 | 5 | crosswind 6 | { 7 | type sets; 8 | libs ("libsampling.so"); 9 | writeControl timeStep; 10 | outputInterval 250; 11 | interpolationScheme cellPoint; 12 | setFormat raw; 13 | sets 14 | ( 15 | data 16 | { 17 | type uniform; 18 | axis y; 19 | start (#calc "2.3*$D" #calc "-1.6*$D" $hub_h); 20 | end (#calc "2.3*$D" #calc "1.6*$D" $hub_h); 21 | nPoints 50; 22 | } 23 | ); 24 | fields (U p); 25 | } 26 | 27 | alongwind 28 | { 29 | type sets; 30 | libs ("libsampling.so"); 31 | writeControl timeStep; 32 | outputInterval 250; 33 | interpolationScheme cellPoint; 34 | setFormat raw; 35 | sets 36 | ( 37 | data 38 | { 39 | type uniform; 40 | axis x; 41 | start (#calc "0.9*$D" 0.9 $hub_h); 42 | end (#calc "2.3*$D" 0.9 $hub_h); 43 | nPoints 50; 44 | } 45 | ); 46 | fields (U p); 47 | } -------------------------------------------------------------------------------- /cases/Chapter_7/coupled/0.orig/alpha.water: -------------------------------------------------------------------------------- 1 | /*--------------------------------*- C++ -*----------------------------------*\ 2 | | ========= | | 3 | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | 4 | | \\ / O peration | Version: v2012 | 5 | | \\ / A nd | Website: www.openfoam.com | 6 | | \\/ M anipulation | | 7 | \*---------------------------------------------------------------------------*/ 8 | FoamFile 9 | { 10 | version 2.0; 11 | format ascii; 12 | class volScalarField; 13 | location "0"; 14 | object alpha.water; 15 | } 16 | // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 17 | 18 | dimensions [0 0 0 0 0 0 0]; 19 | 20 | internalField uniform 0; 21 | 22 | boundaryField 23 | { 24 | "(inlet|outlet|walls|floater|atmosphere)" 25 | { 26 | type zeroGradient; 27 | } 28 | } 29 | 30 | 31 | // ************************************************************************* // 32 | -------------------------------------------------------------------------------- /cases/Chapter_7/coupled/0.orig/include/boundaryConditions: -------------------------------------------------------------------------------- 1 | /*--------------------------------*- C++ -*----------------------------------*\ 2 | | ========= | | 3 | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | 4 | | \\ / O peration | Version: 3.0.x | 5 | | \\ / A nd | Web: www.OpenFOAM.org | 6 | | \\/ M anipulation | | 7 | \*---------------------------------------------------------------------------*/ 8 | #include "$FOAM_CASE/myVars" //Include global variables 9 | 10 | turbulentKE #calc "1.5*pow($I*$Ux,2)" ; // 2% turbulence 11 | 12 | //https://www.cfd-online.com/Wiki/Turbulence_intensity 13 | //https://www.openfoam.com/documentation/guides/latest/doc/guide-turbulence-ras-k-epsilon.html 14 | //https://www.cfd-online.com/Wiki/Turbulence_free-stream_boundary_conditions 15 | 16 | turbulentOmega #calc "sqrt($turbulentKE)/(pow(0.09,0.25)*$chord)"; // Specific dissipation rate, https://www.openfoam.com/documentation/guides/latest/doc/guide-turbulence-ras-k-omega-sst.html 17 | 18 | // ************************************************************************* // 19 | -------------------------------------------------------------------------------- /cases/Chapter_7/coupled/0.orig/nut: -------------------------------------------------------------------------------- 1 | /*--------------------------------*- C++ -*----------------------------------*\ 2 | | ========= | | 3 | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | 4 | | \\ / O peration | Version: v1606+ | 5 | | \\ / A nd | Web: www.OpenFOAM.com | 6 | | \\/ M anipulation | | 7 | \*---------------------------------------------------------------------------*/ 8 | FoamFile 9 | { 10 | version 2.0; 11 | format ascii; 12 | class volScalarField; 13 | location "0"; 14 | object nut; 15 | } 16 | // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 17 | 18 | dimensions [0 2 -1 0 0 0 0]; 19 | 20 | internalField uniform 0; 21 | 22 | boundaryField 23 | { 24 | "(inlet|outlet|walls|atmosphere)" 25 | { 26 | type calculated; 27 | value uniform 0; 28 | } 29 | 30 | floater 31 | { 32 | type nutkWallFunction; 33 | value uniform 0; 34 | } 35 | } 36 | 37 | 38 | // ************************************************************************* // 39 | -------------------------------------------------------------------------------- /cases/Chapter_7/coupled/0.orig/pointDisplacement: -------------------------------------------------------------------------------- 1 | /*--------------------------------*- C++ -*----------------------------------*\ 2 | | ========= | | 3 | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | 4 | | \\ / O peration | Version: v2012 | 5 | | \\ / A nd | Website: www.openfoam.com | 6 | | \\/ M anipulation | | 7 | \*---------------------------------------------------------------------------*/ 8 | FoamFile 9 | { 10 | version 2.0; 11 | format ascii; 12 | class pointVectorField; 13 | object pointDisplacement; 14 | } 15 | // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 16 | 17 | dimensions [0 1 0 0 0 0 0]; 18 | 19 | internalField uniform (0 0 0); 20 | 21 | boundaryField 22 | { 23 | #includeEtc "caseDicts/setConstraintTypes" 24 | 25 | "(inlet|outlet|walls|atmosphere)" 26 | { 27 | type fixedValue; 28 | value $internalField; 29 | } 30 | 31 | floater 32 | { 33 | type calculated; 34 | value $internalField; 35 | } 36 | 37 | } 38 | -------------------------------------------------------------------------------- /cases/Chapter_7/coupled/ALgeometry.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Source tutorial run functions 3 | . $WM_PROJECT_DIR/bin/tools/RunFunctions 4 | 5 | rm -rf turbineGeometry 6 | #rm log.foamListTimes 7 | runApplication foamListTimes 8 | 9 | region='turbine' 10 | components=('blade1' 'blade2' 'blade3' 'tower') 11 | 12 | python3.8 scripts/ALgeometry.py $region "${components[@]}" -------------------------------------------------------------------------------- /cases/Chapter_7/coupled/allClean: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Source tutorial run functions 4 | . $WM_PROJECT_DIR/bin/tools/CleanFunctions 5 | 6 | cleanCase0 -------------------------------------------------------------------------------- /cases/Chapter_7/coupled/coExtract.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | file=log.mpirun 4 | printf 'Time \t Delta t \t Co \t ICo \n' > Co.dat 5 | my_output="$(awk '/Courant Number/{Co=$6;getline;ICo=$7;getline;DTIME=$3;getline;TIME=$3;printf("%8.6f\t%8.6f\t%8.6f\t%8.6f\n",TIME,DTIME,Co,ICo);}' $file)" 6 | echo "$my_output" >> Co.dat -------------------------------------------------------------------------------- /cases/Chapter_7/coupled/constant/g: -------------------------------------------------------------------------------- 1 | /*--------------------------------*- C++ -*----------------------------------*\ 2 | | ========= | | 3 | | \\ / F ield | OpenFOAM Extend Project: Open Source CFD | 4 | | \\ / O peration | Version: 1.6-ext | 5 | | \\ / A nd | Web: www.extend-project.de | 6 | | \\/ M anipulation | | 7 | \*---------------------------------------------------------------------------*/ 8 | FoamFile 9 | { 10 | version 2.0; 11 | format ascii; 12 | class uniformDimensionedVectorField; 13 | location "constant"; 14 | object g; 15 | } 16 | // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 17 | 18 | dimensions [0 1 -2 0 0 0 0]; 19 | value ( 0 0 -9.81 ); 20 | 21 | // ************************************************************************* // 22 | -------------------------------------------------------------------------------- /cases/Chapter_7/coupled/constant/triSurface/floater.stl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fronterapp/thesis-FloatingTurbine/91ffae684f91fadf26a41b7d463cff478242c7e8/cases/Chapter_7/coupled/constant/triSurface/floater.stl -------------------------------------------------------------------------------- /cases/Chapter_7/coupled/constant/turbulenceProperties: -------------------------------------------------------------------------------- 1 | /*--------------------------------*- C++ -*----------------------------------*\ 2 | | ========= | | 3 | | \\ / F ield | OpenFOAM Extend Project: Open Source CFD | 4 | | \\ / O peration | Version: 1.6-ext | 5 | | \\ / A nd | Web: www.extend-project.de | 6 | | \\/ M anipulation | | 7 | \*---------------------------------------------------------------------------*/ 8 | FoamFile 9 | { 10 | version 2.0; 11 | format ascii; 12 | class dictionary; 13 | location "constant"; 14 | object turbulenceProperties; 15 | } 16 | // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 17 | 18 | simulationType RAS; //laminar; 19 | 20 | RAS 21 | { 22 | RASModel kOmegaSST; 23 | turbulence on; 24 | printCoeffs on; 25 | } 26 | 27 | // ************************************************************************* // 28 | 29 | -------------------------------------------------------------------------------- /cases/Chapter_7/coupled/moorExtract.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | ## FILE TO READ 4 | file=log.waveDyMFoam 5 | 6 | ## CREATE HEADER, WRITE IT ON 'RB_DATA.dat' 7 | printf 'Time \t F1x \t F1y \t F1z \t F2x \t F2y \t F2z \t F3x \t F3y \t F3z \n' > MOORING_DATA.dat 8 | 9 | ## SEARCH FOR THE DESIRED KEYWORDS 10 | ## SAVE THE DATA ON 'my_output' 11 | my_output="$(awk ' 12 | /Time/{TIME=$3; next} 13 | /Restraint catenaryLine1/{F1x=$6; F1y=$7; F1z=$8; next} 14 | /Restraint catenaryLine2/{F2x=$6; F2y=$7; F2z=$8; next} 15 | /Restraint catenaryLine3/{F3x=$6; F3y=$7; F3z=$8; 16 | printf("%8.6f\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\n", 17 | TIME,F1x,F1y,F1z,F2x,F2y,F2z,F3x,F3y,F3z);}' $file)" 18 | 19 | ## PRINT 'my_output' 20 | echo "$my_output" >> temp.dat 21 | 22 | ## REMOVE PARENTHESES FROM 'my_output' 23 | sed -e 's/(//g' -e 's/)//g' temp.dat >> MOORING_DATA.dat 24 | rm temp.dat -------------------------------------------------------------------------------- /cases/Chapter_7/coupled/parRun: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | 4 | # Source tutorial run functions 5 | . $WM_PROJECT_DIR/bin/tools/RunFunctions 6 | 7 | 8 | # Use the correct decomposeParDict 9 | rm ./system/decomposeParDict 10 | cp ./system/decomposeParDict_solver ./system/decomposeParDict 11 | 12 | nProc=$(getNumberOfProcessors) 13 | 14 | #Decompose case again 15 | runApplication decomposePar 16 | 17 | # Renumber meshto get a more diagonal system 18 | renumber_application="mpirun --oversubscribe -np $nProc renumberMesh -overwrite -parallel" 19 | runApplication $renumber_application 20 | mv log.mpirun log.renumberMesh 21 | 22 | 23 | -------------------------------------------------------------------------------- /cases/Chapter_7/coupled/postRun: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Source tutorial run functions 4 | . $WM_PROJECT_DIR/bin/tools/RunFunctions 5 | 6 | # Recontruct case 7 | runApplication reconstructPar 8 | 9 | # Reconstruct logs 10 | runApplication foamLog log.waveDyMFoam 11 | 12 | # Compute Q criteria 13 | runApplication postProcess -func Q 14 | # Compute vorticity 15 | runApplication postProcess -func vorticity 16 | 17 | #Extract rigid body data 18 | ./RBextract.sh 19 | 20 | #Extract turbine geometry 21 | #./ALgeometry.sh 22 | 23 | #Extract probes data 24 | #cat postProcessing/alongwind/*/data_p.xy >> p_alongwind.dat 25 | #cat postProcessing/alongwind/*/data_U.xy >> U_alongwind.dat 26 | #cat postProcessing/crosswind/*/data_p.xy >> p_crosswind.dat 27 | #cat postProcessing/crosswind/*/data_U.xy >> U_crosswind.dat 28 | 29 | #cd postProcessing/crosswind/ 30 | #find . -mindepth 1 -maxdepth 1 -name '*' -type d -printf '%f\n' | sort -n> times.dat 31 | #mv times.dat ../../times.dat -------------------------------------------------------------------------------- /cases/Chapter_7/coupled/runClean: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Source tutorial run functions 4 | . $WM_PROJECT_DIR/bin/tools/CleanFunctions 5 | 6 | cleanTimeDirectories 7 | rm -rf processor* -------------------------------------------------------------------------------- /cases/Chapter_7/coupled/solverRun: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | 4 | # Source tutorial run functions 5 | . $WM_PROJECT_DIR/bin/tools/RunFunctions 6 | 7 | nProc=$(getNumberOfProcessors) 8 | 9 | # Set solver name 10 | 11 | solver="mpirun --oversubscribe -np $nProc waveDyMFoam -parallel" 12 | 13 | # Run the solver 14 | runApplication $solver 15 | mv log.mpirun log.waveDyMFoam -------------------------------------------------------------------------------- /cases/Chapter_7/coupled/system/decomposeParDict: -------------------------------------------------------------------------------- 1 | /*--------------------------------*- C++ -*----------------------------------*\ 2 | | ========= | | 3 | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | 4 | | \\ / O peration | Version: v2012 | 5 | | \\ / A nd | Website: www.openfoam.com | 6 | | \\/ M anipulation | | 7 | \*---------------------------------------------------------------------------*/ 8 | FoamFile 9 | { 10 | version 2.0; 11 | format ascii; 12 | class dictionary; 13 | object decomposeParDict; 14 | } 15 | // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 16 | 17 | numberOfSubdomains 20; // number of CPUs 18 | 19 | method scotch; 20 | 21 | // ************************************************************************* // 22 | -------------------------------------------------------------------------------- /cases/Chapter_7/coupled/system/decomposeParDict_pre: -------------------------------------------------------------------------------- 1 | /*--------------------------------*- C++ -*----------------------------------*\ 2 | | ========= | | 3 | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | 4 | | \\ / O peration | Version: v2012 | 5 | | \\ / A nd | Website: www.openfoam.com | 6 | | \\/ M anipulation | | 7 | \*---------------------------------------------------------------------------*/ 8 | FoamFile 9 | { 10 | version 2.0; 11 | format ascii; 12 | class dictionary; 13 | object decomposeParDict; 14 | } 15 | // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 16 | 17 | numberOfSubdomains 20; // number of CPUs 18 | 19 | method scotch; 20 | 21 | // ************************************************************************* // 22 | -------------------------------------------------------------------------------- /cases/Chapter_7/coupled/system/decomposeParDict_solver: -------------------------------------------------------------------------------- 1 | /*--------------------------------*- C++ -*----------------------------------*\ 2 | | ========= | | 3 | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | 4 | | \\ / O peration | Version: v2012 | 5 | | \\ / A nd | Website: www.openfoam.com | 6 | | \\/ M anipulation | | 7 | \*---------------------------------------------------------------------------*/ 8 | FoamFile 9 | { 10 | version 2.0; 11 | format ascii; 12 | class dictionary; 13 | object decomposeParDict; 14 | } 15 | // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 16 | 17 | numberOfSubdomains 256; // number of CPUs 18 | 19 | method scotch; 20 | 21 | // ************************************************************************* // 22 | -------------------------------------------------------------------------------- /cases/Chapter_7/coupled/system/elementData: -------------------------------------------------------------------------------- 1 | // Blade element data 2 | // Divides the blade into N stations. Two stations define a span section (N-1 span sections). 3 | // An integer number of actuator elements will be defined along each span section. 4 | // 18 nodes (17 elements) for the NREL 15-MW RWT 5 | // axialDistance[m], radius[m], azimuth, chord[m], chordMount[%], twist[deg] 6 | (0.000 1.5000 0.000 3.3860 0.250 13.3080) 7 | (0.000 4.2333 0.000 3.6980 0.250 13.3080) 8 | (0.000 6.9667 0.000 4.0105 0.250 13.3080) 9 | (0.000 9.7000 0.000 4.3230 0.250 13.3080) 10 | (0.000 13.8000 0.000 4.6045 0.250 12.3940) 11 | (0.000 17.9000 0.000 4.5550 0.250 10.8210) 12 | (0.000 22.0000 0.000 4.3535 0.250 9.5865) 13 | (0.000 26.1000 0.000 4.1280 0.250 8.4030) 14 | (0.000 30.2000 0.000 3.8775 0.250 7.1695) 15 | (0.000 34.3000 0.000 3.6250 0.250 5.9525) 16 | (0.000 38.4000 0.000 3.3790 0.250 4.7745) 17 | (0.000 42.5000 0.000 3.1330 0.250 3.6565) 18 | (0.000 46.6000 0.000 2.8870 0.250 2.7220) 19 | (0.000 50.7000 0.000 2.6410 0.250 1.9225) 20 | (0.000 54.8000 0.000 2.3950 0.250 1.1282) 21 | (0.000 57.5333 0.000 2.1995 0.250 0.6165) 22 | (0.000 60.2667 0.000 1.7525 0.250 0.2380) 23 | (0.000 63.0000 0.000 1.0855 0.250 -0.0260) -------------------------------------------------------------------------------- /cases/Chapter_7/coupled/system/sampling: -------------------------------------------------------------------------------- 1 | // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 2 | // This file is used to define sampling options// 3 | // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 4 | 5 | crosswind 6 | { 7 | type sets; 8 | libs ("libsampling.so"); 9 | writeControl timeStep; 10 | outputInterval 250; 11 | interpolationScheme cellPoint; 12 | setFormat raw; 13 | sets 14 | ( 15 | data 16 | { 17 | type uniform; 18 | axis y; 19 | start (#calc "$hub_x + $D" #calc "-1.5*$D" $hub_h); 20 | end (#calc "$hub_x + $D" #calc "1.5*$D" $hub_h); 21 | nPoints 50; 22 | } 23 | ); 24 | fields (U p); 25 | } -------------------------------------------------------------------------------- /cases/Chapter_7/floater.FCStd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fronterapp/thesis-FloatingTurbine/91ffae684f91fadf26a41b7d463cff478242c7e8/cases/Chapter_7/floater.FCStd -------------------------------------------------------------------------------- /cases/Chapter_7/floater_only/no_pitch0/0.orig/alpha.water: -------------------------------------------------------------------------------- 1 | /*--------------------------------*- C++ -*----------------------------------*\ 2 | | ========= | | 3 | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | 4 | | \\ / O peration | Version: v2012 | 5 | | \\ / A nd | Website: www.openfoam.com | 6 | | \\/ M anipulation | | 7 | \*---------------------------------------------------------------------------*/ 8 | FoamFile 9 | { 10 | version 2.0; 11 | format ascii; 12 | class volScalarField; 13 | location "0"; 14 | object alpha.water; 15 | } 16 | // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 17 | 18 | dimensions [0 0 0 0 0 0 0]; 19 | 20 | internalField uniform 0; 21 | 22 | boundaryField 23 | { 24 | "(inlet|outlet|walls|floater)" 25 | { 26 | type zeroGradient; 27 | } 28 | atmosphere 29 | { 30 | type inletOutlet; 31 | inletValue uniform 0; 32 | value uniform 0; 33 | } 34 | } 35 | 36 | 37 | // ************************************************************************* // 38 | -------------------------------------------------------------------------------- /cases/Chapter_7/floater_only/no_pitch0/0.orig/include/boundaryConditions: -------------------------------------------------------------------------------- 1 | /*--------------------------------*- C++ -*----------------------------------*\ 2 | | ========= | | 3 | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | 4 | | \\ / O peration | Version: 3.0.x | 5 | | \\ / A nd | Web: www.OpenFOAM.org | 6 | | \\/ M anipulation | | 7 | \*---------------------------------------------------------------------------*/ 8 | #include "$FOAM_CASE/myVars" //Include global variables 9 | 10 | turbulentKE #calc "1.5*pow($I*$Ux,2)" ; // 2% turbulence 11 | 12 | //https://www.cfd-online.com/Wiki/Turbulence_intensity 13 | //https://www.openfoam.com/documentation/guides/latest/doc/guide-turbulence-ras-k-epsilon.html 14 | //https://www.cfd-online.com/Wiki/Turbulence_free-stream_boundary_conditions 15 | 16 | turbulentOmega #calc "sqrt($turbulentKE)/(pow(0.09,0.25)*$chord)"; // Specific dissipation rate, https://www.openfoam.com/documentation/guides/latest/doc/guide-turbulence-ras-k-omega-sst.html 17 | 18 | // ************************************************************************* // 19 | -------------------------------------------------------------------------------- /cases/Chapter_7/floater_only/no_pitch0/0.orig/nut: -------------------------------------------------------------------------------- 1 | /*--------------------------------*- C++ -*----------------------------------*\ 2 | | ========= | | 3 | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | 4 | | \\ / O peration | Version: v1606+ | 5 | | \\ / A nd | Web: www.OpenFOAM.com | 6 | | \\/ M anipulation | | 7 | \*---------------------------------------------------------------------------*/ 8 | FoamFile 9 | { 10 | version 2.0; 11 | format ascii; 12 | class volScalarField; 13 | location "0"; 14 | object nut; 15 | } 16 | // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 17 | 18 | dimensions [0 2 -1 0 0 0 0]; 19 | 20 | internalField uniform 0; 21 | 22 | boundaryField 23 | { 24 | "(inlet|outlet|walls|atmosphere)" 25 | { 26 | type calculated; 27 | value uniform 0; 28 | } 29 | 30 | floater 31 | { 32 | type nutkWallFunction; 33 | value uniform 0; 34 | } 35 | } 36 | 37 | 38 | // ************************************************************************* // 39 | -------------------------------------------------------------------------------- /cases/Chapter_7/floater_only/no_pitch0/0.orig/pointDisplacement: -------------------------------------------------------------------------------- 1 | /*--------------------------------*- C++ -*----------------------------------*\ 2 | | ========= | | 3 | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | 4 | | \\ / O peration | Version: v2012 | 5 | | \\ / A nd | Website: www.openfoam.com | 6 | | \\/ M anipulation | | 7 | \*---------------------------------------------------------------------------*/ 8 | FoamFile 9 | { 10 | version 2.0; 11 | format ascii; 12 | class pointVectorField; 13 | object pointDisplacement; 14 | } 15 | // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 16 | 17 | dimensions [0 1 0 0 0 0 0]; 18 | 19 | internalField uniform (0 0 0); 20 | 21 | boundaryField 22 | { 23 | #includeEtc "caseDicts/setConstraintTypes" 24 | 25 | "(inlet|outlet|walls|atmosphere)" 26 | { 27 | type fixedValue; 28 | value $internalField; 29 | } 30 | 31 | floater 32 | { 33 | type calculated; 34 | value $internalField; 35 | } 36 | 37 | } 38 | -------------------------------------------------------------------------------- /cases/Chapter_7/floater_only/no_pitch0/allClean: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Source tutorial run functions 4 | . $WM_PROJECT_DIR/bin/tools/CleanFunctions 5 | 6 | cleanCase0 -------------------------------------------------------------------------------- /cases/Chapter_7/floater_only/no_pitch0/coExtract.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | file=log.mpirun 4 | printf 'Time \t Delta t \t Co \t ICo \n' > Co.dat 5 | my_output="$(awk '/Courant Number/{Co=$6;getline;ICo=$7;getline;DTIME=$3;getline;TIME=$3;printf("%8.6f\t%8.6f\t%8.6f\t%8.6f\n",TIME,DTIME,Co,ICo);}' $file)" 6 | echo "$my_output" >> Co.dat -------------------------------------------------------------------------------- /cases/Chapter_7/floater_only/no_pitch0/constant/g: -------------------------------------------------------------------------------- 1 | /*--------------------------------*- C++ -*----------------------------------*\ 2 | | ========= | | 3 | | \\ / F ield | OpenFOAM Extend Project: Open Source CFD | 4 | | \\ / O peration | Version: 1.6-ext | 5 | | \\ / A nd | Web: www.extend-project.de | 6 | | \\/ M anipulation | | 7 | \*---------------------------------------------------------------------------*/ 8 | FoamFile 9 | { 10 | version 2.0; 11 | format ascii; 12 | class uniformDimensionedVectorField; 13 | location "constant"; 14 | object g; 15 | } 16 | // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 17 | 18 | dimensions [0 1 -2 0 0 0 0]; 19 | value ( 0 0 -9.81 ); 20 | 21 | // ************************************************************************* // 22 | -------------------------------------------------------------------------------- /cases/Chapter_7/floater_only/no_pitch0/constant/triSurface/floater.stl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fronterapp/thesis-FloatingTurbine/91ffae684f91fadf26a41b7d463cff478242c7e8/cases/Chapter_7/floater_only/no_pitch0/constant/triSurface/floater.stl -------------------------------------------------------------------------------- /cases/Chapter_7/floater_only/no_pitch0/constant/turbulenceProperties: -------------------------------------------------------------------------------- 1 | /*--------------------------------*- C++ -*----------------------------------*\ 2 | | ========= | | 3 | | \\ / F ield | OpenFOAM Extend Project: Open Source CFD | 4 | | \\ / O peration | Version: 1.6-ext | 5 | | \\ / A nd | Web: www.extend-project.de | 6 | | \\/ M anipulation | | 7 | \*---------------------------------------------------------------------------*/ 8 | FoamFile 9 | { 10 | version 2.0; 11 | format ascii; 12 | class dictionary; 13 | location "constant"; 14 | object turbulenceProperties; 15 | } 16 | // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 17 | 18 | simulationType RAS; //laminar; 19 | 20 | RAS 21 | { 22 | RASModel kOmegaSST; 23 | turbulence on; 24 | printCoeffs on; 25 | } 26 | 27 | // ************************************************************************* // 28 | 29 | -------------------------------------------------------------------------------- /cases/Chapter_7/floater_only/no_pitch0/moorExtract.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | ## FILE TO READ 4 | file=log.waveDyMFoam 5 | 6 | ## CREATE HEADER, WRITE IT ON 'RB_DATA.dat' 7 | printf 'Time \t F1x \t F1y \t F1z \t F2x \t F2y \t F2z \t F3x \t F3y \t F3z \n' > MOORING_DATA.dat 8 | 9 | ## SEARCH FOR THE DESIRED KEYWORDS 10 | ## SAVE THE DATA ON 'my_output' 11 | my_output="$(awk ' 12 | /Time/{TIME=$3; next} 13 | /Restraint catenaryLine1/{F1x=$6; F1y=$7; F1z=$8; next} 14 | /Restraint catenaryLine2/{F2x=$6; F2y=$7; F2z=$8; next} 15 | /Restraint catenaryLine3/{F3x=$6; F3y=$7; F3z=$8; 16 | printf("%8.6f\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\n", 17 | TIME,F1x,F1y,F1z,F2x,F2y,F2z,F3x,F3y,F3z);}' $file)" 18 | 19 | ## PRINT 'my_output' 20 | echo "$my_output" >> temp.dat 21 | 22 | ## REMOVE PARENTHESES FROM 'my_output' 23 | sed -e 's/(//g' -e 's/)//g' temp.dat >> MOORING_DATA.dat 24 | rm temp.dat -------------------------------------------------------------------------------- /cases/Chapter_7/floater_only/no_pitch0/parRun: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Source tutorial run functions 4 | . $WM_PROJECT_DIR/bin/tools/RunFunctions 5 | 6 | # Use the correct decomposeParDict 7 | rm ./system/decomposeParDict 8 | cp ./system/decomposeParDict_solver ./system/decomposeParDict 9 | 10 | nProc=$(getNumberOfProcessors) 11 | 12 | #Decompose case again 13 | runApplication decomposePar 14 | 15 | # Renumber meshto get a more diagonal system 16 | renumber_application="mpirun -np $nProc renumberMesh -overwrite -parallel" 17 | runApplication $renumber_application 18 | mv log.mpirun log.renumberMesh 19 | 20 | 21 | -------------------------------------------------------------------------------- /cases/Chapter_7/floater_only/no_pitch0/postRun: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Source tutorial run functions 4 | . $WM_PROJECT_DIR/bin/tools/RunFunctions 5 | 6 | # Recontruct case 7 | runApplication reconstructPar 8 | 9 | # Reconstruct logs 10 | runApplication foamLog log.waveDyMFoam 11 | 12 | # Compute Q criteria 13 | runApplication postProcess -func Q 14 | # Compute vorticity 15 | runApplication postProcess -func vorticity 16 | 17 | #Extract rigid body data 18 | ./RBextract.sh 19 | 20 | #Extract turbine geometry 21 | #./ALgeometry.sh 22 | 23 | #Extract probes data 24 | #cat postProcessing/alongwind/*/data_p.xy >> p_alongwind.dat 25 | #cat postProcessing/alongwind/*/data_U.xy >> U_alongwind.dat 26 | #cat postProcessing/crosswind/*/data_p.xy >> p_crosswind.dat 27 | #cat postProcessing/crosswind/*/data_U.xy >> U_crosswind.dat 28 | 29 | #cd postProcessing/crosswind/ 30 | #find . -mindepth 1 -maxdepth 1 -name '*' -type d -printf '%f\n' | sort -n> times.dat 31 | #mv times.dat ../../times.dat -------------------------------------------------------------------------------- /cases/Chapter_7/floater_only/no_pitch0/runClean: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Source tutorial run functions 4 | . $WM_PROJECT_DIR/bin/tools/CleanFunctions 5 | 6 | cleanTimeDirectories 7 | rm -rf processor* -------------------------------------------------------------------------------- /cases/Chapter_7/floater_only/no_pitch0/solverRun: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Source tutorial run functions 4 | . $WM_PROJECT_DIR/bin/tools/RunFunctions 5 | 6 | nProc=$(getNumberOfProcessors) 7 | 8 | # Host name 9 | cat $PBS_NODEFILE 10 | ( 11 | for host in `cat $PBS_NODEFILE | sort -u -V` 12 | do 13 | count=`grep $host $PBS_NODEFILE | wc -l` 14 | echo $host cpu=$count 15 | done 16 | 17 | ) > host_file 18 | cat host_file 19 | 20 | # Set solver name 21 | solver="mpirun -np $nProc --hostfile host_file waveDyMFoam -parallel" 22 | 23 | # Run the solver 24 | runApplication $solver 25 | mv log.mpirun log.waveDyMFoam -------------------------------------------------------------------------------- /cases/Chapter_7/floater_only/no_pitch0/system/decomposeParDict_pre: -------------------------------------------------------------------------------- 1 | /*--------------------------------*- C++ -*----------------------------------*\ 2 | | ========= | | 3 | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | 4 | | \\ / O peration | Version: v2012 | 5 | | \\ / A nd | Website: www.openfoam.com | 6 | | \\/ M anipulation | | 7 | \*---------------------------------------------------------------------------*/ 8 | FoamFile 9 | { 10 | version 2.0; 11 | format ascii; 12 | class dictionary; 13 | object decomposeParDict; 14 | } 15 | // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 16 | 17 | numberOfSubdomains 20; // number of CPUs 18 | 19 | method scotch; 20 | 21 | // ************************************************************************* // 22 | -------------------------------------------------------------------------------- /cases/Chapter_7/floater_only/no_pitch0/system/decomposeParDict_solver: -------------------------------------------------------------------------------- 1 | /*--------------------------------*- C++ -*----------------------------------*\ 2 | | ========= | | 3 | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | 4 | | \\ / O peration | Version: v2012 | 5 | | \\ / A nd | Website: www.openfoam.com | 6 | | \\/ M anipulation | | 7 | \*---------------------------------------------------------------------------*/ 8 | FoamFile 9 | { 10 | version 2.0; 11 | format ascii; 12 | class dictionary; 13 | object decomposeParDict; 14 | } 15 | // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 16 | 17 | numberOfSubdomains 120; // number of CPUs 18 | 19 | method scotch; 20 | 21 | // ************************************************************************* // 22 | -------------------------------------------------------------------------------- /cases/Chapter_7/floater_only/with_pitch0/0.orig/alpha.water: -------------------------------------------------------------------------------- 1 | /*--------------------------------*- C++ -*----------------------------------*\ 2 | | ========= | | 3 | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | 4 | | \\ / O peration | Version: v2012 | 5 | | \\ / A nd | Website: www.openfoam.com | 6 | | \\/ M anipulation | | 7 | \*---------------------------------------------------------------------------*/ 8 | FoamFile 9 | { 10 | version 2.0; 11 | format ascii; 12 | class volScalarField; 13 | location "0"; 14 | object alpha.water; 15 | } 16 | // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 17 | 18 | dimensions [0 0 0 0 0 0 0]; 19 | 20 | internalField uniform 0; 21 | 22 | boundaryField 23 | { 24 | "(inlet|outlet|walls|floater)" 25 | { 26 | type zeroGradient; 27 | } 28 | atmosphere 29 | { 30 | type inletOutlet; 31 | inletValue uniform 0; 32 | value uniform 0; 33 | } 34 | } 35 | 36 | 37 | // ************************************************************************* // 38 | -------------------------------------------------------------------------------- /cases/Chapter_7/floater_only/with_pitch0/0.orig/include/boundaryConditions: -------------------------------------------------------------------------------- 1 | /*--------------------------------*- C++ -*----------------------------------*\ 2 | | ========= | | 3 | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | 4 | | \\ / O peration | Version: 3.0.x | 5 | | \\ / A nd | Web: www.OpenFOAM.org | 6 | | \\/ M anipulation | | 7 | \*---------------------------------------------------------------------------*/ 8 | #include "$FOAM_CASE/myVars" //Include global variables 9 | 10 | turbulentKE #calc "1.5*pow($I*$Ux,2)" ; // 2% turbulence 11 | 12 | //https://www.cfd-online.com/Wiki/Turbulence_intensity 13 | //https://www.openfoam.com/documentation/guides/latest/doc/guide-turbulence-ras-k-epsilon.html 14 | //https://www.cfd-online.com/Wiki/Turbulence_free-stream_boundary_conditions 15 | 16 | turbulentOmega #calc "sqrt($turbulentKE)/(pow(0.09,0.25)*$chord)"; // Specific dissipation rate, https://www.openfoam.com/documentation/guides/latest/doc/guide-turbulence-ras-k-omega-sst.html 17 | 18 | // ************************************************************************* // 19 | -------------------------------------------------------------------------------- /cases/Chapter_7/floater_only/with_pitch0/0.orig/nut: -------------------------------------------------------------------------------- 1 | /*--------------------------------*- C++ -*----------------------------------*\ 2 | | ========= | | 3 | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | 4 | | \\ / O peration | Version: v1606+ | 5 | | \\ / A nd | Web: www.OpenFOAM.com | 6 | | \\/ M anipulation | | 7 | \*---------------------------------------------------------------------------*/ 8 | FoamFile 9 | { 10 | version 2.0; 11 | format ascii; 12 | class volScalarField; 13 | location "0"; 14 | object nut; 15 | } 16 | // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 17 | 18 | dimensions [0 2 -1 0 0 0 0]; 19 | 20 | internalField uniform 0; 21 | 22 | boundaryField 23 | { 24 | "(inlet|outlet|walls|atmosphere)" 25 | { 26 | type calculated; 27 | value uniform 0; 28 | } 29 | 30 | floater 31 | { 32 | type nutkWallFunction; 33 | value uniform 0; 34 | } 35 | } 36 | 37 | 38 | // ************************************************************************* // 39 | -------------------------------------------------------------------------------- /cases/Chapter_7/floater_only/with_pitch0/0.orig/pointDisplacement: -------------------------------------------------------------------------------- 1 | /*--------------------------------*- C++ -*----------------------------------*\ 2 | | ========= | | 3 | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | 4 | | \\ / O peration | Version: v2012 | 5 | | \\ / A nd | Website: www.openfoam.com | 6 | | \\/ M anipulation | | 7 | \*---------------------------------------------------------------------------*/ 8 | FoamFile 9 | { 10 | version 2.0; 11 | format ascii; 12 | class pointVectorField; 13 | object pointDisplacement; 14 | } 15 | // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 16 | 17 | dimensions [0 1 0 0 0 0 0]; 18 | 19 | internalField uniform (0 0 0); 20 | 21 | boundaryField 22 | { 23 | #includeEtc "caseDicts/setConstraintTypes" 24 | 25 | "(inlet|outlet|walls|atmosphere)" 26 | { 27 | type fixedValue; 28 | value $internalField; 29 | } 30 | 31 | floater 32 | { 33 | type calculated; 34 | value $internalField; 35 | } 36 | 37 | } 38 | -------------------------------------------------------------------------------- /cases/Chapter_7/floater_only/with_pitch0/allClean: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Source tutorial run functions 4 | . $WM_PROJECT_DIR/bin/tools/CleanFunctions 5 | 6 | cleanCase0 -------------------------------------------------------------------------------- /cases/Chapter_7/floater_only/with_pitch0/coExtract.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | file=log.mpirun 4 | printf 'Time \t Delta t \t Co \t ICo \n' > Co.dat 5 | my_output="$(awk '/Courant Number/{Co=$6;getline;ICo=$7;getline;DTIME=$3;getline;TIME=$3;printf("%8.6f\t%8.6f\t%8.6f\t%8.6f\n",TIME,DTIME,Co,ICo);}' $file)" 6 | echo "$my_output" >> Co.dat -------------------------------------------------------------------------------- /cases/Chapter_7/floater_only/with_pitch0/constant/g: -------------------------------------------------------------------------------- 1 | /*--------------------------------*- C++ -*----------------------------------*\ 2 | | ========= | | 3 | | \\ / F ield | OpenFOAM Extend Project: Open Source CFD | 4 | | \\ / O peration | Version: 1.6-ext | 5 | | \\ / A nd | Web: www.extend-project.de | 6 | | \\/ M anipulation | | 7 | \*---------------------------------------------------------------------------*/ 8 | FoamFile 9 | { 10 | version 2.0; 11 | format ascii; 12 | class uniformDimensionedVectorField; 13 | location "constant"; 14 | object g; 15 | } 16 | // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 17 | 18 | dimensions [0 1 -2 0 0 0 0]; 19 | value ( 0 0 -9.81 ); 20 | 21 | // ************************************************************************* // 22 | -------------------------------------------------------------------------------- /cases/Chapter_7/floater_only/with_pitch0/constant/triSurface/floater_org.stl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fronterapp/thesis-FloatingTurbine/91ffae684f91fadf26a41b7d463cff478242c7e8/cases/Chapter_7/floater_only/with_pitch0/constant/triSurface/floater_org.stl -------------------------------------------------------------------------------- /cases/Chapter_7/floater_only/with_pitch0/constant/turbulenceProperties: -------------------------------------------------------------------------------- 1 | /*--------------------------------*- C++ -*----------------------------------*\ 2 | | ========= | | 3 | | \\ / F ield | OpenFOAM Extend Project: Open Source CFD | 4 | | \\ / O peration | Version: 1.6-ext | 5 | | \\ / A nd | Web: www.extend-project.de | 6 | | \\/ M anipulation | | 7 | \*---------------------------------------------------------------------------*/ 8 | FoamFile 9 | { 10 | version 2.0; 11 | format ascii; 12 | class dictionary; 13 | location "constant"; 14 | object turbulenceProperties; 15 | } 16 | // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 17 | 18 | simulationType RAS; //laminar; 19 | 20 | RAS 21 | { 22 | RASModel kOmegaSST; 23 | turbulence on; 24 | printCoeffs on; 25 | } 26 | 27 | // ************************************************************************* // 28 | 29 | -------------------------------------------------------------------------------- /cases/Chapter_7/floater_only/with_pitch0/moorExtract.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | ## FILE TO READ 4 | file=log.waveDyMFoam 5 | 6 | ## CREATE HEADER, WRITE IT ON 'RB_DATA.dat' 7 | printf 'Time \t F1x \t F1y \t F1z \t F2x \t F2y \t F2z \t F3x \t F3y \t F3z \n' > MOORING_DATA.dat 8 | 9 | ## SEARCH FOR THE DESIRED KEYWORDS 10 | ## SAVE THE DATA ON 'my_output' 11 | my_output="$(awk ' 12 | /Time/{TIME=$3; next} 13 | /Restraint catenaryLine1/{F1x=$6; F1y=$7; F1z=$8; next} 14 | /Restraint catenaryLine2/{F2x=$6; F2y=$7; F2z=$8; next} 15 | /Restraint catenaryLine3/{F3x=$6; F3y=$7; F3z=$8; 16 | printf("%8.6f\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\n", 17 | TIME,F1x,F1y,F1z,F2x,F2y,F2z,F3x,F3y,F3z);}' $file)" 18 | 19 | ## PRINT 'my_output' 20 | echo "$my_output" >> temp.dat 21 | 22 | ## REMOVE PARENTHESES FROM 'my_output' 23 | sed -e 's/(//g' -e 's/)//g' temp.dat >> MOORING_DATA.dat 24 | rm temp.dat -------------------------------------------------------------------------------- /cases/Chapter_7/floater_only/with_pitch0/parRun: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | 4 | # Source tutorial run functions 5 | . $WM_PROJECT_DIR/bin/tools/RunFunctions 6 | 7 | # Use the correct decomposeParDict 8 | rm ./system/decomposeParDict 9 | cp ./system/decomposeParDict_solver ./system/decomposeParDict 10 | 11 | nProc=$(getNumberOfProcessors) 12 | 13 | #Decompose case again 14 | runApplication decomposePar 15 | 16 | # Renumber meshto get a more diagonal system 17 | renumber_application="mpirun --oversubscribe -np $nProc renumberMesh -overwrite -parallel" 18 | runApplication $renumber_application 19 | mv log.mpirun log.renumberMesh 20 | 21 | 22 | -------------------------------------------------------------------------------- /cases/Chapter_7/floater_only/with_pitch0/postRun: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Source tutorial run functions 4 | . $WM_PROJECT_DIR/bin/tools/RunFunctions 5 | 6 | # Recontruct case 7 | runApplication reconstructPar 8 | 9 | # Reconstruct logs 10 | runApplication foamLog log.waveDyMFoam 11 | 12 | # Compute Q criteria 13 | runApplication postProcess -func Q 14 | # Compute vorticity 15 | runApplication postProcess -func vorticity 16 | 17 | #Extract rigid body data 18 | ./RBextract.sh 19 | 20 | #Extract turbine geometry 21 | #./ALgeometry.sh 22 | 23 | #Extract probes data 24 | #cat postProcessing/alongwind/*/data_p.xy >> p_alongwind.dat 25 | #cat postProcessing/alongwind/*/data_U.xy >> U_alongwind.dat 26 | #cat postProcessing/crosswind/*/data_p.xy >> p_crosswind.dat 27 | #cat postProcessing/crosswind/*/data_U.xy >> U_crosswind.dat 28 | 29 | #cd postProcessing/crosswind/ 30 | #find . -mindepth 1 -maxdepth 1 -name '*' -type d -printf '%f\n' | sort -n> times.dat 31 | #mv times.dat ../../times.dat -------------------------------------------------------------------------------- /cases/Chapter_7/floater_only/with_pitch0/runClean: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Source tutorial run functions 4 | . $WM_PROJECT_DIR/bin/tools/CleanFunctions 5 | 6 | cleanTimeDirectories 7 | rm -rf processor* -------------------------------------------------------------------------------- /cases/Chapter_7/floater_only/with_pitch0/solverRun: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | 4 | # Source tutorial run functions 5 | . $WM_PROJECT_DIR/bin/tools/RunFunctions 6 | 7 | nProc=$(getNumberOfProcessors) 8 | 9 | # Set solver name 10 | 11 | solver="mpirun --oversubscribe -np $nProc waveDyMFoam -parallel" 12 | 13 | # Run the solver 14 | runApplication $solver 15 | mv log.mpirun log.waveDyMFoam -------------------------------------------------------------------------------- /cases/Chapter_7/floater_only/with_pitch0/system/decomposeParDict: -------------------------------------------------------------------------------- 1 | /*--------------------------------*- C++ -*----------------------------------*\ 2 | | ========= | | 3 | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | 4 | | \\ / O peration | Version: v2012 | 5 | | \\ / A nd | Website: www.openfoam.com | 6 | | \\/ M anipulation | | 7 | \*---------------------------------------------------------------------------*/ 8 | FoamFile 9 | { 10 | version 2.0; 11 | format ascii; 12 | class dictionary; 13 | object decomposeParDict; 14 | } 15 | // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 16 | 17 | numberOfSubdomains 20; // number of CPUs 18 | 19 | method scotch; 20 | 21 | // ************************************************************************* // 22 | -------------------------------------------------------------------------------- /cases/Chapter_7/floater_only/with_pitch0/system/decomposeParDict_pre: -------------------------------------------------------------------------------- 1 | /*--------------------------------*- C++ -*----------------------------------*\ 2 | | ========= | | 3 | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | 4 | | \\ / O peration | Version: v2012 | 5 | | \\ / A nd | Website: www.openfoam.com | 6 | | \\/ M anipulation | | 7 | \*---------------------------------------------------------------------------*/ 8 | FoamFile 9 | { 10 | version 2.0; 11 | format ascii; 12 | class dictionary; 13 | object decomposeParDict; 14 | } 15 | // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 16 | 17 | numberOfSubdomains 20; // number of CPUs 18 | 19 | method scotch; 20 | 21 | // ************************************************************************* // 22 | -------------------------------------------------------------------------------- /cases/Chapter_7/floater_only/with_pitch0/system/decomposeParDict_solver: -------------------------------------------------------------------------------- 1 | /*--------------------------------*- C++ -*----------------------------------*\ 2 | | ========= | | 3 | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | 4 | | \\ / O peration | Version: v2012 | 5 | | \\ / A nd | Website: www.openfoam.com | 6 | | \\/ M anipulation | | 7 | \*---------------------------------------------------------------------------*/ 8 | FoamFile 9 | { 10 | version 2.0; 11 | format ascii; 12 | class dictionary; 13 | object decomposeParDict; 14 | } 15 | // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 16 | 17 | numberOfSubdomains 48; // number of CPUs 18 | 19 | method scotch; 20 | 21 | // ************************************************************************* // 22 | -------------------------------------------------------------------------------- /cases/Chapter_7/turbine_only/0.orig/include/boundaryConditions: -------------------------------------------------------------------------------- 1 | /*--------------------------------*- C++ -*----------------------------------*\ 2 | | ========= | | 3 | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | 4 | | \\ / O peration | Version: 3.0.x | 5 | | \\ / A nd | Web: www.OpenFOAM.org | 6 | | \\/ M anipulation | | 7 | \*---------------------------------------------------------------------------*/ 8 | #include "$FOAM_CASE/myVars" //Include global variables 9 | 10 | turbulentKE #calc "1.5*pow($I*$Ux,2)" ; // 2% turbulence 11 | 12 | //https://www.cfd-online.com/Wiki/Turbulence_intensity 13 | //https://www.openfoam.com/documentation/guides/latest/doc/guide-turbulence-ras-k-epsilon.html 14 | //https://www.cfd-online.com/Wiki/Turbulence_free-stream_boundary_conditions 15 | 16 | turbulentOmega #calc "sqrt($turbulentKE)/(pow(0.09,0.25)*$chord)"; // Specific dissipation rate, https://www.openfoam.com/documentation/guides/latest/doc/guide-turbulence-ras-k-omega-sst.html 17 | 18 | // ************************************************************************* // 19 | -------------------------------------------------------------------------------- /cases/Chapter_7/turbine_only/0.orig/include/logLawField: -------------------------------------------------------------------------------- 1 | // Logarithmic profile condition 2 | 3 | internalField #codeStream 4 | { 5 | codeInclude 6 | #{ 7 | #include "fvCFD.H" 8 | #}; 9 | 10 | codeOptions 11 | #{ 12 | -I$(LIB_SRC)/finiteVolume/lnInclude \ 13 | -I$(LIB_SRC)/meshTools/lnInclude 14 | #}; 15 | 16 | codeLibs 17 | #{ 18 | -lmeshTools \ 19 | -lfiniteVolume 20 | #}; 21 | 22 | code 23 | #{ 24 | const IOdictionary& d = static_cast(dict); 25 | const fvMesh& mesh = refCast(d.db()); 26 | vectorField U(mesh.nCells(), vector(0., 0., 0.)); 27 | 28 | scalar U_h = 0.0; //Height-varying velocity 29 | 30 | forAll(U, i) 31 | { 32 | const scalar z = mesh.C()[i][2]; 33 | if (z-$z_ground>$z_0) // Above ground height 34 | { 35 | U_h = $U_ref * log((z-$z_ground)/$z_0)/log(($z_ref-$z_ground)/$z_0); //Log profile 36 | U[i] = vector(U_h, 0., 0.); 37 | } 38 | else U[i] = vector(0., 0., 0.); 39 | }; 40 | 41 | U.writeEntry("",os); 42 | 43 | #}; 44 | 45 | }; 46 | -------------------------------------------------------------------------------- /cases/Chapter_7/turbine_only/0.orig/include/logLawInlet: -------------------------------------------------------------------------------- 1 | // Logarithmic profile inlet condition 2 | 3 | type fixedValue; 4 | value #codeStream 5 | { 6 | codeInclude 7 | #{ 8 | #include "fvCFD.H" 9 | #}; 10 | 11 | codeOptions 12 | #{ 13 | -I$(LIB_SRC)/finiteVolume/lnInclude \ 14 | -I$(LIB_SRC)/meshTools/lnInclude 15 | #}; 16 | 17 | codeLibs 18 | #{ 19 | -lmeshTools \ 20 | -lfiniteVolume 21 | #}; 22 | 23 | code 24 | #{ 25 | const IOdictionary& d = static_cast 26 | ( 27 | dict.parent().parent() 28 | ); 29 | 30 | const fvMesh& mesh = refCast(d.db()); 31 | const label id = mesh.boundary().findPatchID("inlet"); 32 | const fvPatch& patch = mesh.boundary()[id]; 33 | 34 | vectorField U(patch.size(), vector(0, 0, 0)); 35 | 36 | scalar U_h = 0.0; //Height-varying velocity 37 | 38 | forAll(U, i) 39 | { 40 | const scalar z = patch.Cf()[i][2]; 41 | if (z-$z_ground>$z_0) // Above ground height 42 | { 43 | U_h = $U_ref * log((z-$z_ground)/$z_0)/log(($z_ref-$z_ground)/$z_0); //Log profile 44 | U[i] = vector(U_h, 0., 0.); 45 | } 46 | else U[i] = vector(0., 0., 0.); 47 | }; 48 | 49 | U.writeEntry("",os); 50 | 51 | #}; 52 | 53 | }; 54 | -------------------------------------------------------------------------------- /cases/Chapter_7/turbine_only/0.orig/include/logLawOutlet: -------------------------------------------------------------------------------- 1 | // Logarithmic profile inletOutlet condition 2 | 3 | inletValue #codeStream 4 | { 5 | codeInclude 6 | #{ 7 | #include "fvCFD.H" 8 | #}; 9 | 10 | codeOptions 11 | #{ 12 | -I$(LIB_SRC)/finiteVolume/lnInclude \ 13 | -I$(LIB_SRC)/meshTools/lnInclude 14 | #}; 15 | 16 | codeLibs 17 | #{ 18 | -lmeshTools \ 19 | -lfiniteVolume 20 | #}; 21 | 22 | code 23 | #{ 24 | const IOdictionary& d = static_cast 25 | ( 26 | dict.parent().parent() 27 | ); 28 | 29 | const fvMesh& mesh = refCast(d.db()); 30 | const label id = mesh.boundary().findPatchID("outlet"); 31 | const fvPatch& patch = mesh.boundary()[id]; 32 | 33 | vectorField U(patch.size(), vector(0, 0, 0)); 34 | 35 | scalar U_h = 0.0; //Height-varying velocity 36 | 37 | forAll(U, i) 38 | { 39 | const scalar z = patch.Cf()[i][2]; 40 | if (z-$z_ground>$z_0) // Above ground height 41 | { 42 | U_h = $U_ref * log((z-$z_ground)/$z_0)/log(($z_ref-$z_ground)/$z_0); //Log profile 43 | U[i] = vector(U_h, 0., 0.); 44 | } 45 | else U[i] = vector(0., 0., 0.); 46 | }; 47 | 48 | U.writeEntry("",os); 49 | 50 | #}; 51 | 52 | }; 53 | -------------------------------------------------------------------------------- /cases/Chapter_7/turbine_only/0.orig/k: -------------------------------------------------------------------------------- 1 | /*--------------------------------*- C++ -*----------------------------------*\ 2 | | ========= | | 3 | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | 4 | | \\ / O peration | Version: 4.x | 5 | | \\ / A nd | Web: www.OpenFOAM.org | 6 | | \\/ M anipulation | | 7 | \*---------------------------------------------------------------------------*/ 8 | FoamFile 9 | { 10 | version 2.0; 11 | format ascii; 12 | class volScalarField; 13 | location "0"; 14 | object k; 15 | } 16 | // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 17 | #include "$FOAM_CASE/0/include/boundaryConditions" 18 | 19 | dimensions [0 2 -2 0 0 0 0]; 20 | 21 | internalField uniform $turbulentKE; 22 | 23 | boundaryField 24 | { 25 | "(inlet|outlet|walls|atmosphere)" 26 | { 27 | type fixedValue; 28 | value $internalField; 29 | } 30 | } 31 | 32 | 33 | // ************************************************************************* // 34 | -------------------------------------------------------------------------------- /cases/Chapter_7/turbine_only/0.orig/nut: -------------------------------------------------------------------------------- 1 | /*--------------------------------*- C++ -*----------------------------------*\ 2 | | ========= | | 3 | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | 4 | | \\ / O peration | Version: v1606+ | 5 | | \\ / A nd | Web: www.OpenFOAM.com | 6 | | \\/ M anipulation | | 7 | \*---------------------------------------------------------------------------*/ 8 | FoamFile 9 | { 10 | version 2.0; 11 | format ascii; 12 | class volScalarField; 13 | location "0"; 14 | object nut; 15 | } 16 | // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 17 | 18 | dimensions [0 2 -1 0 0 0 0]; 19 | 20 | internalField uniform 0; 21 | 22 | boundaryField 23 | { 24 | "(inlet|outlet|walls|atmosphere)" 25 | { 26 | type calculated; 27 | value uniform 0; 28 | } 29 | } 30 | 31 | 32 | // ************************************************************************* // 33 | -------------------------------------------------------------------------------- /cases/Chapter_7/turbine_only/ALgeometry.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Source tutorial run functions 3 | . $WM_PROJECT_DIR/bin/tools/RunFunctions 4 | 5 | rm -rf turbineGeometry 6 | #rm log.foamListTimes 7 | runApplication foamListTimes 8 | 9 | region='turbine' 10 | components=('blade1' 'blade2' 'blade3' 'tower') 11 | 12 | python3.8 scripts/ALgeometry.py $region "${components[@]}" -------------------------------------------------------------------------------- /cases/Chapter_7/turbine_only/allClean: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Source tutorial run functions 4 | . $WM_PROJECT_DIR/bin/tools/CleanFunctions 5 | 6 | cleanCase0 -------------------------------------------------------------------------------- /cases/Chapter_7/turbine_only/coExtract.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | file=log.mpirun 4 | printf 'Time \t Delta t \t Co \t ICo \n' > Co.dat 5 | my_output="$(awk '/Courant Number/{Co=$6;getline;ICo=$7;getline;DTIME=$3;getline;TIME=$3;printf("%8.6f\t%8.6f\t%8.6f\t%8.6f\n",TIME,DTIME,Co,ICo);}' $file)" 6 | echo "$my_output" >> Co.dat -------------------------------------------------------------------------------- /cases/Chapter_7/turbine_only/constant/transportProperties: -------------------------------------------------------------------------------- 1 | /*--------------------------------*- C++ -*----------------------------------*\ 2 | | ========= | | 3 | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | 4 | | \\ / O peration | Version: 3.0.x | 5 | | \\ / A nd | Web: www.OpenFOAM.org | 6 | | \\/ M anipulation | | 7 | \*---------------------------------------------------------------------------*/ 8 | FoamFile 9 | { 10 | version 2.0; 11 | format ascii; 12 | class dictionary; 13 | object transportProperties; 14 | } 15 | // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 16 | 17 | transportModel Newtonian; 18 | 19 | nu nu [0 2 -1 0 0 0 0] 1.5e-5; 20 | 21 | // ************************************************************************* // 22 | -------------------------------------------------------------------------------- /cases/Chapter_7/turbine_only/constant/turbulenceProperties: -------------------------------------------------------------------------------- 1 | /*--------------------------------*- C++ -*----------------------------------*\ 2 | | ========= | | 3 | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | 4 | | \\ / O peration | Version: 3.0.x | 5 | | \\ / A nd | Web: www.OpenFOAM.org | 6 | | \\/ M anipulation | | 7 | \*---------------------------------------------------------------------------*/ 8 | FoamFile 9 | { 10 | version 2.0; 11 | format ascii; 12 | class dictionary; 13 | location "constant"; 14 | object turbulenceProperties; 15 | } 16 | // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 17 | 18 | simulationType RAS; 19 | 20 | RAS 21 | { 22 | RASModel kOmegaSST; 23 | turbulence on; 24 | printCoeffs on; 25 | } 26 | 27 | // ************************************************************************* // 28 | -------------------------------------------------------------------------------- /cases/Chapter_7/turbine_only/parRun: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | 4 | # Source tutorial run functions 5 | . $WM_PROJECT_DIR/bin/tools/RunFunctions 6 | 7 | # Use the correct decomposeParDict 8 | rm ./system/decomposeParDict 9 | cp ./system/decomposeParDict_solver ./system/decomposeParDict 10 | 11 | nProc=$(getNumberOfProcessors) 12 | 13 | #Decompose case again 14 | runApplication decomposePar 15 | 16 | # Renumber meshto get a more diagonal system 17 | renumber_application="mpirun --oversubscribe -np $nProc renumberMesh -overwrite -parallel" 18 | runApplication $renumber_application 19 | mv log.mpirun log.renumberMesh 20 | 21 | 22 | -------------------------------------------------------------------------------- /cases/Chapter_7/turbine_only/postRun: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Source tutorial run functions 4 | . $WM_PROJECT_DIR/bin/tools/RunFunctions 5 | 6 | # Recontruct case 7 | runApplication reconstructPar 8 | 9 | # Reconstruct logs 10 | runApplication foamLog log.pimpleFoam 11 | 12 | # Compute Q criteria 13 | runApplication postProcess -func Q 14 | runApplication postProcess -func vorticity 15 | 16 | #Extract turbine geometry 17 | ./ALgeometry.sh 18 | 19 | #Extract probes data 20 | cat postProcessing/crosswind/*/data_p.xy >> p_crosswind.dat 21 | cat postProcessing/crosswind/*/data_U.xy >> U_crosswind.dat 22 | 23 | cd postProcessing/crosswind/ 24 | find . -mindepth 1 -maxdepth 1 -name '*' -type d -printf '%f\n' | sort -n> times.dat 25 | mv times.dat ../../times.dat -------------------------------------------------------------------------------- /cases/Chapter_7/turbine_only/preRun: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Source tutorial run functions 4 | . $WM_PROJECT_DIR/bin/tools/RunFunctions 5 | 6 | # Use the correct decomposeParDict 7 | rm ./system/decomposeParDict 8 | cp ./system/decomposeParDict_pre ./system/decomposeParDict 9 | 10 | # Get number of processors from decomposePar dict 11 | nProc=$(getNumberOfProcessors) 12 | 13 | restore0Dir 14 | 15 | #Run blockMesh 16 | runApplication blockMesh 17 | 18 | #Decompose mesh for snappyHex 19 | runApplication decomposePar 20 | 21 | #Run snappyMesh 22 | mesh_application="mpirun --oversubscribe -np $nProc snappyHexMesh -overwrite -parallel" 23 | runApplication $mesh_application 24 | mv log.mpirun log.snappyHexMesh 25 | #### runApplication snappyHexMesh -overwrite 26 | 27 | #Reconstruct mesh 28 | #This is needed, see https://www.cfd-online.com/Forums/openfoam-meshing/239688-cannot-find-patchfield-entry.html 29 | runApplication reconstructParMesh -mergeTol 1e-06 -latestTime -constant 30 | 31 | #Remove parallel files 32 | rm -rf processor* 33 | rm -rf log.decomposePar 34 | 35 | # Run topoSet 36 | runApplication topoSet 37 | 38 | # copy "points" file from 0/polyMesh to constant/polyMesh 39 | cp -fr 0/polyMesh/points constant/polyMesh/points -------------------------------------------------------------------------------- /cases/Chapter_7/turbine_only/runClean: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Source tutorial run functions 4 | . $WM_PROJECT_DIR/bin/tools/CleanFunctions 5 | 6 | cleanTimeDirectories 7 | rm -rf processor* -------------------------------------------------------------------------------- /cases/Chapter_7/turbine_only/solverRun: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | 4 | # Source tutorial run functions 5 | . $WM_PROJECT_DIR/bin/tools/RunFunctions 6 | 7 | nProc=$(getNumberOfProcessors) 8 | 9 | # Set solver name 10 | 11 | solver="mpirun --oversubscribe -np $nProc pimpleFoam -parallel" 12 | 13 | # Run the solver 14 | runApplication $solver 15 | mv log.mpirun log.pimpleFoam -------------------------------------------------------------------------------- /cases/Chapter_7/turbine_only/system/decomposeParDict: -------------------------------------------------------------------------------- 1 | /*--------------------------------*- C++ -*----------------------------------*\ 2 | | ========= | | 3 | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | 4 | | \\ / O peration | Version: 3.0.x | 5 | | \\ / A nd | Web: www.OpenFOAM.org | 6 | | \\/ M anipulation | | 7 | \*---------------------------------------------------------------------------*/ 8 | FoamFile 9 | { 10 | version 2.0; 11 | format ascii; 12 | class dictionary; 13 | object decomposeParDict; 14 | } 15 | 16 | // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 17 | 18 | numberOfSubdomains 20; 19 | 20 | method scotch; 21 | 22 | // ************************************************************************* // 23 | -------------------------------------------------------------------------------- /cases/Chapter_7/turbine_only/system/decomposeParDict_pre: -------------------------------------------------------------------------------- 1 | /*--------------------------------*- C++ -*----------------------------------*\ 2 | | ========= | | 3 | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | 4 | | \\ / O peration | Version: v2012 | 5 | | \\ / A nd | Website: www.openfoam.com | 6 | | \\/ M anipulation | | 7 | \*---------------------------------------------------------------------------*/ 8 | FoamFile 9 | { 10 | version 2.0; 11 | format ascii; 12 | class dictionary; 13 | object decomposeParDict; 14 | } 15 | // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 16 | 17 | numberOfSubdomains 20; // number of CPUs 18 | 19 | method scotch; 20 | 21 | // ************************************************************************* // 22 | -------------------------------------------------------------------------------- /cases/Chapter_7/turbine_only/system/decomposeParDict_solver: -------------------------------------------------------------------------------- 1 | /*--------------------------------*- C++ -*----------------------------------*\ 2 | | ========= | | 3 | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | 4 | | \\ / O peration | Version: v2012 | 5 | | \\ / A nd | Website: www.openfoam.com | 6 | | \\/ M anipulation | | 7 | \*---------------------------------------------------------------------------*/ 8 | FoamFile 9 | { 10 | version 2.0; 11 | format ascii; 12 | class dictionary; 13 | object decomposeParDict; 14 | } 15 | // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 16 | 17 | numberOfSubdomains 48; // number of CPUs 18 | 19 | method scotch; 20 | 21 | // ************************************************************************* // 22 | -------------------------------------------------------------------------------- /cases/Chapter_7/turbine_only/system/elementData: -------------------------------------------------------------------------------- 1 | // Blade element data 2 | // Divides the blade into N stations. Two stations define a span section (N-1 span sections). 3 | // An integer number of actuator elements will be defined along each span section. 4 | // 18 nodes (17 elements) for the NREL 15-MW RWT 5 | // axialDistance[m], radius[m], azimuth, chord[m], chordMount[%], twist[deg] 6 | (0.000 1.5000 0.000 3.3860 0.250 13.3080) 7 | (0.000 4.2333 0.000 3.6980 0.250 13.3080) 8 | (0.000 6.9667 0.000 4.0105 0.250 13.3080) 9 | (0.000 9.7000 0.000 4.3230 0.250 13.3080) 10 | (0.000 13.8000 0.000 4.6045 0.250 12.3940) 11 | (0.000 17.9000 0.000 4.5550 0.250 10.8210) 12 | (0.000 22.0000 0.000 4.3535 0.250 9.5865) 13 | (0.000 26.1000 0.000 4.1280 0.250 8.4030) 14 | (0.000 30.2000 0.000 3.8775 0.250 7.1695) 15 | (0.000 34.3000 0.000 3.6250 0.250 5.9525) 16 | (0.000 38.4000 0.000 3.3790 0.250 4.7745) 17 | (0.000 42.5000 0.000 3.1330 0.250 3.6565) 18 | (0.000 46.6000 0.000 2.8870 0.250 2.7220) 19 | (0.000 50.7000 0.000 2.6410 0.250 1.9225) 20 | (0.000 54.8000 0.000 2.3950 0.250 1.1282) 21 | (0.000 57.5333 0.000 2.1995 0.250 0.6165) 22 | (0.000 60.2667 0.000 1.7525 0.250 0.2380) 23 | (0.000 63.0000 0.000 1.0855 0.250 -0.0260) -------------------------------------------------------------------------------- /cases/Chapter_7/turbine_only/system/sampling: -------------------------------------------------------------------------------- 1 | // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 2 | // This file is used to define sampling options// 3 | // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 4 | 5 | crosswind 6 | { 7 | type sets; 8 | libs ("libsampling.so"); 9 | writeControl timeStep; 10 | outputInterval 250; 11 | interpolationScheme cellPoint; 12 | setFormat raw; 13 | sets 14 | ( 15 | data 16 | { 17 | type uniform; 18 | axis y; 19 | start (#calc "$hub_x + $D" #calc "-1.5*$D" $hub_h); 20 | end (#calc "$hub_x + $D" #calc "1.5*$D" $hub_h); 21 | nPoints 50; 22 | } 23 | ); 24 | fields (U p); 25 | } -------------------------------------------------------------------------------- /cases/Tests/prescribed_ALM/harmonic_actuatorLine/0.orig/alpha.water: -------------------------------------------------------------------------------- 1 | /*--------------------------------*- C++ -*----------------------------------*\ 2 | | ========= | | 3 | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | 4 | | \\ / O peration | Version: v2012 | 5 | | \\ / A nd | Website: www.openfoam.com | 6 | | \\/ M anipulation | | 7 | \*---------------------------------------------------------------------------*/ 8 | FoamFile 9 | { 10 | version 2.0; 11 | format ascii; 12 | class volScalarField; 13 | location "0"; 14 | object alpha.water; 15 | } 16 | // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 17 | 18 | dimensions [0 0 0 0 0 0 0]; 19 | 20 | internalField uniform 0; 21 | 22 | boundaryField 23 | { 24 | ".*" 25 | { 26 | type zeroGradient; 27 | } 28 | 29 | "proc.*" 30 | { 31 | type processor; 32 | } 33 | 34 | } 35 | 36 | 37 | // ************************************************************************* // 38 | -------------------------------------------------------------------------------- /cases/Tests/prescribed_ALM/harmonic_actuatorLine/0.orig/include/fixedInlet: -------------------------------------------------------------------------------- 1 | /*--------------------------------*- C++ -*----------------------------------*\ 2 | | ========= | | 3 | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | 4 | | \\ / O peration | Version: 3.0.x | 5 | | \\ / A nd | Web: www.OpenFOAM.org | 6 | | \\/ M anipulation | | 7 | \*---------------------------------------------------------------------------*/ 8 | 9 | inlet 10 | { 11 | type fixedValue; 12 | value $internalField; 13 | } 14 | 15 | // ************************************************************************* // 16 | -------------------------------------------------------------------------------- /cases/Tests/prescribed_ALM/harmonic_actuatorLine/0.orig/include/initialConditions: -------------------------------------------------------------------------------- 1 | /*--------------------------------*- C++ -*----------------------------------*\ 2 | | ========= | | 3 | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | 4 | | \\ / O peration | Version: 3.0.x | 5 | | \\ / A nd | Web: www.OpenFOAM.org | 6 | | \\/ M anipulation | | 7 | \*---------------------------------------------------------------------------*/ 8 | 9 | flowVelocity (1 0 0); 10 | pressure 0; 11 | turbulentKE 2e-4; // Was 2e-4 12 | turbulentEpsilon 3e-5; // Was 0.01; Guess ~ 0.09*k**(3/2)/l 13 | 14 | // ************************************************************************* // 15 | -------------------------------------------------------------------------------- /cases/Tests/prescribed_ALM/harmonic_actuatorLine/ALgeometry.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Source tutorial run functions 3 | . $WM_PROJECT_DIR/bin/tools/RunFunctions 4 | 5 | rm -rf turbineGeometry 6 | #rm log.foamListTimes 7 | runApplication foamListTimes 8 | 9 | region='turbine' 10 | components=('blade1' 'blade2' 'blade3' 'tower') 11 | 12 | python3.8 scripts/ALgeometry.py $region "${components[@]}" -------------------------------------------------------------------------------- /cases/Tests/prescribed_ALM/harmonic_actuatorLine/allClean: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Source tutorial run functions 4 | . $WM_PROJECT_DIR/bin/tools/CleanFunctions 5 | 6 | cleanCase0 -------------------------------------------------------------------------------- /cases/Tests/prescribed_ALM/harmonic_actuatorLine/constant/g: -------------------------------------------------------------------------------- 1 | /*--------------------------------*- C++ -*----------------------------------*\ 2 | | ========= | | 3 | | \\ / F ield | OpenFOAM Extend Project: Open Source CFD | 4 | | \\ / O peration | Version: 1.6-ext | 5 | | \\ / A nd | Web: www.extend-project.de | 6 | | \\/ M anipulation | | 7 | \*---------------------------------------------------------------------------*/ 8 | FoamFile 9 | { 10 | version 2.0; 11 | format ascii; 12 | class uniformDimensionedVectorField; 13 | location "constant"; 14 | object g; 15 | } 16 | // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 17 | 18 | dimensions [0 1 -2 0 0 0 0]; 19 | value ( 0 0 -9.81 ); 20 | 21 | // ************************************************************************* // 22 | -------------------------------------------------------------------------------- /cases/Tests/prescribed_ALM/harmonic_actuatorLine/constant/turbulenceProperties: -------------------------------------------------------------------------------- 1 | /*--------------------------------*- C++ -*----------------------------------*\ 2 | | ========= | | 3 | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | 4 | | \\ / O peration | Version: 3.0.x | 5 | | \\ / A nd | Web: www.OpenFOAM.org | 6 | | \\/ M anipulation | | 7 | \*---------------------------------------------------------------------------*/ 8 | FoamFile 9 | { 10 | version 2.0; 11 | format ascii; 12 | class dictionary; 13 | location "constant"; 14 | object turbulenceProperties; 15 | } 16 | // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 17 | 18 | simulationType RAS; 19 | 20 | RAS 21 | { 22 | #include "RASProperties" 23 | } 24 | 25 | // ************************************************************************* // 26 | -------------------------------------------------------------------------------- /cases/Tests/prescribed_ALM/harmonic_actuatorLine/preRun: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Source tutorial run functions 4 | . $WM_PROJECT_DIR/bin/tools/RunFunctions 5 | 6 | restore0Dir 7 | 8 | #Run blockMesh 9 | runApplication blockMesh 10 | 11 | #Run snappyMesh 12 | runApplication snappyHexMesh -overwrite 13 | 14 | # Run topoSet 15 | runApplication topoSet 16 | 17 | # copy "points" file from 0/polyMesh to constant/polyMesh 18 | cp -fr 0/polyMesh/points constant/polyMesh/points -------------------------------------------------------------------------------- /cases/Tests/prescribed_ALM/harmonic_actuatorLine/solverClean: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Source tutorial run functions 4 | . $WM_PROJECT_DIR/bin/tools/CleanFunctions 5 | 6 | cleanTimeDirectories 7 | rm -rf processor* -------------------------------------------------------------------------------- /cases/Tests/prescribed_ALM/harmonic_actuatorLine/solverRun: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | 4 | # Source tutorial run functions 5 | . $WM_PROJECT_DIR/bin/tools/RunFunctions 6 | 7 | # Prepare for parallelisation 8 | runApplication decomposePar 9 | 10 | # Set application name 11 | application="mpirun --oversubscribe -np 16 interFoam -parallel" 12 | 13 | # Renumber meshto get a more diagonal system 14 | # runApplication $renum 15 | 16 | # Run the application 17 | runApplication $application 18 | 19 | # Recontruct case 20 | runApplication reconstructPar 21 | 22 | # Reconstruct logs 23 | runApplication foamLog log.mpirun 24 | 25 | # Post-process turbine geo 26 | ./ALgeometry.sh -------------------------------------------------------------------------------- /cases/Tests/prescribed_ALM/harmonic_actuatorLine/system/decomposeParDict: -------------------------------------------------------------------------------- 1 | /*--------------------------------*- C++ -*----------------------------------*\ 2 | | ========= | | 3 | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | 4 | | \\ / O peration | Version: 3.0.x | 5 | | \\ / A nd | Web: www.OpenFOAM.org | 6 | | \\/ M anipulation | | 7 | \*---------------------------------------------------------------------------*/ 8 | FoamFile 9 | { 10 | version 2.0; 11 | format ascii; 12 | class dictionary; 13 | object decomposeParDict; 14 | } 15 | 16 | // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 17 | 18 | numberOfSubdomains 16; 19 | 20 | method scotch; 21 | 22 | // ************************************************************************* // 23 | -------------------------------------------------------------------------------- /cases/Tests/prescribed_ALM/harmonic_turbine/0.orig/include/fixedInlet: -------------------------------------------------------------------------------- 1 | /*--------------------------------*- C++ -*----------------------------------*\ 2 | | ========= | | 3 | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | 4 | | \\ / O peration | Version: 3.0.x | 5 | | \\ / A nd | Web: www.OpenFOAM.org | 6 | | \\/ M anipulation | | 7 | \*---------------------------------------------------------------------------*/ 8 | 9 | inlet 10 | { 11 | type fixedValue; 12 | value $internalField; 13 | } 14 | 15 | // ************************************************************************* // 16 | -------------------------------------------------------------------------------- /cases/Tests/prescribed_ALM/harmonic_turbine/0.orig/include/initialConditions: -------------------------------------------------------------------------------- 1 | /*--------------------------------*- C++ -*----------------------------------*\ 2 | | ========= | | 3 | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | 4 | | \\ / O peration | Version: 3.0.x | 5 | | \\ / A nd | Web: www.OpenFOAM.org | 6 | | \\/ M anipulation | | 7 | \*---------------------------------------------------------------------------*/ 8 | 9 | flowVelocity (10 0 0); 10 | pressure 0; 11 | turbulentKE 2e-4; // Was 2e-4 12 | turbulentEpsilon 2e-6; // Was 0.01; Guess ~ 0.09*k**(3/2)/l 13 | 14 | // ************************************************************************* // 15 | -------------------------------------------------------------------------------- /cases/Tests/prescribed_ALM/harmonic_turbine/ALgeometry.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Source tutorial run functions 3 | . $WM_PROJECT_DIR/bin/tools/RunFunctions 4 | 5 | rm -rf turbineGeometry 6 | #rm log.foamListTimes 7 | runApplication foamListTimes 8 | 9 | region='turbine' 10 | components=('blade1' 'blade2' 'blade3' 'tower') 11 | 12 | python3.8 scripts/ALgeometry.py $region "${components[@]}" -------------------------------------------------------------------------------- /cases/Tests/prescribed_ALM/harmonic_turbine/allClean: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | cd ${0%/*} || exit 1 # run from this directory 3 | 4 | # Source tutorial clean functions 5 | . $WM_PROJECT_DIR/bin/tools/CleanFunctions 6 | 7 | rm -rf 0 > /dev/null 2>&1 8 | 9 | cleanCase 10 | 11 | # ----------------------------------------------------------------- end-of-file 12 | -------------------------------------------------------------------------------- /cases/Tests/prescribed_ALM/harmonic_turbine/constant/RASProperties: -------------------------------------------------------------------------------- 1 | /*--------------------------------*- C++ -*----------------------------------*\ 2 | | ========= | | 3 | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | 4 | | \\ / O peration | Version: 3.0.x | 5 | | \\ / A nd | Web: www.OpenFOAM.org | 6 | | \\/ M anipulation | | 7 | \*---------------------------------------------------------------------------*/ 8 | FoamFile 9 | { 10 | version 2.0; 11 | format ascii; 12 | class dictionary; 13 | object RASProperties; 14 | } 15 | // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 16 | 17 | RASModel kEpsilon; 18 | 19 | turbulence on; 20 | 21 | printCoeffs on; 22 | 23 | // ************************************************************************* // 24 | -------------------------------------------------------------------------------- /cases/Tests/prescribed_ALM/harmonic_turbine/constant/transportProperties: -------------------------------------------------------------------------------- 1 | /*--------------------------------*- C++ -*----------------------------------*\ 2 | | ========= | | 3 | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | 4 | | \\ / O peration | Version: 3.0.x | 5 | | \\ / A nd | Web: www.OpenFOAM.org | 6 | | \\/ M anipulation | | 7 | \*---------------------------------------------------------------------------*/ 8 | FoamFile 9 | { 10 | version 2.0; 11 | format ascii; 12 | class dictionary; 13 | object transportProperties; 14 | } 15 | // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 16 | 17 | transportModel Newtonian; 18 | 19 | nu nu [0 2 -1 0 0 0 0] 1.5e-5; 20 | 21 | // ************************************************************************* // 22 | -------------------------------------------------------------------------------- /cases/Tests/prescribed_ALM/harmonic_turbine/constant/turbulenceProperties: -------------------------------------------------------------------------------- 1 | /*--------------------------------*- C++ -*----------------------------------*\ 2 | | ========= | | 3 | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | 4 | | \\ / O peration | Version: 3.0.x | 5 | | \\ / A nd | Web: www.OpenFOAM.org | 6 | | \\/ M anipulation | | 7 | \*---------------------------------------------------------------------------*/ 8 | FoamFile 9 | { 10 | version 2.0; 11 | format ascii; 12 | class dictionary; 13 | location "constant"; 14 | object turbulenceProperties; 15 | } 16 | // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 17 | 18 | simulationType RAS; 19 | 20 | RAS 21 | { 22 | #include "RASProperties" 23 | } 24 | 25 | // ************************************************************************* // 26 | -------------------------------------------------------------------------------- /cases/Tests/prescribed_ALM/harmonic_turbine/preRun: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Source tutorial run functions 4 | . $WM_PROJECT_DIR/bin/tools/RunFunctions 5 | 6 | restore0Dir 7 | 8 | #Run blockMesh 9 | runApplication blockMesh 10 | 11 | #Run snappyMesh 12 | runApplication snappyHexMesh -overwrite 13 | 14 | # Run topoSet 15 | runApplication topoSet 16 | 17 | # copy "points" file from 0/polyMesh to constant/polyMesh 18 | cp -fr 0/polyMesh/points constant/polyMesh/points -------------------------------------------------------------------------------- /cases/Tests/prescribed_ALM/harmonic_turbine/solverClean: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Source tutorial run functions 4 | . $WM_PROJECT_DIR/bin/tools/CleanFunctions 5 | 6 | cleanTimeDirectories 7 | rm -rf processor* -------------------------------------------------------------------------------- /cases/Tests/prescribed_ALM/harmonic_turbine/solverRun: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | 4 | # Source tutorial run functions 5 | . $WM_PROJECT_DIR/bin/tools/RunFunctions 6 | 7 | # Prepare for parallelisation 8 | runApplication decomposePar 9 | 10 | # Set application name 11 | application="mpirun --oversubscribe -np 16 pimpleFoam -parallel" 12 | 13 | # Renumber meshto get a more diagonal system 14 | # runApplication $renum 15 | 16 | # Run the application 17 | runApplication $application 18 | 19 | # Recontruct case 20 | runApplication reconstructPar 21 | 22 | # Reconstruct logs 23 | runApplication foamLog log.mpirun 24 | # Compute Q criteria 25 | runApplication postProcess -func Q 26 | # Post-process turbine geo 27 | ./ALgeometry.sh 28 | -------------------------------------------------------------------------------- /cases/Tests/prescribed_ALM/harmonic_turbine/system/decomposeParDict: -------------------------------------------------------------------------------- 1 | /*--------------------------------*- C++ -*----------------------------------*\ 2 | | ========= | | 3 | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | 4 | | \\ / O peration | Version: 3.0.x | 5 | | \\ / A nd | Web: www.OpenFOAM.org | 6 | | \\/ M anipulation | | 7 | \*---------------------------------------------------------------------------*/ 8 | FoamFile 9 | { 10 | version 2.0; 11 | format ascii; 12 | class dictionary; 13 | object decomposeParDict; 14 | } 15 | 16 | // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 17 | 18 | numberOfSubdomains 16; 19 | 20 | method scotch; 21 | 22 | // ************************************************************************* // 23 | -------------------------------------------------------------------------------- /cases/Tests/prescribed_ALM/resources/foilData/NACA0021_multiRe_Re: -------------------------------------------------------------------------------- 1 | 40000 80000 160000 360000 700000 1000000 2000000 5000000 2 | -------------------------------------------------------------------------------- /cases/Tests/prescribed_ALM/resources/foilData/S826_1e5_upstroke: -------------------------------------------------------------------------------- 1 | // From Chivaee (2014) 2 | // Re = 1e5 3 | // (alpha_deg cl cd) 4 | (-9.93 -0.23785 0.14162) 5 | (-7.97 -0.44053000000000003 0.13447) 6 | (-5.98 -0.32471 0.05193) 7 | (-4.02 0.04841 0.03263) 8 | (-2.02 0.25935 0.03524) 9 | (-1.01 0.33485 0.03363) 10 | (-0.01 0.53315 0.028560000000000002) 11 | (0.98 0.61083 0.029689999999999998) 12 | (1.99 0.71753 0.02949) 13 | (3.02 0.84191 0.03015) 14 | (4.0 0.94685 0.031239999999999997) 15 | (5.0 1.0554700000000001 0.03115) 16 | (6.01 1.17566 0.034210000000000004) 17 | (6.99 1.2665 0.02797) 18 | (7.99 1.32586 0.02104) 19 | (8.99 1.33418 0.034710000000000005) 20 | (9.95 1.27315 0.04678) 21 | (10.95 1.2278 0.07574) 22 | (11.95 1.1961899999999999 0.11062999999999999) 23 | (12.95 1.172 0.13859000000000002) 24 | (13.97 1.1500700000000001 0.1627) 25 | (14.94 1.1259299999999999 0.19008) 26 | (15.96 0.90846 0.29117) 27 | (17.99 0.9542299999999999 0.34084000000000003) 28 | (19.97 0.9894799999999999 0.37576) 29 | (24.93 1.16523 0.45132) 30 | -------------------------------------------------------------------------------- /cases/Tests/rigidBody_ALM/extruded_Cylinder/0.orig/alpha.water: -------------------------------------------------------------------------------- 1 | /*--------------------------------*- C++ -*----------------------------------*\ 2 | | ========= | | 3 | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | 4 | | \\ / O peration | Version: v2012 | 5 | | \\ / A nd | Website: www.openfoam.com | 6 | | \\/ M anipulation | | 7 | \*---------------------------------------------------------------------------*/ 8 | FoamFile 9 | { 10 | version 2.0; 11 | format ascii; 12 | class volScalarField; 13 | location "0"; 14 | object alpha.water; 15 | } 16 | // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 17 | 18 | dimensions [0 0 0 0 0 0 0]; 19 | 20 | internalField uniform 0; 21 | 22 | boundaryField 23 | { 24 | ".*" 25 | { 26 | type zeroGradient; 27 | } 28 | 29 | "proc.*" 30 | { 31 | type processor; 32 | } 33 | 34 | } 35 | 36 | 37 | // ************************************************************************* // 38 | -------------------------------------------------------------------------------- /cases/Tests/rigidBody_ALM/extruded_Cylinder/0.orig/include/fixedInlet: -------------------------------------------------------------------------------- 1 | /*--------------------------------*- C++ -*----------------------------------*\ 2 | | ========= | | 3 | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | 4 | | \\ / O peration | Version: 3.0.x | 5 | | \\ / A nd | Web: www.OpenFOAM.org | 6 | | \\/ M anipulation | | 7 | \*---------------------------------------------------------------------------*/ 8 | 9 | inlet 10 | { 11 | type fixedValue; 12 | value $internalField; 13 | } 14 | 15 | // ************************************************************************* // 16 | -------------------------------------------------------------------------------- /cases/Tests/rigidBody_ALM/extruded_Cylinder/0.orig/include/initialConditions: -------------------------------------------------------------------------------- 1 | /*--------------------------------*- C++ -*----------------------------------*\ 2 | | ========= | | 3 | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | 4 | | \\ / O peration | Version: 3.0.x | 5 | | \\ / A nd | Web: www.OpenFOAM.org | 6 | | \\/ M anipulation | | 7 | \*---------------------------------------------------------------------------*/ 8 | 9 | flowVelocity (1 0 0); 10 | pressure 0; 11 | turbulentKE 2e-4; // Was 2e-4 12 | turbulentEpsilon 3e-5; // Was 0.01; Guess ~ 0.09*k**(3/2)/l 13 | 14 | // ************************************************************************* // 15 | -------------------------------------------------------------------------------- /cases/Tests/rigidBody_ALM/extruded_Cylinder/ALgeometry.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Source tutorial run functions 3 | . $WM_PROJECT_DIR/bin/tools/RunFunctions 4 | 5 | rm -rf turbineGeometry 6 | #rm log.foamListTimes 7 | runApplication foamListTimes 8 | 9 | region='turbine' 10 | components=('blade1' 'blade2' 'blade3' 'tower') 11 | 12 | python3.8 scripts/ALgeometry.py $region "${components[@]}" -------------------------------------------------------------------------------- /cases/Tests/rigidBody_ALM/extruded_Cylinder/Coextract.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | file=log.mpirun 4 | printf 'Time \t Delta t \t Co \t ICo \n' > Co.dat 5 | my_output="$(awk '/Courant Number/{Co=$6;getline;ICo=$7;getline;DTIME=$3;getline;TIME=$3;printf("%8.6f\t%8.6f\t%8.6f\t%8.6f\n",TIME,DTIME,Co,ICo);}' $file)" 6 | echo "$my_output" >> Co.dat -------------------------------------------------------------------------------- /cases/Tests/rigidBody_ALM/extruded_Cylinder/allClean: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Source tutorial run functions 4 | . $WM_PROJECT_DIR/bin/tools/CleanFunctions 5 | 6 | cleanCase0 -------------------------------------------------------------------------------- /cases/Tests/rigidBody_ALM/extruded_Cylinder/constant/g: -------------------------------------------------------------------------------- 1 | /*--------------------------------*- C++ -*----------------------------------*\ 2 | | ========= | | 3 | | \\ / F ield | OpenFOAM Extend Project: Open Source CFD | 4 | | \\ / O peration | Version: 1.6-ext | 5 | | \\ / A nd | Web: www.extend-project.de | 6 | | \\/ M anipulation | | 7 | \*---------------------------------------------------------------------------*/ 8 | FoamFile 9 | { 10 | version 2.0; 11 | format ascii; 12 | class uniformDimensionedVectorField; 13 | location "constant"; 14 | object g; 15 | } 16 | // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 17 | 18 | dimensions [0 1 -2 0 0 0 0]; 19 | value ( 0 0 -9.81 ); 20 | 21 | // ************************************************************************* // 22 | -------------------------------------------------------------------------------- /cases/Tests/rigidBody_ALM/extruded_Cylinder/constant/polyMesh/cellZones: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fronterapp/thesis-FloatingTurbine/91ffae684f91fadf26a41b7d463cff478242c7e8/cases/Tests/rigidBody_ALM/extruded_Cylinder/constant/polyMesh/cellZones -------------------------------------------------------------------------------- /cases/Tests/rigidBody_ALM/extruded_Cylinder/constant/polyMesh/faces: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fronterapp/thesis-FloatingTurbine/91ffae684f91fadf26a41b7d463cff478242c7e8/cases/Tests/rigidBody_ALM/extruded_Cylinder/constant/polyMesh/faces -------------------------------------------------------------------------------- /cases/Tests/rigidBody_ALM/extruded_Cylinder/constant/polyMesh/neighbour: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fronterapp/thesis-FloatingTurbine/91ffae684f91fadf26a41b7d463cff478242c7e8/cases/Tests/rigidBody_ALM/extruded_Cylinder/constant/polyMesh/neighbour -------------------------------------------------------------------------------- /cases/Tests/rigidBody_ALM/extruded_Cylinder/constant/polyMesh/owner: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fronterapp/thesis-FloatingTurbine/91ffae684f91fadf26a41b7d463cff478242c7e8/cases/Tests/rigidBody_ALM/extruded_Cylinder/constant/polyMesh/owner -------------------------------------------------------------------------------- /cases/Tests/rigidBody_ALM/extruded_Cylinder/constant/polyMesh/points: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fronterapp/thesis-FloatingTurbine/91ffae684f91fadf26a41b7d463cff478242c7e8/cases/Tests/rigidBody_ALM/extruded_Cylinder/constant/polyMesh/points -------------------------------------------------------------------------------- /cases/Tests/rigidBody_ALM/extruded_Cylinder/constant/turbulenceProperties: -------------------------------------------------------------------------------- 1 | /*--------------------------------*- C++ -*----------------------------------*\ 2 | | ========= | | 3 | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | 4 | | \\ / O peration | Version: 3.0.x | 5 | | \\ / A nd | Web: www.OpenFOAM.org | 6 | | \\/ M anipulation | | 7 | \*---------------------------------------------------------------------------*/ 8 | FoamFile 9 | { 10 | version 2.0; 11 | format ascii; 12 | class dictionary; 13 | location "constant"; 14 | object turbulenceProperties; 15 | } 16 | // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 17 | 18 | simulationType RAS; 19 | 20 | RAS 21 | { 22 | #include "RASProperties" 23 | } 24 | 25 | // ************************************************************************* // 26 | -------------------------------------------------------------------------------- /cases/Tests/rigidBody_ALM/extruded_Cylinder/myVars: -------------------------------------------------------------------------------- 1 | // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 2 | // This file is used to define global variables// 3 | // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 4 | 5 | 6 | cyl_a 0.0762; //Cylinder radii, 3 inches 7 | y0 0; //Initial displacement, 1 inch 8 | relaxation_length 0; // Length of the relaxation zones 9 | water_depth #calc "1.2192/2"; // 4 feet + initial displacement, since mean water level is at -y0 10 | tank_length $water_depth; //4 feet 11 | domain_length #calc "$tank_length+2*$relaxation_length"; //4 feet + relaxation zones 12 | domain_height #calc $water_depth; 13 | 14 | // Front/back locations 15 | zmin -0.25; 16 | zmax 0.25; -------------------------------------------------------------------------------- /cases/Tests/rigidBody_ALM/extruded_Cylinder/preRun: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Source tutorial run functions 4 | . $WM_PROJECT_DIR/bin/tools/RunFunctions 5 | 6 | restore0Dir 7 | 8 | #Run blockMesh 9 | runApplication blockMesh 10 | 11 | #runApplication extrudeMesh 12 | 13 | # Run topoSet 14 | runApplication topoSet 15 | 16 | # copy "points" file from 0/polyMesh to constant/polyMesh 17 | cp -fr 0/polyMesh/points constant/polyMesh/points -------------------------------------------------------------------------------- /cases/Tests/rigidBody_ALM/extruded_Cylinder/solverClean: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Source tutorial run functions 4 | . $WM_PROJECT_DIR/bin/tools/CleanFunctions 5 | 6 | cleanTimeDirectories 7 | rm -rf processor* -------------------------------------------------------------------------------- /cases/Tests/rigidBody_ALM/extruded_Cylinder/solverRun: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | 4 | # Source tutorial run functions 5 | . $WM_PROJECT_DIR/bin/tools/RunFunctions 6 | 7 | # Prepare for parallelisation 8 | runApplication decomposePar 9 | 10 | # Set application name 11 | application="mpirun --oversubscribe -np 16 interFoam -parallel" 12 | 13 | # Renumber meshto get a more diagonal system 14 | # runApplication $renum 15 | 16 | # Run the application 17 | runApplication $application 18 | 19 | # Recontruct case 20 | runApplication reconstructPar 21 | 22 | # Reconstruct logs 23 | runApplication foamLog log.mpirun 24 | 25 | # Post-process turbine geo 26 | ./ALgeometry.sh -------------------------------------------------------------------------------- /cases/Tests/rigidBody_ALM/extruded_Cylinder/system/decomposeParDict: -------------------------------------------------------------------------------- 1 | /*--------------------------------*- C++ -*----------------------------------*\ 2 | | ========= | | 3 | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | 4 | | \\ / O peration | Version: 3.0.x | 5 | | \\ / A nd | Web: www.OpenFOAM.org | 6 | | \\/ M anipulation | | 7 | \*---------------------------------------------------------------------------*/ 8 | FoamFile 9 | { 10 | version 2.0; 11 | format ascii; 12 | class dictionary; 13 | object decomposeParDict; 14 | } 15 | 16 | // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 17 | 18 | numberOfSubdomains 16; 19 | 20 | method scotch; 21 | 22 | // ************************************************************************* // 23 | -------------------------------------------------------------------------------- /cases/Tests/rigidBody_ALM/extruded_Cylinder/system/elementData: -------------------------------------------------------------------------------- 1 | // Blade element data 2 | // axialDistance, radius, azimuth, chord, chordMount, twist 3 | (0.0 0.00357 0.0 0.0135 0.25 0.0) 4 | (0.0 0.09643 0.0 0.02592585 0.25 0.71674) -------------------------------------------------------------------------------- /libraries/floatingSixDoFRigidBodyMotion/Make/options: -------------------------------------------------------------------------------- 1 | EXE_INC = \ 2 | -I$(LIB_SRC)/finiteVolume/lnInclude \ 3 | -I$(LIB_SRC)/fileFormats/lnInclude \ 4 | -I$(LIB_SRC)/meshTools/lnInclude \ 5 | -I$(LIB_SRC)/functionObjects/forces/lnInclude \ 6 | -I$(LIB_SRC)/dynamicMesh/lnInclude 7 | 8 | LIB_LIBS = \ 9 | -lfiniteVolume \ 10 | -lmeshTools \ 11 | -lforces \ 12 | -ldynamicMesh 13 | -------------------------------------------------------------------------------- /libraries/floatingTurbinesFoam/Allwclean: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | echo "Cleaning turbinesFoam" 4 | 5 | wclean src 6 | -------------------------------------------------------------------------------- /libraries/floatingTurbinesFoam/Allwmake: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # Parse arguments for library compilation without documentation by default 4 | . $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments 5 | 6 | wmake libso src 7 | -------------------------------------------------------------------------------- /libraries/floatingTurbinesFoam/src/Make/files: -------------------------------------------------------------------------------- 1 | interpolations/interpolateUtils.C 2 | fvOptions/turbineALSource/turbineALSource.C 3 | fvOptions/crossFlowTurbineALSource/crossFlowTurbineALSource.C 4 | fvOptions/axialFlowTurbineALSource/axialFlowTurbineALSource.C 5 | fvOptions/actuatorLineSource/actuatorLineSource.C 6 | fvOptions/actuatorLineSource/actuatorLineElement/actuatorLineElement.C 7 | fvOptions/actuatorLineSource/actuatorLineElement/addedMassModel/addedMassModel.C 8 | fvOptions/actuatorLineSource/actuatorLineElement/dynamicStallModels/dynamicStallModel/dynamicStallModel.C 9 | fvOptions/actuatorLineSource/actuatorLineElement/dynamicStallModels/LeishmanBeddoes/LeishmanBeddoes.C 10 | fvOptions/actuatorLineSource/actuatorLineElement/dynamicStallModels/LeishmanBeddoes3G/LeishmanBeddoes3G.C 11 | fvOptions/actuatorLineSource/actuatorLineElement/dynamicStallModels/LeishmanBeddoesSGC/LeishmanBeddoesSGC.C 12 | fvOptions/actuatorLineSource/actuatorLineElement/dynamicStallModels/LeishmanBeddoesSD/LeishmanBeddoesSD.C 13 | fvOptions/actuatorLineSource/actuatorLineElement/profileData/profileData.C 14 | 15 | LIB = $(FOAM_USER_LIBBIN)/libfloatingTurbinesFoam 16 | -------------------------------------------------------------------------------- /libraries/floatingTurbinesFoam/src/Make/options: -------------------------------------------------------------------------------- 1 | EXE_INC = \ 2 | -I$(LIB_SRC)/finiteVolume/lnInclude \ 3 | -I$(LIB_SRC)/meshTools/lnInclude \ 4 | -I$(LIB_SRC)/sampling/lnInclude \ 5 | -I$(LIB_SRC)/fvOptions/lnInclude 6 | 7 | LIB_LIBS = \ 8 | -lfiniteVolume \ 9 | -lsampling \ 10 | -lmeshTools \ 11 | -lfvOptions -------------------------------------------------------------------------------- /other/job_submission_scripts/README.md: -------------------------------------------------------------------------------- 1 | PBS scripts 2 | ============ 3 | 4 | Basic PBS scripts for job submission in the server. 5 | 6 | Divided into pre-processing, solver and post-processing steps. -------------------------------------------------------------------------------- /other/job_submission_scripts/postJob.pbs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fronterapp/thesis-FloatingTurbine/91ffae684f91fadf26a41b7d463cff478242c7e8/other/job_submission_scripts/postJob.pbs -------------------------------------------------------------------------------- /other/job_submission_scripts/preJob.pbs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fronterapp/thesis-FloatingTurbine/91ffae684f91fadf26a41b7d463cff478242c7e8/other/job_submission_scripts/preJob.pbs -------------------------------------------------------------------------------- /other/job_submission_scripts/solverJob_multiNode.pbs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fronterapp/thesis-FloatingTurbine/91ffae684f91fadf26a41b7d463cff478242c7e8/other/job_submission_scripts/solverJob_multiNode.pbs -------------------------------------------------------------------------------- /other/job_submission_scripts/solverJob_singleNode.pbs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fronterapp/thesis-FloatingTurbine/91ffae684f91fadf26a41b7d463cff478242c7e8/other/job_submission_scripts/solverJob_singleNode.pbs -------------------------------------------------------------------------------- /other/postProcessing/AL_geometry_extractor/ALgeometry.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Source tutorial run functions 3 | . $WM_PROJECT_DIR/bin/tools/RunFunctions 4 | 5 | rm -rf turbineGeometry 6 | #rm log.foamListTimes 7 | runApplication foamListTimes 8 | 9 | region='turbine' 10 | components=('blade1' 'blade2' 'blade3' 'tower') 11 | 12 | python3.8 scripts/ALgeometry.py $region "${components[@]}" -------------------------------------------------------------------------------- /other/postProcessing/README.md: -------------------------------------------------------------------------------- 1 | Post-processing utilities 2 | ============ 3 | 4 | Basic scripts (MATLAB and Python) for post-processing purposes. 5 | 6 | ## waves 7 | From the data generated by `waves2Foam`: 8 | - Extraction of surface elevation. 9 | - Error w.r.t. Stokes' second-order theory. 10 | - Calculation of wavelength with the non-linear dispersion relation. 11 | 12 | ## turbine 13 | From the data generated by `turbinesFoam`: 14 | - Extraction of hub loads. 15 | - Blade distributions: 16 | - For a given time. 17 | - Time-averaged. 18 | - Properties at a given radial section. 19 | 20 | ## ALM_geometry_extractor 21 | Writes a VTK file with the coordinates of the actuator elements so they can be visualized (e.g. in Paraview). 22 | 23 | These coordinates are read from the `postProcessing` folder created by `turbinesFoam`. 24 | 25 | The `ALgeometry.sh` file must contain the names of the actuator lines of interest. 26 | 27 | The `ALgeometry.sh` file must be run from within the case folder. -------------------------------------------------------------------------------- /other/postProcessing/waves/computeWavelength/computeLambda.m: -------------------------------------------------------------------------------- 1 | %% Computes wavelength of a wave 2 | % Given the period, water depth and wave height 3 | function [lambda] = computeLambda(period, depth, g) 4 | lambda = 0; % Variable initialization 5 | fun = @(lambda)dispersionRelation(lambda, period, depth, g); 6 | x0 = 0; % Intial guess 7 | lambda = fsolve(fun,x0); % Solve the non-linear dispersion relation 8 | end -------------------------------------------------------------------------------- /other/postProcessing/waves/computeWavelength/dispersionRelation.m: -------------------------------------------------------------------------------- 1 | %% Wave dispersion relation for shallow waters 2 | % Returns zero if the dispersion relation is met 3 | function [F] = dispersionRelation(lambda, period, depth, g) 4 | F = lambda - (g/(2*pi))*period^2*tanh(2*pi*depth/lambda); 5 | end -------------------------------------------------------------------------------- /other/postProcessing/waves/computeWavelength/main.m: -------------------------------------------------------------------------------- 1 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 2 | %%%%%%%%%%%% Compute wavelength given the period and depth %%%%%%%%%%%% 3 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 4 | 5 | %% Define the parameters 6 | period = 8; % Wave period [s] 7 | depth = 150; % Water depth [m] 8 | g = 9.81; % Gravity acceleration [m/s^2] 9 | 10 | %% Compute wavelength 11 | lambda = computeLambda(period, depth, g) % Wavelength -------------------------------------------------------------------------------- /other/postProcessing/waves/extractSurfaceElevation/averagePhase.m: -------------------------------------------------------------------------------- 1 | %% Computes phase averaged value of a periodic signal, refFun 2 | % Computation will not take into account the first N = delayPeriods periods 3 | % Each period will be shortened or enlarged up to M = refSampleLength points 4 | 5 | function [phaseAvg] = averagePhase(ref_fun, delay_periods, ref_sample_length) 6 | 7 | % Find the peaks 8 | [peaks, idx]= findpeaks(ref_fun); 9 | % To avoid numerical error, consider peaks only those that are at least 5% of wave height 10 | idxPeaks = idx(peaks>0.05*max(peaks)); 11 | % Split according to the peaks' position 12 | splitFun = zeros(length(idxPeaks)-1-delay_periods,ref_sample_length); 13 | 14 | for i=delay_periods+1:length(idxPeaks)-1 15 | % Size of the actual period 16 | sampleLength = idxPeaks(i+1)-idxPeaks(i)+1; 17 | % Interpolate in case the periods do not contain the same number of samples, needed if we want to sum them up 18 | splitFun(i,:) = interp1(linspace(0,1,sampleLength),ref_fun(idxPeaks(i):idxPeaks(i+1)),linspace(0,1,ref_sample_length)); 19 | end 20 | 21 | % Compute the phase-average 22 | phaseAvg = sum(splitFun,1)./(length(idxPeaks)-1-delay_periods); 23 | 24 | end -------------------------------------------------------------------------------- /other/postProcessing/waves/extractSurfaceElevation/surfaceElevation_2nd.m: -------------------------------------------------------------------------------- 1 | %% Compute surface elevation according to Stoke's second-order theory 2 | % Inputs are: 3 | % Position (x), time (t), wavelength(lambda) 4 | % Period (T), wave height (H), and water depth (h) 5 | % Output is surface elevation (eta) 6 | function [eta] = surfaceElevation_2nd(x, t, lambda,T, H, h) 7 | a = H/2; % Wave amplitude 8 | k = 2*pi/lambda; % Wavenumber 9 | w = 2*pi/T; %Wave frequency 10 | theta = k*x - w*t; % Phase 11 | sigma = tanh(k*h); 12 | f = (3-sigma^2)/(4*sigma^3); 13 | eta = a*(cos(theta)+ k*a*cos(2*theta)*f); % Surface elevation 14 | end --------------------------------------------------------------------------------