├── Axisymmetric2D ├── README ├── case │ ├── 0 │ │ ├── .svn │ │ │ ├── all-wcprops │ │ │ ├── entries │ │ │ └── text-base │ │ │ │ ├── U.svn-base │ │ │ │ └── p.svn-base │ │ ├── U │ │ ├── epsilon │ │ ├── k │ │ ├── nuTilda │ │ ├── nut │ │ └── p │ ├── constant │ │ ├── RASProperties │ │ ├── transportProperties │ │ └── turbulenceProperties │ └── system │ │ ├── baffleDict │ │ ├── controlDict │ │ ├── fvSchemes │ │ └── fvSolution └── mesh │ └── main.geo ├── AxisymmetricCoaxialRotor ├── 0 │ ├── U │ ├── k │ ├── nut │ ├── omega │ └── p ├── cleanAll ├── constant │ ├── transportProperties │ └── turbulenceProperties ├── mesh │ ├── detached.geo │ └── main.geo ├── rotorDiskSourceTemplates.C ├── runAll └── system │ ├── changeDictionaryDict │ ├── controlDict │ ├── fvOptions │ ├── fvSchemes │ └── fvSolution ├── AxisymmetricCoaxialRotorParallel ├── 0 │ ├── U │ ├── k │ ├── nut │ ├── omega │ └── p ├── README.txt ├── cleanAll ├── constant │ ├── transportProperties │ └── turbulenceProperties ├── decomposeParDict ├── mesh │ ├── detached.geo │ └── main.geo ├── rotorDiskSourceTemplates.C ├── runAll └── system │ ├── changeDictionaryDict │ ├── controlDict │ ├── decomposeParDict │ ├── fvOptions │ ├── fvSchemes │ └── fvSolution ├── AxisymmetricRotor ├── 0 │ ├── U │ ├── k │ ├── nut │ ├── omega │ └── p ├── cleanAll ├── constant │ ├── transportProperties │ └── turbulenceProperties ├── mesh │ ├── shaft.geo │ └── wedge.geo ├── rotorDiskSourceTemplates.C ├── runAll └── system │ ├── changeDictionaryDict │ ├── controlDict │ ├── fvOptions │ ├── fvSchemes │ └── fvSolution ├── Baffle ├── README ├── case │ ├── 0 │ │ ├── .svn │ │ │ ├── all-wcprops │ │ │ ├── entries │ │ │ └── text-base │ │ │ │ ├── U.svn-base │ │ │ │ └── p.svn-base │ │ ├── U │ │ ├── epsilon │ │ ├── k │ │ ├── nuTilda │ │ ├── nut │ │ └── p │ ├── constant │ │ ├── RASProperties │ │ ├── transportProperties │ │ └── turbulenceProperties │ └── system │ │ ├── baffleDict │ │ ├── controlDict │ │ ├── fvSchemes │ │ └── fvSolution ├── commands.txt └── main.geo ├── Beginner └── README.txt ├── BluffBodyWake ├── README.md ├── case │ ├── 0 │ │ ├── U │ │ ├── include │ │ │ ├── fixedInlet │ │ │ ├── front_and_back_and_tunnel │ │ │ └── initialConditions │ │ ├── nuTilda │ │ ├── nut │ │ └── p │ ├── constant │ │ ├── transportProperties │ │ └── turbulenceProperties │ └── system │ │ ├── baffleDict │ │ ├── controlDict │ │ ├── fvSchemes │ │ └── fvSolution └── mesh.geo ├── Cantilever ├── README.md ├── case │ ├── 0 │ │ ├── D │ │ └── T │ ├── clear_solution │ ├── constant │ │ ├── mechanicalProperties │ │ └── thermalProperties │ ├── sigma.py │ └── system │ │ ├── changeDictionaryDict │ │ ├── controlDict │ │ ├── fvSchemes │ │ └── fvSolution ├── converged_coarser.png ├── converged_finer.png └── mesh │ └── cantilever.geo ├── CoaxialDistance ├── 0 │ ├── U │ ├── k │ ├── nut │ ├── omega │ └── p ├── cleanAll ├── constant │ ├── transportProperties │ └── turbulenceProperties ├── mesh │ ├── alternate.geo │ └── simple.geo ├── results.txt ├── rotorDiskSourceTemplates.C ├── runAll └── system │ ├── changeDictionaryDict │ ├── controlDict │ ├── decomposeParDict │ ├── fvOptions │ ├── fvSchemes │ └── fvSolution ├── CompilingCustomOutput ├── README.txt └── rotorDiskSourceTemplates.C ├── CompilingCustomSolver ├── README ├── mixerVesselAMI2D │ ├── 0 │ │ ├── U │ │ ├── epsilon │ │ ├── k │ │ ├── nut │ │ └── p │ ├── Allrun │ ├── constant │ │ ├── RASProperties │ │ ├── dynamicMeshDict │ │ ├── polyMesh │ │ │ └── blockMeshDict.m4 │ │ ├── transportProperties │ │ ├── triSurface │ │ │ └── projectionSurface.stl │ │ └── turbulenceProperties │ ├── makeMesh │ └── system │ │ ├── controlDict │ │ ├── decomposeParDict │ │ ├── fvSchemes │ │ ├── fvSolution │ │ └── topoSetDict └── solvers │ ├── UEqn.H │ ├── createFields.H │ ├── mySolver │ ├── Make │ │ ├── files │ │ └── options │ ├── correctPhi.H │ ├── mySolver.C │ ├── mySolver.dep │ ├── pEqn.H │ └── readControls.H │ ├── pEqn.H │ └── pimpleDyMFoam │ ├── Make │ ├── files │ └── options │ ├── correctPhi.H │ ├── pEqn.H │ ├── pimpleDyMFoam.C │ ├── pimpleDyMFoam.dep │ └── readControls.H ├── DuctedFan ├── README ├── case │ ├── 0 │ │ ├── .svn │ │ │ ├── all-wcprops │ │ │ ├── entries │ │ │ └── text-base │ │ │ │ ├── U.svn-base │ │ │ │ └── p.svn-base │ │ ├── U │ │ ├── nuTilda │ │ ├── nut │ │ └── p │ ├── constant │ │ ├── RASProperties │ │ ├── transportProperties │ │ └── turbulenceProperties │ └── system │ │ ├── baffleDict │ │ ├── controlDict │ │ ├── fvSchemes │ │ └── fvSolution └── mesh │ ├── domainboundary.geo │ ├── functions.geo │ ├── innercore.geo │ ├── inputs.geo │ ├── main.geo │ ├── outercore.geo │ ├── revolutions.geo │ ├── shapes │ ├── basic.geo │ └── basicbl.geo │ └── unstructuredboundary.geo ├── FanWing2D ├── README.txt ├── case │ ├── 0 │ │ ├── .svn │ │ │ ├── all-wcprops │ │ │ ├── entries │ │ │ └── text-base │ │ │ │ ├── U.svn-base │ │ │ │ └── p.svn-base │ │ ├── U │ │ ├── U~ │ │ ├── include │ │ │ └── ami │ │ ├── nuTilda │ │ ├── nut │ │ └── p │ ├── constant │ │ ├── RASProperties │ │ ├── dynamicMeshDict │ │ ├── transportProperties │ │ └── turbulenceProperties │ └── system │ │ ├── controlDict │ │ ├── fvSchemes │ │ └── fvSolution └── mesh │ ├── bound.geo │ ├── cap.geo │ ├── casing.geo │ ├── extrusion.geo │ ├── firstplane.geo │ ├── gmsh tips and hints.txt │ ├── inputs.geo │ ├── intro.geo │ ├── main.geo │ ├── rotor.geo │ ├── secondplane.geo │ ├── subs.geo │ ├── thirdplane.geo │ ├── wt.geo │ ├── wtext.geo │ ├── wtfill.geo │ └── wtspan.geo ├── GmshBasic0 ├── README └── main.geo ├── GmshBasic1 ├── README └── main.geo ├── GmshBasic2 ├── README ├── convert.sh ├── dummyCase │ ├── constant │ │ └── polyMesh │ │ │ ├── boundary │ │ │ ├── cellZones │ │ │ ├── faceZones │ │ │ ├── faces │ │ │ ├── neighbour │ │ │ ├── owner │ │ │ ├── pointZones │ │ │ ├── points │ │ │ └── sets │ │ │ └── cellZone_0 │ └── system │ │ └── controlDict └── main.geo ├── GmshBasic3 ├── README ├── main.geo ├── makemesh.sh └── originals │ └── cavity │ ├── 0 │ ├── U │ ├── epsilon │ ├── k │ ├── nuTilda │ ├── nut │ └── p │ ├── constant │ ├── RASProperties │ ├── polyMesh │ │ └── blockMeshDict │ ├── transportProperties │ └── turbulenceProperties │ └── system │ ├── controlDict │ ├── fvSchemes │ └── fvSolution ├── GroundEffect ├── README ├── case │ ├── 0 │ │ ├── .svn │ │ │ ├── all-wcprops │ │ │ ├── entries │ │ │ └── text-base │ │ │ │ ├── U.svn-base │ │ │ │ └── p.svn-base │ │ ├── U │ │ ├── epsilon │ │ ├── k │ │ ├── nuTilda │ │ ├── nut │ │ └── p │ ├── constant │ │ ├── RASProperties │ │ ├── transportProperties │ │ └── turbulenceProperties │ └── system │ │ ├── controlDict │ │ ├── fvSchemes │ │ └── fvSolution └── mesh │ ├── NACA2412.dat │ ├── NACA2412.geo │ ├── dat2geo.py │ └── main.geo ├── HowToPlotForces ├── README ├── airFoil2D_new.zip ├── airFoil2D_original.zip ├── gnuplot_script.sh └── plot_forces.py ├── Hyperloop0 ├── README ├── case │ ├── 0 │ │ ├── .svn │ │ │ ├── all-wcprops │ │ │ ├── entries │ │ │ └── text-base │ │ │ │ ├── U.svn-base │ │ │ │ └── p.svn-base │ │ ├── T │ │ ├── U │ │ └── p │ ├── constant │ │ ├── thermophysicalProperties │ │ └── turbulenceProperties │ └── system │ │ ├── controlDict │ │ ├── fvSchemes │ │ └── fvSolution └── mesh │ └── main.geo ├── InfiniRotor ├── 0 │ ├── U │ ├── k │ ├── nut │ ├── omega │ └── p ├── cleanAll ├── constant │ ├── transportProperties │ └── turbulenceProperties ├── mesh │ └── main.geo ├── results.txt ├── rotorDiskSourceTemplates.C ├── runAll ├── runAllPar └── system │ ├── changeDictionaryDict │ ├── controlDict │ ├── decomposeParDict │ ├── fvOptions │ ├── fvSchemes │ └── fvSolution ├── MagnusEffect ├── README ├── case │ ├── 0 │ │ ├── .svn │ │ │ ├── all-wcprops │ │ │ ├── entries │ │ │ └── text-base │ │ │ │ ├── U.svn-base │ │ │ │ └── p.svn-base │ │ ├── U │ │ ├── epsilon │ │ ├── k │ │ ├── nuTilda │ │ ├── nut │ │ └── p │ ├── constant │ │ ├── RASProperties │ │ ├── RASProperties~ │ │ ├── transportProperties │ │ └── turbulenceProperties │ └── system │ │ ├── controlDict │ │ ├── fvSchemes │ │ └── fvSolution └── mesh │ └── main.geo ├── MultiRotor ├── 0 │ ├── U │ ├── k │ ├── nut │ ├── omega │ └── p ├── cleanAll ├── constant │ ├── transportProperties │ └── turbulenceProperties ├── mesh │ ├── main.geo │ └── old.geo ├── results.txt ├── resultsBig.txt ├── rotorDiskSourceTemplates.C ├── runAll ├── runAllPar └── system │ ├── changeDictionaryDict │ ├── controlDict │ ├── decomposeParDict │ ├── fvOptions │ ├── fvSchemes │ └── fvSolution ├── Parallel ├── README.md ├── case │ ├── 0 │ │ ├── U │ │ ├── nuTilda │ │ ├── nut │ │ └── p │ ├── constant │ │ ├── transportProperties │ │ └── turbulenceProperties │ └── system │ │ ├── controlDict │ │ ├── decomposeParDict │ │ ├── fvSchemes │ │ └── fvSolution ├── decomposeParDict └── mesh │ ├── NACA2412.dat │ ├── NACA2412.geo │ ├── README.md │ ├── dat2geo.py │ └── mesh.geo ├── README.md ├── RotorGridConvergence ├── 0 │ ├── U │ ├── k │ ├── nut │ ├── omega │ └── p ├── cleanAll ├── constant │ ├── transportProperties │ └── turbulenceProperties ├── mesh │ └── main.geo ├── results.txt ├── resultsBig.txt ├── rotorDiskSourceTemplates.C ├── runAll ├── runAllPar └── system │ ├── changeDictionaryDict │ ├── controlDict │ ├── decomposeParDict │ ├── fvOptions │ ├── fvSchemes │ └── fvSolution ├── SpaceCapsule ├── README.md ├── case │ ├── 0 │ │ ├── T │ │ ├── U │ │ ├── alphat │ │ ├── epsilon │ │ ├── inputs │ │ ├── k │ │ ├── nut │ │ └── p │ ├── constant │ │ ├── thermophysicalProperties │ │ └── turbulenceProperties │ └── system │ │ ├── controlDict │ │ ├── fvSchemes │ │ └── fvSolution └── mesh.geo └── TimeProfiling ├── README ├── log.pimpleDyMFoamTimed ├── new ├── UEqn.H ├── createFields.H ├── pEqn.H └── pimpleDyMFoamTimed │ ├── Make │ ├── files │ └── options │ ├── StopWatch.H │ ├── correctPhi.H │ ├── pEqn.H │ ├── pimpleDyMFoamTimed.C │ ├── pimpleDyMFoamTimed.dep │ └── readControls.H ├── original ├── UEqn.H ├── createFields.H ├── pEqn.H └── pimpleDyMFoam │ ├── Make │ ├── files │ └── options │ ├── correctPhi.H │ ├── pEqn.H │ ├── pimpleDyMFoam.C │ └── readControls.H └── propeller ├── 0.org ├── U ├── epsilon ├── k ├── nut └── p ├── Allclean ├── Allrun ├── Allrun.pre ├── constant ├── RASProperties ├── dynamicMeshDict ├── polyMesh │ ├── blockMeshDict │ └── boundary ├── transportProperties ├── triSurface │ ├── innerCylinder.obj │ ├── innerCylinderSmall.obj │ ├── outerCylinder.obj │ ├── propellerStem1.obj │ ├── propellerStem2.obj │ └── propellerStem3.obj └── turbulenceProperties └── system ├── Q ├── controlDict ├── createInletOutletSets.topoSetDict ├── createPatchDict ├── decomposeParDict ├── forces ├── fvSchemes ├── fvSolution ├── readFields ├── snappyHexMeshDict ├── surfaceFeatureExtractDict ├── surfaceFeatureExtractDictDefaults └── surfaces /Axisymmetric2D/README: -------------------------------------------------------------------------------- 1 | Axisymmetric 2D Simulation in OpenFOAM 2 | 3 | All code can be found at: https://github.com/lordvon/OpenFOAM_Tutorials/tree/master/Axisymmetric2D 4 | 5 | DESCRIPTION: 6 | Here we will do a simple 2D axisymmetric simulation of a donut shape in freestream. The 'wedge' boundary condition will be introduced and details on setting up an axisymmetric case will be shown. 7 | 8 | OUTLINE: 9 | -Use rotational extrude in Gmsh to create a wedge shape. 10 | -Convert the mesh and change the boundary file. 11 | -Change the write format in system/controlDict to 'binary' to prevent errors. 12 | -Run the simulation and view post-processed results. 13 | 14 | COMMANDS: 15 | gmsh mesh/main.geo -3 -o test.msh 16 | gmshToFoam test.msh -case case 17 | # Modify boundary file 18 | pimpleFoam 19 | 20 | This tutorial was run successfully on: 21 | -Ubuntu 14.04 64-bit 22 | -OpenFOAM 2.3.1 23 | -Gmsh 2.9.3 -------------------------------------------------------------------------------- /Axisymmetric2D/case/0/.svn/all-wcprops: -------------------------------------------------------------------------------- 1 | K 25 2 | svn:wc:ra_dav:version-url 3 | V 98 4 | /svnroot/openfoam-extend/!svn/ver/1160/trunk/Core/OpenFOAM-1.5-dev/tutorials/icoDyMFoam/mixerGgi/0 5 | END 6 | p 7 | K 25 8 | svn:wc:ra_dav:version-url 9 | V 100 10 | /svnroot/openfoam-extend/!svn/ver/1160/trunk/Core/OpenFOAM-1.5-dev/tutorials/icoDyMFoam/mixerGgi/0/p 11 | END 12 | U 13 | K 25 14 | svn:wc:ra_dav:version-url 15 | V 100 16 | /svnroot/openfoam-extend/!svn/ver/1160/trunk/Core/OpenFOAM-1.5-dev/tutorials/icoDyMFoam/mixerGgi/0/U 17 | END 18 | -------------------------------------------------------------------------------- /Axisymmetric2D/case/0/.svn/entries: -------------------------------------------------------------------------------- 1 | 10 2 | 3 | dir 4 | 1824 5 | https://openfoam-extend.svn.sourceforge.net/svnroot/openfoam-extend/trunk/Core/OpenFOAM-1.5-dev/tutorials/icoDyMFoam/mixerGgi/0 6 | https://openfoam-extend.svn.sourceforge.net/svnroot/openfoam-extend 7 | 8 | 9 | 10 | 2009-04-02T10:19:15.967477Z 11 | 1160 12 | hjasak 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | e4e07f05-0c2f-0410-a05a-b8ba57e0c909 28 | 29 | p 30 | file 31 | 32 | 33 | 34 | 35 | 2010-09-12T03:25:12.586382Z 36 | dd2b863de322b1d9c35faef303f89f85 37 | 2009-04-02T10:19:15.967477Z 38 | 1160 39 | hjasak 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 1312 62 | 63 | U 64 | file 65 | 66 | 67 | 68 | 69 | 2010-09-12T03:25:12.586382Z 70 | c1b8734ca81431daedfa5badc1f03002 71 | 2009-04-02T10:19:15.967477Z 72 | 1160 73 | hjasak 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 1416 96 | 97 | -------------------------------------------------------------------------------- /Axisymmetric2D/case/constant/RASProperties: -------------------------------------------------------------------------------- 1 | /*--------------------------------*- C++ -*----------------------------------*\ 2 | | ========= | | 3 | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | 4 | | \\ / O peration | Version: 2.3.1 | 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 RASProperties; 15 | } 16 | // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 17 | 18 | RASModel kEpsilon; 19 | 20 | turbulence on; 21 | 22 | printCoeffs on; 23 | 24 | 25 | // ************************************************************************* // 26 | -------------------------------------------------------------------------------- /Axisymmetric2D/case/constant/turbulenceProperties: -------------------------------------------------------------------------------- 1 | /*--------------------------------*- C++ -*----------------------------------*\ 2 | | ========= | | 3 | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | 4 | | \\ / O peration | Version: 2.3.1 | 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 RASModel; 19 | 20 | 21 | // ************************************************************************* // 22 | -------------------------------------------------------------------------------- /Axisymmetric2D/case/system/baffleDict: -------------------------------------------------------------------------------- 1 | /*--------------------------------*- C++ -*----------------------------------*\ 2 | | ========= | | 3 | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | 4 | | \\ / O peration | Version: 2.3.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 | object createBafflesDict; 14 | } 15 | // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 16 | 17 | internalFacesOnly true; 18 | 19 | baffles 20 | { 21 | baffleFaces 22 | { 23 | type faceZone; 24 | zoneName plate; 25 | flip false; 26 | 27 | patches 28 | { 29 | master 30 | { 31 | name plate; 32 | type wall; 33 | } 34 | slave { ${..master} } 35 | } 36 | } 37 | } 38 | 39 | // ************************************************************************* // 40 | -------------------------------------------------------------------------------- /Axisymmetric2D/case/system/controlDict: -------------------------------------------------------------------------------- 1 | /*--------------------------------*- C++ -*----------------------------------*\ 2 | | ========= | | 3 | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | 4 | | \\ / O peration | Version: 2.3.1 | 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 "system"; 14 | object controlDict; 15 | } 16 | // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 17 | 18 | applicationClass pimpleFoam; 19 | startFrom latestTime; 20 | endTime 1; 21 | stopAt endTime; 22 | deltaT 1; 23 | writeControl adjustableRunTime; 24 | writeInterval 0.01; 25 | cycleWrite 0; 26 | writeFormat binary; 27 | writePrecision 6; 28 | writeCompression uncompressed; 29 | timeFormat general; 30 | timePrecision 6; 31 | runTimeModifiable yes; 32 | adjustTimeStep yes; 33 | maxCo 1; 34 | maxDeltaT 1; 35 | 36 | // ************************************************************************* // 37 | -------------------------------------------------------------------------------- /AxisymmetricCoaxialRotor/cleanAll: -------------------------------------------------------------------------------- 1 | rm mesh/*.msh log 2 | rm -r constant/polyMesh 3 | rm -r 1* 2* 3* 4* 5* 6* 7* 8* 9* 4 | -------------------------------------------------------------------------------- /AxisymmetricCoaxialRotor/constant/transportProperties: -------------------------------------------------------------------------------- 1 | /*--------------------------------*- C++ -*----------------------------------*\ 2 | | ========= | | 3 | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | 4 | | \\ / O peration | Version: 4.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 | object transportProperties; 14 | } 15 | // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 16 | 17 | transportModel Newtonian; 18 | 19 | nu [0 2 -1 0 0 0 0] 1.5e-05; 20 | 21 | // ************************************************************************* // 22 | -------------------------------------------------------------------------------- /AxisymmetricCoaxialRotor/constant/turbulenceProperties: -------------------------------------------------------------------------------- 1 | /*--------------------------------*- C++ -*----------------------------------*\ 2 | | ========= | | 3 | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | 4 | | \\ / O peration | Version: 4.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 | object turbulenceProperties; 14 | } 15 | // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 16 | 17 | simulationType RAS; 18 | 19 | RAS 20 | { 21 | RASModel kOmegaSST; 22 | turbulence on; 23 | printCoeffs on; 24 | } 25 | 26 | // ************************************************************************* // 27 | -------------------------------------------------------------------------------- /AxisymmetricCoaxialRotor/runAll: -------------------------------------------------------------------------------- 1 | gmsh -3 mesh/main.geo 2 | gmshToFoam mesh/main.msh 3 | changeDictionary 4 | simpleFoam 5 | 6 | -------------------------------------------------------------------------------- /AxisymmetricCoaxialRotor/system/changeDictionaryDict: -------------------------------------------------------------------------------- 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 dictionary; 13 | object changeDictionaryDict; 14 | } 15 | // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 16 | 17 | boundary 18 | { 19 | "wedge.*" 20 | { 21 | type wedge; 22 | physicalType wedge; 23 | } 24 | tunnel 25 | { 26 | type slip; 27 | physicalType slip; 28 | } 29 | } 30 | 31 | // ************************************************************************* // 32 | -------------------------------------------------------------------------------- /AxisymmetricCoaxialRotor/system/controlDict: -------------------------------------------------------------------------------- 1 | /*--------------------------------*- C++ -*----------------------------------*\ 2 | | ========= | | 3 | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | 4 | | \\ / O peration | Version: 4.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 | object controlDict; 14 | } 15 | // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 16 | 17 | application simpleFoam; 18 | 19 | startFrom startTime; 20 | 21 | startTime 0; 22 | 23 | stopAt endTime; 24 | 25 | endTime 1000; 26 | 27 | deltaT 1; 28 | 29 | writeControl timeStep; 30 | 31 | writeInterval 50; 32 | 33 | purgeWrite 0; 34 | 35 | writeFormat binary; 36 | 37 | writeCompression off; 38 | 39 | timeFormat general; 40 | 41 | timePrecision 6; 42 | 43 | runTimeModifiable true; 44 | 45 | // ************************************************************************* // 46 | -------------------------------------------------------------------------------- /AxisymmetricCoaxialRotorParallel/README.txt: -------------------------------------------------------------------------------- 1 | 2 | mpirun -np 4 simpleFoam -parallel 3 | reconstructPar -latestTime 4 | -------------------------------------------------------------------------------- /AxisymmetricCoaxialRotorParallel/cleanAll: -------------------------------------------------------------------------------- 1 | rm mesh/*.msh log 2 | rm -r constant/polyMesh 3 | rm -r 1* 2* 3* 4* 5* 6* 7* 8* 9* 4 | rm -r proc* 5 | -------------------------------------------------------------------------------- /AxisymmetricCoaxialRotorParallel/constant/transportProperties: -------------------------------------------------------------------------------- 1 | /*--------------------------------*- C++ -*----------------------------------*\ 2 | | ========= | | 3 | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | 4 | | \\ / O peration | Version: 4.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 | object transportProperties; 14 | } 15 | // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 16 | 17 | transportModel Newtonian; 18 | 19 | nu [0 2 -1 0 0 0 0] 1.5e-05; 20 | 21 | // ************************************************************************* // 22 | -------------------------------------------------------------------------------- /AxisymmetricCoaxialRotorParallel/constant/turbulenceProperties: -------------------------------------------------------------------------------- 1 | /*--------------------------------*- C++ -*----------------------------------*\ 2 | | ========= | | 3 | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | 4 | | \\ / O peration | Version: 4.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 | object turbulenceProperties; 14 | } 15 | // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 16 | 17 | simulationType RAS; 18 | 19 | RAS 20 | { 21 | RASModel kOmegaSST; 22 | turbulence on; 23 | printCoeffs on; 24 | } 25 | 26 | // ************************************************************************* // 27 | -------------------------------------------------------------------------------- /AxisymmetricCoaxialRotorParallel/runAll: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | gmsh -3 mesh/main.geo && \ 4 | gmshToFoam mesh/main.msh && \ 5 | changeDictionary && \ 6 | decomposePar 7 | mpirun -np 4 simpleFoam -parallel && \ 8 | reconstructPar -latestTime 9 | 10 | -------------------------------------------------------------------------------- /AxisymmetricCoaxialRotorParallel/system/changeDictionaryDict: -------------------------------------------------------------------------------- 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 dictionary; 13 | object changeDictionaryDict; 14 | } 15 | // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 16 | 17 | boundary 18 | { 19 | "wedge.*" 20 | { 21 | type wedge; 22 | physicalType wedge; 23 | } 24 | tunnel 25 | { 26 | type slip; 27 | physicalType slip; 28 | } 29 | } 30 | 31 | // ************************************************************************* // 32 | -------------------------------------------------------------------------------- /AxisymmetricCoaxialRotorParallel/system/controlDict: -------------------------------------------------------------------------------- 1 | /*--------------------------------*- C++ -*----------------------------------*\ 2 | | ========= | | 3 | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | 4 | | \\ / O peration | Version: 4.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 | object controlDict; 14 | } 15 | // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 16 | 17 | application simpleFoam; 18 | 19 | startFrom startTime; 20 | 21 | startTime 0; 22 | 23 | stopAt endTime; 24 | 25 | endTime 1000; 26 | 27 | deltaT 1; 28 | 29 | writeControl timeStep; 30 | 31 | writeInterval 50; 32 | 33 | purgeWrite 0; 34 | 35 | writeFormat binary; 36 | 37 | writeCompression off; 38 | 39 | timeFormat general; 40 | 41 | timePrecision 6; 42 | 43 | runTimeModifiable true; 44 | 45 | // ************************************************************************* // 46 | -------------------------------------------------------------------------------- /AxisymmetricCoaxialRotorParallel/system/decomposeParDict: -------------------------------------------------------------------------------- 1 | /*--------------------------------*- C++ -*----------------------------------*\ 2 | | ========= | | 3 | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | 4 | | \\ / O peration | Version: 3.0.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 "system"; 14 | object decomposeParDict; 15 | } 16 | // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 17 | 18 | numberOfSubdomains 4; 19 | 20 | method simple; 21 | 22 | simpleCoeffs 23 | { 24 | n (2 2 1); 25 | delta 0.001; 26 | } 27 | 28 | hierarchicalCoeffs 29 | { 30 | n (2 2 1); 31 | delta 0.001; 32 | order xyz; 33 | } 34 | 35 | 36 | // ************************************************************************* // 37 | -------------------------------------------------------------------------------- /AxisymmetricRotor/0/nut: -------------------------------------------------------------------------------- 1 | /*--------------------------------*- C++ -*----------------------------------*\ 2 | | ========= | | 3 | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | 4 | | \\ / O peration | Version: 4.0 | 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 | object nut; 14 | } 15 | // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 16 | 17 | dimensions [0 2 -1 0 0 0 0]; 18 | 19 | internalField uniform 0; 20 | 21 | boundaryField 22 | { 23 | inlet 24 | { 25 | type calculated; 26 | value uniform 0; 27 | } 28 | 29 | outlet 30 | { 31 | type calculated; 32 | value uniform 0; 33 | } 34 | "wedge.*" 35 | { 36 | type wedge; 37 | } 38 | tunnel 39 | { 40 | type slip; 41 | } 42 | 43 | #includeEtc "caseDicts/setConstraintTypes" 44 | } 45 | 46 | // ************************************************************************* // 47 | -------------------------------------------------------------------------------- /AxisymmetricRotor/cleanAll: -------------------------------------------------------------------------------- 1 | rm mesh/*.msh log 2 | rm -r constant/polyMesh 3 | rm -r 1* 2* 3* 4* 5* 6* 7* 8* 9* 4 | -------------------------------------------------------------------------------- /AxisymmetricRotor/constant/transportProperties: -------------------------------------------------------------------------------- 1 | /*--------------------------------*- C++ -*----------------------------------*\ 2 | | ========= | | 3 | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | 4 | | \\ / O peration | Version: 4.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 | object transportProperties; 14 | } 15 | // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 16 | 17 | transportModel Newtonian; 18 | 19 | nu [0 2 -1 0 0 0 0] 1.5e-05; 20 | 21 | // ************************************************************************* // 22 | -------------------------------------------------------------------------------- /AxisymmetricRotor/constant/turbulenceProperties: -------------------------------------------------------------------------------- 1 | /*--------------------------------*- C++ -*----------------------------------*\ 2 | | ========= | | 3 | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | 4 | | \\ / O peration | Version: 4.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 | object turbulenceProperties; 14 | } 15 | // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 16 | 17 | simulationType RAS; 18 | 19 | RAS 20 | { 21 | RASModel kOmegaSST; 22 | turbulence on; 23 | printCoeffs on; 24 | } 25 | 26 | // ************************************************************************* // 27 | -------------------------------------------------------------------------------- /AxisymmetricRotor/runAll: -------------------------------------------------------------------------------- 1 | gmsh -3 mesh/wedge.geo 2 | gmshToFoam mesh/wedge.msh 3 | changeDictionary 4 | simpleFoam 5 | 6 | -------------------------------------------------------------------------------- /AxisymmetricRotor/system/changeDictionaryDict: -------------------------------------------------------------------------------- 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 dictionary; 13 | object changeDictionaryDict; 14 | } 15 | // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 16 | 17 | boundary 18 | { 19 | "wedge.*" 20 | { 21 | type wedge; 22 | physicalType wedge; 23 | } 24 | tunnel 25 | { 26 | type slip; 27 | physicalType slip; 28 | } 29 | } 30 | 31 | // ************************************************************************* // 32 | -------------------------------------------------------------------------------- /AxisymmetricRotor/system/controlDict: -------------------------------------------------------------------------------- 1 | /*--------------------------------*- C++ -*----------------------------------*\ 2 | | ========= | | 3 | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | 4 | | \\ / O peration | Version: 4.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 | object controlDict; 14 | } 15 | // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 16 | 17 | application simpleFoam; 18 | 19 | startFrom startTime; 20 | 21 | startTime 0; 22 | 23 | stopAt endTime; 24 | 25 | endTime 1000; 26 | 27 | deltaT 1; 28 | 29 | writeControl timeStep; 30 | 31 | writeInterval 50; 32 | 33 | purgeWrite 0; 34 | 35 | writeFormat binary; 36 | 37 | writeCompression off; 38 | 39 | timeFormat general; 40 | 41 | timePrecision 6; 42 | 43 | runTimeModifiable true; 44 | 45 | // ************************************************************************* // 46 | -------------------------------------------------------------------------------- /Baffle/README: -------------------------------------------------------------------------------- 1 | How to Make Baffles (Thin Walls, Internal Faces) in OpenFOAM 2 | 3 | All code can be found at: https://github.com/lordvon/OpenFOAM_Tutorials/tree/master/Baffle 4 | 5 | DESCRIPTION: 6 | Here we will make a simple 2D simulation of a flat plate in a windtunnel. 7 | 8 | The flat plate is generated as an internal face in Gmsh. An internal face is a surface where fluid cells are on both sides of the surface. In OpenFOAM, this is known as a baffle. It an internal face that is to be recognized as an infinitely thin wall. The patch type can be something other than wall, for example, it could be cyclic for a pressure-jump actuator disk. 9 | 10 | In Gmsh we can group and name internal faces, but they will not be recognized the same as regular boundaries. In the conversion to OpenFOAM, they do not show up as boundaries, but are stored as faceZones with the same name we specified. We detail how to produce a regular boundary from the faceZones using OpenFOAM utilities. 11 | 12 | 'commands.txt': contains the commands and procedure descriptions for each step. 13 | 'U_result.ogv': video of the velocity field results of running the simulation. 14 | 15 | OUTLINE: 16 | -Generate mesh in Gmsh. 17 | -Convert mesh to OpenFOAM format. 18 | -Convert faceZone to wall baffle. 19 | -Run the simulation. 20 | 21 | This tutorial was run on: 22 | -Ubuntu 14.04 64-bit 23 | -OpenFOAM 2.3.1 24 | -Gmsh 2.9.3 -------------------------------------------------------------------------------- /Baffle/case/0/.svn/all-wcprops: -------------------------------------------------------------------------------- 1 | K 25 2 | svn:wc:ra_dav:version-url 3 | V 98 4 | /svnroot/openfoam-extend/!svn/ver/1160/trunk/Core/OpenFOAM-1.5-dev/tutorials/icoDyMFoam/mixerGgi/0 5 | END 6 | p 7 | K 25 8 | svn:wc:ra_dav:version-url 9 | V 100 10 | /svnroot/openfoam-extend/!svn/ver/1160/trunk/Core/OpenFOAM-1.5-dev/tutorials/icoDyMFoam/mixerGgi/0/p 11 | END 12 | U 13 | K 25 14 | svn:wc:ra_dav:version-url 15 | V 100 16 | /svnroot/openfoam-extend/!svn/ver/1160/trunk/Core/OpenFOAM-1.5-dev/tutorials/icoDyMFoam/mixerGgi/0/U 17 | END 18 | -------------------------------------------------------------------------------- /Baffle/case/0/.svn/entries: -------------------------------------------------------------------------------- 1 | 10 2 | 3 | dir 4 | 1824 5 | https://openfoam-extend.svn.sourceforge.net/svnroot/openfoam-extend/trunk/Core/OpenFOAM-1.5-dev/tutorials/icoDyMFoam/mixerGgi/0 6 | https://openfoam-extend.svn.sourceforge.net/svnroot/openfoam-extend 7 | 8 | 9 | 10 | 2009-04-02T10:19:15.967477Z 11 | 1160 12 | hjasak 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | e4e07f05-0c2f-0410-a05a-b8ba57e0c909 28 | 29 | p 30 | file 31 | 32 | 33 | 34 | 35 | 2010-09-12T03:25:12.586382Z 36 | dd2b863de322b1d9c35faef303f89f85 37 | 2009-04-02T10:19:15.967477Z 38 | 1160 39 | hjasak 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 1312 62 | 63 | U 64 | file 65 | 66 | 67 | 68 | 69 | 2010-09-12T03:25:12.586382Z 70 | c1b8734ca81431daedfa5badc1f03002 71 | 2009-04-02T10:19:15.967477Z 72 | 1160 73 | hjasak 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 1416 96 | 97 | -------------------------------------------------------------------------------- /Baffle/case/constant/RASProperties: -------------------------------------------------------------------------------- 1 | /*--------------------------------*- C++ -*----------------------------------*\ 2 | | ========= | | 3 | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | 4 | | \\ / O peration | Version: 2.3.1 | 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 RASProperties; 15 | } 16 | // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 17 | 18 | RASModel kEpsilon; 19 | 20 | turbulence on; 21 | 22 | printCoeffs on; 23 | 24 | 25 | // ************************************************************************* // 26 | -------------------------------------------------------------------------------- /Baffle/case/constant/turbulenceProperties: -------------------------------------------------------------------------------- 1 | /*--------------------------------*- C++ -*----------------------------------*\ 2 | | ========= | | 3 | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | 4 | | \\ / O peration | Version: 2.3.1 | 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 RASModel; 19 | 20 | 21 | // ************************************************************************* // 22 | -------------------------------------------------------------------------------- /Baffle/case/system/baffleDict: -------------------------------------------------------------------------------- 1 | /*--------------------------------*- C++ -*----------------------------------*\ 2 | | ========= | | 3 | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | 4 | | \\ / O peration | Version: 2.3.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 | object createBafflesDict; 14 | } 15 | // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 16 | 17 | internalFacesOnly true; 18 | 19 | baffles 20 | { 21 | baffleFaces 22 | { 23 | type faceZone; 24 | zoneName plate; 25 | flip false; 26 | 27 | patches 28 | { 29 | master 30 | { 31 | name plate; 32 | type wall; 33 | } 34 | slave { ${..master} } 35 | } 36 | } 37 | } 38 | 39 | // ************************************************************************* // 40 | -------------------------------------------------------------------------------- /Baffle/case/system/controlDict: -------------------------------------------------------------------------------- 1 | /*--------------------------------*- C++ -*----------------------------------*\ 2 | | ========= | | 3 | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | 4 | | \\ / O peration | Version: 2.3.1 | 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 "system"; 14 | object controlDict; 15 | } 16 | // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 17 | 18 | applicationClass pimpleFoam; 19 | startFrom latestTime; 20 | endTime 1; 21 | stopAt endTime; 22 | deltaT 1; 23 | writeControl adjustableRunTime; 24 | writeInterval 0.01; 25 | cycleWrite 0; 26 | writeFormat ascii; 27 | writePrecision 6; 28 | writeCompression uncompressed; 29 | timeFormat general; 30 | timePrecision 6; 31 | runTimeModifiable yes; 32 | adjustTimeStep yes; 33 | maxCo 1; 34 | maxDeltaT 1; 35 | 36 | // ************************************************************************* // 37 | -------------------------------------------------------------------------------- /Baffle/commands.txt: -------------------------------------------------------------------------------- 1 | # Do not run this script! This is only meant to show the procedure. 2 | # You should execute the following, one line at a time, and do what the comments suggest. 3 | # The comment portions can be automated by a script, but it detracts from the main point of the tutorial. 4 | # I have used Python scripts to easily automate the whole process. 5 | 6 | gmsh main.geo -3 -o test.msh 7 | 8 | gmshToFoam test.msh -case case 9 | 10 | # Here, you should change the boundary file to include specific boundaries where necessary. 11 | # Specifically, make tunnel and plate 'wall' boundaries, and frontAndBack to 'empty'. 12 | 13 | createBaffles -case case -dict system/baffleDict -overwrite 14 | 15 | 16 | -------------------------------------------------------------------------------- /Beginner/README.txt: -------------------------------------------------------------------------------- 1 | How To Install and Use OpenFOAM (open source CFD) for the Absolute Beginner 2 | 3 | All code can be found at: https://github.com/lordvon/OpenFOAM_Tutorials/tree/master/Beginner 4 | 5 | DESCRIPTION: 6 | Here we will go over how to install OpenFOAM on Ubuntu Linux, and run a tutorial case. The flow field solution will be viewed with ParaView. 7 | 8 | OUTLINE: 9 | -Follow Instructions on OpenFOAM website. 10 | -Add desired settings. 11 | -Copy a tutorial case from $FOAM_TUTORIALS. 12 | -Explain the file directories. 13 | -Run a case and view results. 14 | 15 | This tutorial was run successfully on: 16 | -Ubuntu 14.04 64-bit 17 | -OpenFOAM 2.4.0 -------------------------------------------------------------------------------- /BluffBodyWake/README.md: -------------------------------------------------------------------------------- 1 | # Simulation of a 2D Bluff Body in a High-Speed Wake in OpenFOAM 2 | 3 | All code can be found at: 4 | https://github.com/rlee32/openfoam_tutorials/tree/master/BluffBodyWake 5 | 6 | ## Description 7 | In this tutorial we set a bluff body (high drag, no/low lift) into the 8 | high-speed wake of an actuator disk. We shall see that this causes the bluff 9 | body to become a more aerodynamic body. The high-speed wake reduces the drag of 10 | this particular configuration by about a factor of 1.8 and the lift by about 11 | 1.7 (the L/D ratio is about 0.5 in both cases). The high-speed wake also 12 | substantially mitigates large aerodynamic force oscillations. 13 | 14 | ## Outline 15 | -Generate mesh in Gmsh. 16 | -Convert mesh to OpenFOAM format. 17 | -Make internal baffle faces a pressure jump region. 18 | -Run the simulation. 19 | 20 | ## Commands 21 | gmsh mesh.geo -3 -o test.msh 22 | gmshToFoam test.msh -case case 23 | (Modify boundary file) 24 | -tunnel and body as walls 25 | -front_and_back as empty 26 | -baffle as cyclic 27 | -add baffleother and neighbourPatch entries 28 | createBaffles -case case -dict system/baffleDict -overwrite 29 | pimpleFoam 30 | 31 | ## Software 32 | -Ubuntu 14.04 64-bit 33 | -OpenFOAM 3.0.0 34 | -Gmsh 2.11 -------------------------------------------------------------------------------- /BluffBodyWake/case/0/include/fixedInlet: -------------------------------------------------------------------------------- 1 | /*--------------------------------*- C++ -*----------------------------------*\ 2 | | ========= | | 3 | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | 4 | | \\ / O peration | Version: 3.0.0 | 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 | -------------------------------------------------------------------------------- /BluffBodyWake/case/0/include/front_and_back_and_tunnel: -------------------------------------------------------------------------------- 1 | /*--------------------------------*- C++ -*----------------------------------*\ 2 | | ========= | | 3 | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | 4 | | \\ / O peration | Version: 3.0.0 | 5 | | \\ / A nd | Web: www.OpenFOAM.org | 6 | | \\/ M anipulation | | 7 | \*---------------------------------------------------------------------------*/ 8 | 9 | tunnel 10 | { 11 | type slip; 12 | } 13 | 14 | front_and_back 15 | { 16 | type empty; 17 | } 18 | 19 | // ************************************************************************* // 20 | -------------------------------------------------------------------------------- /BluffBodyWake/case/0/include/initialConditions: -------------------------------------------------------------------------------- 1 | /*--------------------------------*- C++ -*----------------------------------*\ 2 | | ========= | | 3 | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | 4 | | \\ / O peration | Version: 3.0.0 | 5 | | \\ / A nd | Web: www.OpenFOAM.org | 6 | | \\/ M anipulation | | 7 | \*---------------------------------------------------------------------------*/ 8 | 9 | flowVelocity (11.176 0 0); // 25 mph 10 | pressure 0; 11 | freestreamNut 0.14; 12 | 13 | // ************************************************************************* // 14 | -------------------------------------------------------------------------------- /BluffBodyWake/case/constant/transportProperties: -------------------------------------------------------------------------------- 1 | /*--------------------------------*- C++ -*----------------------------------*\ 2 | | ========= | | 3 | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | 4 | | \\ / O peration | Version: 3.0.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 | object transportProperties; 14 | } 15 | 16 | // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 17 | 18 | transportModel Newtonian; 19 | 20 | nu [0 2 -1 0 0 0 0] 1.568e-05; 21 | 22 | // ************************************************************************* // 23 | -------------------------------------------------------------------------------- /BluffBodyWake/case/constant/turbulenceProperties: -------------------------------------------------------------------------------- 1 | /*--------------------------------*- C++ -*----------------------------------*\ 2 | | ========= | | 3 | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | 4 | | \\ / O peration | Version: 3.0.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 turbulenceProperties; 15 | } 16 | // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 17 | 18 | simulationType RAS; 19 | 20 | RAS 21 | { 22 | // RASModel kEspilon; 23 | RASModel SpalartAllmaras; 24 | // RASModel kOmegaSST; 25 | 26 | turbulence on; 27 | 28 | printCoeffs on; 29 | } 30 | 31 | 32 | // ************************************************************************* // 33 | -------------------------------------------------------------------------------- /Cantilever/README.md: -------------------------------------------------------------------------------- 1 | # Structural Simulation in OpenFOAM: Cantilever Beam (How to Avoid Sharp Corner Stress Singularities) 2 | 3 | All code can be found at: https://github.com/rlee32/openfoam_tutorials/tree/master/Bracket 4 | 5 | ## Description 6 | Here we will simulate a cantilever beam in OpenFOAM, using the solidDisplacementFoam solver, and validate the results by comparison to analytical models. A mesh is made in Gmsh and shear loads (AKA traction) are specified in the OpenFOAM case files. We discuss how to work around the stress singularities at square corners by moving the point of singularity so it does not affect the results. 7 | For some additional description of the solver, please see: http://cfd.direct/openfoam/user-guide/platehole/. 8 | 9 | ## Outline 10 | -Go over mesh. 11 | -Go over boundary conditions and load specification. 12 | -Run the solver. 13 | 14 | ## Commands 15 | gmsh mesh/cantilever.geo -3 -o cantilever.msh 16 | gmshToFoam cantilever.msh -case case 17 | changeDictionary 18 | solidDisplacementFoam > log 19 | -When viewing results in ParaFoam, you may have to advance one time step in order to see sigmaEq selectable in the fields menu. Otherwise, you may only see T and D. 20 | python sigma.py 21 | -observe convergence in sigmaEq file 22 | 23 | ## Software 24 | -Ubuntu 14.04 64-bit 25 | -OpenFOAM 3.0.0 26 | -Gmsh 2.11 27 | 28 | 29 | -------------------------------------------------------------------------------- /Cantilever/case/0/T: -------------------------------------------------------------------------------- 1 | /*--------------------------------*- C++ -*----------------------------------*\ 2 | | ========= | | 3 | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | 4 | | \\ / O peration | Version: 2.3.1 | 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 | object T; 14 | } 15 | // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 16 | 17 | dimensions [0 0 0 1 0 0 0]; 18 | 19 | internalField uniform 300; 20 | 21 | boundaryField 22 | { 23 | frontAndBack 24 | { 25 | type empty; 26 | } 27 | freeSurface 28 | { 29 | type zeroGradient; 30 | } 31 | loadSurface 32 | { 33 | type zeroGradient; 34 | } 35 | fixedSurface 36 | { 37 | type zeroGradient; 38 | } 39 | } 40 | 41 | // ************************************************************************* // 42 | -------------------------------------------------------------------------------- /Cantilever/case/clear_solution: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | rm -r 1* 2* 3* 4* 5* 6* 7* 8* 9* 4 | rm log 5 | rm sigmaEq 6 | rm -r constant/polyMesh 7 | -------------------------------------------------------------------------------- /Cantilever/case/constant/mechanicalProperties: -------------------------------------------------------------------------------- 1 | /*--------------------------------*- C++ -*----------------------------------*\ 2 | | ========= | | 3 | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | 4 | | \\ / O peration | Version: 2.3.1 | 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 mechanicalProperties; 15 | } 16 | // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 17 | 18 | // These properties are approximate for Aluminum 6061. 19 | 20 | rho 21 | {//Density, kg/m^3 22 | type uniform; 23 | value 2700; 24 | } 25 | 26 | nu 27 | {//Poisson's ratio 28 | type uniform; 29 | value 0.33; 30 | } 31 | 32 | E 33 | {//Young's modulus, Pa 34 | type uniform; 35 | value 68.9e9; 36 | } 37 | 38 | planeStress yes; 39 | 40 | // ************************************************************************* // 41 | -------------------------------------------------------------------------------- /Cantilever/case/sigma.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | 3 | """ 4 | This extracts the sigmaEq field from the log file. 5 | """ 6 | 7 | log_file = "log" 8 | sigma_file = "sigmaEq" 9 | 10 | with open(sigma_file, 'w') as wf: 11 | with open(log_file, 'r') as rf: 12 | for line in rf: 13 | # format of line is: Max sigmaEq = 5.22596e+06 14 | if "sigmaEq" in line: 15 | value = line.strip().split()[3] 16 | wf.write(value+"\n") 17 | -------------------------------------------------------------------------------- /Cantilever/case/system/changeDictionaryDict: -------------------------------------------------------------------------------- 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 changeDictionaryDict; 14 | } 15 | // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 16 | 17 | dictionaryReplacement 18 | { 19 | boundary 20 | { 21 | freeSurface 22 | { 23 | type patch; 24 | } 25 | loadSurface 26 | { 27 | type patch; 28 | } 29 | fixedSurface 30 | { 31 | type patch; 32 | } 33 | frontAndBack 34 | { 35 | type empty; 36 | } 37 | } 38 | } 39 | // ************************************************************************* // -------------------------------------------------------------------------------- /Cantilever/case/system/fvSolution: -------------------------------------------------------------------------------- 1 | /*--------------------------------*- C++ -*----------------------------------*\ 2 | | ========= | | 3 | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | 4 | | \\ / O peration | Version: 2.3.1 | 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 "system"; 14 | object fvSolution; 15 | } 16 | // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 17 | 18 | solvers 19 | { 20 | "(D|T)" 21 | { 22 | solver GAMG; 23 | tolerance 1e-6; 24 | relTol 0.9; 25 | smoother GaussSeidel; 26 | cacheAgglomeration true; 27 | nCellsInCoarsestLevel 20; 28 | agglomerator faceAreaPair; 29 | mergeLevels 1; 30 | } 31 | } 32 | 33 | stressAnalysis 34 | { 35 | compactNormalStress yes; 36 | nCorrectors 1; 37 | D 1e-6; 38 | } 39 | 40 | 41 | // ************************************************************************* // 42 | -------------------------------------------------------------------------------- /Cantilever/converged_coarser.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openfoamtutorials/openfoam_tutorials/36c82d86388bdfd67aec4743cac3294d63fdb415/Cantilever/converged_coarser.png -------------------------------------------------------------------------------- /Cantilever/converged_finer.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openfoamtutorials/openfoam_tutorials/36c82d86388bdfd67aec4743cac3294d63fdb415/Cantilever/converged_finer.png -------------------------------------------------------------------------------- /CoaxialDistance/0/nut: -------------------------------------------------------------------------------- 1 | /*--------------------------------*- C++ -*----------------------------------*\ 2 | | ========= | | 3 | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | 4 | | \\ / O peration | Version: 4.0 | 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 | object nut; 14 | } 15 | // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 16 | 17 | dimensions [0 2 -1 0 0 0 0]; 18 | 19 | internalField uniform 0; 20 | 21 | boundaryField 22 | { 23 | inlet 24 | { 25 | type calculated; 26 | value uniform 0; 27 | } 28 | 29 | outlet 30 | { 31 | type calculated; 32 | value uniform 0; 33 | } 34 | "wedge.*" 35 | { 36 | type wedge; 37 | } 38 | tunnel 39 | { 40 | type slip; 41 | } 42 | 43 | #includeEtc "caseDicts/setConstraintTypes" 44 | } 45 | 46 | // ************************************************************************* // 47 | -------------------------------------------------------------------------------- /CoaxialDistance/cleanAll: -------------------------------------------------------------------------------- 1 | rm mesh/*.msh log 2 | rm -r constant/polyMesh 3 | rm -r 1* 2* 3* 4* 5* 6* 7* 8* 9* 4 | rm -r proc* 5 | -------------------------------------------------------------------------------- /CoaxialDistance/constant/transportProperties: -------------------------------------------------------------------------------- 1 | /*--------------------------------*- C++ -*----------------------------------*\ 2 | | ========= | | 3 | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | 4 | | \\ / O peration | Version: 4.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 | object transportProperties; 14 | } 15 | // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 16 | 17 | transportModel Newtonian; 18 | 19 | nu [0 2 -1 0 0 0 0] 1.5e-05; 20 | 21 | // ************************************************************************* // 22 | -------------------------------------------------------------------------------- /CoaxialDistance/constant/turbulenceProperties: -------------------------------------------------------------------------------- 1 | /*--------------------------------*- C++ -*----------------------------------*\ 2 | | ========= | | 3 | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | 4 | | \\ / O peration | Version: 4.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 | object turbulenceProperties; 14 | } 15 | // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 16 | 17 | simulationType RAS; 18 | 19 | RAS 20 | { 21 | RASModel kOmegaSST; 22 | turbulence on; 23 | printCoeffs on; 24 | } 25 | 26 | // ************************************************************************* // 27 | -------------------------------------------------------------------------------- /CoaxialDistance/results.txt: -------------------------------------------------------------------------------- 1 | # Diameter-Normalized Separation, 5 Deg. Wedge Upstream (power (W), thrust (N)), 5 Deg. Wedge Downstream (power (W), thrust (N)), Iterations 2 | 0, (5.10, 0.463), (0, 0) 3 | 0.125, (4.90, 0.444), (4.24, 0.348), 738 4 | 0.375, (5.05, 0.460), (4.29, 0.336), 266 5 | 0.75, (5.10, 0.463), (4.34, 0.330), 943 6 | 1.5, (5.09, 0.462), (4.39, 0.334), 2000+ 7 | -------------------------------------------------------------------------------- /CoaxialDistance/runAll: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | gmsh -3 mesh/simple.geo && \ 4 | gmshToFoam mesh/simple.msh && \ 5 | changeDictionary && \ 6 | simpleFoam 7 | #decomposePar 8 | #mpirun -np 4 simpleFoam -parallel && \ 9 | #reconstructPar -latestTime 10 | 11 | -------------------------------------------------------------------------------- /CoaxialDistance/system/changeDictionaryDict: -------------------------------------------------------------------------------- 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 dictionary; 13 | object changeDictionaryDict; 14 | } 15 | // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 16 | 17 | boundary 18 | { 19 | "wedge.*" 20 | { 21 | type wedge; 22 | physicalType wedge; 23 | } 24 | tunnel 25 | { 26 | type slip; 27 | physicalType slip; 28 | } 29 | } 30 | 31 | // ************************************************************************* // 32 | -------------------------------------------------------------------------------- /CoaxialDistance/system/controlDict: -------------------------------------------------------------------------------- 1 | /*--------------------------------*- C++ -*----------------------------------*\ 2 | | ========= | | 3 | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | 4 | | \\ / O peration | Version: 4.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 | object controlDict; 14 | } 15 | // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 16 | 17 | application simpleFoam; 18 | 19 | startFrom startTime; 20 | 21 | startTime 0; 22 | 23 | stopAt endTime; 24 | 25 | endTime 2000; 26 | 27 | deltaT 1; 28 | 29 | writeControl timeStep; 30 | 31 | writeInterval 50; 32 | 33 | purgeWrite 0; 34 | 35 | writeFormat binary; 36 | 37 | writeCompression off; 38 | 39 | timeFormat general; 40 | 41 | timePrecision 6; 42 | 43 | runTimeModifiable true; 44 | 45 | // ************************************************************************* // 46 | -------------------------------------------------------------------------------- /CoaxialDistance/system/decomposeParDict: -------------------------------------------------------------------------------- 1 | /*--------------------------------*- C++ -*----------------------------------*\ 2 | | ========= | | 3 | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | 4 | | \\ / O peration | Version: 3.0.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 "system"; 14 | object decomposeParDict; 15 | } 16 | // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 17 | 18 | numberOfSubdomains 4; 19 | 20 | method simple; 21 | 22 | simpleCoeffs 23 | { 24 | n (2 2 1); 25 | delta 0.001; 26 | } 27 | 28 | hierarchicalCoeffs 29 | { 30 | n (2 2 1); 31 | delta 0.001; 32 | order xyz; 33 | } 34 | 35 | 36 | // ************************************************************************* // 37 | -------------------------------------------------------------------------------- /CompilingCustomOutput/README.txt: -------------------------------------------------------------------------------- 1 | # Get user privileges 2 | sudo bash 3 | # Copy modified source to appropriate location 4 | cp *.C /opt/openfoam4/... 5 | # Go to closest parent directory that can wmake 6 | cd /opt/openfoam4/... 7 | # Compile 8 | wmake 9 | # Now your modified library is ready to use! 10 | 11 | -------------------------------------------------------------------------------- /CompilingCustomSolver/mixerVesselAMI2D/Allrun: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | cd ${0%/*} || exit 1 # run from this directory 3 | 4 | # Source tutorial run functions 5 | . $WM_PROJECT_DIR/bin/tools/RunFunctions 6 | 7 | application=`getApplication` 8 | 9 | ./makeMesh 10 | 11 | #runApplication $application 12 | runApplication decomposePar 13 | runParallel $application 4 14 | runApplication reconstructPar 15 | 16 | # ----------------------------------------------------------------- end-of-file 17 | -------------------------------------------------------------------------------- /CompilingCustomSolver/mixerVesselAMI2D/constant/RASProperties: -------------------------------------------------------------------------------- 1 | /*--------------------------------*- C++ -*----------------------------------*\ 2 | | ========= | | 3 | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | 4 | | \\ / O peration | Version: 2.3.1 | 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 RASProperties; 15 | } 16 | // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 17 | 18 | RASModel kEpsilon; 19 | 20 | turbulence on; 21 | 22 | printCoeffs on; 23 | 24 | 25 | // ************************************************************************* // 26 | -------------------------------------------------------------------------------- /CompilingCustomSolver/mixerVesselAMI2D/constant/dynamicMeshDict: -------------------------------------------------------------------------------- 1 | /*--------------------------------*- C++ -*----------------------------------*\ 2 | | ========= | | 3 | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | 4 | | \\ / O peration | Version: 2.3.1 | 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 dynamicMeshDict; 15 | } 16 | // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 17 | 18 | dynamicFvMesh solidBodyMotionFvMesh; 19 | 20 | motionSolverLibs ( "libfvMotionSolvers.so" ); 21 | 22 | solidBodyMotionFvMeshCoeffs 23 | { 24 | cellZone rotor; 25 | 26 | solidBodyMotionFunction rotatingMotion; 27 | rotatingMotionCoeffs 28 | { 29 | origin (0 0 0); 30 | axis (0 0 1); 31 | omega 6.2832; // rad/s 32 | } 33 | } 34 | 35 | 36 | // ************************************************************************* // 37 | -------------------------------------------------------------------------------- /CompilingCustomSolver/mixerVesselAMI2D/constant/turbulenceProperties: -------------------------------------------------------------------------------- 1 | /*--------------------------------*- C++ -*----------------------------------*\ 2 | | ========= | | 3 | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | 4 | | \\ / O peration | Version: 2.3.1 | 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 laminar; 19 | 20 | 21 | // ************************************************************************* // 22 | -------------------------------------------------------------------------------- /CompilingCustomSolver/mixerVesselAMI2D/makeMesh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | cd ${0%/*} || exit 1 # run from this directory 3 | 4 | # Source tutorial run functions 5 | . $WM_PROJECT_DIR/bin/tools/RunFunctions 6 | 7 | m4 < constant/polyMesh/blockMeshDict.m4 > constant/polyMesh/blockMeshDict 8 | 9 | runApplication blockMesh 10 | 11 | runApplication topoSet 12 | 13 | # ----------------------------------------------------------------- end-of-file 14 | -------------------------------------------------------------------------------- /CompilingCustomSolver/mixerVesselAMI2D/system/decomposeParDict: -------------------------------------------------------------------------------- 1 | /*--------------------------------*- C++ -*----------------------------------*\ 2 | | ========= | | 3 | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | 4 | | \\ / O peration | Version: 2.3.1 | 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 "system"; 14 | object decomposeParDict; 15 | } 16 | // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 17 | 18 | //- Force AMI to be on single processor. Can cause imbalance with some 19 | // decomposers. 20 | //singleProcessorFaceSets ((AMI -1)); 21 | 22 | numberOfSubdomains 4; 23 | 24 | method scotch; 25 | 26 | distributed no; 27 | 28 | roots ( ); 29 | 30 | 31 | // ************************************************************************* // 32 | -------------------------------------------------------------------------------- /CompilingCustomSolver/mixerVesselAMI2D/system/topoSetDict: -------------------------------------------------------------------------------- 1 | /*--------------------------------*- C++ -*----------------------------------*\ 2 | | ========= | | 3 | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | 4 | | \\ / O peration | Version: 2.3.1 | 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 topoSetDict; 14 | } 15 | // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 16 | 17 | actions 18 | ( 19 | // Get both sides of ami 20 | // ~~~~~~~~~~~~~~~~~~~~~ 21 | 22 | // Get all faces in cellSet 23 | { 24 | name AMI; 25 | type faceSet; 26 | action new; 27 | source patchToFace; 28 | sourceInfo 29 | { 30 | name "AMI.*"; 31 | } 32 | } 33 | ); 34 | 35 | // ************************************************************************* // 36 | -------------------------------------------------------------------------------- /CompilingCustomSolver/solvers/UEqn.H: -------------------------------------------------------------------------------- 1 | // Solve the Momentum equation 2 | 3 | tmp UEqn 4 | ( 5 | fvm::ddt(U) 6 | + fvm::div(phi, U) 7 | + turbulence->divDevReff(U) 8 | == 9 | fvOptions(U) 10 | ); 11 | 12 | UEqn().relax(); 13 | 14 | fvOptions.constrain(UEqn()); 15 | 16 | volScalarField rAU(1.0/UEqn().A()); 17 | 18 | if (pimple.momentumPredictor()) 19 | { 20 | solve(UEqn() == -fvc::grad(p)); 21 | 22 | fvOptions.correct(U); 23 | } 24 | -------------------------------------------------------------------------------- /CompilingCustomSolver/solvers/createFields.H: -------------------------------------------------------------------------------- 1 | Info<< "Reading field p\n" << endl; 2 | volScalarField p 3 | ( 4 | IOobject 5 | ( 6 | "p", 7 | runTime.timeName(), 8 | mesh, 9 | IOobject::MUST_READ, 10 | IOobject::AUTO_WRITE 11 | ), 12 | mesh 13 | ); 14 | 15 | Info<< "Reading field U\n" << endl; 16 | volVectorField U 17 | ( 18 | IOobject 19 | ( 20 | "U", 21 | runTime.timeName(), 22 | mesh, 23 | IOobject::MUST_READ, 24 | IOobject::AUTO_WRITE 25 | ), 26 | mesh 27 | ); 28 | 29 | #include "createPhi.H" 30 | 31 | 32 | label pRefCell = 0; 33 | scalar pRefValue = 0.0; 34 | setRefCell(p, mesh.solutionDict().subDict("PIMPLE"), pRefCell, pRefValue); 35 | 36 | 37 | singlePhaseTransportModel laminarTransport(U, phi); 38 | 39 | autoPtr turbulence 40 | ( 41 | incompressible::turbulenceModel::New(U, phi, laminarTransport) 42 | ); 43 | -------------------------------------------------------------------------------- /CompilingCustomSolver/solvers/mySolver/Make/files: -------------------------------------------------------------------------------- 1 | mySolver.C 2 | 3 | EXE = $(FOAM_APPBIN)/mySolver 4 | -------------------------------------------------------------------------------- /CompilingCustomSolver/solvers/mySolver/Make/options: -------------------------------------------------------------------------------- 1 | EXE_INC = \ 2 | -I.. \ 3 | -I$(LIB_SRC)/turbulenceModels/incompressible/turbulenceModel \ 4 | -I$(LIB_SRC)/transportModels \ 5 | -I$(LIB_SRC)/transportModels/incompressible/singlePhaseTransportModel \ 6 | -I$(LIB_SRC)/finiteVolume/lnInclude \ 7 | -I$(LIB_SRC)/fvOptions/lnInclude \ 8 | -I$(LIB_SRC)/sampling/lnInclude \ 9 | -I$(LIB_SRC)/dynamicFvMesh/lnInclude \ 10 | -I$(LIB_SRC)/dynamicMesh/lnInclude \ 11 | -I$(LIB_SRC)/meshTools/lnInclude \ 12 | 13 | EXE_LIBS = \ 14 | -lincompressibleTransportModels \ 15 | -lincompressibleTurbulenceModel \ 16 | -lincompressibleRASModels \ 17 | -lincompressibleLESModels \ 18 | -lfiniteVolume \ 19 | -lfvOptions \ 20 | -lsampling \ 21 | -ldynamicFvMesh \ 22 | -ltopoChangerFvMesh \ 23 | -ldynamicMesh \ 24 | -lmeshTools 25 | -------------------------------------------------------------------------------- /CompilingCustomSolver/solvers/mySolver/pEqn.H: -------------------------------------------------------------------------------- 1 | surfaceScalarField rAUf("rAUf", fvc::interpolate(rAU)); 2 | 3 | volVectorField HbyA("HbyA", U); 4 | HbyA = rAU*UEqn().H(); 5 | 6 | if (pimple.nCorrPISO() <= 1) 7 | { 8 | UEqn.clear(); 9 | } 10 | 11 | surfaceScalarField phiHbyA 12 | ( 13 | "phiHbyA", 14 | (fvc::interpolate(HbyA) & mesh.Sf()) 15 | + rAUf*fvc::ddtCorr(U, Uf) 16 | ); 17 | 18 | if (p.needReference()) 19 | { 20 | fvc::makeRelative(phiHbyA, U); 21 | adjustPhi(phiHbyA, U, p); 22 | fvc::makeAbsolute(phiHbyA, U); 23 | } 24 | 25 | while (pimple.correctNonOrthogonal()) 26 | { 27 | fvScalarMatrix pEqn 28 | ( 29 | fvm::laplacian(rAUf, p) == fvc::div(phiHbyA) 30 | ); 31 | 32 | pEqn.setReference(pRefCell, pRefValue); 33 | 34 | pEqn.solve(mesh.solver(p.select(pimple.finalInnerIter()))); 35 | 36 | if (pimple.finalNonOrthogonalIter()) 37 | { 38 | phi = phiHbyA - pEqn.flux(); 39 | } 40 | } 41 | 42 | #include "continuityErrs.H" 43 | 44 | // Explicitly relax pressure for momentum corrector 45 | p.relax(); 46 | 47 | U = HbyA - rAU*fvc::grad(p); 48 | U.correctBoundaryConditions(); 49 | fvOptions.correct(U); 50 | 51 | { 52 | Uf = fvc::interpolate(U); 53 | surfaceVectorField n(mesh.Sf()/mesh.magSf()); 54 | Uf += n*(phi/mesh.magSf() - (n & Uf)); 55 | } 56 | 57 | // Make the fluxes relative to the mesh motion 58 | fvc::makeRelative(phi, U); 59 | -------------------------------------------------------------------------------- /CompilingCustomSolver/solvers/mySolver/readControls.H: -------------------------------------------------------------------------------- 1 | #include "readTimeControls.H" 2 | 3 | const bool correctPhi = 4 | pimple.dict().lookupOrDefault("correctPhi", false); 5 | 6 | const bool checkMeshCourantNo = 7 | pimple.dict().lookupOrDefault("checkMeshCourantNo", false); 8 | -------------------------------------------------------------------------------- /CompilingCustomSolver/solvers/pimpleDyMFoam/Make/files: -------------------------------------------------------------------------------- 1 | pimpleDyMFoam.C 2 | 3 | EXE = $(FOAM_APPBIN)/pimpleDyMFoam 4 | -------------------------------------------------------------------------------- /CompilingCustomSolver/solvers/pimpleDyMFoam/Make/options: -------------------------------------------------------------------------------- 1 | EXE_INC = \ 2 | -I.. \ 3 | -I$(LIB_SRC)/turbulenceModels/incompressible/turbulenceModel \ 4 | -I$(LIB_SRC)/transportModels \ 5 | -I$(LIB_SRC)/transportModels/incompressible/singlePhaseTransportModel \ 6 | -I$(LIB_SRC)/finiteVolume/lnInclude \ 7 | -I$(LIB_SRC)/fvOptions/lnInclude \ 8 | -I$(LIB_SRC)/sampling/lnInclude \ 9 | -I$(LIB_SRC)/dynamicFvMesh/lnInclude \ 10 | -I$(LIB_SRC)/dynamicMesh/lnInclude \ 11 | -I$(LIB_SRC)/meshTools/lnInclude \ 12 | 13 | EXE_LIBS = \ 14 | -lincompressibleTransportModels \ 15 | -lincompressibleTurbulenceModel \ 16 | -lincompressibleRASModels \ 17 | -lincompressibleLESModels \ 18 | -lfiniteVolume \ 19 | -lfvOptions \ 20 | -lsampling \ 21 | -ldynamicFvMesh \ 22 | -ltopoChangerFvMesh \ 23 | -ldynamicMesh \ 24 | -lmeshTools 25 | -------------------------------------------------------------------------------- /CompilingCustomSolver/solvers/pimpleDyMFoam/pEqn.H: -------------------------------------------------------------------------------- 1 | surfaceScalarField rAUf("rAUf", fvc::interpolate(rAU)); 2 | 3 | volVectorField HbyA("HbyA", U); 4 | HbyA = rAU*UEqn().H(); 5 | 6 | if (pimple.nCorrPISO() <= 1) 7 | { 8 | UEqn.clear(); 9 | } 10 | 11 | surfaceScalarField phiHbyA 12 | ( 13 | "phiHbyA", 14 | (fvc::interpolate(HbyA) & mesh.Sf()) 15 | + rAUf*fvc::ddtCorr(U, Uf) 16 | ); 17 | 18 | if (p.needReference()) 19 | { 20 | fvc::makeRelative(phiHbyA, U); 21 | adjustPhi(phiHbyA, U, p); 22 | fvc::makeAbsolute(phiHbyA, U); 23 | } 24 | 25 | while (pimple.correctNonOrthogonal()) 26 | { 27 | fvScalarMatrix pEqn 28 | ( 29 | fvm::laplacian(rAUf, p) == fvc::div(phiHbyA) 30 | ); 31 | 32 | pEqn.setReference(pRefCell, pRefValue); 33 | 34 | pEqn.solve(mesh.solver(p.select(pimple.finalInnerIter()))); 35 | 36 | if (pimple.finalNonOrthogonalIter()) 37 | { 38 | phi = phiHbyA - pEqn.flux(); 39 | } 40 | } 41 | 42 | #include "continuityErrs.H" 43 | 44 | // Explicitly relax pressure for momentum corrector 45 | p.relax(); 46 | 47 | U = HbyA - rAU*fvc::grad(p); 48 | U.correctBoundaryConditions(); 49 | fvOptions.correct(U); 50 | 51 | { 52 | Uf = fvc::interpolate(U); 53 | surfaceVectorField n(mesh.Sf()/mesh.magSf()); 54 | Uf += n*(phi/mesh.magSf() - (n & Uf)); 55 | } 56 | 57 | // Make the fluxes relative to the mesh motion 58 | fvc::makeRelative(phi, U); 59 | -------------------------------------------------------------------------------- /CompilingCustomSolver/solvers/pimpleDyMFoam/readControls.H: -------------------------------------------------------------------------------- 1 | #include "readTimeControls.H" 2 | 3 | const bool correctPhi = 4 | pimple.dict().lookupOrDefault("correctPhi", false); 5 | 6 | const bool checkMeshCourantNo = 7 | pimple.dict().lookupOrDefault("checkMeshCourantNo", false); 8 | -------------------------------------------------------------------------------- /DuctedFan/README: -------------------------------------------------------------------------------- 1 | Ducted Fan Simulation in OpenFOAM 2 | 3 | All code can be found at: https://github.com/lordvon/OpenFOAM_Tutorials/tree/master/DuctedFan 4 | 5 | DESCRIPTION: 6 | An actuator disk (pressure-jump baffle) will be used to simulate a propeller. A duct surrounds the actuator disk. The simulation is axisymmetric 2D via the wedge boundary condition. 7 | The knowledge required to create this simulation can be obtained from the baffle, axisymmetric 2D, and Gmsh tutorials. 8 | 9 | OUTLINE: 10 | -Overview of the mesh. 11 | -Overview of the necessary boundary conditions. 12 | -Inspect the velocity and pressure fields. 13 | 14 | COMMANDS: 15 | gmsh mesh/main.geo -3 -o test.msh 16 | gmshToFoam test.msh -case case 17 | # Modify boundary file 18 | createBaffles -case case -dict system/baffleDict -overwrite 19 | pimpleFoam 20 | 21 | This tutorial was run successfully on: 22 | -Ubuntu 14.04 64-bit 23 | -OpenFOAM 2.3.1 24 | -Gmsh 2.9.3 -------------------------------------------------------------------------------- /DuctedFan/case/0/.svn/all-wcprops: -------------------------------------------------------------------------------- 1 | K 25 2 | svn:wc:ra_dav:version-url 3 | V 98 4 | /svnroot/openfoam-extend/!svn/ver/1160/trunk/Core/OpenFOAM-1.5-dev/tutorials/icoDyMFoam/mixerGgi/0 5 | END 6 | p 7 | K 25 8 | svn:wc:ra_dav:version-url 9 | V 100 10 | /svnroot/openfoam-extend/!svn/ver/1160/trunk/Core/OpenFOAM-1.5-dev/tutorials/icoDyMFoam/mixerGgi/0/p 11 | END 12 | U 13 | K 25 14 | svn:wc:ra_dav:version-url 15 | V 100 16 | /svnroot/openfoam-extend/!svn/ver/1160/trunk/Core/OpenFOAM-1.5-dev/tutorials/icoDyMFoam/mixerGgi/0/U 17 | END 18 | -------------------------------------------------------------------------------- /DuctedFan/case/0/.svn/entries: -------------------------------------------------------------------------------- 1 | 10 2 | 3 | dir 4 | 1824 5 | https://openfoam-extend.svn.sourceforge.net/svnroot/openfoam-extend/trunk/Core/OpenFOAM-1.5-dev/tutorials/icoDyMFoam/mixerGgi/0 6 | https://openfoam-extend.svn.sourceforge.net/svnroot/openfoam-extend 7 | 8 | 9 | 10 | 2009-04-02T10:19:15.967477Z 11 | 1160 12 | hjasak 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | e4e07f05-0c2f-0410-a05a-b8ba57e0c909 28 | 29 | p 30 | file 31 | 32 | 33 | 34 | 35 | 2010-09-12T03:25:12.586382Z 36 | dd2b863de322b1d9c35faef303f89f85 37 | 2009-04-02T10:19:15.967477Z 38 | 1160 39 | hjasak 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 1312 62 | 63 | U 64 | file 65 | 66 | 67 | 68 | 69 | 2010-09-12T03:25:12.586382Z 70 | c1b8734ca81431daedfa5badc1f03002 71 | 2009-04-02T10:19:15.967477Z 72 | 1160 73 | hjasak 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 1416 96 | 97 | -------------------------------------------------------------------------------- /DuctedFan/case/constant/RASProperties: -------------------------------------------------------------------------------- 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 RASProperties; 15 | } 16 | // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 17 | 18 | RASModel SpalartAllmaras; 19 | 20 | turbulence on; 21 | 22 | printCoeffs on; 23 | 24 | 25 | // ************************************************************************* // 26 | -------------------------------------------------------------------------------- /DuctedFan/case/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 | transportModel Newtonian; 19 | 20 | nu nu [ 0 2 -1 0 0 0 0 ] 1.568e-5; 21 | 22 | // ************************************************************************* // 23 | -------------------------------------------------------------------------------- /DuctedFan/case/constant/turbulenceProperties: -------------------------------------------------------------------------------- 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 turbulenceProperties; 15 | } 16 | // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 17 | 18 | simulationType RASModel; 19 | 20 | 21 | // ************************************************************************* // 22 | -------------------------------------------------------------------------------- /DuctedFan/case/system/controlDict: -------------------------------------------------------------------------------- 1 | /*--------------------------------*- C++ -*----------------------------------*\ 2 | | ========= | | 3 | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | 4 | | \\ / O peration | Version: 2.3.1 | 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 "system"; 14 | object controlDict; 15 | } 16 | // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 17 | 18 | applicationClass pimpleFoam; 19 | startFrom latestTime; 20 | endTime 1; 21 | stopAt endTime; 22 | deltaT 1; 23 | writeControl adjustableRunTime; 24 | writeInterval 0.01; 25 | cycleWrite 0; 26 | writeFormat binary; 27 | writePrecision 6; 28 | writeCompression uncompressed; 29 | timeFormat general; 30 | timePrecision 6; 31 | runTimeModifiable yes; 32 | adjustTimeStep yes; 33 | maxCo 20; 34 | maxDeltaT 1; 35 | 36 | // ************************************************************************* // 37 | -------------------------------------------------------------------------------- /DuctedFan/mesh/main.geo: -------------------------------------------------------------------------------- 1 | //Gmsh 2 | TUNNEL[]={}; 3 | WEDGE0[]={}; 4 | WEDGE1[]={}; 5 | DUCT[]={}; 6 | ROTOR[]={}; 7 | INLET[]={}; 8 | OUTLET[]={}; 9 | AIR[]={}; 10 | 11 | Include "functions.geo"; 12 | Include "inputs.geo"; 13 | ce = 0; 14 | Point(ce++)={0,0,0}; 15 | origin=ce; 16 | 17 | Include "shapes/basicbl.geo"; 18 | 19 | Include "unstructuredboundary.geo"; 20 | 21 | Include "domainboundary.geo"; 22 | 23 | 24 | Transfinite Surface{ROTOR[]}; 25 | Recombine Surface{ROTOR[]}; 26 | 27 | //Physical Point("testPoints")=testPoints[]; 28 | //Physical Line("test") = TL[]; 29 | Physical Surface("inlet") = INLET[]; 30 | Physical Surface("outlet") = OUTLET[]; 31 | Physical Surface("tunnel") = TUNNEL[]; 32 | Physical Surface("duct") = DUCT[]; 33 | Physical Surface("wedge0") = WEDGE0[]; 34 | Physical Surface("wedge1") = WEDGE1[]; 35 | Physical Surface("baffle")=ROTOR[]; 36 | 37 | Physical Volume("air") = AIR[]; 38 | 39 | allVolumes[] = Volume "*"; 40 | Rotate{{0,1,0},{0,0,0},-2.5*Pi/180} 41 | { 42 | Volume {allVolumes[]}; 43 | } -------------------------------------------------------------------------------- /DuctedFan/mesh/shapes/basic.geo: -------------------------------------------------------------------------------- 1 | //Gmsh 2 | 3 | LR = DC/20;//le radius. 4 | DFA = 10*Pi/180;//rad, duct flare angle. 5 | 6 | top=RCP*DC; 7 | bottom=top-DC; 8 | 9 | start=top-LR; 10 | innerx=-RD/2; 11 | 12 | Point(ce++)={innerx,start,0,DLS};ip=ce; 13 | Point(ce++)={innerx-LR,start,0,DLS};cp=ce; 14 | Point(ce++)={innerx-LR,top,0,DLS};tp=ce; 15 | Point(ce++)={innerx+bottom*Tan(DFA),bottom,0,DLS};bp=ce; 16 | Point(ce++)={innerx,0,0,DLS};rp=ce; 17 | 18 | angle=Acos(LR/(Sqrt( (DC-LR)^2+(LR)^2 ))); 19 | Point(ce++)={innerx-LR+Cos(-angle-Pi/2)*LR,start+Sin(-angle-Pi/2)*LR,0,DLS};op=ce; 20 | 21 | 22 | lns[]={}; 23 | Line(ce++)={bp,rp};lns[]+=ce; 24 | Line(ce++)={rp,ip};lns[]+=ce; 25 | Circle(ce++)={ip,cp,tp};lns[]+=ce; 26 | Circle(ce++)={tp,cp,op};lns[]+=ce; 27 | Line(ce++)={op,bp};lns[]+=ce; 28 | 29 | 30 | -------------------------------------------------------------------------------- /FanWing2D/README.txt: -------------------------------------------------------------------------------- 1 | FanWing Simulation in OpenFOAM Using Arbitrary Mesh Interface (AMI) 2 | 3 | All code can be found at: https://github.com/lordvon/OpenFOAM_Tutorials/tree/master/FanWing2D 4 | 5 | DESCRIPTION: 6 | Here we will simulate a FanWing wing section in 2D. The FanWing is a novel lift device invented recently in the late 90's by Patrick Peebles. It utilizes a cross flow fan to produce air flow over the whole span of the wing. In 2D, the simulation does not match well with wind tunnel experiments, but 3D cases do match well (a tutorial for this is/will be made on this channel). The 2D simulation would still be good for fast parametric design simulations. The rotor is a moving mesh made possible by the OpenFOAM Arbitrary Mesh Interface (AMI). 7 | 8 | OUTLINE: 9 | -Create mesh in Gmsh. 10 | -Convert the mesh and change the 'constant/polyMesh/boundary' file. 11 | -To the AMI patches add (replace angle brackets; the parameter values can be changed): 12 | type cyclicAMI; 13 | neighbourPatch ; 14 | matchTolerance 1e-4; 15 | transform noOrdering; 16 | -Run the simulation and view post-processed results. 17 | 18 | COMMANDS: 19 | gmsh mesh/main.geo -3 -o test.msh 20 | gmshToFoam test.msh -case case 21 | # Modify boundary file 22 | pimpleDyMFoam 23 | 24 | This tutorial was run successfully on: 25 | -Ubuntu 14.04 64-bit 26 | -OpenFOAM 2.4.0 27 | -Gmsh 2.9.3 -------------------------------------------------------------------------------- /FanWing2D/case/0/.svn/all-wcprops: -------------------------------------------------------------------------------- 1 | K 25 2 | svn:wc:ra_dav:version-url 3 | V 98 4 | /svnroot/openfoam-extend/!svn/ver/1160/trunk/Core/OpenFOAM-1.5-dev/tutorials/icoDyMFoam/mixerGgi/0 5 | END 6 | p 7 | K 25 8 | svn:wc:ra_dav:version-url 9 | V 100 10 | /svnroot/openfoam-extend/!svn/ver/1160/trunk/Core/OpenFOAM-1.5-dev/tutorials/icoDyMFoam/mixerGgi/0/p 11 | END 12 | U 13 | K 25 14 | svn:wc:ra_dav:version-url 15 | V 100 16 | /svnroot/openfoam-extend/!svn/ver/1160/trunk/Core/OpenFOAM-1.5-dev/tutorials/icoDyMFoam/mixerGgi/0/U 17 | END 18 | -------------------------------------------------------------------------------- /FanWing2D/case/0/.svn/entries: -------------------------------------------------------------------------------- 1 | 10 2 | 3 | dir 4 | 1824 5 | https://openfoam-extend.svn.sourceforge.net/svnroot/openfoam-extend/trunk/Core/OpenFOAM-1.5-dev/tutorials/icoDyMFoam/mixerGgi/0 6 | https://openfoam-extend.svn.sourceforge.net/svnroot/openfoam-extend 7 | 8 | 9 | 10 | 2009-04-02T10:19:15.967477Z 11 | 1160 12 | hjasak 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | e4e07f05-0c2f-0410-a05a-b8ba57e0c909 28 | 29 | p 30 | file 31 | 32 | 33 | 34 | 35 | 2010-09-12T03:25:12.586382Z 36 | dd2b863de322b1d9c35faef303f89f85 37 | 2009-04-02T10:19:15.967477Z 38 | 1160 39 | hjasak 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 1312 62 | 63 | U 64 | file 65 | 66 | 67 | 68 | 69 | 2010-09-12T03:25:12.586382Z 70 | c1b8734ca81431daedfa5badc1f03002 71 | 2009-04-02T10:19:15.967477Z 72 | 1160 73 | hjasak 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 1416 96 | 97 | -------------------------------------------------------------------------------- /FanWing2D/case/0/include/ami: -------------------------------------------------------------------------------- 1 | //c++ 2 | ami00 { type cyclicAMI;value $internalField; } 3 | ami01 { type cyclicAMI;value $internalField; } 4 | //ami10 { type cyclicAMI;value $internalField; } 5 | //ami11 { type cyclicAMI;value $internalField; } 6 | defaultFaces { type empty; } 7 | -------------------------------------------------------------------------------- /FanWing2D/case/constant/RASProperties: -------------------------------------------------------------------------------- 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 RASProperties; 15 | } 16 | // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 17 | 18 | RASModel SpalartAllmaras; 19 | 20 | turbulence on; 21 | 22 | printCoeffs on; 23 | 24 | 25 | // ************************************************************************* // 26 | -------------------------------------------------------------------------------- /FanWing2D/case/constant/dynamicMeshDict: -------------------------------------------------------------------------------- 1 | /*--------------------------------*- C++ -*----------------------------------*\ 2 | | ========= | | 3 | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | 4 | | \\ / O peration | Version: 2.4.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 dynamicMeshDict; 15 | } 16 | // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 17 | 18 | dynamicFvMesh solidBodyMotionFvMesh; 19 | 20 | motionSolverLibs ( "libfvMotionSolvers.so" ); 21 | 22 | solidBodyMotionFvMeshCoeffs 23 | { 24 | cellZone rotorVolume0; 25 | 26 | solidBodyMotionFunction rotatingMotion; 27 | rotatingMotionCoeffs 28 | { 29 | origin (0 0 0); 30 | axis (0 0 -1); 31 | omega 250; // rad/s 32 | } 33 | } 34 | 35 | // ************************************************************************* // 36 | -------------------------------------------------------------------------------- /FanWing2D/case/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 | transportModel Newtonian; 19 | 20 | nu nu [ 0 2 -1 0 0 0 0 ] 1.568e-5; 21 | 22 | // ************************************************************************* // 23 | -------------------------------------------------------------------------------- /FanWing2D/case/constant/turbulenceProperties: -------------------------------------------------------------------------------- 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 turbulenceProperties; 15 | } 16 | // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 17 | 18 | simulationType RASModel; 19 | 20 | 21 | // ************************************************************************* // 22 | -------------------------------------------------------------------------------- /FanWing2D/mesh/bound.geo: -------------------------------------------------------------------------------- 1 | //Gmsh 2 | //Given a z. 3 | 4 | p[]={}; 5 | Point(ce++)={uBoundCenter[0]+uBoundDim[0]/2,uBoundCenter[1]+uBoundDim[1]/2,z};p[]+=ce; 6 | Point(ce++)={uBoundCenter[0]-uBoundDim[0]/2,uBoundCenter[1]+uBoundDim[1]/2,z};p[]+=ce; 7 | Point(ce++)={uBoundCenter[0]-uBoundDim[0]/2,uBoundCenter[1]-uBoundDim[1]/2,z};p[]+=ce; 8 | Point(ce++)={uBoundCenter[0]+uBoundDim[0]/2,uBoundCenter[1]-uBoundDim[1]/2,z};p[]+=ce; 9 | 10 | uboundlines[]={}; 11 | Line(ce++)={p[0],p[1]};uboundlines[]+=ce;Transfinite Line{ce}=middleCells[1]+1; 12 | Line(ce++)={p[1],p[2]};uboundlines[]+=ce;Transfinite Line{ce}=middleCells[0]+1; 13 | Line(ce++)={p[2],p[3]};uboundlines[]+=ce;Transfinite Line{ce}=middleCells[3]+1; 14 | Line(ce++)={p[3],p[0]};uboundlines[]+=ce;Transfinite Line{ce}=middleCells[2]+1; 15 | 16 | Include "wt.geo"; 17 | -------------------------------------------------------------------------------- /FanWing2D/mesh/gmsh tips and hints.txt: -------------------------------------------------------------------------------- 1 | When manually making a transfinite surface from a surface loop, it will be necessary to reaffirm transfinite surface and recombination for surfaces that came out of an extrusion, if an error about incompatible surfaces arises. -------------------------------------------------------------------------------- /FanWing2D/mesh/intro.geo: -------------------------------------------------------------------------------- 1 | //Gmsh 2 | 3 | Include "inputs.geo"; 4 | Include "extrusion.geo"; 5 | Include "subs.geo"; 6 | capSurfaces[]={}; 7 | casingSurfaces[]={}; 8 | statorInterfaceSurfaces[]={}; 9 | tunnelSurfaces[]={}; 10 | inletSurfaces[]={}; 11 | outletSurfaces[]={}; 12 | symmetrySurfaces[]={}; 13 | baffleSurfaces[]={}; 14 | 15 | statorVolumes[]={}; 16 | 17 | ce=0; 18 | Point(ce++)={0,0,0};origin1=ce; 19 | Point(ce++)={0,0,span};origin2=ce; 20 | 21 | //Te calculation 22 | s=Sin(-cornerAngle); 23 | c=Cos(-cornerAngle); 24 | dy=(cr+s*cr+ct); 25 | dx=dy/Tan(jetAngles[0]); 26 | jetLength=Sqrt(dx^2+dy^2); 27 | 28 | jetLines[]={}; 29 | bottomLines[]={}; 30 | corneradapts[]={}; 31 | jetPlates[]={}; 32 | tes[]={}; 33 | corners[]={}; 34 | inlips[]={}; 35 | outlips[]={}; 36 | bottoms[]={}; 37 | topCorners[]={}; 38 | topDisks[]={}; 39 | adapts[]={}; 40 | -------------------------------------------------------------------------------- /FanWing2D/mesh/wtext.geo: -------------------------------------------------------------------------------- 1 | //Gmsh 2 | 3 | z=wtBoundDim[2]; 4 | p[]=p3[]; 5 | uboundlines[]=uboundlines3[]; 6 | ubc[]=ubc3[]; 7 | ubs[]=ubs3[]; 8 | 9 | 10 | Include "wt.geo"; 11 | pp3[]=pp[]; 12 | outwardLines3[]=outwardLines[]; 13 | peripheralLines3[]=peripheralLines[]; 14 | farsurfaces3[]=farsurfaces[]; 15 | 16 | pplines[]={}; 17 | For k In {0:#pp2[]-1} 18 | Line(ce++)={pp2[k],pp3[k]};pplines[]+=ce; 19 | EndFor 20 | Transfinite Line{pplines[]}=extCells+1; 21 | 22 | //outwardSurfaces[]=outwardLines3[]; 23 | peripheralLines1[]=peripheralLines2[]; 24 | peripheralLines2[]=peripheralLines3[]; 25 | outwardLines1[]=outwardLines2[]; 26 | outwardLines2[]=outwardLines3[]; 27 | farsurfaces1[]=farsurfaces2[]; 28 | farsurfaces2[]=farsurfaces3[]; 29 | //ubc[]; 30 | //ubs[]; 31 | Include "wtfill.geo"; 32 | inletSurfaces[]+=peripheralSurfaces[{3:5}]; 33 | outletSurfaces[]+=peripheralSurfaces[{9:11}]; 34 | tunnelSurfaces[]+=peripheralSurfaces[{0:2,6:8}]; 35 | tunnelSurfaces[]+=farsurfaces3[]; 36 | -------------------------------------------------------------------------------- /FanWing2D/mesh/wtspan.geo: -------------------------------------------------------------------------------- 1 | //Gmsh 2 | 3 | z=span; 4 | p[]=p2[]; 5 | uboundlines[]=uboundlines2[]; 6 | Include "wt.geo"; 7 | pp2[]=pp[]; 8 | outwardLines2[]=outwardLines[]; 9 | peripheralLines2[]=peripheralLines[]; 10 | farsurfaces2[]=farsurfaces[]; 11 | 12 | pplines[]={}; 13 | For k In {0:#pp1[]-1} 14 | Line(ce++)={pp1[k],pp2[k]};pplines[]+=ce; 15 | //Line(ce++)={pp2[k],pp3[k]}; 16 | EndFor 17 | Transfinite Line{pplines[]}=spanCells+1; 18 | 19 | Include "wtfill.geo"; 20 | inletSurfaces[]+=peripheralSurfaces[{3:5}]; 21 | outletSurfaces[]+=peripheralSurfaces[{9:11}]; 22 | tunnelSurfaces[]+=peripheralSurfaces[{0:2,6:8}]; 23 | //tunnelSurfaces[]+=farsurfaces2[]; 24 | 25 | -------------------------------------------------------------------------------- /GmshBasic0/README: -------------------------------------------------------------------------------- 1 | Making Meshes for OpenFOAM with Gmsh, Part 0: Basic Scripting and Structured Mesh 2 | 3 | DESCRIPTION: 4 | Here we will make a 2D square mesh and learn the basics of Gmsh scripting. 5 | 6 | There are many meshing utilities out there, but Gmsh is my favorite because you can make the mesh with the Gmsh scripting language, which is similar to C. Making a mesh this way, you can make quick changes to the geometry and mesh density by changing user-defined variables. This goes along well with what I think CFD is useful for: exploration of design spaces by variation of parameters. 7 | 8 | OUTLINE: 9 | Make Points and Lines to construct a Surface. 10 | Show how to make structured and recombined cells. 11 | 12 | This tutorial was run successfully on: 13 | -Ubuntu 14.04 64-bit 14 | -OpenFOAM 2.3.1 15 | -Gmsh 2.9.3 -------------------------------------------------------------------------------- /GmshBasic0/main.geo: -------------------------------------------------------------------------------- 1 | //Inputs 2 | boxdim = 1; 3 | gridsize = boxdim/10; 4 | 5 | Point(1) = {0,0,0,gridsize}; 6 | Point(2) = {boxdim,0,0,gridsize}; 7 | Point(3) = {boxdim,boxdim,0,gridsize}; 8 | Point(4) = {0,boxdim,0,gridsize}; 9 | 10 | Line(5) = {1,2}; 11 | Line(6) = {2,3}; 12 | Line(7) = {3,4}; 13 | Line(8) = {4,1}; 14 | 15 | Line Loop(9) = {5,6,7,8}; 16 | Plane Surface(10) = 9; 17 | 18 | Transfinite Line{5,6,7,8} = boxdim/gridsize; 19 | Transfinite Surface{10}; 20 | Recombine Surface{10}; 21 | Transfinite Line{5,6,7,8} = boxdim/gridsize Using Bump 0.25; 22 | Transfinite Line{5,6} = boxdim/gridsize Using Progression 1.2; 23 | Transfinite Line{-7,-8} = boxdim/gridsize Using Progression 1.2; -------------------------------------------------------------------------------- /GmshBasic1/README: -------------------------------------------------------------------------------- 1 | Making Meshes for OpenFOAM with Gmsh, Part 1: Unstructured and Structured Hybrid Meshes 2 | 3 | DESCRIPTION: 4 | Here we will make different types of unstructured meshes and make a mesh that contains both unstructured and structured cells. 5 | 6 | OUTLINE: 7 | Make a 2D square mesh with 2 unstructured partitions. 8 | Make one partition structured. 9 | Show recombined unstructured cells. 10 | 11 | This tutorial was run successfully on: 12 | -Ubuntu 14.04 64-bit 13 | -OpenFOAM 2.3.1 14 | -Gmsh 2.9.3 -------------------------------------------------------------------------------- /GmshBasic1/main.geo: -------------------------------------------------------------------------------- 1 | //Inputs 2 | boxdim = 1; 3 | gridsize = boxdim/10; 4 | 5 | Point(1) = {0,0,0,gridsize}; 6 | Point(2) = {boxdim,0,0,gridsize}; 7 | Point(3) = {boxdim,boxdim,0,gridsize}; 8 | Point(4) = {0,boxdim,0,gridsize}; 9 | 10 | Point(5) = {2*boxdim,0,0,gridsize}; 11 | Point(6) = {2*boxdim,boxdim,0,gridsize}; 12 | 13 | Line(7) = {1,2}; 14 | Line(8) = {2,3}; 15 | Line(9) = {3,4}; 16 | Line(10) = {4,1}; 17 | 18 | Line(11) = {2,5}; 19 | Line(12) = {5,6}; 20 | Line(13) = {6,3}; 21 | 22 | Line Loop(14) = {7,8,9,10}; 23 | Line Loop(15) = {11,12,13,-8}; 24 | 25 | Plane Surface(16) = 14; 26 | Plane Surface(17) = 15; 27 | 28 | //Make one square structured. 29 | Transfinite Line{7,8,9,10} = boxdim/gridsize; 30 | Transfinite Surface{16}; 31 | Recombine Surface{16}; 32 | 33 | Recombine Surface{17}; -------------------------------------------------------------------------------- /GmshBasic2/README: -------------------------------------------------------------------------------- 1 | Making Meshes for OpenFOAM with Gmsh, Part 2: Extrusions and Conversion to OpenFOAM Format 2 | 3 | All code can be found at: https://github.com/lordvon/OpenFOAM_Tutorials/tree/master/GmshBasic2 4 | 5 | DESCRIPTION: 6 | Here we will make a simple cube mesh by extrusion from a 2D sqaure mesh. Then we will export the mesh to a file and use the OpenFOAM mesh conversion utility to import it into a dummy case. 7 | 8 | OUTLINE: 9 | Make a 2D square mesh. 10 | Extrude the 2D mesh to create a 3D mesh. 11 | Define the volume and surfaces so that OpenFOAM can recognize them. 12 | Create the mesh by exporting it to a file with the command line. 13 | Convert the mesh with the command-line OpenFOAM mesh conversion utility. 14 | 15 | This tutorial was run successfully on: 16 | -Ubuntu 14.04 64-bit 17 | -OpenFOAM 2.3.1 18 | -Gmsh 2.9.3 -------------------------------------------------------------------------------- /GmshBasic2/convert.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | gmsh main.geo -3 -o test.msh 4 | 5 | gmshToFoam test.msh -case dummyCase 6 | 7 | rm test.msh 8 | -------------------------------------------------------------------------------- /GmshBasic2/dummyCase/constant/polyMesh/faceZones: -------------------------------------------------------------------------------- 1 | /*--------------------------------*- C++ -*----------------------------------*\ 2 | | ========= | | 3 | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | 4 | | \\ / O peration | Version: 2.3.1 | 5 | | \\ / A nd | Web: www.OpenFOAM.org | 6 | | \\/ M anipulation | | 7 | \*---------------------------------------------------------------------------*/ 8 | FoamFile 9 | { 10 | version 2.0; 11 | format ascii; 12 | class regIOobject; 13 | location "constant/polyMesh"; 14 | object faceZones; 15 | } 16 | // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 17 | 18 | 0 19 | () 20 | 21 | // ************************************************************************* // 22 | -------------------------------------------------------------------------------- /GmshBasic2/dummyCase/constant/polyMesh/pointZones: -------------------------------------------------------------------------------- 1 | /*--------------------------------*- C++ -*----------------------------------*\ 2 | | ========= | | 3 | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | 4 | | \\ / O peration | Version: 2.3.1 | 5 | | \\ / A nd | Web: www.OpenFOAM.org | 6 | | \\/ M anipulation | | 7 | \*---------------------------------------------------------------------------*/ 8 | FoamFile 9 | { 10 | version 2.0; 11 | format ascii; 12 | class regIOobject; 13 | location "constant/polyMesh"; 14 | object pointZones; 15 | } 16 | // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 17 | 18 | 0 19 | () 20 | 21 | // ************************************************************************* // 22 | -------------------------------------------------------------------------------- /GmshBasic2/main.geo: -------------------------------------------------------------------------------- 1 | //Inputs 2 | boxdim = 1; 3 | gridsize = boxdim/10; 4 | 5 | //Create 2D square mesh. 6 | Point(1) = {0,0,0,gridsize}; 7 | Point(2) = {boxdim,0,0,gridsize}; 8 | Point(3) = {boxdim,boxdim,0,gridsize}; 9 | Point(4) = {0,boxdim,0,gridsize}; 10 | 11 | Line(5) = {1,2}; 12 | Line(6) = {2,3}; 13 | Line(7) = {3,4}; 14 | Line(8) = {4,1}; 15 | 16 | Line Loop(9) = {5,6,7,8}; 17 | Plane Surface(10) = 9; 18 | 19 | Transfinite Line{5,6,7,8} = boxdim/gridsize+1; 20 | Transfinite Surface{10}; 21 | Recombine Surface{10}; 22 | 23 | //Now make 3D by extrusion. 24 | newEntities[] = 25 | Extrude { 0,0,1 } 26 | { 27 | Surface{10}; 28 | Layers{boxdim/gridsize}; 29 | Recombine; 30 | }; 31 | 32 | Physical Surface("back") = {10}; 33 | Physical Surface("front") = {newEntities[0]}; 34 | Physical Surface("bottom") = {newEntities[2]}; 35 | Physical Surface("right") = {newEntities[3]}; 36 | Physical Surface("top") = {newEntities[4]}; 37 | Physical Surface("left") = {newEntities[5]}; 38 | Physical Volume(100) = {newEntities[1]}; -------------------------------------------------------------------------------- /GmshBasic3/README: -------------------------------------------------------------------------------- 1 | Making Meshes for OpenFOAM with Gmsh, Part 3: Preparing a 2D Simulation 2 | 3 | All code can be found at: https://github.com/lordvon/OpenFOAM_Tutorials/tree/master/GmshBasic3 4 | 5 | DESCRIPTION: 6 | Here we will use the 'cavity' tutorial case, but replace the blockMesh-made mesh (the OpenFOAM built-in default) with a Gmsh mesh. The commands used in the tutorial can be found in 'makemesh.sh'. 7 | 8 | OUTLINE: 9 | Make the cavity mesh in Gmsh. 10 | Convert the mesh with the command-line OpenFOAM mesh conversion utility. 11 | Modify the boundary conditions so that the case works appropriately. 12 | 13 | This tutorial was run successfully on: 14 | -Ubuntu 14.04 64-bit 15 | -OpenFOAM 2.3.1 16 | -Gmsh 2.9.3 -------------------------------------------------------------------------------- /GmshBasic3/main.geo: -------------------------------------------------------------------------------- 1 | //Inputs 2 | boxdim = 1; 3 | celldim = 20; 4 | depth = boxdim/celldim; 5 | 6 | Point(1) = {0,0,0}; 7 | Point(2) = {boxdim,0,0}; 8 | Point(3) = {boxdim,boxdim,0}; 9 | Point(4) = {0,boxdim,0}; 10 | 11 | Line(5) = {1,2}; 12 | Line(6) = {2,3}; 13 | Line(7) = {3,4}; 14 | Line(8) = {4,1}; 15 | 16 | Line Loop(9) = {5,6,7,8}; 17 | Plane Surface(10) = 9; 18 | 19 | Transfinite Line{5,6,7,8} = celldim+1; 20 | Transfinite Surface{10}; 21 | 22 | Recombine Surface{10}; 23 | 24 | newEntities[] = 25 | Extrude{0,0,depth} 26 | { 27 | Surface{10}; 28 | Layers{1}; 29 | Recombine; 30 | }; 31 | 32 | Physical Surface("fixedWalls") = {newEntities[{2,3,5}]}; 33 | Physical Surface("movingWall") = {newEntities[4]}; 34 | Physical Surface("frontAndBack") = {10,newEntities[0]}; 35 | Physical Volume(100) = {newEntities[1]}; -------------------------------------------------------------------------------- /GmshBasic3/makemesh.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | cp -r originals/cavity . 4 | 5 | gmsh main.geo -3 -o test.msh 6 | 7 | gmshToFoam test.msh -case cavity 8 | 9 | #Now go into 'cavity/constant/polyMesh/boundary', 10 | #and change the types to be consistent with those in '0', 11 | #as shown in the tutorial video. -------------------------------------------------------------------------------- /GmshBasic3/originals/cavity/0/U: -------------------------------------------------------------------------------- 1 | /*--------------------------------*- C++ -*----------------------------------*\ 2 | | ========= | | 3 | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | 4 | | \\ / O peration | Version: 2.3.1 | 5 | | \\ / A nd | Web: www.OpenFOAM.org | 6 | | \\/ M anipulation | | 7 | \*---------------------------------------------------------------------------*/ 8 | FoamFile 9 | { 10 | version 2.0; 11 | format ascii; 12 | class volVectorField; 13 | object U; 14 | } 15 | // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 16 | 17 | dimensions [0 1 -1 0 0 0 0]; 18 | 19 | internalField uniform (0 0 0); 20 | 21 | boundaryField 22 | { 23 | movingWall 24 | { 25 | type fixedValue; 26 | value uniform (1 0 0); 27 | } 28 | 29 | fixedWalls 30 | { 31 | type fixedValue; 32 | value uniform (0 0 0); 33 | } 34 | 35 | frontAndBack 36 | { 37 | type empty; 38 | } 39 | } 40 | 41 | // ************************************************************************* // 42 | -------------------------------------------------------------------------------- /GmshBasic3/originals/cavity/0/epsilon: -------------------------------------------------------------------------------- 1 | /*--------------------------------*- C++ -*----------------------------------*\ 2 | | ========= | | 3 | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | 4 | | \\ / O peration | Version: 2.3.1 | 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 epsilon; 15 | } 16 | // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 17 | 18 | dimensions [0 2 -3 0 0 0 0]; 19 | 20 | internalField uniform 0.000765; 21 | 22 | boundaryField 23 | { 24 | movingWall 25 | { 26 | type epsilonWallFunction; 27 | value uniform 0.000765; 28 | } 29 | fixedWalls 30 | { 31 | type epsilonWallFunction; 32 | value uniform 0.000765; 33 | } 34 | frontAndBack 35 | { 36 | type empty; 37 | } 38 | } 39 | 40 | 41 | // ************************************************************************* // 42 | -------------------------------------------------------------------------------- /GmshBasic3/originals/cavity/0/k: -------------------------------------------------------------------------------- 1 | /*--------------------------------*- C++ -*----------------------------------*\ 2 | | ========= | | 3 | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | 4 | | \\ / O peration | Version: 2.3.1 | 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 | 18 | dimensions [0 2 -2 0 0 0 0]; 19 | 20 | internalField uniform 0.00325; 21 | 22 | boundaryField 23 | { 24 | movingWall 25 | { 26 | type kqRWallFunction; 27 | value uniform 0.00325; 28 | } 29 | fixedWalls 30 | { 31 | type kqRWallFunction; 32 | value uniform 0.00325; 33 | } 34 | frontAndBack 35 | { 36 | type empty; 37 | } 38 | } 39 | 40 | 41 | // ************************************************************************* // 42 | -------------------------------------------------------------------------------- /GmshBasic3/originals/cavity/0/nuTilda: -------------------------------------------------------------------------------- 1 | /*--------------------------------*- C++ -*----------------------------------*\ 2 | | ========= | | 3 | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | 4 | | \\ / O peration | Version: 2.3.1 | 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 | object nuTilda; 14 | } 15 | // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 16 | 17 | dimensions [0 2 -1 0 0 0 0]; 18 | 19 | internalField uniform 0; 20 | 21 | boundaryField 22 | { 23 | movingWall 24 | { 25 | type zeroGradient; 26 | } 27 | 28 | fixedWalls 29 | { 30 | type zeroGradient; 31 | } 32 | 33 | frontAndBack 34 | { 35 | type empty; 36 | } 37 | } 38 | 39 | // ************************************************************************* // 40 | -------------------------------------------------------------------------------- /GmshBasic3/originals/cavity/0/nut: -------------------------------------------------------------------------------- 1 | /*--------------------------------*- C++ -*----------------------------------*\ 2 | | ========= | | 3 | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | 4 | | \\ / O peration | Version: 2.3.1 | 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 nut; 15 | } 16 | // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 17 | 18 | dimensions [0 2 -1 0 0 0 0]; 19 | 20 | internalField uniform 0; 21 | 22 | boundaryField 23 | { 24 | movingWall 25 | { 26 | type nutkWallFunction; 27 | value uniform 0; 28 | } 29 | fixedWalls 30 | { 31 | type nutkWallFunction; 32 | value uniform 0; 33 | } 34 | frontAndBack 35 | { 36 | type empty; 37 | } 38 | } 39 | 40 | 41 | // ************************************************************************* // 42 | -------------------------------------------------------------------------------- /GmshBasic3/originals/cavity/0/p: -------------------------------------------------------------------------------- 1 | /*--------------------------------*- C++ -*----------------------------------*\ 2 | | ========= | | 3 | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | 4 | | \\ / O peration | Version: 2.3.1 | 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 | object p; 14 | } 15 | // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 16 | 17 | dimensions [0 2 -2 0 0 0 0]; 18 | 19 | internalField uniform 0; 20 | 21 | boundaryField 22 | { 23 | movingWall 24 | { 25 | type zeroGradient; 26 | } 27 | 28 | fixedWalls 29 | { 30 | type zeroGradient; 31 | } 32 | 33 | frontAndBack 34 | { 35 | type empty; 36 | } 37 | } 38 | 39 | // ************************************************************************* // 40 | -------------------------------------------------------------------------------- /GmshBasic3/originals/cavity/constant/RASProperties: -------------------------------------------------------------------------------- 1 | /*--------------------------------*- C++ -*----------------------------------*\ 2 | | ========= | | 3 | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | 4 | | \\ / O peration | Version: 2.3.1 | 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 RASProperties; 15 | } 16 | // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 17 | 18 | RASModel kEpsilon; 19 | 20 | turbulence on; 21 | 22 | printCoeffs on; 23 | 24 | 25 | // ************************************************************************* // 26 | -------------------------------------------------------------------------------- /GmshBasic3/originals/cavity/constant/turbulenceProperties: -------------------------------------------------------------------------------- 1 | /*--------------------------------*- C++ -*----------------------------------*\ 2 | | ========= | | 3 | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | 4 | | \\ / O peration | Version: 2.3.1 | 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 RASModel; 19 | 20 | 21 | // ************************************************************************* // 22 | -------------------------------------------------------------------------------- /GroundEffect/README: -------------------------------------------------------------------------------- 1 | Ground Effect Vehicle Airfoil Simulation in OpenFOAM 2 | 3 | All code can be found at: https://github.com/lordvon/OpenFOAM_Tutorials/tree/master/GroundEffect 4 | 5 | DESCRIPTION: 6 | Here we will be doing a simple 2D simulation of a ground effect vehicle airfoil. This is simply an airfoil that is some small multiple of its chord above the ground. 7 | 8 | OUTLINE: 9 | -Go over mesh. 10 | -Go over boundary conditions. 11 | -Run simulation. 12 | -View results. 13 | 14 | COMMANDS: 15 | gmsh mesh/main.geo -3 -o test.msh 16 | gmshToFoam test.msh -case case 17 | # Modify boundary file. 18 | pimpleFoam 19 | 20 | This tutorial was run successfully on: 21 | -Ubuntu 14.04 64-bit 22 | -OpenFOAM 2.3.1 23 | -Gmsh 2.9.3 -------------------------------------------------------------------------------- /GroundEffect/case/0/.svn/all-wcprops: -------------------------------------------------------------------------------- 1 | K 25 2 | svn:wc:ra_dav:version-url 3 | V 98 4 | /svnroot/openfoam-extend/!svn/ver/1160/trunk/Core/OpenFOAM-1.5-dev/tutorials/icoDyMFoam/mixerGgi/0 5 | END 6 | p 7 | K 25 8 | svn:wc:ra_dav:version-url 9 | V 100 10 | /svnroot/openfoam-extend/!svn/ver/1160/trunk/Core/OpenFOAM-1.5-dev/tutorials/icoDyMFoam/mixerGgi/0/p 11 | END 12 | U 13 | K 25 14 | svn:wc:ra_dav:version-url 15 | V 100 16 | /svnroot/openfoam-extend/!svn/ver/1160/trunk/Core/OpenFOAM-1.5-dev/tutorials/icoDyMFoam/mixerGgi/0/U 17 | END 18 | -------------------------------------------------------------------------------- /GroundEffect/case/0/.svn/entries: -------------------------------------------------------------------------------- 1 | 10 2 | 3 | dir 4 | 1824 5 | https://openfoam-extend.svn.sourceforge.net/svnroot/openfoam-extend/trunk/Core/OpenFOAM-1.5-dev/tutorials/icoDyMFoam/mixerGgi/0 6 | https://openfoam-extend.svn.sourceforge.net/svnroot/openfoam-extend 7 | 8 | 9 | 10 | 2009-04-02T10:19:15.967477Z 11 | 1160 12 | hjasak 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | e4e07f05-0c2f-0410-a05a-b8ba57e0c909 28 | 29 | p 30 | file 31 | 32 | 33 | 34 | 35 | 2010-09-12T03:25:12.586382Z 36 | dd2b863de322b1d9c35faef303f89f85 37 | 2009-04-02T10:19:15.967477Z 38 | 1160 39 | hjasak 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 1312 62 | 63 | U 64 | file 65 | 66 | 67 | 68 | 69 | 2010-09-12T03:25:12.586382Z 70 | c1b8734ca81431daedfa5badc1f03002 71 | 2009-04-02T10:19:15.967477Z 72 | 1160 73 | hjasak 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 1416 96 | 97 | -------------------------------------------------------------------------------- /GroundEffect/case/0/nuTilda: -------------------------------------------------------------------------------- 1 | /*--------------------------------*- C++ -*----------------------------------*\ 2 | | ========= | | 3 | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | 4 | | \\ / O peration | Version: 2.3.1 | 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 nuTilda; 15 | } 16 | // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 17 | 18 | dimensions [0 2 -1 0 0 0 0]; 19 | 20 | internalField uniform 0; 21 | 22 | boundaryField 23 | { 24 | frontAndBack 25 | { 26 | type empty; 27 | } 28 | domain_boundary 29 | { 30 | type freestream; 31 | freestreamValue uniform 0; 32 | } 33 | wing 34 | { 35 | type zeroGradient; 36 | } 37 | ground 38 | { 39 | type zeroGradient; 40 | } 41 | } 42 | 43 | 44 | // ************************************************************************* // 45 | -------------------------------------------------------------------------------- /GroundEffect/case/0/p: -------------------------------------------------------------------------------- 1 | /*--------------------------------*- C++ -*----------------------------------*\ 2 | | ========= | | 3 | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | 4 | | \\ / O peration | Version: 2.3.1 | 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 p; 15 | } 16 | // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 17 | 18 | dimensions [0 2 -2 0 0 0 0]; 19 | 20 | internalField uniform 0; 21 | 22 | boundaryField 23 | { 24 | frontAndBack 25 | { 26 | type empty; 27 | } 28 | domain_boundary 29 | { 30 | type zeroGradient; 31 | } 32 | wing 33 | { 34 | type zeroGradient; 35 | } 36 | ground 37 | { 38 | type zeroGradient; 39 | } 40 | } 41 | 42 | 43 | // ************************************************************************* // 44 | -------------------------------------------------------------------------------- /GroundEffect/case/constant/RASProperties: -------------------------------------------------------------------------------- 1 | /*--------------------------------*- C++ -*----------------------------------*\ 2 | | ========= | | 3 | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | 4 | | \\ / O peration | Version: 2.3.1 | 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 RASProperties; 15 | } 16 | // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 17 | 18 | RASModel kEpsilon; 19 | 20 | turbulence on; 21 | 22 | printCoeffs on; 23 | 24 | 25 | // ************************************************************************* // 26 | -------------------------------------------------------------------------------- /GroundEffect/case/constant/turbulenceProperties: -------------------------------------------------------------------------------- 1 | /*--------------------------------*- C++ -*----------------------------------*\ 2 | | ========= | | 3 | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | 4 | | \\ / O peration | Version: 2.3.1 | 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 RASModel; 19 | 20 | 21 | // ************************************************************************* // 22 | -------------------------------------------------------------------------------- /GroundEffect/case/system/controlDict: -------------------------------------------------------------------------------- 1 | /*--------------------------------*- C++ -*----------------------------------*\ 2 | | ========= | | 3 | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | 4 | | \\ / O peration | Version: 2.3.1 | 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 "system"; 14 | object controlDict; 15 | } 16 | // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 17 | 18 | applicationClass pimpleFoam; 19 | startFrom latestTime; 20 | endTime 1; 21 | stopAt endTime; 22 | deltaT 1; 23 | writeControl adjustableRunTime; 24 | writeInterval 0.01; 25 | cycleWrite 0; 26 | writeFormat ascii; 27 | writePrecision 6; 28 | writeCompression uncompressed; 29 | timeFormat general; 30 | timePrecision 6; 31 | runTimeModifiable yes; 32 | adjustTimeStep yes; 33 | maxCo 5; 34 | maxDeltaT 1; 35 | 36 | // ************************************************************************* // 37 | -------------------------------------------------------------------------------- /GroundEffect/mesh/dat2geo.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | 3 | import os 4 | 5 | dat_file_name = "NACA2412.dat" 6 | geo_file_name = "NACA2412.geo" 7 | skip_lines = 1 8 | coordinates_per_line = 5 9 | 10 | coordinates = [] 11 | with open(dat_file_name) as opened_file: 12 | skipped_lines = 0 13 | for line in opened_file: 14 | if skipped_lines < skip_lines: 15 | skipped_lines = skipped_lines + 1 16 | continue 17 | else: 18 | coordinates += [line.split()] 19 | 20 | geo_file = open(geo_file_name,'w') 21 | 22 | geo_file.write("airfoil_points = "+str(len(coordinates))+";\n") 23 | 24 | geo_file.write("airfoil_x[] = {\n") 25 | point_number = 0 26 | for point in coordinates: 27 | point_number = point_number + 1 28 | geo_file.write("\t"+point[0]) 29 | if point_number < len(coordinates): 30 | geo_file.write(",") 31 | if point_number % coordinates_per_line == 0: 32 | geo_file.write("\n") 33 | geo_file.write(" };\n") 34 | 35 | geo_file.write("airfoil_y[] = {\n") 36 | point_number = 0 37 | for point in coordinates: 38 | point_number = point_number + 1 39 | geo_file.write("\t"+point[1]) 40 | if point_number < len(coordinates): 41 | geo_file.write(",") 42 | if point_number % coordinates_per_line == 0: 43 | geo_file.write("\n") 44 | geo_file.write(" };\n") 45 | 46 | geo_file.close() -------------------------------------------------------------------------------- /HowToPlotForces/README: -------------------------------------------------------------------------------- 1 | How to Plot Forces in OpenFOAM 2 | 3 | All code can be found at: https://github.com/lordvon/OpenFOAM_Tutorials/tree/master/HowToPlotForces 4 | 5 | DESCRIPTION: 6 | Here we will go over how to generate force data, and then plot it using gnuplot. We will use a standard OpenFOAM tutorial case, airFoil2D, which can be found at $FOAM_TUTORIALS/incompressible/simpleFoam/airFoil2D. 7 | 8 | OUTLINE: 9 | -Modify the controlDict to output force data. 10 | -Run the simulation. 11 | -Walk through the python script that processes and plots the force output. 12 | 13 | COMMANDS: 14 | ./Allclean 15 | ./Allrun 16 | ./plot_forces.py 17 | 18 | This tutorial was run successfully on: 19 | -Ubuntu 14.04 64-bit 20 | -OpenFOAM 2.3.1 -------------------------------------------------------------------------------- /HowToPlotForces/airFoil2D_new.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openfoamtutorials/openfoam_tutorials/36c82d86388bdfd67aec4743cac3294d63fdb415/HowToPlotForces/airFoil2D_new.zip -------------------------------------------------------------------------------- /HowToPlotForces/airFoil2D_original.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openfoamtutorials/openfoam_tutorials/36c82d86388bdfd67aec4743cac3294d63fdb415/HowToPlotForces/airFoil2D_original.zip -------------------------------------------------------------------------------- /HowToPlotForces/gnuplot_script.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | gnuplot -persist > /dev/null 2>&1 << EOF 4 | set title "Forces vs. Time" 5 | set xlabel "Time / Iteration" 6 | set ylabel "Force (N) or Moment (N*m)" 7 | 8 | plot "forces.txt" using 1:2 title 'Lift' with linespoints,\ 9 | "forces.txt" using 1:3 title 'Drag' with linespoints,\ 10 | "forces.txt" using 1:4 title 'Moment' with linespoints 11 | EOF -------------------------------------------------------------------------------- /Hyperloop0/README: -------------------------------------------------------------------------------- 1 | Hyperloop Drag Simulation (No Compressor) in OpenFOAM 2 | 3 | All code can be found at: https://github.com/lordvon/OpenFOAM_Tutorials/tree/master/Hyperloop0 4 | 5 | DESCRIPTION: 6 | Here we will perform a simple 2D axisymmetric simulation of a transonic Hyperloop vehicle. Notice that the real Hyperloop (as described in the technical paper available on the SpaceX website) has a compressor at the front of the vehicle to power the air skis and reduce drag. This is not captured here, but could be modeled by a pressure jump actuator disk. 7 | 8 | OUTLINE: 9 | -Create wedge mesh in Gmsh. 10 | -Convert the mesh and change the boundary file. 11 | -Change the write format in system/controlDict to 'binary' to prevent errors. 12 | -Run the simulation and view post-processed results. 13 | 14 | COMMANDS: 15 | gmsh mesh/main.geo -3 -o test.msh 16 | gmshToFoam test.msh -case case 17 | # Modify boundary file 18 | rhoCentralFoam 19 | 20 | This tutorial was run successfully on: 21 | -Ubuntu 14.04 64-bit 22 | -OpenFOAM 2.3.1 23 | -Gmsh 2.9.3 -------------------------------------------------------------------------------- /Hyperloop0/case/0/.svn/all-wcprops: -------------------------------------------------------------------------------- 1 | K 25 2 | svn:wc:ra_dav:version-url 3 | V 98 4 | /svnroot/openfoam-extend/!svn/ver/1160/trunk/Core/OpenFOAM-1.5-dev/tutorials/icoDyMFoam/mixerGgi/0 5 | END 6 | p 7 | K 25 8 | svn:wc:ra_dav:version-url 9 | V 100 10 | /svnroot/openfoam-extend/!svn/ver/1160/trunk/Core/OpenFOAM-1.5-dev/tutorials/icoDyMFoam/mixerGgi/0/p 11 | END 12 | U 13 | K 25 14 | svn:wc:ra_dav:version-url 15 | V 100 16 | /svnroot/openfoam-extend/!svn/ver/1160/trunk/Core/OpenFOAM-1.5-dev/tutorials/icoDyMFoam/mixerGgi/0/U 17 | END 18 | -------------------------------------------------------------------------------- /Hyperloop0/case/0/.svn/entries: -------------------------------------------------------------------------------- 1 | 10 2 | 3 | dir 4 | 1824 5 | https://openfoam-extend.svn.sourceforge.net/svnroot/openfoam-extend/trunk/Core/OpenFOAM-1.5-dev/tutorials/icoDyMFoam/mixerGgi/0 6 | https://openfoam-extend.svn.sourceforge.net/svnroot/openfoam-extend 7 | 8 | 9 | 10 | 2009-04-02T10:19:15.967477Z 11 | 1160 12 | hjasak 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | e4e07f05-0c2f-0410-a05a-b8ba57e0c909 28 | 29 | p 30 | file 31 | 32 | 33 | 34 | 35 | 2010-09-12T03:25:12.586382Z 36 | dd2b863de322b1d9c35faef303f89f85 37 | 2009-04-02T10:19:15.967477Z 38 | 1160 39 | hjasak 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 1312 62 | 63 | U 64 | file 65 | 66 | 67 | 68 | 69 | 2010-09-12T03:25:12.586382Z 70 | c1b8734ca81431daedfa5badc1f03002 71 | 2009-04-02T10:19:15.967477Z 72 | 1160 73 | hjasak 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 1416 96 | 97 | -------------------------------------------------------------------------------- /Hyperloop0/case/constant/turbulenceProperties: -------------------------------------------------------------------------------- 1 | /*--------------------------------*- C++ -*----------------------------------*\ 2 | | ========= | | 3 | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | 4 | | \\ / O peration | Version: 2.3.1 | 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 laminar; 19 | 20 | 21 | // ************************************************************************* // 22 | -------------------------------------------------------------------------------- /Hyperloop0/case/system/controlDict: -------------------------------------------------------------------------------- 1 | /*--------------------------------*- C++ -*----------------------------------*\ 2 | | ========= | | 3 | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | 4 | | \\ / O peration | Version: 2.3.1 | 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 "system"; 14 | object controlDict; 15 | } 16 | // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 17 | 18 | applicationClass rhoCentralFoam; 19 | startFrom latestTime; 20 | endTime 0.05; 21 | stopAt endTime; 22 | deltaT 1e-7; 23 | writeControl adjustableRunTime; 24 | writeInterval 0.0001; 25 | cycleWrite 0; 26 | writeFormat binary; 27 | writePrecision 6; 28 | writeCompression uncompressed; 29 | timeFormat general; 30 | timePrecision 6; 31 | runTimeModifiable yes; 32 | adjustTimeStep yes; 33 | maxCo 1; 34 | maxDeltaT 1; 35 | 36 | // ************************************************************************* // 37 | -------------------------------------------------------------------------------- /Hyperloop0/case/system/fvSolution: -------------------------------------------------------------------------------- 1 | /*--------------------------------*- C++ -*----------------------------------*\ 2 | | ========= | | 3 | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | 4 | | \\ / O peration | Version: 2.3.1 | 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 | location "system"; 14 | object fvSolution; 15 | } 16 | // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 17 | 18 | solvers 19 | { 20 | "(rho|rhoU|rhoE)" 21 | { 22 | solver diagonal; 23 | } 24 | 25 | U 26 | { 27 | solver smoothSolver; 28 | smoother GaussSeidel; 29 | nSweeps 2; 30 | tolerance 1e-09; 31 | relTol 0.01; 32 | } 33 | 34 | h 35 | { 36 | $U; 37 | tolerance 1e-10; 38 | relTol 0; 39 | } 40 | } 41 | 42 | // ************************************************************************* // 43 | -------------------------------------------------------------------------------- /InfiniRotor/0/U: -------------------------------------------------------------------------------- 1 | /*--------------------------------*- C++ -*----------------------------------*\ 2 | | ========= | | 3 | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | 4 | | \\ / O peration | Version: 4.0 | 5 | | \\ / A nd | Web: www.OpenFOAM.org | 6 | | \\/ M anipulation | | 7 | \*---------------------------------------------------------------------------*/ 8 | FoamFile 9 | { 10 | version 2.0; 11 | format ascii; 12 | class volVectorField; 13 | object U; 14 | } 15 | // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 16 | 17 | Uinlet (0 0 -2); 18 | 19 | dimensions [0 1 -1 0 0 0 0]; 20 | 21 | internalField uniform $Uinlet; 22 | 23 | boundaryField 24 | { 25 | inlet 26 | { 27 | type fixedValue; 28 | value uniform $Uinlet; 29 | } 30 | outlet 31 | { 32 | type pressureInletOutletVelocity; 33 | value uniform $Uinlet; 34 | } 35 | #includeEtc "caseDicts/setConstraintTypes" 36 | } 37 | 38 | // ************************************************************************* // 39 | -------------------------------------------------------------------------------- /InfiniRotor/0/k: -------------------------------------------------------------------------------- 1 | /*--------------------------------*- C++ -*----------------------------------*\ 2 | | ========= | | 3 | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | 4 | | \\ / O peration | Version: 4.0 | 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 | object k; 14 | } 15 | // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 16 | 17 | kInlet 0.02; 18 | 19 | dimensions [0 2 -2 0 0 0 0]; 20 | 21 | internalField uniform $kInlet; 22 | 23 | boundaryField 24 | { 25 | inlet 26 | { 27 | type fixedValue; 28 | value uniform $kInlet; 29 | } 30 | outlet 31 | { 32 | type inletOutlet; 33 | inletValue uniform $kInlet; 34 | value uniform $kInlet; 35 | } 36 | #includeEtc "caseDicts/setConstraintTypes" 37 | } 38 | 39 | // ************************************************************************* // 40 | -------------------------------------------------------------------------------- /InfiniRotor/0/nut: -------------------------------------------------------------------------------- 1 | /*--------------------------------*- C++ -*----------------------------------*\ 2 | | ========= | | 3 | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | 4 | | \\ / O peration | Version: 4.0 | 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 | object nut; 14 | } 15 | // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 16 | 17 | dimensions [0 2 -1 0 0 0 0]; 18 | 19 | internalField uniform 0; 20 | 21 | boundaryField 22 | { 23 | inlet 24 | { 25 | type calculated; 26 | value uniform 0; 27 | } 28 | outlet 29 | { 30 | type calculated; 31 | value uniform 0; 32 | } 33 | #includeEtc "caseDicts/setConstraintTypes" 34 | } 35 | 36 | // ************************************************************************* // 37 | -------------------------------------------------------------------------------- /InfiniRotor/0/omega: -------------------------------------------------------------------------------- 1 | /*--------------------------------*- C++ -*----------------------------------*\ 2 | | ========= | | 3 | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | 4 | | \\ / O peration | Version: 4.0 | 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 | object omega; 14 | } 15 | // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 16 | 17 | omegaInlet 10.0; 18 | 19 | dimensions [0 0 -1 0 0 0 0]; 20 | 21 | internalField uniform $omegaInlet; 22 | 23 | boundaryField 24 | { 25 | inlet 26 | { 27 | type fixedValue; 28 | value uniform $omegaInlet; 29 | } 30 | outlet 31 | { 32 | type inletOutlet; 33 | inletValue uniform $omegaInlet; 34 | value uniform $omegaInlet; 35 | } 36 | #includeEtc "caseDicts/setConstraintTypes" 37 | } 38 | 39 | // ************************************************************************* // 40 | -------------------------------------------------------------------------------- /InfiniRotor/0/p: -------------------------------------------------------------------------------- 1 | /*--------------------------------*- C++ -*----------------------------------*\ 2 | | ========= | | 3 | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | 4 | | \\ / O peration | Version: 4.0 | 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 | object p; 14 | } 15 | // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 16 | 17 | dimensions [0 2 -2 0 0 0 0]; 18 | 19 | internalField uniform 0; 20 | 21 | boundaryField 22 | { 23 | inlet 24 | { 25 | type zeroGradient; 26 | } 27 | outlet 28 | { 29 | type fixedValue; 30 | value uniform 0; 31 | } 32 | #includeEtc "caseDicts/setConstraintTypes" 33 | } 34 | 35 | // ************************************************************************* // 36 | -------------------------------------------------------------------------------- /InfiniRotor/cleanAll: -------------------------------------------------------------------------------- 1 | rm mesh/*.msh log 2 | rm -r constant/polyMesh 3 | rm -r 1* 2* 3* 4* 5* 6* 7* 8* 9* 4 | rm -r proc* 5 | -------------------------------------------------------------------------------- /InfiniRotor/constant/transportProperties: -------------------------------------------------------------------------------- 1 | /*--------------------------------*- C++ -*----------------------------------*\ 2 | | ========= | | 3 | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | 4 | | \\ / O peration | Version: 4.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 | object transportProperties; 14 | } 15 | // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 16 | 17 | transportModel Newtonian; 18 | 19 | nu [0 2 -1 0 0 0 0] 1.5e-05; 20 | 21 | // ************************************************************************* // 22 | -------------------------------------------------------------------------------- /InfiniRotor/constant/turbulenceProperties: -------------------------------------------------------------------------------- 1 | /*--------------------------------*- C++ -*----------------------------------*\ 2 | | ========= | | 3 | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | 4 | | \\ / O peration | Version: 4.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 | object turbulenceProperties; 14 | } 15 | // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 16 | 17 | simulationType RAS; 18 | 19 | RAS 20 | { 21 | RASModel kOmegaSST; 22 | turbulence on; 23 | printCoeffs on; 24 | } 25 | 26 | // ************************************************************************* // 27 | -------------------------------------------------------------------------------- /InfiniRotor/results.txt: -------------------------------------------------------------------------------- 1 | Diameter-Normalized Separation, (Power (W), Thrust (N)), Iterations 2 | 1.2, (, ), 3 | 1.05, (, ), 4 | 5 | 6 | -------------------------------------------------------------------------------- /InfiniRotor/runAll: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | gmsh -3 mesh/main.geo && \ 4 | gmshToFoam mesh/main.msh && \ 5 | changeDictionary && \ 6 | simpleFoam 7 | 8 | -------------------------------------------------------------------------------- /InfiniRotor/runAllPar: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | gmsh -3 mesh/main.geo && \ 4 | gmshToFoam mesh/main.msh && \ 5 | changeDictionary && \ 6 | decomposePar && \ 7 | mpirun -np 4 simpleFoam -parallel && \ 8 | reconstructPar -latestTime 9 | 10 | -------------------------------------------------------------------------------- /InfiniRotor/system/changeDictionaryDict: -------------------------------------------------------------------------------- 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 dictionary; 13 | object changeDictionaryDict; 14 | } 15 | // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 16 | 17 | boundary 18 | { 19 | symmetry 20 | { 21 | type symmetry; 22 | physicalType symmetry; 23 | } 24 | } 25 | 26 | // ************************************************************************* // 27 | -------------------------------------------------------------------------------- /InfiniRotor/system/controlDict: -------------------------------------------------------------------------------- 1 | /*--------------------------------*- C++ -*----------------------------------*\ 2 | | ========= | | 3 | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | 4 | | \\ / O peration | Version: 4.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 | object controlDict; 14 | } 15 | // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 16 | 17 | application simpleFoam; 18 | 19 | startFrom startTime; 20 | 21 | startTime 0; 22 | 23 | stopAt endTime; 24 | 25 | endTime 2000; 26 | 27 | deltaT 1; 28 | 29 | writeControl timeStep; 30 | 31 | writeInterval 50; 32 | 33 | purgeWrite 0; 34 | 35 | writeFormat binary; 36 | 37 | writeCompression off; 38 | 39 | timeFormat general; 40 | 41 | timePrecision 6; 42 | 43 | runTimeModifiable true; 44 | 45 | // ************************************************************************* // 46 | -------------------------------------------------------------------------------- /InfiniRotor/system/decomposeParDict: -------------------------------------------------------------------------------- 1 | /*--------------------------------*- C++ -*----------------------------------*\ 2 | | ========= | | 3 | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | 4 | | \\ / O peration | Version: 3.0.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 "system"; 14 | object decomposeParDict; 15 | } 16 | // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 17 | 18 | numberOfSubdomains 4; 19 | 20 | method simple; 21 | 22 | simpleCoeffs 23 | { 24 | n (1 1 4); 25 | delta 0.001; 26 | } 27 | 28 | hierarchicalCoeffs 29 | { 30 | n (2 2 1); 31 | delta 0.001; 32 | order xyz; 33 | } 34 | 35 | 36 | // ************************************************************************* // 37 | -------------------------------------------------------------------------------- /MagnusEffect/README: -------------------------------------------------------------------------------- 1 | Magnus Effect Simulation in OpenFOAM 2 | 3 | All code can be found at: https://github.com/lordvon/OpenFOAM_Tutorials/tree/master/MagnusEffect 4 | 5 | DESCRIPTION: 6 | Here we will simulate the Magnus effect on a spinning cylinder in freestream in a 2D simulation in OpenFOAM. The mesh will be hybrid structured-unstructured and generated in Gmsh. The flowfield will be inspected. 7 | 8 | OUTLINE: 9 | -Gmsh mesh overview. 10 | -Mesh generation and conversion to OpenFOAM. 11 | -Simulation using pimpleFoam. 12 | -Inspect flow field. 13 | 14 | COMMANDS: 15 | gmsh mesh/main.geo -3 -o test.msh 16 | gmshToFoam test.msh -case case 17 | # Set freestream velocity and rotation speed. 18 | # Modify boundary file. 19 | pimpleFoam 20 | 21 | This tutorial was run successfully on: 22 | -Ubuntu 14.04 64-bit 23 | -OpenFOAM 2.3.1 24 | -Gmsh 2.9.3 -------------------------------------------------------------------------------- /MagnusEffect/case/0/.svn/all-wcprops: -------------------------------------------------------------------------------- 1 | K 25 2 | svn:wc:ra_dav:version-url 3 | V 98 4 | /svnroot/openfoam-extend/!svn/ver/1160/trunk/Core/OpenFOAM-1.5-dev/tutorials/icoDyMFoam/mixerGgi/0 5 | END 6 | p 7 | K 25 8 | svn:wc:ra_dav:version-url 9 | V 100 10 | /svnroot/openfoam-extend/!svn/ver/1160/trunk/Core/OpenFOAM-1.5-dev/tutorials/icoDyMFoam/mixerGgi/0/p 11 | END 12 | U 13 | K 25 14 | svn:wc:ra_dav:version-url 15 | V 100 16 | /svnroot/openfoam-extend/!svn/ver/1160/trunk/Core/OpenFOAM-1.5-dev/tutorials/icoDyMFoam/mixerGgi/0/U 17 | END 18 | -------------------------------------------------------------------------------- /MagnusEffect/case/0/.svn/entries: -------------------------------------------------------------------------------- 1 | 10 2 | 3 | dir 4 | 1824 5 | https://openfoam-extend.svn.sourceforge.net/svnroot/openfoam-extend/trunk/Core/OpenFOAM-1.5-dev/tutorials/icoDyMFoam/mixerGgi/0 6 | https://openfoam-extend.svn.sourceforge.net/svnroot/openfoam-extend 7 | 8 | 9 | 10 | 2009-04-02T10:19:15.967477Z 11 | 1160 12 | hjasak 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | e4e07f05-0c2f-0410-a05a-b8ba57e0c909 28 | 29 | p 30 | file 31 | 32 | 33 | 34 | 35 | 2010-09-12T03:25:12.586382Z 36 | dd2b863de322b1d9c35faef303f89f85 37 | 2009-04-02T10:19:15.967477Z 38 | 1160 39 | hjasak 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 1312 62 | 63 | U 64 | file 65 | 66 | 67 | 68 | 69 | 2010-09-12T03:25:12.586382Z 70 | c1b8734ca81431daedfa5badc1f03002 71 | 2009-04-02T10:19:15.967477Z 72 | 1160 73 | hjasak 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 1416 96 | 97 | -------------------------------------------------------------------------------- /MagnusEffect/case/0/epsilon: -------------------------------------------------------------------------------- 1 | /*--------------------------------*- C++ -*----------------------------------*\ 2 | | ========= | | 3 | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | 4 | | \\ / O peration | Version: 2.3.1 | 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 epsilon; 15 | } 16 | // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 17 | 18 | dimensions [0 2 -3 0 0 0 0]; 19 | 20 | internalField uniform 0.000765; 21 | 22 | boundaryField 23 | { 24 | frontAndBack 25 | { 26 | type empty; 27 | } 28 | domain_boundary 29 | { 30 | type freestream; 31 | freestreamValue uniform 0.000765; 32 | } 33 | cylinder 34 | { 35 | type epsilonWallFunction; 36 | value uniform 0; 37 | } 38 | } 39 | 40 | 41 | // ************************************************************************* // 42 | -------------------------------------------------------------------------------- /MagnusEffect/case/0/k: -------------------------------------------------------------------------------- 1 | /*--------------------------------*- C++ -*----------------------------------*\ 2 | | ========= | | 3 | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | 4 | | \\ / O peration | Version: 2.3.1 | 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 | 18 | dimensions [0 2 -2 0 0 0 0]; 19 | 20 | internalField uniform 0.00325; 21 | 22 | boundaryField 23 | { 24 | frontAndBack 25 | { 26 | type empty; 27 | } 28 | domain_boundary 29 | { 30 | type freestream; 31 | freestreamValue uniform 0.00325; 32 | } 33 | cylinder 34 | { 35 | type kqRWallFunction; 36 | value uniform 0; 37 | } 38 | } 39 | 40 | 41 | // ************************************************************************* // 42 | -------------------------------------------------------------------------------- /MagnusEffect/case/0/nuTilda: -------------------------------------------------------------------------------- 1 | /*--------------------------------*- C++ -*----------------------------------*\ 2 | | ========= | | 3 | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | 4 | | \\ / O peration | Version: 2.3.1 | 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 nuTilda; 15 | } 16 | // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 17 | 18 | dimensions [0 2 -1 0 0 0 0]; 19 | 20 | internalField uniform 0; 21 | 22 | boundaryField 23 | { 24 | frontAndBack 25 | { 26 | type empty; 27 | } 28 | domain_boundary 29 | { 30 | type freestream; 31 | freestreamValue uniform 0; 32 | } 33 | cylinder 34 | { 35 | type zeroGradient; 36 | } 37 | } 38 | 39 | 40 | // ************************************************************************* // 41 | -------------------------------------------------------------------------------- /MagnusEffect/case/0/nut: -------------------------------------------------------------------------------- 1 | /*--------------------------------*- C++ -*----------------------------------*\ 2 | | ========= | | 3 | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | 4 | | \\ / O peration | Version: 2.3.1 | 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 nut; 15 | } 16 | // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 17 | 18 | dimensions [0 2 -1 0 0 0 0]; 19 | 20 | internalField uniform 0; 21 | 22 | boundaryField 23 | { 24 | frontAndBack 25 | { 26 | type empty; 27 | } 28 | domain_boundary 29 | { 30 | type freestream; 31 | freestreamValue uniform 0.14; 32 | } 33 | cylinder 34 | { 35 | type nutkWallFunction; 36 | value uniform 0; 37 | } 38 | } 39 | 40 | 41 | // ************************************************************************* // 42 | -------------------------------------------------------------------------------- /MagnusEffect/case/0/p: -------------------------------------------------------------------------------- 1 | /*--------------------------------*- C++ -*----------------------------------*\ 2 | | ========= | | 3 | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | 4 | | \\ / O peration | Version: 2.3.1 | 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 p; 15 | } 16 | // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 17 | 18 | dimensions [0 2 -2 0 0 0 0]; 19 | 20 | internalField uniform 0; 21 | 22 | boundaryField 23 | { 24 | frontAndBack 25 | { 26 | type empty; 27 | } 28 | domain_boundary 29 | { 30 | type zeroGradient; 31 | } 32 | cylinder 33 | { 34 | type zeroGradient; 35 | } 36 | } 37 | 38 | 39 | // ************************************************************************* // 40 | -------------------------------------------------------------------------------- /MagnusEffect/case/constant/RASProperties: -------------------------------------------------------------------------------- 1 | /*--------------------------------*- C++ -*----------------------------------*\ 2 | | ========= | | 3 | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | 4 | | \\ / O peration | Version: 2.3.1 | 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 RASProperties; 15 | } 16 | // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 17 | 18 | RASModel kEpsilon; 19 | 20 | turbulence on; 21 | 22 | printCoeffs on; 23 | 24 | 25 | // ************************************************************************* // 26 | -------------------------------------------------------------------------------- /MagnusEffect/case/constant/RASProperties~: -------------------------------------------------------------------------------- 1 | /*--------------------------------*- C++ -*----------------------------------*\ 2 | | ========= | | 3 | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | 4 | | \\ / O peration | Version: 2.3.1 | 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 RASProperties; 15 | } 16 | // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 17 | 18 | RASModel SpalartAllmaras; 19 | 20 | turbulence on; 21 | 22 | printCoeffs on; 23 | 24 | 25 | // ************************************************************************* // 26 | -------------------------------------------------------------------------------- /MagnusEffect/case/constant/turbulenceProperties: -------------------------------------------------------------------------------- 1 | /*--------------------------------*- C++ -*----------------------------------*\ 2 | | ========= | | 3 | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | 4 | | \\ / O peration | Version: 2.3.1 | 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 RASModel; 19 | 20 | 21 | // ************************************************************************* // 22 | -------------------------------------------------------------------------------- /MagnusEffect/case/system/controlDict: -------------------------------------------------------------------------------- 1 | /*--------------------------------*- C++ -*----------------------------------*\ 2 | | ========= | | 3 | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | 4 | | \\ / O peration | Version: 2.3.1 | 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 "system"; 14 | object controlDict; 15 | } 16 | // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 17 | 18 | applicationClass pimpleFoam; 19 | startFrom latestTime; 20 | endTime 1; 21 | stopAt endTime; 22 | deltaT 1; 23 | writeControl adjustableRunTime; 24 | writeInterval 0.01; 25 | cycleWrite 0; 26 | writeFormat ascii; 27 | writePrecision 6; 28 | writeCompression uncompressed; 29 | timeFormat general; 30 | timePrecision 6; 31 | runTimeModifiable yes; 32 | adjustTimeStep yes; 33 | maxCo 2; 34 | maxDeltaT 1; 35 | 36 | // ************************************************************************* // 37 | -------------------------------------------------------------------------------- /MultiRotor/0/nut: -------------------------------------------------------------------------------- 1 | /*--------------------------------*- C++ -*----------------------------------*\ 2 | | ========= | | 3 | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | 4 | | \\ / O peration | Version: 4.0 | 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 | object nut; 14 | } 15 | // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 16 | 17 | dimensions [0 2 -1 0 0 0 0]; 18 | 19 | internalField uniform 0; 20 | 21 | boundaryField 22 | { 23 | inlet 24 | { 25 | type calculated; 26 | value uniform 0; 27 | } 28 | 29 | outlet 30 | { 31 | type calculated; 32 | value uniform 0; 33 | } 34 | "wedge.*" 35 | { 36 | type wedge; 37 | } 38 | tunnel 39 | { 40 | type slip; 41 | } 42 | 43 | #includeEtc "caseDicts/setConstraintTypes" 44 | } 45 | 46 | // ************************************************************************* // 47 | -------------------------------------------------------------------------------- /MultiRotor/cleanAll: -------------------------------------------------------------------------------- 1 | rm mesh/*.msh log 2 | rm -r constant/polyMesh 3 | rm -r 1* 2* 3* 4* 5* 6* 7* 8* 9* 4 | rm -r proc* 5 | -------------------------------------------------------------------------------- /MultiRotor/constant/transportProperties: -------------------------------------------------------------------------------- 1 | /*--------------------------------*- C++ -*----------------------------------*\ 2 | | ========= | | 3 | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | 4 | | \\ / O peration | Version: 4.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 | object transportProperties; 14 | } 15 | // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 16 | 17 | transportModel Newtonian; 18 | 19 | nu [0 2 -1 0 0 0 0] 1.5e-05; 20 | 21 | // ************************************************************************* // 22 | -------------------------------------------------------------------------------- /MultiRotor/constant/turbulenceProperties: -------------------------------------------------------------------------------- 1 | /*--------------------------------*- C++ -*----------------------------------*\ 2 | | ========= | | 3 | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | 4 | | \\ / O peration | Version: 4.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 | object turbulenceProperties; 14 | } 15 | // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 16 | 17 | simulationType RAS; 18 | 19 | RAS 20 | { 21 | RASModel kOmegaSST; 22 | turbulence on; 23 | printCoeffs on; 24 | } 25 | 26 | // ************************************************************************* // 27 | -------------------------------------------------------------------------------- /MultiRotor/results.txt: -------------------------------------------------------------------------------- 1 | Number of Rotors, Diameter-Normalized Separation, (Power (W), Thrust (N)), Iterations 2 | 4, 1.2, (338, 33.1), 1183 3 | 4, 1.05, (338, 33), 1001 4 | 5 | 6 | -------------------------------------------------------------------------------- /MultiRotor/resultsBig.txt: -------------------------------------------------------------------------------- 1 | Number of Rotors, Diameter-Normalized Separation, (Power (W), Thrust (N)), Iterations, Notes 2 | 4, 1.2, (2610, 134), 3500+, 40-10 pitch 3 | 4, 1.2, (1320, 122), 1050, 30-10 pitch 4 | 4, 1.2, (1805, 146), 1067, 30-15 pitch 5 | 6 | 7 | -------------------------------------------------------------------------------- /MultiRotor/runAll: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | gmsh -3 mesh/main.geo && \ 4 | gmshToFoam mesh/main.msh && \ 5 | changeDictionary && \ 6 | simpleFoam 7 | 8 | -------------------------------------------------------------------------------- /MultiRotor/runAllPar: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | gmsh -3 mesh/main.geo && \ 4 | gmshToFoam mesh/main.msh && \ 5 | changeDictionary && \ 6 | decomposePar && \ 7 | mpirun -np 4 simpleFoam -parallel && \ 8 | reconstructPar -latestTime 9 | 10 | -------------------------------------------------------------------------------- /MultiRotor/system/changeDictionaryDict: -------------------------------------------------------------------------------- 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 dictionary; 13 | object changeDictionaryDict; 14 | } 15 | // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 16 | 17 | boundary 18 | { 19 | "wedge.*" 20 | { 21 | type wedge; 22 | physicalType wedge; 23 | } 24 | tunnel 25 | { 26 | type slip; 27 | physicalType slip; 28 | } 29 | symmetry 30 | { 31 | type symmetry; 32 | physicalType symmetry; 33 | } 34 | } 35 | 36 | // ************************************************************************* // 37 | -------------------------------------------------------------------------------- /MultiRotor/system/controlDict: -------------------------------------------------------------------------------- 1 | /*--------------------------------*- C++ -*----------------------------------*\ 2 | | ========= | | 3 | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | 4 | | \\ / O peration | Version: 4.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 | object controlDict; 14 | } 15 | // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 16 | 17 | application simpleFoam; 18 | 19 | startFrom latestTime; 20 | 21 | startTime 0; 22 | 23 | stopAt endTime; 24 | 25 | endTime 5000; 26 | 27 | deltaT 1; 28 | 29 | writeControl timeStep; 30 | 31 | writeInterval 50; 32 | 33 | purgeWrite 0; 34 | 35 | writeFormat binary; 36 | 37 | writeCompression off; 38 | 39 | timeFormat general; 40 | 41 | timePrecision 6; 42 | 43 | runTimeModifiable true; 44 | 45 | // ************************************************************************* // 46 | -------------------------------------------------------------------------------- /MultiRotor/system/decomposeParDict: -------------------------------------------------------------------------------- 1 | /*--------------------------------*- C++ -*----------------------------------*\ 2 | | ========= | | 3 | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | 4 | | \\ / O peration | Version: 3.0.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 "system"; 14 | object decomposeParDict; 15 | } 16 | // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 17 | 18 | numberOfSubdomains 4; 19 | 20 | method simple; 21 | 22 | simpleCoeffs 23 | { 24 | n (1 1 4); 25 | delta 0.001; 26 | } 27 | 28 | hierarchicalCoeffs 29 | { 30 | n (2 2 1); 31 | delta 0.001; 32 | order xyz; 33 | } 34 | 35 | 36 | // ************************************************************************* // 37 | -------------------------------------------------------------------------------- /Parallel/README.md: -------------------------------------------------------------------------------- 1 | # MPI Parallel Simulations in OpenFOAM 2 | 3 | All code can be found at: 4 | https://github.com/rlee32/OpenFOAM_Tutorials/tree/master/Parallel 5 | 6 | ## Description 7 | In this tutorial we parallelize a tutorial case. We use the built-in 8 | OpenFOAM MPI implementation and invoke a few built-in tools to help with setup 9 | and post-processing. 10 | 11 | ## Outline 12 | -Make and convert mesh. 13 | -Go over decomposeParDict file. 14 | -Decompose domain. 15 | -Run simulation in parallel. 16 | -Reconstruct output for viewing. 17 | 18 | ## Commands 19 | gmsh mesh/mesh.geo -3 -o test.msh 20 | gmshToFoam test.msh -case case 21 | Modify boundary file: 22 | -frontAndBack as empty 23 | -wing as wall 24 | -tunnel as wall 25 | decomposePar 26 | mpirun -np 4 simpleFoam -parallel 27 | reconstructPar -latestTime 28 | 29 | ## Software 30 | This tutorial was run successfully on: 31 | -Ubuntu 14.04 64-bit 32 | -OpenFOAM 3.0.0 33 | -Gmsh 2.11 -------------------------------------------------------------------------------- /Parallel/case/0/p: -------------------------------------------------------------------------------- 1 | /*--------------------------------*- C++ -*----------------------------------*\ 2 | | ========= | | 3 | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | 4 | | \\ / O peration | Version: 3.0.0 | 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 | object p; 14 | } 15 | // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 16 | 17 | dimensions [0 2 -2 0 0 0 0]; 18 | 19 | internalField uniform 0; 20 | 21 | boundaryField 22 | { 23 | inlet 24 | { 25 | type freestreamPressure; 26 | } 27 | 28 | outlet 29 | { 30 | type freestreamPressure; 31 | } 32 | 33 | tunnel 34 | { 35 | type zeroGradient; 36 | } 37 | 38 | wing 39 | { 40 | type zeroGradient; 41 | } 42 | 43 | frontAndBack 44 | { 45 | type empty; 46 | } 47 | } 48 | 49 | // ************************************************************************* // 50 | -------------------------------------------------------------------------------- /Parallel/case/constant/transportProperties: -------------------------------------------------------------------------------- 1 | /*--------------------------------*- C++ -*----------------------------------*\ 2 | | ========= | | 3 | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | 4 | | \\ / O peration | Version: 3.0.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 | transportModel Newtonian; 19 | 20 | rho [1 -3 0 0 0 0 0] 1; 21 | 22 | nu [0 2 -1 0 0 0 0] 1e-05; 23 | 24 | // ************************************************************************* // 25 | -------------------------------------------------------------------------------- /Parallel/case/constant/turbulenceProperties: -------------------------------------------------------------------------------- 1 | /*--------------------------------*- C++ -*----------------------------------*\ 2 | | ========= | | 3 | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | 4 | | \\ / O peration | Version: 3.0.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 turbulenceProperties; 15 | } 16 | // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 17 | 18 | simulationType RAS; 19 | 20 | RAS 21 | { 22 | RASModel SpalartAllmaras; 23 | 24 | turbulence on; 25 | 26 | printCoeffs on; 27 | } 28 | 29 | // ************************************************************************* // 30 | -------------------------------------------------------------------------------- /Parallel/case/system/controlDict: -------------------------------------------------------------------------------- 1 | /*--------------------------------*- C++ -*----------------------------------*\ 2 | | ========= | | 3 | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | 4 | | \\ / O peration | Version: 3.0.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 "system"; 14 | object controlDict; 15 | } 16 | // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 17 | 18 | application simpleFoam; 19 | 20 | startFrom latestTime; 21 | 22 | startTime 0; 23 | 24 | stopAt endTime; 25 | 26 | endTime 500; 27 | 28 | deltaT 1; 29 | 30 | writeControl timeStep; 31 | 32 | writeInterval 50; 33 | 34 | purgeWrite 0; 35 | 36 | writeFormat ascii; 37 | 38 | writePrecision 6; 39 | 40 | writeCompression off; 41 | 42 | timeFormat general; 43 | 44 | timePrecision 6; 45 | 46 | runTimeModifiable true; 47 | 48 | 49 | // ************************************************************************* // 50 | -------------------------------------------------------------------------------- /Parallel/case/system/decomposeParDict: -------------------------------------------------------------------------------- 1 | /*--------------------------------*- C++ -*----------------------------------*\ 2 | | ========= | | 3 | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | 4 | | \\ / O peration | Version: 3.0.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 "system"; 14 | object decomposeParDict; 15 | } 16 | // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 17 | 18 | numberOfSubdomains 4; 19 | 20 | method simple; 21 | 22 | simpleCoeffs 23 | { 24 | n (2 2 1); 25 | delta 0.001; 26 | } 27 | 28 | hierarchicalCoeffs 29 | { 30 | n (2 2 1); 31 | delta 0.001; 32 | order xyz; 33 | } 34 | 35 | 36 | // ************************************************************************* // 37 | -------------------------------------------------------------------------------- /Parallel/mesh/README.md: -------------------------------------------------------------------------------- 1 | This folder contains a sub-utility that converts raw airfoil point data 2 | that you might find online into a Gmsh-palatable form. 3 | 4 | dat2geo.py: converts your raw airfoil point data into a geo file to be included 5 | in the main.geo script. You have to change the variable in main.geo to point 6 | to the desired airfoil geo file. 7 | 8 | main.geo: generates the geometry from your specified airfoil geo file. 9 | -------------------------------------------------------------------------------- /Parallel/mesh/dat2geo.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | 3 | import os 4 | 5 | dat_file_name = "NACA2412.dat" 6 | geo_file_name = "NACA2412.geo" 7 | skip_lines = 1 8 | coordinates_per_line = 5 9 | 10 | coordinates = [] 11 | with open(dat_file_name) as opened_file: 12 | skipped_lines = 0 13 | for line in opened_file: 14 | if skipped_lines < skip_lines: 15 | skipped_lines = skipped_lines + 1 16 | continue 17 | else: 18 | coordinates += [line.split()] 19 | 20 | geo_file = open(geo_file_name,'w') 21 | 22 | geo_file.write("airfoil_points = "+str(len(coordinates))+";\n") 23 | 24 | geo_file.write("airfoil_x[] = {\n") 25 | point_number = 0 26 | for point in coordinates: 27 | point_number = point_number + 1 28 | geo_file.write("\t"+point[0]) 29 | if point_number < len(coordinates): 30 | geo_file.write(",") 31 | if point_number % coordinates_per_line == 0: 32 | geo_file.write("\n") 33 | geo_file.write(" };\n") 34 | 35 | geo_file.write("airfoil_y[] = {\n") 36 | point_number = 0 37 | for point in coordinates: 38 | point_number = point_number + 1 39 | geo_file.write("\t"+point[1]) 40 | if point_number < len(coordinates): 41 | geo_file.write(",") 42 | if point_number % coordinates_per_line == 0: 43 | geo_file.write("\n") 44 | geo_file.write(" };\n") 45 | 46 | geo_file.close() -------------------------------------------------------------------------------- /RotorGridConvergence/cleanAll: -------------------------------------------------------------------------------- 1 | rm mesh/*.msh log 2 | rm -r constant/polyMesh 3 | rm -r 1* 2* 3* 4* 5* 6* 7* 8* 9* 4 | rm -r proc* 5 | -------------------------------------------------------------------------------- /RotorGridConvergence/constant/transportProperties: -------------------------------------------------------------------------------- 1 | /*--------------------------------*- C++ -*----------------------------------*\ 2 | | ========= | | 3 | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | 4 | | \\ / O peration | Version: 4.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 | object transportProperties; 14 | } 15 | // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 16 | 17 | transportModel Newtonian; 18 | 19 | nu [0 2 -1 0 0 0 0] 1.5e-05; 20 | 21 | // ************************************************************************* // 22 | -------------------------------------------------------------------------------- /RotorGridConvergence/constant/turbulenceProperties: -------------------------------------------------------------------------------- 1 | /*--------------------------------*- C++ -*----------------------------------*\ 2 | | ========= | | 3 | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | 4 | | \\ / O peration | Version: 4.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 | object turbulenceProperties; 14 | } 15 | // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 16 | 17 | simulationType RAS; 18 | 19 | RAS 20 | { 21 | RASModel kOmegaSST; 22 | turbulence on; 23 | printCoeffs on; 24 | } 25 | 26 | // ************************************************************************* // 27 | -------------------------------------------------------------------------------- /RotorGridConvergence/results.txt: -------------------------------------------------------------------------------- 1 | # 5 Deg. Wedge (Power (W), Thrust (N), Iterations), Rotor Radius Normalized (Tip LC, Aura LC, Aura Distance, Far LC, Far Distance) 2 | (5.06, 0.460, 316), (0.04, 0.16, 0.5, 1.0, 10, 1e-4) 3 | (4.97, 0.468, 1221), (0.02, 0.16, 0.5, 1.0, 10, 1e-4) 4 | (4.99, 0.469, 1277), (0.02, 0.08, 0.5, 1.0, 10, 1e-4) 5 | (4.99, 0.470, 1309), (0.02, 0.16, 1.0, 1.0, 10, 1e-4) 6 | (4.97, 0.468, 2000+), (0.02, 0.16, 0.5, 0.5, 10, 1e-4) 7 | (4.95, 0.461, 1223), (0.02, 0.16, 0.5, 1.0, 20, 1e-4) 8 | (4.97, 0.468, 1362), (0.02, 0.08, 1.0, 1.0, 20, 1e-4) 9 | (5.13, 0.453, 345), (0.01, 0.16, 0.5, 1.0, 20, 1e-4) 10 | (5.11, 0.461, 479), (0.01, 0.04, 0.5, 1.0, 20, 1e-4) 11 | (4.97, 0.477, 2000+), (0.01, 0.16, 0.5, 1.0, 20, 1e-5) 12 | (5.06, 0.48, 309), (0.005, 0.16, 0.5, 1.0, 20, 1e-4) 13 | 14 | 15 | -------------------------------------------------------------------------------- /RotorGridConvergence/resultsBig.txt: -------------------------------------------------------------------------------- 1 | # 5 Deg. Wedge (Power (W), Thrust (N), Iterations), Rotor Radius Normalized (Tip LC, Aura LC, Aura Distance, Far LC, Far Distance) 2 | (38.2, 1.83, 806), (0.04, 0.16, 0.5, 1.0, 10, 1e-4) 3 | 4 | 5 | -------------------------------------------------------------------------------- /RotorGridConvergence/runAll: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # ./cleanAll && \ 4 | gmsh -3 mesh/main.geo && \ 5 | gmshToFoam mesh/main.msh && \ 6 | changeDictionary && \ 7 | simpleFoam 8 | #decomposePar 9 | #mpirun -np 4 simpleFoam -parallel && \ 10 | #reconstructPar -latestTime 11 | 12 | -------------------------------------------------------------------------------- /RotorGridConvergence/runAllPar: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | gmsh -3 mesh/main.geo && \ 4 | gmshToFoam mesh/main.msh && \ 5 | changeDictionary && \ 6 | decomposePar && \ 7 | mpirun -np 3 simpleFoam -parallel && \ 8 | reconstructPar -latestTime 9 | 10 | -------------------------------------------------------------------------------- /RotorGridConvergence/system/changeDictionaryDict: -------------------------------------------------------------------------------- 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 dictionary; 13 | object changeDictionaryDict; 14 | } 15 | // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 16 | 17 | boundary 18 | { 19 | "wedge.*" 20 | { 21 | type wedge; 22 | physicalType wedge; 23 | } 24 | tunnel 25 | { 26 | type slip; 27 | physicalType slip; 28 | } 29 | } 30 | 31 | // ************************************************************************* // 32 | -------------------------------------------------------------------------------- /RotorGridConvergence/system/controlDict: -------------------------------------------------------------------------------- 1 | /*--------------------------------*- C++ -*----------------------------------*\ 2 | | ========= | | 3 | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | 4 | | \\ / O peration | Version: 4.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 | object controlDict; 14 | } 15 | // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 16 | 17 | application simpleFoam; 18 | 19 | startFrom startTime; 20 | 21 | startTime 0; 22 | 23 | stopAt endTime; 24 | 25 | endTime 2000; 26 | 27 | deltaT 1; 28 | 29 | writeControl timeStep; 30 | 31 | writeInterval 50; 32 | 33 | purgeWrite 0; 34 | 35 | writeFormat binary; 36 | 37 | writeCompression off; 38 | 39 | timeFormat general; 40 | 41 | timePrecision 6; 42 | 43 | runTimeModifiable true; 44 | 45 | // ************************************************************************* // 46 | -------------------------------------------------------------------------------- /RotorGridConvergence/system/decomposeParDict: -------------------------------------------------------------------------------- 1 | /*--------------------------------*- C++ -*----------------------------------*\ 2 | | ========= | | 3 | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | 4 | | \\ / O peration | Version: 3.0.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 "system"; 14 | object decomposeParDict; 15 | } 16 | // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 17 | 18 | numberOfSubdomains 3; 19 | 20 | method simple; 21 | 22 | simpleCoeffs 23 | { 24 | n (1 3 1); 25 | delta 0.001; 26 | } 27 | 28 | hierarchicalCoeffs 29 | { 30 | n (2 2 1); 31 | delta 0.001; 32 | order xyz; 33 | } 34 | 35 | 36 | // ************************************************************************* // 37 | -------------------------------------------------------------------------------- /SpaceCapsule/README.md: -------------------------------------------------------------------------------- 1 | # Space Capsule Atmospheric Entry Simulation in OpenFOAM 2 | 3 | All code can be found at: 4 | https://github.com/rlee32/openfoam_tutorials/tree/master/SpaceCapsule 5 | 6 | ## Description 7 | Here we simulate supersonic reentry of a generically-shaped space capsule. 8 | We will use an axisymmetric configuration. Some specifics of the sonicFoam 9 | solver will be discussed and bow shocks in the solution will be observed. 10 | 11 | ## Outline 12 | -Create mesh in Gmsh. 13 | -Convert the mesh and change the boundary file. 14 | -Run the simulation and view post-processed results. 15 | 16 | ## Commands 17 | gmsh mesh.geo -3 -o test.msh 18 | gmshToFoam test.msh -case case 19 | (Modify boundary file) 20 | -vehicle as wall 21 | -wedge0 and wedge1 as wedge 22 | -tunnel as slip 23 | sonicFoam 24 | 25 | ## Software 26 | -Ubuntu 14.04 64-bit 27 | -OpenFOAM 3.0.0 28 | -Gmsh 2.11 -------------------------------------------------------------------------------- /SpaceCapsule/case/0/inputs: -------------------------------------------------------------------------------- 1 | /*--------------------------------*- C++ -*----------------------------------*\ 2 | | ========= | | 3 | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | 4 | | \\ / O peration | Version: 3.0.0 | 5 | | \\ / A nd | Web: www.OpenFOAM.org | 6 | | \\/ M anipulation | | 7 | \*---------------------------------------------------------------------------*/ 8 | FoamFile 9 | { 10 | version 2.0; 11 | format ascii; 12 | class volVectorField; 13 | object U; 14 | } 15 | // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 16 | speed (825 0 0); // m/s 17 | temperature 270; // Kelvin 18 | pressure 76; // Pascals 19 | turbulentKE 1000; // k 20 | turbulentEpsilon 25000; // epsilon 21 | 22 | // ************************************************************************* // 23 | -------------------------------------------------------------------------------- /SpaceCapsule/case/constant/turbulenceProperties: -------------------------------------------------------------------------------- 1 | /*--------------------------------*- C++ -*----------------------------------*\ 2 | | ========= | | 3 | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | 4 | | \\ / O peration | Version: 3.0.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 turbulenceProperties; 15 | } 16 | // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 17 | 18 | simulationType RAS; 19 | 20 | RAS 21 | { 22 | // RASModel LaunderSharmaKE; 23 | RASModel kEpsilon; 24 | 25 | turbulence on; 26 | 27 | printCoeffs on; 28 | } 29 | 30 | 31 | // ************************************************************************* // 32 | -------------------------------------------------------------------------------- /TimeProfiling/README: -------------------------------------------------------------------------------- 1 | Compiling Your Own Custom OpenFOAM Solver: Time Profiling 2 | 3 | All code can be found at: https://github.com/lordvon/OpenFOAM_Tutorials/tree/master/TimeProfiling 4 | 5 | DESCRIPTION: 6 | In this tutorial we profile the run time of an OpenFOAM solver by determining the run times of the different subcomponents. Specifically, we modify the pimpleDyMFoam solver (any solver can be modified in the same way as demonstrated here) and profile the standard 'propeller' tutorial case. 7 | 8 | OUTLINE: 9 | -Overview of the pimpleDyMFoam solver code. 10 | -Description of the time-keeping method and modifications to the original solver. 11 | -Compilation of the modified, time-profiling solver. 12 | -View the results of running the new solver. 13 | 14 | This tutorial was run successfully on: 15 | -Ubuntu 14.04 64-bit 16 | -OpenFOAM 2.3.1 17 | -------------------------------------------------------------------------------- /TimeProfiling/new/UEqn.H: -------------------------------------------------------------------------------- 1 | // Solve the Momentum equation 2 | 3 | tmp UEqn 4 | ( 5 | fvm::ddt(U) 6 | + fvm::div(phi, U) 7 | + turbulence->divDevReff(U) 8 | == 9 | fvOptions(U) 10 | ); 11 | 12 | UEqn().relax(); 13 | 14 | fvOptions.constrain(UEqn()); 15 | 16 | volScalarField rAU(1.0/UEqn().A()); 17 | 18 | if (pimple.momentumPredictor()) 19 | { 20 | solve(UEqn() == -fvc::grad(p)); 21 | 22 | fvOptions.correct(U); 23 | } 24 | -------------------------------------------------------------------------------- /TimeProfiling/new/createFields.H: -------------------------------------------------------------------------------- 1 | Info<< "Reading field p\n" << endl; 2 | volScalarField p 3 | ( 4 | IOobject 5 | ( 6 | "p", 7 | runTime.timeName(), 8 | mesh, 9 | IOobject::MUST_READ, 10 | IOobject::AUTO_WRITE 11 | ), 12 | mesh 13 | ); 14 | 15 | Info<< "Reading field U\n" << endl; 16 | volVectorField U 17 | ( 18 | IOobject 19 | ( 20 | "U", 21 | runTime.timeName(), 22 | mesh, 23 | IOobject::MUST_READ, 24 | IOobject::AUTO_WRITE 25 | ), 26 | mesh 27 | ); 28 | 29 | #include "createPhi.H" 30 | 31 | 32 | label pRefCell = 0; 33 | scalar pRefValue = 0.0; 34 | setRefCell(p, mesh.solutionDict().subDict("PIMPLE"), pRefCell, pRefValue); 35 | 36 | 37 | singlePhaseTransportModel laminarTransport(U, phi); 38 | 39 | autoPtr turbulence 40 | ( 41 | incompressible::turbulenceModel::New(U, phi, laminarTransport) 42 | ); 43 | -------------------------------------------------------------------------------- /TimeProfiling/new/pimpleDyMFoamTimed/Make/files: -------------------------------------------------------------------------------- 1 | pimpleDyMFoamTimed.C 2 | 3 | EXE = $(FOAM_APPBIN)/pimpleDyMFoamTimed 4 | -------------------------------------------------------------------------------- /TimeProfiling/new/pimpleDyMFoamTimed/Make/options: -------------------------------------------------------------------------------- 1 | EXE_INC = \ 2 | -I.. \ 3 | -I$(LIB_SRC)/turbulenceModels/incompressible/turbulenceModel \ 4 | -I$(LIB_SRC)/transportModels \ 5 | -I$(LIB_SRC)/transportModels/incompressible/singlePhaseTransportModel \ 6 | -I$(LIB_SRC)/finiteVolume/lnInclude \ 7 | -I$(LIB_SRC)/fvOptions/lnInclude \ 8 | -I$(LIB_SRC)/sampling/lnInclude \ 9 | -I$(LIB_SRC)/dynamicFvMesh/lnInclude \ 10 | -I$(LIB_SRC)/dynamicMesh/lnInclude \ 11 | -I$(LIB_SRC)/meshTools/lnInclude \ 12 | 13 | EXE_LIBS = \ 14 | -lincompressibleTransportModels \ 15 | -lincompressibleTurbulenceModel \ 16 | -lincompressibleRASModels \ 17 | -lincompressibleLESModels \ 18 | -lfiniteVolume \ 19 | -lfvOptions \ 20 | -lsampling \ 21 | -ldynamicFvMesh \ 22 | -ltopoChangerFvMesh \ 23 | -ldynamicMesh \ 24 | -lmeshTools 25 | -------------------------------------------------------------------------------- /TimeProfiling/new/pimpleDyMFoamTimed/StopWatch.H: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | class StopWatch 6 | { 7 | private: 8 | std::clock_t startTime; 9 | double totalTime; 10 | public: 11 | StopWatch() 12 | { 13 | totalTime = 0; 14 | } 15 | void start() 16 | { 17 | startTime = std::clock(); 18 | } 19 | void stop() 20 | { 21 | totalTime += ( std::clock() - startTime ) / (double) CLOCKS_PER_SEC; 22 | } 23 | double getTotalTime() 24 | { 25 | return totalTime; 26 | } 27 | }; 28 | -------------------------------------------------------------------------------- /TimeProfiling/new/pimpleDyMFoamTimed/pEqn.H: -------------------------------------------------------------------------------- 1 | surfaceScalarField rAUf("rAUf", fvc::interpolate(rAU)); 2 | 3 | volVectorField HbyA("HbyA", U); 4 | HbyA = rAU*UEqn().H(); 5 | 6 | if (pimple.nCorrPISO() <= 1) 7 | { 8 | UEqn.clear(); 9 | } 10 | 11 | surfaceScalarField phiHbyA 12 | ( 13 | "phiHbyA", 14 | (fvc::interpolate(HbyA) & mesh.Sf()) 15 | + rAUf*fvc::ddtCorr(U, Uf) 16 | ); 17 | 18 | if (p.needReference()) 19 | { 20 | fvc::makeRelative(phiHbyA, U); 21 | adjustPhi(phiHbyA, U, p); 22 | fvc::makeAbsolute(phiHbyA, U); 23 | } 24 | 25 | while (pimple.correctNonOrthogonal()) 26 | { 27 | fvScalarMatrix pEqn 28 | ( 29 | fvm::laplacian(rAUf, p) == fvc::div(phiHbyA) 30 | ); 31 | 32 | pEqn.setReference(pRefCell, pRefValue); 33 | 34 | pEqn.solve(mesh.solver(p.select(pimple.finalInnerIter()))); 35 | 36 | if (pimple.finalNonOrthogonalIter()) 37 | { 38 | phi = phiHbyA - pEqn.flux(); 39 | } 40 | } 41 | 42 | #include "continuityErrs.H" 43 | 44 | // Explicitly relax pressure for momentum corrector 45 | p.relax(); 46 | 47 | U = HbyA - rAU*fvc::grad(p); 48 | U.correctBoundaryConditions(); 49 | fvOptions.correct(U); 50 | 51 | { 52 | Uf = fvc::interpolate(U); 53 | surfaceVectorField n(mesh.Sf()/mesh.magSf()); 54 | Uf += n*(phi/mesh.magSf() - (n & Uf)); 55 | } 56 | 57 | // Make the fluxes relative to the mesh motion 58 | fvc::makeRelative(phi, U); 59 | -------------------------------------------------------------------------------- /TimeProfiling/new/pimpleDyMFoamTimed/readControls.H: -------------------------------------------------------------------------------- 1 | #include "readTimeControls.H" 2 | 3 | const bool correctPhi = 4 | pimple.dict().lookupOrDefault("correctPhi", false); 5 | 6 | const bool checkMeshCourantNo = 7 | pimple.dict().lookupOrDefault("checkMeshCourantNo", false); 8 | -------------------------------------------------------------------------------- /TimeProfiling/original/UEqn.H: -------------------------------------------------------------------------------- 1 | // Solve the Momentum equation 2 | 3 | tmp UEqn 4 | ( 5 | fvm::ddt(U) 6 | + fvm::div(phi, U) 7 | + turbulence->divDevReff(U) 8 | == 9 | fvOptions(U) 10 | ); 11 | 12 | UEqn().relax(); 13 | 14 | fvOptions.constrain(UEqn()); 15 | 16 | volScalarField rAU(1.0/UEqn().A()); 17 | 18 | if (pimple.momentumPredictor()) 19 | { 20 | solve(UEqn() == -fvc::grad(p)); 21 | 22 | fvOptions.correct(U); 23 | } 24 | -------------------------------------------------------------------------------- /TimeProfiling/original/createFields.H: -------------------------------------------------------------------------------- 1 | Info<< "Reading field p\n" << endl; 2 | volScalarField p 3 | ( 4 | IOobject 5 | ( 6 | "p", 7 | runTime.timeName(), 8 | mesh, 9 | IOobject::MUST_READ, 10 | IOobject::AUTO_WRITE 11 | ), 12 | mesh 13 | ); 14 | 15 | Info<< "Reading field U\n" << endl; 16 | volVectorField U 17 | ( 18 | IOobject 19 | ( 20 | "U", 21 | runTime.timeName(), 22 | mesh, 23 | IOobject::MUST_READ, 24 | IOobject::AUTO_WRITE 25 | ), 26 | mesh 27 | ); 28 | 29 | #include "createPhi.H" 30 | 31 | 32 | label pRefCell = 0; 33 | scalar pRefValue = 0.0; 34 | setRefCell(p, mesh.solutionDict().subDict("PIMPLE"), pRefCell, pRefValue); 35 | 36 | 37 | singlePhaseTransportModel laminarTransport(U, phi); 38 | 39 | autoPtr turbulence 40 | ( 41 | incompressible::turbulenceModel::New(U, phi, laminarTransport) 42 | ); 43 | -------------------------------------------------------------------------------- /TimeProfiling/original/pimpleDyMFoam/Make/files: -------------------------------------------------------------------------------- 1 | pimpleDyMFoam.C 2 | 3 | EXE = $(FOAM_APPBIN)/pimpleDyMFoam 4 | -------------------------------------------------------------------------------- /TimeProfiling/original/pimpleDyMFoam/Make/options: -------------------------------------------------------------------------------- 1 | EXE_INC = \ 2 | -I.. \ 3 | -I$(LIB_SRC)/turbulenceModels/incompressible/turbulenceModel \ 4 | -I$(LIB_SRC)/transportModels \ 5 | -I$(LIB_SRC)/transportModels/incompressible/singlePhaseTransportModel \ 6 | -I$(LIB_SRC)/finiteVolume/lnInclude \ 7 | -I$(LIB_SRC)/fvOptions/lnInclude \ 8 | -I$(LIB_SRC)/sampling/lnInclude \ 9 | -I$(LIB_SRC)/dynamicFvMesh/lnInclude \ 10 | -I$(LIB_SRC)/dynamicMesh/lnInclude \ 11 | -I$(LIB_SRC)/meshTools/lnInclude \ 12 | 13 | EXE_LIBS = \ 14 | -lincompressibleTransportModels \ 15 | -lincompressibleTurbulenceModel \ 16 | -lincompressibleRASModels \ 17 | -lincompressibleLESModels \ 18 | -lfiniteVolume \ 19 | -lfvOptions \ 20 | -lsampling \ 21 | -ldynamicFvMesh \ 22 | -ltopoChangerFvMesh \ 23 | -ldynamicMesh \ 24 | -lmeshTools 25 | -------------------------------------------------------------------------------- /TimeProfiling/original/pimpleDyMFoam/pEqn.H: -------------------------------------------------------------------------------- 1 | surfaceScalarField rAUf("rAUf", fvc::interpolate(rAU)); 2 | 3 | volVectorField HbyA("HbyA", U); 4 | HbyA = rAU*UEqn().H(); 5 | 6 | if (pimple.nCorrPISO() <= 1) 7 | { 8 | UEqn.clear(); 9 | } 10 | 11 | surfaceScalarField phiHbyA 12 | ( 13 | "phiHbyA", 14 | (fvc::interpolate(HbyA) & mesh.Sf()) 15 | + rAUf*fvc::ddtCorr(U, Uf) 16 | ); 17 | 18 | if (p.needReference()) 19 | { 20 | fvc::makeRelative(phiHbyA, U); 21 | adjustPhi(phiHbyA, U, p); 22 | fvc::makeAbsolute(phiHbyA, U); 23 | } 24 | 25 | while (pimple.correctNonOrthogonal()) 26 | { 27 | fvScalarMatrix pEqn 28 | ( 29 | fvm::laplacian(rAUf, p) == fvc::div(phiHbyA) 30 | ); 31 | 32 | pEqn.setReference(pRefCell, pRefValue); 33 | 34 | pEqn.solve(mesh.solver(p.select(pimple.finalInnerIter()))); 35 | 36 | if (pimple.finalNonOrthogonalIter()) 37 | { 38 | phi = phiHbyA - pEqn.flux(); 39 | } 40 | } 41 | 42 | #include "continuityErrs.H" 43 | 44 | // Explicitly relax pressure for momentum corrector 45 | p.relax(); 46 | 47 | U = HbyA - rAU*fvc::grad(p); 48 | U.correctBoundaryConditions(); 49 | fvOptions.correct(U); 50 | 51 | { 52 | Uf = fvc::interpolate(U); 53 | surfaceVectorField n(mesh.Sf()/mesh.magSf()); 54 | Uf += n*(phi/mesh.magSf() - (n & Uf)); 55 | } 56 | 57 | // Make the fluxes relative to the mesh motion 58 | fvc::makeRelative(phi, U); 59 | -------------------------------------------------------------------------------- /TimeProfiling/original/pimpleDyMFoam/readControls.H: -------------------------------------------------------------------------------- 1 | #include "readTimeControls.H" 2 | 3 | const bool correctPhi = 4 | pimple.dict().lookupOrDefault("correctPhi", false); 5 | 6 | const bool checkMeshCourantNo = 7 | pimple.dict().lookupOrDefault("checkMeshCourantNo", false); 8 | -------------------------------------------------------------------------------- /TimeProfiling/propeller/Allclean: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | cd ${0%/*} || exit 1 # run from this directory 3 | 4 | # Source tutorial clean functions 5 | . $WM_PROJECT_DIR/bin/tools/CleanFunctions 6 | 7 | # remove surface 8 | \rm -f constant/triSurface/propellerTip.obj.gz > /dev/null 2>&1 9 | 10 | cleanCase 11 | 12 | \rm -rf 0 > /dev/null 2>&1 13 | \rm -rf constant/extendedFeatureEdgeMesh > /dev/null 2>&1 14 | \rm -f constant/triSurface/*.eMesh* > /dev/null 2>&1 15 | -------------------------------------------------------------------------------- /TimeProfiling/propeller/Allrun: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | cd ${0%/*} || exit 1 # run from this directory 3 | 4 | # Source tutorial run functions 5 | . $WM_PROJECT_DIR/bin/tools/RunFunctions 6 | 7 | ./Allrun.pre 8 | 9 | runApplication decomposePar 10 | 11 | runParallel `getApplication` 4 12 | 13 | runApplication reconstructPar 14 | -------------------------------------------------------------------------------- /TimeProfiling/propeller/Allrun.pre: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | cd ${0%/*} || exit 1 # run from this directory 3 | 4 | # Source tutorial run functions 5 | . $WM_PROJECT_DIR/bin/tools/RunFunctions 6 | 7 | # copy propeller surface from resources directory 8 | cp $FOAM_TUTORIALS/resources/geometry/propellerTip.obj.gz constant/triSurface/ 9 | 10 | 11 | # - meshing 12 | 13 | runApplication blockMesh 14 | 15 | runApplication surfaceFeatureExtract 16 | 17 | runApplication snappyHexMesh -overwrite 18 | 19 | runApplication renumberMesh -overwrite 20 | 21 | # force removal of fields generated by snappy 22 | \rm -rf 0 23 | 24 | # - generate face/cell sets and zones 25 | runApplication topoSet -dict system/createInletOutletSets.topoSetDict 26 | 27 | # - create the inlet/outlet and AMI patches 28 | runApplication createPatch -overwrite 29 | 30 | # - test by running moveDynamicMes 31 | #runApplication moveDynamicMesh -checkAMI 32 | 33 | # - set the initial fields 34 | cp -rf 0.org 0 35 | -------------------------------------------------------------------------------- /TimeProfiling/propeller/constant/RASProperties: -------------------------------------------------------------------------------- 1 | /*--------------------------------*- C++ -*----------------------------------*\ 2 | | ========= | | 3 | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | 4 | | \\ / O peration | Version: 2.3.1 | 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 RASProperties; 15 | } 16 | // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 17 | 18 | RASModel kEpsilon; 19 | 20 | turbulence on; 21 | 22 | printCoeffs on; 23 | 24 | 25 | // ************************************************************************* // 26 | -------------------------------------------------------------------------------- /TimeProfiling/propeller/constant/dynamicMeshDict: -------------------------------------------------------------------------------- 1 | /*--------------------------------*- C++ -*----------------------------------*\ 2 | | ========= | | 3 | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | 4 | | \\ / O peration | Version: 2.3.1 | 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 dynamicMeshDict; 15 | } 16 | // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 17 | 18 | dynamicFvMesh solidBodyMotionFvMesh; 19 | 20 | motionSolverLibs ( "libfvMotionSolvers.so" ); 21 | 22 | solidBodyMotionFvMeshCoeffs 23 | { 24 | cellZone innerCylinderSmall; 25 | 26 | solidBodyMotionFunction rotatingMotion; 27 | rotatingMotionCoeffs 28 | { 29 | origin (0 0 0); 30 | axis (0 1 0); 31 | omega 158; // rad/s 32 | } 33 | } 34 | 35 | 36 | // ************************************************************************* // 37 | -------------------------------------------------------------------------------- /TimeProfiling/propeller/constant/transportProperties: -------------------------------------------------------------------------------- 1 | /*--------------------------------*- C++ -*----------------------------------*\ 2 | | ========= | | 3 | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | 4 | | \\ / O peration | Version: 2.3.1 | 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 | transportModel Newtonian; 19 | 20 | nu nu [ 0 2 -1 0 0 0 0 ] 1e-6; 21 | 22 | // ************************************************************************* // 23 | -------------------------------------------------------------------------------- /TimeProfiling/propeller/constant/turbulenceProperties: -------------------------------------------------------------------------------- 1 | /*--------------------------------*- C++ -*----------------------------------*\ 2 | | ========= | | 3 | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | 4 | | \\ / O peration | Version: 2.3.1 | 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 RASModel; 19 | 20 | 21 | // ************************************************************************* // 22 | -------------------------------------------------------------------------------- /TimeProfiling/propeller/system/Q: -------------------------------------------------------------------------------- 1 | /*--------------------------------*- C++ -*----------------------------------*\ 2 | | ========= | | 3 | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | 4 | | \\ / O peration | Version: 2.3.1 | 5 | | \\ / A nd | Web: www.OpenFOAM.org | 6 | | \\/ M anipulation | | 7 | \*---------------------------------------------------------------------------*/ 8 | 9 | // Calculate Q (from U) 10 | Q 11 | { 12 | // Where to load it from 13 | functionObjectLibs ("libutilityFunctionObjects.so"); 14 | 15 | type Q; 16 | 17 | // Output every 18 | outputControl outputTime; 19 | } 20 | 21 | 22 | // ************************************************************************* // 23 | -------------------------------------------------------------------------------- /TimeProfiling/propeller/system/decomposeParDict: -------------------------------------------------------------------------------- 1 | /*--------------------------------*- C++ -*----------------------------------*\ 2 | | ========= | | 3 | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | 4 | | \\ / O peration | Version: 2.3.1 | 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 4; 19 | 20 | method hierarchical; 21 | 22 | hierarchicalCoeffs 23 | { 24 | n (1 4 1); 25 | delta 0.001; 26 | order xyz; 27 | } 28 | 29 | 30 | // ************************************************************************* // 31 | -------------------------------------------------------------------------------- /TimeProfiling/propeller/system/forces: -------------------------------------------------------------------------------- 1 | /*--------------------------------*- C++ -*----------------------------------*\ 2 | | ========= | | 3 | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | 4 | | \\ / O peration | Version: 2.3.1 | 5 | | \\ / A nd | Web: www.OpenFOAM.org | 6 | | \\/ M anipulation | | 7 | \*---------------------------------------------------------------------------*/ 8 | 9 | forces 10 | { 11 | type forces; 12 | 13 | functionObjectLibs ( "libforces.so" ); 14 | 15 | outputControl timeStep; 16 | timeInterval 1; 17 | 18 | log yes; 19 | 20 | patches ( "propeller.*" ); 21 | pName p; 22 | UName U; 23 | rhoName rhoInf; // Indicates incompressible 24 | log true; 25 | rhoInf 1; // Redundant for incompressible 26 | 27 | CofR (0 0 0); // Rotation around centre line of propeller 28 | pitchAxis (0 1 0); 29 | } 30 | 31 | 32 | // ************************************************************************* // 33 | -------------------------------------------------------------------------------- /TimeProfiling/propeller/system/readFields: -------------------------------------------------------------------------------- 1 | /*--------------------------------*- C++ -*----------------------------------*\ 2 | | ========= | | 3 | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | 4 | | \\ / O peration | Version: 2.3.1 | 5 | | \\ / A nd | Web: www.OpenFOAM.org | 6 | | \\/ M anipulation | | 7 | \*---------------------------------------------------------------------------*/ 8 | 9 | // Make sure all fields for functionObjects are loaded. Prevents any 10 | // problems running with execFlowFunctionObjects. 11 | readFields 12 | { 13 | // Where to load it from (if not already in solver) 14 | functionObjectLibs ("libfieldFunctionObjects.so"); 15 | 16 | type readFields; 17 | fields (p U k); 18 | } 19 | 20 | 21 | // ************************************************************************* // 22 | -------------------------------------------------------------------------------- /TimeProfiling/propeller/system/surfaceFeatureExtractDictDefaults: -------------------------------------------------------------------------------- 1 | // How to obtain raw features (extractFromFile || extractFromSurface) 2 | extractionMethod extractFromSurface; 3 | 4 | extractFromSurfaceCoeffs 5 | { 6 | // Mark edges whose adjacent surface normals are at an angle less 7 | // than includedAngle as features 8 | // - 0 : selects no edges 9 | // - 180: selects all edges 10 | includedAngle 150; 11 | } 12 | 13 | trimFeatures 14 | { 15 | // Remove features with fewer than the specified number of edges 16 | minElem 10; 17 | } 18 | --------------------------------------------------------------------------------