Repository: phresher/OpenFOAM_Tutorials_Plus Branch: master Commit: 6b66f9b097b0 Files: 594 Total size: 2.6 MB Directory structure: gitextract_re6asacm/ ├── .gitignore ├── LICENSE ├── README.md ├── _config.yml ├── abruptContraction/ │ ├── interPhaseChangeFoam/ │ │ ├── 0/ │ │ │ ├── U │ │ │ ├── alpha.water │ │ │ ├── k │ │ │ ├── nuTilda │ │ │ ├── nut │ │ │ ├── p_rgh │ │ │ ├── phi │ │ │ └── s │ │ ├── Allclean │ │ ├── Allmesh │ │ ├── Allrun │ │ ├── Allrun.parallel │ │ ├── constant/ │ │ │ ├── g │ │ │ ├── transportProperties │ │ │ └── turbulenceProperties │ │ └── system/ │ │ ├── blockMeshDict │ │ ├── controlDict │ │ ├── decomposeParDict │ │ ├── fvSchemes │ │ ├── fvSolution │ │ ├── probes │ │ ├── refineMeshDict.1 │ │ ├── refineMeshDict.2 │ │ ├── surfaces │ │ ├── topoSetDict.1 │ │ └── topoSetDict.2 │ ├── pimpleFoam/ │ │ ├── 0/ │ │ │ ├── U │ │ │ ├── epsilon │ │ │ ├── k │ │ │ ├── nuTilda │ │ │ ├── nut │ │ │ └── p │ │ ├── Allclean │ │ ├── Allrun │ │ ├── Allrun.parallel │ │ ├── constant/ │ │ │ ├── transportProperties │ │ │ └── turbulenceProperties │ │ └── system/ │ │ ├── blockMeshDict │ │ ├── controlDict │ │ ├── decomposeParDict │ │ ├── fvSchemes │ │ ├── fvSolution │ │ ├── probes │ │ └── surfaces │ ├── pisoFoam/ │ │ ├── 0/ │ │ │ ├── U │ │ │ ├── k │ │ │ ├── nuTilda │ │ │ ├── nut │ │ │ ├── p │ │ │ └── s │ │ ├── Allclean │ │ ├── Allrun │ │ ├── Allrun.parallel │ │ ├── constant/ │ │ │ ├── transportProperties │ │ │ └── turbulenceProperties │ │ └── system/ │ │ ├── blockMeshDict │ │ ├── controlDict │ │ ├── decomposeParDict │ │ ├── fvSchemes │ │ ├── fvSolution │ │ ├── probes │ │ └── surfaces │ └── simpleFoam/ │ ├── 0/ │ │ ├── U │ │ ├── epsilon │ │ ├── k │ │ ├── nut │ │ └── p │ ├── Allclean │ ├── Allrun │ ├── constant/ │ │ ├── transportProperties │ │ └── turbulenceProperties │ └── system/ │ ├── blockMeshDict │ ├── controlDict │ ├── fvSchemes │ └── fvSolution ├── cavitatingBullet/ │ ├── 0/ │ │ ├── U │ │ ├── alpha.water │ │ └── p_rgh │ ├── Allclean │ ├── Allrun │ ├── constant/ │ │ ├── g │ │ ├── transportProperties │ │ ├── triSurface/ │ │ │ └── README │ │ └── turbulenceProperties │ └── system/ │ ├── blockMeshDict │ ├── controlDict │ ├── decomposeParDict │ ├── fvSchemes │ ├── fvSolution │ └── snappyHexMeshDict ├── fishChannel/ │ ├── 0/ │ │ ├── U │ │ ├── alpha.water.orig │ │ ├── epsilon │ │ ├── k │ │ ├── nut │ │ ├── omega │ │ └── p_rgh │ ├── Allclean │ ├── Allmesh │ ├── Allrun │ ├── constant/ │ │ ├── g │ │ ├── transportProperties │ │ └── turbulenceProperties │ ├── showCase.pvsm │ └── system/ │ ├── blockMeshDict │ ├── controlDict │ ├── createBafflesDict │ ├── createPatchDict │ ├── decomposeParDict │ ├── fvSchemes │ ├── fvSolution │ ├── refineMeshDict │ ├── refineMeshDict.section1 │ ├── refineMeshDict.section2 │ ├── setFieldsDict │ ├── topoSetDict.outlet2 │ ├── topoSetDict.section1 │ └── topoSetDict.section2 ├── flatPlate/ │ ├── 0/ │ │ ├── U │ │ ├── U~ │ │ ├── epsilon │ │ ├── k │ │ ├── nut │ │ └── p │ ├── Allclean │ ├── Allrun │ ├── constant/ │ │ ├── transportProperties │ │ └── turbulenceProperties │ └── system/ │ ├── blockMeshDict │ ├── controlDict │ ├── fvSchemes │ └── fvSolution ├── linuxCheatSheet/ │ ├── Common linux command in OpenFoam.md │ └── linuxCheatSheet.docx ├── magnusEffect/ │ ├── 0/ │ │ ├── .svn/ │ │ │ ├── all-wcprops │ │ │ ├── entries │ │ │ └── text-base/ │ │ │ ├── U.svn-base │ │ │ └── p.svn-base │ │ ├── U │ │ ├── epsilon │ │ ├── k │ │ ├── nuTilda │ │ ├── nut │ │ └── p │ ├── Allclean │ ├── Allrun │ ├── README.md │ ├── constant/ │ │ ├── transportProperties │ │ └── turbulenceProperties │ ├── magnus.geo │ └── system/ │ ├── controlDict │ ├── fvSchemes │ └── fvSolution ├── mpiTest/ │ ├── Alltest │ └── damBreak4phaseFine/ │ ├── 0/ │ │ ├── U │ │ ├── U.air │ │ ├── U.mercury │ │ ├── U.oil │ │ ├── U.water │ │ ├── alpha.air.orig │ │ ├── alpha.mercury.orig │ │ ├── alpha.oil.orig │ │ ├── alpha.water.orig │ │ └── p_rgh │ ├── Allclean │ ├── Allsbatch │ ├── constant/ │ │ ├── g │ │ ├── motionProperties │ │ ├── transportProperties │ │ └── turbulenceProperties │ └── system/ │ ├── blockMeshDict │ ├── controlDict │ ├── decomposeParDict │ ├── fvSchemes │ ├── fvSolution │ └── setFieldsDict ├── programmingTutorials/ │ ├── .gitignore │ ├── LICENSE │ ├── OFtutorial00_helloWorld/ │ │ ├── Allwclean │ │ ├── Allwmake │ │ ├── Make/ │ │ │ ├── files │ │ │ └── options │ │ ├── OFtutorial0.C │ │ └── testCase/ │ │ ├── 0/ │ │ │ ├── U │ │ │ └── p │ │ ├── Allclean │ │ ├── Allrun │ │ ├── constant/ │ │ │ └── transportProperties │ │ └── system/ │ │ ├── blockMeshDict │ │ ├── controlDict │ │ ├── fvSchemes │ │ └── fvSolution │ ├── OFtutorial01_inputOutput/ │ │ ├── Allwclean │ │ ├── Allwmake │ │ ├── Make/ │ │ │ ├── files │ │ │ └── options │ │ ├── OFtutorial1.C │ │ └── testCase/ │ │ ├── 0/ │ │ │ ├── U │ │ │ └── p │ │ ├── Allclean │ │ ├── Allrun │ │ ├── constant/ │ │ │ ├── customProperties │ │ │ └── transportProperties │ │ └── system/ │ │ ├── blockMeshDict │ │ ├── controlDict │ │ ├── fvSchemes │ │ └── fvSolution │ ├── OFtutorial02_commandLineArgumentsAndOptions/ │ │ ├── Allwclean │ │ ├── Allwmake │ │ ├── Make/ │ │ │ ├── files │ │ │ └── options │ │ ├── OFtutorial2.C │ │ └── testCase/ │ │ ├── 0/ │ │ │ ├── U │ │ │ └── p │ │ ├── Allclean │ │ ├── Allrun │ │ ├── constant/ │ │ │ └── transportProperties │ │ └── system/ │ │ ├── blockMeshDict │ │ ├── controlDict │ │ ├── fvSchemes │ │ └── fvSolution │ ├── OFtutorial03_understandingTheMesh/ │ │ ├── Allwclean │ │ ├── Allwmake │ │ ├── Make/ │ │ │ ├── files │ │ │ └── options │ │ ├── OFtutorial3.C │ │ └── testCase/ │ │ ├── 0/ │ │ │ ├── U │ │ │ └── p │ │ ├── Allclean │ │ ├── Allrun │ │ ├── constant/ │ │ │ └── transportProperties │ │ └── system/ │ │ ├── blockMeshDict │ │ ├── controlDict │ │ ├── fvSchemes │ │ └── fvSolution │ ├── OFtutorial04_basicFieldOperations/ │ │ ├── Allwclean │ │ ├── Allwmake │ │ ├── Make/ │ │ │ ├── files │ │ │ └── options │ │ ├── OFtutorial4.C │ │ └── testCase/ │ │ ├── 0/ │ │ │ ├── U │ │ │ └── p │ │ ├── Allclean │ │ ├── Allrun │ │ ├── constant/ │ │ │ └── transportProperties │ │ └── system/ │ │ ├── blockMeshDict │ │ ├── controlDict │ │ ├── fvSchemes │ │ └── fvSolution │ ├── OFtutorial05_basicParallelComputing/ │ │ ├── Allwclean │ │ ├── Allwmake │ │ ├── Make/ │ │ │ ├── files │ │ │ └── options │ │ ├── OFtutorial5.C │ │ ├── createFields.H │ │ └── testCase/ │ │ ├── 0/ │ │ │ ├── U │ │ │ └── p │ │ ├── Allclean │ │ ├── Allrun │ │ ├── constant/ │ │ │ └── transportProperties │ │ └── system/ │ │ ├── blockMeshDict │ │ ├── controlDict │ │ ├── decomposeParDict │ │ ├── fvSchemes │ │ └── fvSolution │ ├── OFtutorial06_customClasses/ │ │ ├── Allwclean │ │ ├── Allwmake │ │ ├── Make/ │ │ │ ├── files │ │ │ └── options │ │ ├── OFtutorial6.C │ │ ├── customClass.C │ │ ├── customClass.H │ │ ├── derivedClass.C │ │ ├── derivedClass.H │ │ └── testCase/ │ │ ├── 0/ │ │ │ ├── U │ │ │ └── p │ │ ├── Allclean │ │ ├── Allrun │ │ ├── constant/ │ │ │ └── transportProperties │ │ └── system/ │ │ ├── blockMeshDict │ │ ├── controlDict │ │ ├── decomposeParDict │ │ ├── fvSchemes │ │ └── fvSolution │ ├── OFtutorial07_customLibraries/ │ │ ├── Allwclean │ │ ├── Allwmake │ │ ├── Make/ │ │ │ ├── files │ │ │ └── options │ │ ├── OFtutorial7.C │ │ ├── createFields.H │ │ ├── customLibrary/ │ │ │ ├── Make/ │ │ │ │ ├── files │ │ │ │ └── options │ │ │ ├── customLibrary.C │ │ │ └── customLibrary.H │ │ └── testCase/ │ │ ├── 0/ │ │ │ ├── U │ │ │ └── p │ │ ├── Allclean │ │ ├── Allrun │ │ ├── constant/ │ │ │ └── transportProperties │ │ └── system/ │ │ ├── blockMeshDict │ │ ├── controlDict │ │ ├── decomposeParDict │ │ ├── fvSchemes │ │ └── fvSolution │ ├── OFtutorial08_customBC/ │ │ ├── Allwclean │ │ ├── Allwmake │ │ ├── Make/ │ │ │ ├── files │ │ │ └── options │ │ ├── prescribedPipeInletFvPatchVectorField.C │ │ ├── prescribedPipeInletFvPatchVectorField.H │ │ └── testCase/ │ │ ├── 0.org/ │ │ │ ├── U │ │ │ ├── k │ │ │ ├── nut │ │ │ ├── omega │ │ │ └── p │ │ ├── Allclean │ │ ├── Allrun │ │ ├── Allrun.mesh │ │ ├── constant/ │ │ │ ├── transportProperties │ │ │ └── turbulenceProperties │ │ └── system/ │ │ ├── blockMeshDict │ │ ├── controlDict │ │ ├── decomposeParDict │ │ ├── fvSchemes │ │ ├── fvSolution │ │ ├── mirrorMeshDict │ │ ├── runConditions │ │ └── sampleDict │ ├── OFtutorial09_runtimePostprocessingUtility/ │ │ ├── Allwclean │ │ ├── Allwmake │ │ ├── Make/ │ │ │ ├── files │ │ │ └── options │ │ ├── pipeCalc.C │ │ ├── pipeCalc.H │ │ └── testCase/ │ │ ├── 0.org/ │ │ │ ├── U │ │ │ ├── k │ │ │ ├── nut │ │ │ ├── omega │ │ │ └── p │ │ ├── Allclean │ │ ├── Allrun │ │ ├── Allrun.mesh │ │ ├── constant/ │ │ │ ├── transportProperties │ │ │ └── turbulenceProperties │ │ └── system/ │ │ ├── blockMeshDict │ │ ├── controlDict │ │ ├── decomposeParDict │ │ ├── fvSchemes │ │ ├── fvSolution │ │ ├── mirrorMeshDict │ │ ├── runConditions │ │ ├── sampleDict │ │ └── topoSetDict │ ├── OFtutorial10_transportEquation/ │ │ ├── Allwclean │ │ ├── Allwmake │ │ ├── Make/ │ │ │ ├── files │ │ │ └── options │ │ ├── OFtutorial10.C │ │ └── testCase/ │ │ ├── 0/ │ │ │ ├── U │ │ │ └── beta │ │ ├── Allclean │ │ ├── Allrun │ │ ├── constant/ │ │ │ └── transportProperties │ │ ├── system/ │ │ │ ├── blockMeshDict │ │ │ ├── controlDict │ │ │ ├── fvSchemes │ │ │ └── fvSolution │ │ └── viewData.pvsm │ ├── OFtutorial11_modifyingTheMesh/ │ │ ├── Allwclean │ │ ├── Allwmake │ │ ├── Make/ │ │ │ ├── files │ │ │ └── options │ │ ├── OFtutorial11.C │ │ ├── meshPoints.geo │ │ └── testCase/ │ │ ├── Allclean │ │ ├── Allrun │ │ ├── constant/ │ │ │ └── transportProperties │ │ ├── system/ │ │ │ ├── blockMeshDict │ │ │ ├── controlDict │ │ │ ├── fvSchemes │ │ │ └── fvSolution │ │ └── viewGrid.pvsm │ ├── OFtutorial12_momentumSource/ │ │ ├── Allwclean │ │ ├── Allwmake │ │ ├── Make/ │ │ │ ├── files │ │ │ └── options │ │ ├── customActuationDiskSource.C │ │ ├── customActuationDiskSource.H │ │ ├── customActuationDiskSourceTemplates.C │ │ └── testCase/ │ │ ├── 0/ │ │ │ ├── U │ │ │ ├── k │ │ │ ├── nut │ │ │ ├── omega │ │ │ └── p │ │ ├── Allclean │ │ ├── Allrun │ │ ├── constant/ │ │ │ ├── fvOptions │ │ │ ├── transportProperties │ │ │ └── turbulenceProperties │ │ ├── system/ │ │ │ ├── blockMeshDict │ │ │ ├── controlDict │ │ │ ├── fvSchemes │ │ │ └── fvSolution │ │ └── viewData.pvsm │ ├── OldReleases/ │ │ └── OF301/ │ │ ├── OFtutorial0_helloWorld/ │ │ │ ├── Make/ │ │ │ │ ├── files │ │ │ │ └── options │ │ │ ├── OFtutorial0.C │ │ │ └── testCase/ │ │ │ ├── 0/ │ │ │ │ ├── U │ │ │ │ └── p │ │ │ ├── Allclean │ │ │ ├── Allrun │ │ │ ├── constant/ │ │ │ │ └── transportProperties │ │ │ └── system/ │ │ │ ├── blockMeshDict │ │ │ ├── controlDict │ │ │ ├── fvSchemes │ │ │ └── fvSolution │ │ ├── OFtutorial1_inputOutput/ │ │ │ ├── Make/ │ │ │ │ ├── files │ │ │ │ └── options │ │ │ ├── OFtutorial1.C │ │ │ └── testCase/ │ │ │ ├── 0/ │ │ │ │ ├── U │ │ │ │ └── p │ │ │ ├── Allclean │ │ │ ├── Allrun │ │ │ ├── constant/ │ │ │ │ ├── customProperties │ │ │ │ └── transportProperties │ │ │ └── system/ │ │ │ ├── blockMeshDict │ │ │ ├── controlDict │ │ │ ├── fvSchemes │ │ │ └── fvSolution │ │ ├── OFtutorial2_understandingTheMesh/ │ │ │ ├── Make/ │ │ │ │ ├── files │ │ │ │ └── options │ │ │ ├── OFtutorial2.C │ │ │ └── testCase/ │ │ │ ├── 0/ │ │ │ │ ├── U │ │ │ │ └── p │ │ │ ├── Allclean │ │ │ ├── Allrun │ │ │ ├── constant/ │ │ │ │ └── transportProperties │ │ │ └── system/ │ │ │ ├── blockMeshDict │ │ │ ├── controlDict │ │ │ ├── fvSchemes │ │ │ └── fvSolution │ │ ├── OFtutorial3_basicFieldOperations/ │ │ │ ├── Make/ │ │ │ │ ├── files │ │ │ │ └── options │ │ │ ├── OFtutorial3.C │ │ │ └── testCase/ │ │ │ ├── 0/ │ │ │ │ ├── U │ │ │ │ └── p │ │ │ ├── Allclean │ │ │ ├── Allrun │ │ │ ├── constant/ │ │ │ │ └── transportProperties │ │ │ └── system/ │ │ │ ├── blockMeshDict │ │ │ ├── controlDict │ │ │ ├── fvSchemes │ │ │ └── fvSolution │ │ ├── OFtutorial4_basicParallelComputing/ │ │ │ ├── Make/ │ │ │ │ ├── files │ │ │ │ └── options │ │ │ ├── OFtutorial4.C │ │ │ ├── createFields.H │ │ │ └── testCase/ │ │ │ ├── 0/ │ │ │ │ ├── U │ │ │ │ └── p │ │ │ ├── Allclean │ │ │ ├── Allrun │ │ │ ├── constant/ │ │ │ │ └── transportProperties │ │ │ └── system/ │ │ │ ├── blockMeshDict │ │ │ ├── controlDict │ │ │ ├── decomposeParDict │ │ │ ├── fvSchemes │ │ │ └── fvSolution │ │ ├── OFtutorial5_customClasses/ │ │ │ ├── Make/ │ │ │ │ ├── files │ │ │ │ └── options │ │ │ ├── OFtutorial5.C │ │ │ ├── customClass.C │ │ │ ├── customClass.H │ │ │ ├── derivedClass.C │ │ │ ├── derivedClass.H │ │ │ └── testCase/ │ │ │ ├── 0/ │ │ │ │ ├── U │ │ │ │ └── p │ │ │ ├── Allclean │ │ │ ├── Allrun │ │ │ ├── constant/ │ │ │ │ └── transportProperties │ │ │ └── system/ │ │ │ ├── blockMeshDict │ │ │ ├── controlDict │ │ │ ├── decomposeParDict │ │ │ ├── fvSchemes │ │ │ └── fvSolution │ │ ├── OFtutorial6_customLibraries/ │ │ │ ├── Allwclean │ │ │ ├── Allwmake │ │ │ ├── Make/ │ │ │ │ ├── files │ │ │ │ └── options │ │ │ ├── OFtutorial6.C │ │ │ ├── createFields.H │ │ │ ├── customLibrary/ │ │ │ │ ├── Make/ │ │ │ │ │ ├── files │ │ │ │ │ └── options │ │ │ │ ├── customLibrary.C │ │ │ │ └── customLibrary.H │ │ │ └── testCase/ │ │ │ ├── 0/ │ │ │ │ ├── U │ │ │ │ └── p │ │ │ ├── Allclean │ │ │ ├── Allrun │ │ │ ├── constant/ │ │ │ │ └── transportProperties │ │ │ └── system/ │ │ │ ├── blockMeshDict │ │ │ ├── controlDict │ │ │ ├── decomposeParDict │ │ │ ├── fvSchemes │ │ │ └── fvSolution │ │ ├── OFtutorial7_customBC/ │ │ │ ├── Allwclean │ │ │ ├── Allwmake │ │ │ ├── Make/ │ │ │ │ ├── files │ │ │ │ └── options │ │ │ ├── prescribedPipeInletFvPatchVectorField.C │ │ │ ├── prescribedPipeInletFvPatchVectorField.H │ │ │ └── testCase/ │ │ │ ├── 0.org/ │ │ │ │ ├── U │ │ │ │ ├── k │ │ │ │ ├── nut │ │ │ │ ├── omega │ │ │ │ └── p │ │ │ ├── Allclean │ │ │ ├── Allrun │ │ │ ├── Allrun.mesh │ │ │ ├── constant/ │ │ │ │ ├── transportProperties │ │ │ │ └── turbulenceProperties │ │ │ └── system/ │ │ │ ├── blockMeshDict │ │ │ ├── controlDict │ │ │ ├── decomposeParDict │ │ │ ├── fvSchemes │ │ │ ├── fvSolution │ │ │ ├── mirrorMeshDict │ │ │ ├── runConditions │ │ │ └── sampleDict │ │ ├── OFtutorial8_runtimePostprocessingUtility/ │ │ │ ├── IOpipeCalc.H │ │ │ ├── Make/ │ │ │ │ ├── files │ │ │ │ └── options │ │ │ ├── pipeCalc.C │ │ │ ├── pipeCalc.H │ │ │ ├── pipeCalcFunctionObject.C │ │ │ ├── pipeCalcFunctionObject.H │ │ │ └── testCase/ │ │ │ ├── 0.org/ │ │ │ │ ├── U │ │ │ │ ├── k │ │ │ │ ├── nut │ │ │ │ ├── omega │ │ │ │ └── p │ │ │ ├── Allclean │ │ │ ├── Allrun │ │ │ ├── Allrun.mesh │ │ │ ├── constant/ │ │ │ │ ├── transportProperties │ │ │ │ └── turbulenceProperties │ │ │ └── system/ │ │ │ ├── blockMeshDict │ │ │ ├── controlDict │ │ │ ├── decomposeParDict │ │ │ ├── fvSchemes │ │ │ ├── fvSolution │ │ │ ├── mirrorMeshDict │ │ │ ├── runConditions │ │ │ ├── sampleDict │ │ │ └── topoSetDict │ │ ├── OFtutorial9_transportEquation/ │ │ │ ├── Make/ │ │ │ │ ├── files │ │ │ │ └── options │ │ │ ├── OFtutorial9.C │ │ │ └── testCase/ │ │ │ ├── 0/ │ │ │ │ ├── U │ │ │ │ └── beta │ │ │ ├── Allclean │ │ │ ├── Allrun │ │ │ ├── constant/ │ │ │ │ └── transportProperties │ │ │ └── system/ │ │ │ ├── blockMeshDict │ │ │ ├── controlDict │ │ │ ├── fvSchemes │ │ │ └── fvSolution │ │ └── README.md │ ├── README.md │ └── testAll └── waterChannel/ ├── 0/ │ ├── U │ ├── alpha.water.orig │ ├── k │ ├── nut │ ├── omega │ └── p_rgh ├── Allclean ├── Allmesh ├── Allrun ├── constant/ │ ├── g │ ├── transportProperties │ └── turbulenceProperties └── system/ ├── blockMeshDict ├── controlDict ├── extrudeMeshDict ├── extrudeMeshDict.1 ├── extrudeMeshDict.2 ├── fvSchemes ├── fvSolution ├── setFieldsDict └── surfaces ================================================ FILE CONTENTS ================================================ ================================================ FILE: .gitignore ================================================ *.grf *.gz log.* postProcessing *~ processor* [0-9]* [0-9]*.[0-9]* !0 !0.org !0.orig !0/ *.eMesh polyMesh/ *.OpenFOAM dynamicCode sequencedVTK/ ================================================ FILE: LICENSE ================================================ GNU GENERAL PUBLIC LICENSE Version 3, 29 June 2007 Copyright (C) 2007 Free Software Foundation, Inc. Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The GNU General Public License is a free, copyleft license for software and other kinds of works. The licenses for most software and other practical works are designed to take away your freedom to share and change the works. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change all versions of a program--to make sure it remains free software for all its users. We, the Free Software Foundation, use the GNU General Public License for most of our software; it applies also to any other work released this way by its authors. You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for them if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs, and that you know you can do these things. To protect your rights, we need to prevent others from denying you these rights or asking you to surrender the rights. Therefore, you have certain responsibilities if you distribute copies of the software, or if you modify it: responsibilities to respect the freedom of others. For example, if you distribute copies of such a program, whether gratis or for a fee, you must pass on to the recipients the same freedoms that you received. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. Developers that use the GNU GPL protect your rights with two steps: (1) assert copyright on the software, and (2) offer you this License giving you legal permission to copy, distribute and/or modify it. For the developers' and authors' protection, the GPL clearly explains that there is no warranty for this free software. For both users' and authors' sake, the GPL requires that modified versions be marked as changed, so that their problems will not be attributed erroneously to authors of previous versions. Some devices are designed to deny users access to install or run modified versions of the software inside them, although the manufacturer can do so. This is fundamentally incompatible with the aim of protecting users' freedom to change the software. The systematic pattern of such abuse occurs in the area of products for individuals to use, which is precisely where it is most unacceptable. Therefore, we have designed this version of the GPL to prohibit the practice for those products. If such problems arise substantially in other domains, we stand ready to extend this provision to those domains in future versions of the GPL, as needed to protect the freedom of users. Finally, every program is threatened constantly by software patents. States should not allow patents to restrict development and use of software on general-purpose computers, but in those that do, we wish to avoid the special danger that patents applied to a free program could make it effectively proprietary. To prevent this, the GPL assures that patents cannot be used to render the program non-free. The precise terms and conditions for copying, distribution and modification follow. TERMS AND CONDITIONS 0. Definitions. "This License" refers to version 3 of the GNU General Public License. "Copyright" also means copyright-like laws that apply to other kinds of works, such as semiconductor masks. "The Program" refers to any copyrightable work licensed under this License. Each licensee is addressed as "you". "Licensees" and "recipients" may be individuals or organizations. To "modify" a work means to copy from or adapt all or part of the work in a fashion requiring copyright permission, other than the making of an exact copy. The resulting work is called a "modified version" of the earlier work or a work "based on" the earlier work. A "covered work" means either the unmodified Program or a work based on the Program. To "propagate" a work means to do anything with it that, without permission, would make you directly or secondarily liable for infringement under applicable copyright law, except executing it on a computer or modifying a private copy. Propagation includes copying, distribution (with or without modification), making available to the public, and in some countries other activities as well. To "convey" a work means any kind of propagation that enables other parties to make or receive copies. Mere interaction with a user through a computer network, with no transfer of a copy, is not conveying. An interactive user interface displays "Appropriate Legal Notices" to the extent that it includes a convenient and prominently visible feature that (1) displays an appropriate copyright notice, and (2) tells the user that there is no warranty for the work (except to the extent that warranties are provided), that licensees may convey the work under this License, and how to view a copy of this License. If the interface presents a list of user commands or options, such as a menu, a prominent item in the list meets this criterion. 1. Source Code. The "source code" for a work means the preferred form of the work for making modifications to it. "Object code" means any non-source form of a work. A "Standard Interface" means an interface that either is an official standard defined by a recognized standards body, or, in the case of interfaces specified for a particular programming language, one that is widely used among developers working in that language. The "System Libraries" of an executable work include anything, other than the work as a whole, that (a) is included in the normal form of packaging a Major Component, but which is not part of that Major Component, and (b) serves only to enable use of the work with that Major Component, or to implement a Standard Interface for which an implementation is available to the public in source code form. A "Major Component", in this context, means a major essential component (kernel, window system, and so on) of the specific operating system (if any) on which the executable work runs, or a compiler used to produce the work, or an object code interpreter used to run it. The "Corresponding Source" for a work in object code form means all the source code needed to generate, install, and (for an executable work) run the object code and to modify the work, including scripts to control those activities. However, it does not include the work's System Libraries, or general-purpose tools or generally available free programs which are used unmodified in performing those activities but which are not part of the work. For example, Corresponding Source includes interface definition files associated with source files for the work, and the source code for shared libraries and dynamically linked subprograms that the work is specifically designed to require, such as by intimate data communication or control flow between those subprograms and other parts of the work. The Corresponding Source need not include anything that users can regenerate automatically from other parts of the Corresponding Source. The Corresponding Source for a work in source code form is that same work. 2. Basic Permissions. All rights granted under this License are granted for the term of copyright on the Program, and are irrevocable provided the stated conditions are met. This License explicitly affirms your unlimited permission to run the unmodified Program. The output from running a covered work is covered by this License only if the output, given its content, constitutes a covered work. This License acknowledges your rights of fair use or other equivalent, as provided by copyright law. You may make, run and propagate covered works that you do not convey, without conditions so long as your license otherwise remains in force. You may convey covered works to others for the sole purpose of having them make modifications exclusively for you, or provide you with facilities for running those works, provided that you comply with the terms of this License in conveying all material for which you do not control copyright. Those thus making or running the covered works for you must do so exclusively on your behalf, under your direction and control, on terms that prohibit them from making any copies of your copyrighted material outside their relationship with you. Conveying under any other circumstances is permitted solely under the conditions stated below. Sublicensing is not allowed; section 10 makes it unnecessary. 3. Protecting Users' Legal Rights From Anti-Circumvention Law. No covered work shall be deemed part of an effective technological measure under any applicable law fulfilling obligations under article 11 of the WIPO copyright treaty adopted on 20 December 1996, or similar laws prohibiting or restricting circumvention of such measures. When you convey a covered work, you waive any legal power to forbid circumvention of technological measures to the extent such circumvention is effected by exercising rights under this License with respect to the covered work, and you disclaim any intention to limit operation or modification of the work as a means of enforcing, against the work's users, your or third parties' legal rights to forbid circumvention of technological measures. 4. Conveying Verbatim Copies. You may convey verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice; keep intact all notices stating that this License and any non-permissive terms added in accord with section 7 apply to the code; keep intact all notices of the absence of any warranty; and give all recipients a copy of this License along with the Program. You may charge any price or no price for each copy that you convey, and you may offer support or warranty protection for a fee. 5. Conveying Modified Source Versions. You may convey a work based on the Program, or the modifications to produce it from the Program, in the form of source code under the terms of section 4, provided that you also meet all of these conditions: a) The work must carry prominent notices stating that you modified it, and giving a relevant date. b) The work must carry prominent notices stating that it is released under this License and any conditions added under section 7. This requirement modifies the requirement in section 4 to "keep intact all notices". c) You must license the entire work, as a whole, under this License to anyone who comes into possession of a copy. This License will therefore apply, along with any applicable section 7 additional terms, to the whole of the work, and all its parts, regardless of how they are packaged. This License gives no permission to license the work in any other way, but it does not invalidate such permission if you have separately received it. d) If the work has interactive user interfaces, each must display Appropriate Legal Notices; however, if the Program has interactive interfaces that do not display Appropriate Legal Notices, your work need not make them do so. A compilation of a covered work with other separate and independent works, which are not by their nature extensions of the covered work, and which are not combined with it such as to form a larger program, in or on a volume of a storage or distribution medium, is called an "aggregate" if the compilation and its resulting copyright are not used to limit the access or legal rights of the compilation's users beyond what the individual works permit. Inclusion of a covered work in an aggregate does not cause this License to apply to the other parts of the aggregate. 6. Conveying Non-Source Forms. You may convey a covered work in object code form under the terms of sections 4 and 5, provided that you also convey the machine-readable Corresponding Source under the terms of this License, in one of these ways: a) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by the Corresponding Source fixed on a durable physical medium customarily used for software interchange. b) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by a written offer, valid for at least three years and valid for as long as you offer spare parts or customer support for that product model, to give anyone who possesses the object code either (1) a copy of the Corresponding Source for all the software in the product that is covered by this License, on a durable physical medium customarily used for software interchange, for a price no more than your reasonable cost of physically performing this conveying of source, or (2) access to copy the Corresponding Source from a network server at no charge. c) Convey individual copies of the object code with a copy of the written offer to provide the Corresponding Source. This alternative is allowed only occasionally and noncommercially, and only if you received the object code with such an offer, in accord with subsection 6b. d) Convey the object code by offering access from a designated place (gratis or for a charge), and offer equivalent access to the Corresponding Source in the same way through the same place at no further charge. You need not require recipients to copy the Corresponding Source along with the object code. If the place to copy the object code is a network server, the Corresponding Source may be on a different server (operated by you or a third party) that supports equivalent copying facilities, provided you maintain clear directions next to the object code saying where to find the Corresponding Source. Regardless of what server hosts the Corresponding Source, you remain obligated to ensure that it is available for as long as needed to satisfy these requirements. e) Convey the object code using peer-to-peer transmission, provided you inform other peers where the object code and Corresponding Source of the work are being offered to the general public at no charge under subsection 6d. A separable portion of the object code, whose source code is excluded from the Corresponding Source as a System Library, need not be included in conveying the object code work. A "User Product" is either (1) a "consumer product", which means any tangible personal property which is normally used for personal, family, or household purposes, or (2) anything designed or sold for incorporation into a dwelling. In determining whether a product is a consumer product, doubtful cases shall be resolved in favor of coverage. For a particular product received by a particular user, "normally used" refers to a typical or common use of that class of product, regardless of the status of the particular user or of the way in which the particular user actually uses, or expects or is expected to use, the product. A product is a consumer product regardless of whether the product has substantial commercial, industrial or non-consumer uses, unless such uses represent the only significant mode of use of the product. "Installation Information" for a User Product means any methods, procedures, authorization keys, or other information required to install and execute modified versions of a covered work in that User Product from a modified version of its Corresponding Source. The information must suffice to ensure that the continued functioning of the modified object code is in no case prevented or interfered with solely because modification has been made. If you convey an object code work under this section in, or with, or specifically for use in, a User Product, and the conveying occurs as part of a transaction in which the right of possession and use of the User Product is transferred to the recipient in perpetuity or for a fixed term (regardless of how the transaction is characterized), the Corresponding Source conveyed under this section must be accompanied by the Installation Information. But this requirement does not apply if neither you nor any third party retains the ability to install modified object code on the User Product (for example, the work has been installed in ROM). The requirement to provide Installation Information does not include a requirement to continue to provide support service, warranty, or updates for a work that has been modified or installed by the recipient, or for the User Product in which it has been modified or installed. Access to a network may be denied when the modification itself materially and adversely affects the operation of the network or violates the rules and protocols for communication across the network. Corresponding Source conveyed, and Installation Information provided, in accord with this section must be in a format that is publicly documented (and with an implementation available to the public in source code form), and must require no special password or key for unpacking, reading or copying. 7. Additional Terms. "Additional permissions" are terms that supplement the terms of this License by making exceptions from one or more of its conditions. Additional permissions that are applicable to the entire Program shall be treated as though they were included in this License, to the extent that they are valid under applicable law. If additional permissions apply only to part of the Program, that part may be used separately under those permissions, but the entire Program remains governed by this License without regard to the additional permissions. When you convey a copy of a covered work, you may at your option remove any additional permissions from that copy, or from any part of it. (Additional permissions may be written to require their own removal in certain cases when you modify the work.) You may place additional permissions on material, added by you to a covered work, for which you have or can give appropriate copyright permission. Notwithstanding any other provision of this License, for material you add to a covered work, you may (if authorized by the copyright holders of that material) supplement the terms of this License with terms: a) Disclaiming warranty or limiting liability differently from the terms of sections 15 and 16 of this License; or b) Requiring preservation of specified reasonable legal notices or author attributions in that material or in the Appropriate Legal Notices displayed by works containing it; or c) Prohibiting misrepresentation of the origin of that material, or requiring that modified versions of such material be marked in reasonable ways as different from the original version; or d) Limiting the use for publicity purposes of names of licensors or authors of the material; or e) Declining to grant rights under trademark law for use of some trade names, trademarks, or service marks; or f) Requiring indemnification of licensors and authors of that material by anyone who conveys the material (or modified versions of it) with contractual assumptions of liability to the recipient, for any liability that these contractual assumptions directly impose on those licensors and authors. All other non-permissive additional terms are considered "further restrictions" within the meaning of section 10. If the Program as you received it, or any part of it, contains a notice stating that it is governed by this License along with a term that is a further restriction, you may remove that term. If a license document contains a further restriction but permits relicensing or conveying under this License, you may add to a covered work material governed by the terms of that license document, provided that the further restriction does not survive such relicensing or conveying. If you add terms to a covered work in accord with this section, you must place, in the relevant source files, a statement of the additional terms that apply to those files, or a notice indicating where to find the applicable terms. Additional terms, permissive or non-permissive, may be stated in the form of a separately written license, or stated as exceptions; the above requirements apply either way. 8. Termination. You may not propagate or modify a covered work except as expressly provided under this License. Any attempt otherwise to propagate or modify it is void, and will automatically terminate your rights under this License (including any patent licenses granted under the third paragraph of section 11). However, if you cease all violation of this License, then your license from a particular copyright holder is reinstated (a) provisionally, unless and until the copyright holder explicitly and finally terminates your license, and (b) permanently, if the copyright holder fails to notify you of the violation by some reasonable means prior to 60 days after the cessation. Moreover, your license from a particular copyright holder is reinstated permanently if the copyright holder notifies you of the violation by some reasonable means, this is the first time you have received notice of violation of this License (for any work) from that copyright holder, and you cure the violation prior to 30 days after your receipt of the notice. Termination of your rights under this section does not terminate the licenses of parties who have received copies or rights from you under this License. If your rights have been terminated and not permanently reinstated, you do not qualify to receive new licenses for the same material under section 10. 9. Acceptance Not Required for Having Copies. You are not required to accept this License in order to receive or run a copy of the Program. Ancillary propagation of a covered work occurring solely as a consequence of using peer-to-peer transmission to receive a copy likewise does not require acceptance. However, nothing other than this License grants you permission to propagate or modify any covered work. These actions infringe copyright if you do not accept this License. Therefore, by modifying or propagating a covered work, you indicate your acceptance of this License to do so. 10. Automatic Licensing of Downstream Recipients. Each time you convey a covered work, the recipient automatically receives a license from the original licensors, to run, modify and propagate that work, subject to this License. You are not responsible for enforcing compliance by third parties with this License. An "entity transaction" is a transaction transferring control of an organization, or substantially all assets of one, or subdividing an organization, or merging organizations. If propagation of a covered work results from an entity transaction, each party to that transaction who receives a copy of the work also receives whatever licenses to the work the party's predecessor in interest had or could give under the previous paragraph, plus a right to possession of the Corresponding Source of the work from the predecessor in interest, if the predecessor has it or can get it with reasonable efforts. You may not impose any further restrictions on the exercise of the rights granted or affirmed under this License. For example, you may not impose a license fee, royalty, or other charge for exercise of rights granted under this License, and you may not initiate litigation (including a cross-claim or counterclaim in a lawsuit) alleging that any patent claim is infringed by making, using, selling, offering for sale, or importing the Program or any portion of it. 11. Patents. A "contributor" is a copyright holder who authorizes use under this License of the Program or a work on which the Program is based. The work thus licensed is called the contributor's "contributor version". A contributor's "essential patent claims" are all patent claims owned or controlled by the contributor, whether already acquired or hereafter acquired, that would be infringed by some manner, permitted by this License, of making, using, or selling its contributor version, but do not include claims that would be infringed only as a consequence of further modification of the contributor version. For purposes of this definition, "control" includes the right to grant patent sublicenses in a manner consistent with the requirements of this License. Each contributor grants you a non-exclusive, worldwide, royalty-free patent license under the contributor's essential patent claims, to make, use, sell, offer for sale, import and otherwise run, modify and propagate the contents of its contributor version. In the following three paragraphs, a "patent license" is any express agreement or commitment, however denominated, not to enforce a patent (such as an express permission to practice a patent or covenant not to sue for patent infringement). To "grant" such a patent license to a party means to make such an agreement or commitment not to enforce a patent against the party. If you convey a covered work, knowingly relying on a patent license, and the Corresponding Source of the work is not available for anyone to copy, free of charge and under the terms of this License, through a publicly available network server or other readily accessible means, then you must either (1) cause the Corresponding Source to be so available, or (2) arrange to deprive yourself of the benefit of the patent license for this particular work, or (3) arrange, in a manner consistent with the requirements of this License, to extend the patent license to downstream recipients. "Knowingly relying" means you have actual knowledge that, but for the patent license, your conveying the covered work in a country, or your recipient's use of the covered work in a country, would infringe one or more identifiable patents in that country that you have reason to believe are valid. If, pursuant to or in connection with a single transaction or arrangement, you convey, or propagate by procuring conveyance of, a covered work, and grant a patent license to some of the parties receiving the covered work authorizing them to use, propagate, modify or convey a specific copy of the covered work, then the patent license you grant is automatically extended to all recipients of the covered work and works based on it. A patent license is "discriminatory" if it does not include within the scope of its coverage, prohibits the exercise of, or is conditioned on the non-exercise of one or more of the rights that are specifically granted under this License. You may not convey a covered work if you are a party to an arrangement with a third party that is in the business of distributing software, under which you make payment to the third party based on the extent of your activity of conveying the work, and under which the third party grants, to any of the parties who would receive the covered work from you, a discriminatory patent license (a) in connection with copies of the covered work conveyed by you (or copies made from those copies), or (b) primarily for and in connection with specific products or compilations that contain the covered work, unless you entered into that arrangement, or that patent license was granted, prior to 28 March 2007. Nothing in this License shall be construed as excluding or limiting any implied license or other defenses to infringement that may otherwise be available to you under applicable patent law. 12. No Surrender of Others' Freedom. If conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot convey a covered work so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not convey it at all. For example, if you agree to terms that obligate you to collect a royalty for further conveying from those to whom you convey the Program, the only way you could satisfy both those terms and this License would be to refrain entirely from conveying the Program. 13. Use with the GNU Affero General Public License. Notwithstanding any other provision of this License, you have permission to link or combine any covered work with a work licensed under version 3 of the GNU Affero General Public License into a single combined work, and to convey the resulting work. The terms of this License will continue to apply to the part which is the covered work, but the special requirements of the GNU Affero General Public License, section 13, concerning interaction through a network will apply to the combination as such. 14. Revised Versions of this License. The Free Software Foundation may publish revised and/or new versions of the GNU General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies that a certain numbered version of the GNU General Public License "or any later version" applies to it, you have the option of following the terms and conditions either of that numbered version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of the GNU General Public License, you may choose any version ever published by the Free Software Foundation. If the Program specifies that a proxy can decide which future versions of the GNU General Public License can be used, that proxy's public statement of acceptance of a version permanently authorizes you to choose that version for the Program. Later license versions may give you additional or different permissions. However, no additional obligations are imposed on any author or copyright holder as a result of your choosing to follow a later version. 15. Disclaimer of Warranty. THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 16. Limitation of Liability. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. 17. Interpretation of Sections 15 and 16. If the disclaimer of warranty and limitation of liability provided above cannot be given local legal effect according to their terms, reviewing courts shall apply local law that most closely approximates an absolute waiver of all civil liability in connection with the Program, unless a warranty or assumption of liability accompanies a copy of the Program in return for a fee. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively state the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. {one line to give the program's name and a brief idea of what it does.} Copyright (C) {year} {name of author} This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . Also add information on how to contact you by electronic and paper mail. If the program does terminal interaction, make it output a short notice like this when it starts in an interactive mode: {project} Copyright (C) {year} {fullname} This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, your program's commands might be different; for a GUI interface, you would use an "about box". You should also get your employer (if you work as a programmer) or school, if any, to sign a "copyright disclaimer" for the program, if necessary. For more information on this, and how to apply and follow the GNU GPL, see . The GNU General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Lesser General Public License instead of this License. But first, please read . ================================================ FILE: README.md ================================================ # OpenFOAM Tutorials Plus This repository contains several OpenFOAM tutorials, cases and notes. Here's a brief description: * **linuxCheatSheet** OpenFOAM Linux Cheat Sheet. * **flatPlate** A simple 2D geometry is used to show the development of a turbulent boundary layer. It's an exercise of [Flow over a flat plate - YouTube](https://youtu.be/69Nna1UjICI). * **magnusEffect** A rotating cylinder in free stream to show magnus effect. Gmsh is used to generate mesh. * **abruptContraction** Abrupt contraction of a rectangular channel where cavitation occures. The *blockMeshDict* is written with variables. *interPhaseChangeFoam*, *pisoFoam* and *pimpleFoam* are used. * **waterChannel** Two-phase open channel flow. It's a fork of the original interFoam tutorial *waterChannel*. The *surfaces* function is configured to generate water surfaces (namely, the isosurfaces where *alpha.water* is equal to 0.5). * **fishChannel** A baffled open channel for fish migration in eco-hydraulic engineering. A combination of *blockMesh*, *topoSet*, *createBaffles*, *refineMesh*, *refineWallLayer* etc are used for geometry and mesh generation. * **cavitatingBullet** The simplified version of the original cavitatingBullet case. The initialization process using potentialFoam is removed in this version to show the basic usage of interPhaseChangeFoam. * **mpiTest** Parallel test for clusters using slurm job management tool. It can also be used on other platforms i.e. workstation after small modification. The case is based on damBreak4PhasesFine with multiphaseEulerFoam. * **programmingTutorials** Basic tutorials to show how to programme within the framework of OpenFOAM. Refer to the README file within the folder. Pull requests are welcome! Happy foaming! ================================================ FILE: _config.yml ================================================ theme: jekyll-theme-cayman ================================================ FILE: abruptContraction/interPhaseChangeFoam/0/U ================================================ /*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: 4.1 | | \\ / A nd | Web: www.OpenFOAM.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class volVectorField; location "0"; object U; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // dimensions [0 1 -1 0 0 0 0]; internalField uniform (0 0 0); boundaryField { inlet { type turbulentInlet; referenceField uniform (5 0 0); fluctuationScale (0.02 0.01 0.01); value uniform (5 0 0); } outlet { type inletOutlet; inletValue uniform (0 0 0); value uniform (0 0 0); } side { type noSlip; } walls { type noSlip; } symmetry { type symmetry; } } // ************************************************************************* // ================================================ FILE: abruptContraction/interPhaseChangeFoam/0/alpha.water ================================================ /*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: 3.0.0 | | \\ / A nd | Web: www.OpenFOAM.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class volScalarField; location "0"; object alpha.water; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // dimensions [0 0 0 0 0]; internalField uniform 1; boundaryField { inlet { type fixedValue; value 1; } outlet { type inletOutlet; inletValue $internalField; } side { type zeroGradient; } walls { type zeroGradient; } symmetry { type symmetry; } } // ************************************************************************* // ================================================ FILE: abruptContraction/interPhaseChangeFoam/0/k ================================================ /*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: 4.1 | | \\ / A nd | Web: www.OpenFOAM.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class volScalarField; object k; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // dimensions [0 2 -2 0 0 0 0]; internalField uniform 0; boundaryField { inlet { type fixedValue; value uniform 2e-05; } outlet { type inletOutlet; inletValue uniform 0; value uniform 0; } side { type fixedValue; value uniform 0; } walls { type fixedValue; value uniform 0; } symmetry { type symmetry; value uniform 0; } } // ************************************************************************* // ================================================ FILE: abruptContraction/interPhaseChangeFoam/0/nuTilda ================================================ /*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: 4.1 | | \\ / A nd | Web: www.OpenFOAM.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class volScalarField; object nuTilda; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // dimensions [0 2 -1 0 0 0 0]; internalField uniform 0; boundaryField { inlet { type fixedValue; value uniform 0; } outlet { type inletOutlet; inletValue uniform 0; value uniform 0; } side { type fixedValue; value uniform 0; } walls { type fixedValue; value uniform 0; } symmetry { type fixedValue; value uniform 0; } } // ************************************************************************* // ================================================ FILE: abruptContraction/interPhaseChangeFoam/0/nut ================================================ /*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: 4.1 | | \\ / A nd | Web: www.OpenFOAM.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class volScalarField; object nut; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // dimensions [0 2 -1 0 0 0 0]; internalField uniform 0; boundaryField { inlet { type zeroGradient; } outlet { type zeroGradient; } side { type zeroGradient; } walls { type zeroGradient; } symmetry { type symmetry; } } // ************************************************************************* // ================================================ FILE: abruptContraction/interPhaseChangeFoam/0/p_rgh ================================================ /*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: 3.0.0 | | \\ / A nd | Web: www.OpenFOAM.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class volScalarField; location "0"; object p_rgh; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // dimensions [1 -1 -2 0 0]; internalField uniform 100952; boundaryField { inlet { type zeroGradient; } outlet { type fixedValue; value 72000; //experimental value } walls { type zeroGradient; } side { type zeroGradient; } symmetry { type symmetry; } } // ************************************************************************* // ================================================ FILE: abruptContraction/interPhaseChangeFoam/0/phi ================================================ /*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: 4.1 | | \\ / A nd | Web: www.OpenFOAM.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class surfaceScalarField; location "0"; object phi; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // dimensions [0 3 -1 0 0 0 0]; internalField uniform 0; boundaryField { inlet { type calculated; value uniform 0; } outlet { type calculated; value uniform 0; } side { type calculated; value uniform 0; } walls { type calculated; value uniform 0; } symmetry { type symmetry; value uniform 0; } } // ************************************************************************* // ================================================ FILE: abruptContraction/interPhaseChangeFoam/0/s ================================================ /*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: 4.1 | | \\ / A nd | Web: www.OpenFOAM.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class volScalarField; object s; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // dimensions [0 0 0 0 0 0 0]; internalField uniform 0; boundaryField { inlet { type fixedValue; value uniform 1; } outlet { type inletOutlet; inletValue uniform 0; value uniform 0; } side { type zeroGradient; } walls { type zeroGradient; } symmetry { type zeroGradient; } } // ************************************************************************* // ================================================ FILE: abruptContraction/interPhaseChangeFoam/Allclean ================================================ #!/bin/sh cd ${0%/*} || exit 1 # Run from this directory # Source tutorial clean functions . $WM_PROJECT_DIR/bin/tools/CleanFunctions # Remove copy of 0.org # rm -rf 0 cleanCase # ----------------------------------------------------------------- end-of-file ================================================ FILE: abruptContraction/interPhaseChangeFoam/Allmesh ================================================ #!/bin/sh cd ${0%/*} || exit 1 # Run from this directory # Source tutorial run functions . $WM_PROJECT_DIR/bin/tools/RunFunctions refineMeshByCellSet() { while [ $# -ge 1 ] do if [ ! -e log.refineMesh.$1 ] then echo "Creating cell set for primary zone - $1" topoSet -dict system/topoSetDict.$1 > log.topoSet.$1 2>&1 echo "Refining primary zone - $1" refineMesh -dict system/refineMeshDict.$1 -overwrite \ > log.refineMesh.$1 2>&1 fi shift done } runApplication blockMesh refineMeshByCellSet 1 refineWallLayer -overwrite '(walls)' 0.2 >> log.refineWallLayer.1 #------------------------------------------------------------------------------ ================================================ FILE: abruptContraction/interPhaseChangeFoam/Allrun ================================================ #!/bin/sh cd ${0%/*} || exit 1 # Run from this directory # Source tutorial run functions . $WM_PROJECT_DIR/bin/tools/RunFunctions # Generate the base block mesh and refine ./Allmesh # Run the solver in parallel runApplication `getApplication` # ----------------------------------------------------------------- end-of-file ================================================ FILE: abruptContraction/interPhaseChangeFoam/Allrun.parallel ================================================ #!/bin/sh cd ${0%/*} || exit 1 # Run from this directory # Source tutorial run functions . $WM_PROJECT_DIR/bin/tools/RunFunctions # Generate the base block mesh and refine ./Allrun.mesh # Decompose the mesh for parallel runApplication decomposePar # Run the solver in parallel runParallel `getApplication` # Reconstruct the decomposed mesh for postprocessing runApplication reconstructPar # ----------------------------------------------------------------- end-of-file ================================================ FILE: abruptContraction/interPhaseChangeFoam/constant/g ================================================ /*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: 3.0.0 | | \\ / A nd | Web: www.OpenFOAM.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class uniformDimensionedVectorField; location "constant"; object g; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // dimensions [0 1 -2 0 0 0 0]; value (0 0 -9.81); // ************************************************************************* // ================================================ FILE: abruptContraction/interPhaseChangeFoam/constant/transportProperties ================================================ /*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: 3.0.0 | | \\ / A nd | Web: www.OpenFOAM.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class dictionary; object transportProperties; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // phases (water vapour); phaseChangeTwoPhaseMixture SchnerrSauer; pSat [1 -1 -2 0 0 0 0] 2300; // Saturation pressure sigma [1 0 -2 0 0 0 0] 0.07; water { transportModel Newtonian; nu [0 2 -1 0 0 0 0] 9e-07; rho [1 -3 0 0 0 0 0] 1000; } vapour { transportModel Newtonian; nu [0 2 -1 0 0 0 0] 4.273e-04; rho [1 -3 0 0 0 0 0] 0.02308; } KunzCoeffs { UInf UInf [0 1 -1 0 0 0 0] 20.0; tInf tInf [0 0 1 0 0 0 0] 0.005; // L = 0.1 m Cc Cc [0 0 0 0 0 0 0] 1000; Cv Cv [0 0 0 0 0 0 0] 1000; } MerkleCoeffs { UInf UInf [0 1 -1 0 0 0 0] 20.0; tInf tInf [0 0 1 0 0 0 0] 0.005; // L = 0.1 m Cc Cc [0 0 0 0 0 0 0] 80; Cv Cv [0 0 0 0 0 0 0] 1e-03; } SchnerrSauerCoeffs { n n [0 -3 0 0 0 0 0] 1.6e+13; dNuc dNuc [0 1 0 0 0 0 0] 2.0e-07; Cc Cc [0 0 0 0 0 0 0] 1; Cv Cv [0 0 0 0 0 0 0] 1; } // ************************************************************************* // ================================================ FILE: abruptContraction/interPhaseChangeFoam/constant/turbulenceProperties ================================================ /*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: 4.1 | | \\ / A nd | Web: www.OpenFOAM.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class dictionary; location "constant"; object turbulenceProperties; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // simulationType LES; //simulationType laminar; LES { LESModel dynamicKEqn; turbulence on; printCoeffs on; delta cubeRootVol; dynamicKEqnCoeffs { filter simple; } cubeRootVolCoeffs { deltaCoeff 1; } PrandtlCoeffs { delta cubeRootVol; cubeRootVolCoeffs { deltaCoeff 1; } smoothCoeffs { delta cubeRootVol; cubeRootVolCoeffs { deltaCoeff 1; } maxDeltaRatio 1.1; } Cdelta 0.158; } vanDriestCoeffs { delta cubeRootVol; cubeRootVolCoeffs { deltaCoeff 1; } smoothCoeffs { delta cubeRootVol; cubeRootVolCoeffs { deltaCoeff 1; } maxDeltaRatio 1.1; } Aplus 26; Cdelta 0.158; } smoothCoeffs { delta cubeRootVol; cubeRootVolCoeffs { deltaCoeff 1; } maxDeltaRatio 1.1; } } // ************************************************************************* // ================================================ FILE: abruptContraction/interPhaseChangeFoam/system/blockMeshDict ================================================ /*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: 4.1 | | \\ / A nd | Web: www.OpenFOAM.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class dictionary; object blockMeshDict; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // convertToMeters 0.01; h1 18; //Height of the channel before contraction h2 9; //Height of the channel after contraction l1 40; //Length of the channel before contraction l2 40; //Length of the channel after contraction w1 18; //Width of the channel minX 0; minY -9; minZ 0; midX #calc "$minX+$l1"; midZ #calc "$minZ+$h2"; maxX #calc "$midX+$l2"; maxY #calc "$minY+$w1"; maxZ #calc "$minZ+$h1"; vertices ( ($minX $minY $minZ) //0 ($midX $minY $minZ) ($maxX $minY $minZ) //2 ($minX $minY $midZ) ($midX $minY $midZ) //4 ($maxX $minY $midZ) ($minX $minY $maxZ) //6 ($midX $minY $maxZ) ($minX $maxY $minZ) //8 ($midX $maxY $minZ) ($maxX $maxY $minZ) //10 ($minX $maxY $midZ) ($midX $maxY $midZ) //12 ($maxX $maxY $midZ) ($minX $maxY $maxZ) //14 ($midX $maxY $maxZ) ); blocks ( hex (0 1 9 8 3 4 12 11) (80 40 20) simpleGrading (0.5 1 0.5) hex (3 4 12 11 6 7 15 14) (80 40 20) simpleGrading (0.5 1 2) hex (1 2 10 9 4 5 13 12) (80 40 20) simpleGrading (2 1 0.5) ); edges ( ); boundary ( inlet { type patch; faces ( (0 3 11 8) (3 6 14 11) ); } outlet { type patch; faces ( (10 13 5 2) ); } side { type patch; faces ( (0 1 4 3) (1 2 5 4) (3 4 7 6) (11 12 9 8) (12 13 10 9) (14 15 12 11) ); } walls { type wall; faces ( (6 7 15 14) (4 12 15 7) (4 5 13 12) ); } symmetry { type symmetry; faces ( (0 8 9 1) (1 9 10 2) ); } ); // ************************************************************************* // ================================================ FILE: abruptContraction/interPhaseChangeFoam/system/controlDict ================================================ /*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: 3.0.0 | | \\ / A nd | Web: www.OpenFOAM.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class dictionary; object controlDict; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // application interPhaseChangeFoam; startFrom latestTime; startTime 0; stopAt endTime; endTime 1; deltaT 1e-5; writeControl adjustableRunTime; writeInterval 0.001; purgeWrite 1; writeFormat ascii; writePrecision 6; writeCompression uncompressed; timeFormat general; runTimeModifiable yes; adjustTimeStep on; maxCo 1; functions { #includeFunc "surfaces" #includeFunc "probes" fieldAverage1 { type fieldAverage; libs ("libfieldFunctionObjects.so"); writeControl writeTime; fields ( U { mean on; prime2Mean on; base time; } p_rgh { mean on; prime2Mean on; base time; } ); } } // ************************************************************************* // ================================================ FILE: abruptContraction/interPhaseChangeFoam/system/decomposeParDict ================================================ /*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: 4.1 | | \\ / A nd | Web: www.OpenFOAM.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class dictionary; note "mesh decomposition control dictionary"; object decomposeParDict; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // numberOfSubdomains 2; method simple; simpleCoeffs { n (1 2 1); delta 0.001; } // ************************************************************************* // ================================================ FILE: abruptContraction/interPhaseChangeFoam/system/fvSchemes ================================================ /*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: 3.0.0 | | \\ / A nd | Web: www.OpenFOAM.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class dictionary; object fvSchemes; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // ddtSchemes { default Euler; } interpolationSchemes { default linear; } divSchemes { default none; div(rhoPhi,U) Gauss linearUpwind grad(U); div(phi,omega) Gauss linearUpwind grad(omega); div(phi,k) Gauss linearUpwind grad(k); div(phi,alpha) Gauss vanLeer; div(phirb,alpha) Gauss linear; div(((rho*nuEff)*dev2(T(grad(U))))) Gauss linear; } gradSchemes { default Gauss linear; } laplacianSchemes { default Gauss linear limited corrected 0.5; } snGradSchemes { default limited corrected 0.5; } // ************************************************************************* // ================================================ FILE: abruptContraction/interPhaseChangeFoam/system/fvSolution ================================================ /*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: 3.0.0 | | \\ / A nd | Web: www.OpenFOAM.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class dictionary; object fvSolution; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // solvers { "alpha.water.*" { cAlpha 0; nAlphaCorr 2; nAlphaSubCycles 1; MULESCorr yes; nLimiterIter 5; solver smoothSolver; smoother symGaussSeidel; tolerance 1e-8; relTol 0; maxIter 10; }; "U.*" { solver smoothSolver; smoother symGaussSeidel; tolerance 1e-6; relTol 0; }; p_rgh { solver GAMG; tolerance 1e-8; relTol 0.1; smoother DICGaussSeidel; nPreSweeps 0; nPostSweeps 2; cacheAgglomeration true; nCellsInCoarsestLevel 10; agglomerator faceAreaPair; mergeLevels 1; maxIter 50; }; p_rghFinal { solver PCG; preconditioner { preconditioner GAMG; tolerance 1e-6; relTol 0; nVcycles 2; smoother DICGaussSeidel; nPreSweeps 0; nPostSweeps 2; nFinestSweeps 2; cacheAgglomeration true; nCellsInCoarsestLevel 10; agglomerator faceAreaPair; mergeLevels 1; }; tolerance 1e-7; relTol 0; maxIter 50; }; pcorr { $p_rgh; relTol 0; }; Phi { $p_rgh; relTol 0; }; "(U|k|B|nuTilda|s)" { solver smoothSolver; smoother GaussSeidel; tolerance 1e-05; relTol 0; }; "(U|k|nuTilda)Final" { $U; tolerance 1e-05; relTol 0; }; } potentialFlow { nNonOrthogonalCorrectors 3; } PIMPLE { momentumPredictor no; nOuterCorrectors 1; nCorrectors 3; nNonOrthogonalCorrectors 0; } relaxationFactors { equations { "U.*" 1; } } // ************************************************************************* // ================================================ FILE: abruptContraction/interPhaseChangeFoam/system/probes ================================================ /*--------------------------------*- C++ -*----------------------------------*\ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | \\ / A nd | Web: www.OpenFOAM.org \\/ M anipulation | ------------------------------------------------------------------------------- Description Writes out values of fields from cells nearest to specified locations. \*---------------------------------------------------------------------------*/ #includeEtc "caseDicts/postProcessing/probes/probes.cfg" fields (p); probeLocations ( (0.1 0 0.09) (0.15 0 0.09) (0.215 0 0) (0.245 0 0) (0.275 0 0) (0.375 0 0) (0.555 0 0) ); // ************************************************************************* // ================================================ FILE: abruptContraction/interPhaseChangeFoam/system/refineMeshDict.1 ================================================ /*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: 5 | | \\ / A nd | Web: www.OpenFOAM.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class dictionary; location "system"; object refineMeshDict; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // set c0; coordinateSystem global; globalCoeffs { tan1 (1 0 0); tan2 (0 0 1); } directions ( tan2 ); useHexTopology yes; geometricCut no; writeMesh no; // ************************************************************************* // ================================================ FILE: abruptContraction/interPhaseChangeFoam/system/refineMeshDict.2 ================================================ /*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: 5 | | \\ / A nd | Web: www.OpenFOAM.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class dictionary; location "system"; object refineMeshDict; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // set c0; coordinateSystem global; globalCoeffs { tan1 (1 0 0); tan2 (0 0 1); } directions ( tan2 ); useHexTopology yes; geometricCut no; writeMesh no; // ************************************************************************* // ================================================ FILE: abruptContraction/interPhaseChangeFoam/system/surfaces ================================================ /*--------------------------------*- C++ -*----------------------------------*\ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | \\ / A nd | Web: www.OpenFOAM.org \\/ M anipulation | ------------------------------------------------------------------------------- Description Writes out surface files with interpolated field data in VTK format, e.g. cutting planes, iso-surfaces and patch boundary surfaces. This file includes a selection of example surfaces, each of which the user should configure and/or remove. \*---------------------------------------------------------------------------*/ #includeEtc "caseDicts/postProcessing/visualization/surfaces.cfg" fields (p U alpha.water); surfaces ( yNormal { $cuttingPlane; pointAndNormalDict { normalVector $y; // Overrides default normalVector (1 0 0) } // $y: macro for (0 1 0) } waterSurface { $isosurface; isoField alpha.water; isoValue 0.50; } ); // ************************************************************************* // ================================================ FILE: abruptContraction/interPhaseChangeFoam/system/topoSetDict.1 ================================================ /*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: 5 | | \\ / A nd | Web: www.OpenFOAM.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class dictionary; location "system"; object topoSetDict; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // actions ( { name c0; type cellSet; action new; source boxToCell; sourceInfo { box (0.3 -0.09 0.01) (0.6 0.9 0.17); } } ); // ************************************************************************* // ================================================ FILE: abruptContraction/interPhaseChangeFoam/system/topoSetDict.2 ================================================ /*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: 5 | | \\ / A nd | Web: www.OpenFOAM.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class dictionary; location "system"; object topoSetDict; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // actions ( { name c0; type cellSet; action new; source boxToCell; sourceInfo { box (0.35 -0.09 0.01) (0.8 0.9 0.14); } } ); // ************************************************************************* // ================================================ FILE: abruptContraction/pimpleFoam/0/U ================================================ /*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: 4.1 | | \\ / A nd | Web: www.OpenFOAM.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class volVectorField; object U; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // dimensions [0 1 -1 0 0 0 0]; internalField uniform (0 0 0); boundaryField { inlet { type fixedValue; value uniform (5 0 0); } outlet { type zeroGradient; } side { type noSlip; } walls { type noSlip; } symmetry { type noSlip; } } // ************************************************************************* // ================================================ FILE: abruptContraction/pimpleFoam/0/epsilon ================================================ /*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: 4.1 | | \\ / A nd | Web: www.OpenFOAM.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class volScalarField; location "0"; object epsilon; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // dimensions [0 2 -3 0 0 0 0]; internalField uniform 14.855; boundaryField { inlet { type fixedValue; value uniform 14.855; } outlet { type zeroGradient; } side { type epsilonWallFunction; value uniform 14.855; } walls { type epsilonWallFunction; value uniform 14.855; } symmetry { type epsilonWallFunction; value uniform 14.855; } } // ************************************************************************* // ================================================ FILE: abruptContraction/pimpleFoam/0/k ================================================ /*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: 4.1 | | \\ / A nd | Web: www.OpenFOAM.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class volScalarField; location "0"; object k; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // dimensions [0 2 -2 0 0 0 0]; internalField uniform 0.375; boundaryField { inlet { type fixedValue; value uniform 0.375; } outlet { type zeroGradient; } side { type kqRWallFunction; value uniform 0.375; } walls { type kqRWallFunction; value uniform 0.375; } symmetry { type kqRWallFunction; value uniform 0.375; } } // ************************************************************************* // ================================================ FILE: abruptContraction/pimpleFoam/0/nuTilda ================================================ /*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: 4.1 | | \\ / A nd | Web: www.OpenFOAM.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class volScalarField; object nuTilda; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // dimensions [0 2 -1 0 0 0 0]; internalField uniform 0; boundaryField { inlet { type fixedValue; value uniform 0; } outlet { type zeroGradient; } side { type zeroGradient; } walls { type zeroGradient; } symmetry { type zeroGradient; } } // ************************************************************************* // ================================================ FILE: abruptContraction/pimpleFoam/0/nut ================================================ /*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: 4.1 | | \\ / A nd | Web: www.OpenFOAM.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class volScalarField; location "0"; object nut; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // dimensions [0 2 -1 0 0 0 0]; internalField uniform 0; boundaryField { inlet { type calculated; value uniform 0; } outlet { type calculated; value uniform 0; } side { type nutkWallFunction; value uniform 0; } walls { type nutkWallFunction; value uniform 0; } symmetry { type nutkWallFunction; value uniform 0; } } // ************************************************************************* // ================================================ FILE: abruptContraction/pimpleFoam/0/p ================================================ /*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: 4.1 | | \\ / A nd | Web: www.OpenFOAM.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class volScalarField; object p; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // dimensions [0 2 -2 0 0 0 0]; internalField uniform 0; boundaryField { inlet { type zeroGradient; } outlet { type fixedValue; value 72; } side { type zeroGradient; } walls { type zeroGradient; } symmetry { type zeroGradient; } } // ************************************************************************* // ================================================ FILE: abruptContraction/pimpleFoam/Allclean ================================================ #!/bin/sh cd ${0%/*} || exit 1 # Run from this directory # Source tutorial clean functions . $WM_PROJECT_DIR/bin/tools/CleanFunctions cleanCase # ----------------------------------------------------------------- end-of-file ================================================ FILE: abruptContraction/pimpleFoam/Allrun ================================================ #!/bin/sh cd ${0%/*} || exit 1 # Run from this directory # Source tutorial run functions . $WM_PROJECT_DIR/bin/tools/RunFunctions # Generate the base block mesh runApplication blockMesh # Run the solver runApplication `getApplication` # ----------------------------------------------------------------- end-of-file ================================================ FILE: abruptContraction/pimpleFoam/Allrun.parallel ================================================ #!/bin/sh cd ${0%/*} || exit 1 # Run from this directory # Source tutorial run functions . $WM_PROJECT_DIR/bin/tools/RunFunctions # Generate the base block mesh runApplication blockMesh # Decompose the mesh for parallel runApplication decomposePar # Run the solver in parallel runParallel `getApplication` # Reconstruct the decomposed mesh for postprocessing runApplication reconstructPar # ----------------------------------------------------------------- end-of-file ================================================ FILE: abruptContraction/pimpleFoam/constant/transportProperties ================================================ /*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: 4.1 | | \\ / A nd | Web: www.OpenFOAM.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class dictionary; location "constant"; object transportProperties; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // transportModel Newtonian; nu [0 2 -1 0 0 0 0] 9e-07; //rho [1 -3 0 0 0 0 0] 1000; // ************************************************************************* // ================================================ FILE: abruptContraction/pimpleFoam/constant/turbulenceProperties ================================================ /*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: 4.1 | | \\ / A nd | Web: www.OpenFOAM.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class dictionary; location "constant"; object turbulenceProperties; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // simulationType laminar; RAS { RASModel kEpsilon; turbulence off; printCoeffs off; } // ************************************************************************* // ================================================ FILE: abruptContraction/pimpleFoam/system/blockMeshDict ================================================ /*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: 4.1 | | \\ / A nd | Web: www.OpenFOAM.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class dictionary; object blockMeshDict; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // convertToMeters 0.01; h1 18; //Height of the channel before contraction h2 9; //Height of the channel after contraction l1 20; //Length of the channel before contraction l2 40; //Length of the channel after contraction w1 18; //Width of the channel minX 0; minY -9; minZ 0; midX #calc "$minX+$l1"; midZ #calc "$minZ+$h2"; maxX #calc "$midX+$l2"; maxY #calc "$minY+$w1"; maxZ #calc "$minZ+$h1"; vertices ( ($minX $minY $minZ) //0 ($midX $minY $minZ) ($maxX $minY $minZ) //2 ($minX $minY $midZ) ($midX $minY $midZ) //4 ($maxX $minY $midZ) ($minX $minY $maxZ) //6 ($midX $minY $maxZ) ($minX $maxY $minZ) //8 ($midX $maxY $minZ) ($maxX $maxY $minZ) //10 ($minX $maxY $midZ) ($midX $maxY $midZ) //12 ($maxX $maxY $midZ) ($minX $maxY $maxZ) //14 ($midX $maxY $maxZ) ); blocks ( hex (0 1 9 8 3 4 12 11) (75 40 60) simpleGrading (0.25 1 0.25) hex (3 4 12 11 6 7 15 14) (75 40 60) simpleGrading (0.25 1 4) hex (1 2 10 9 4 5 13 12) (200 40 60) simpleGrading (2 1 0.25) ); edges ( ); boundary ( inlet { type patch; faces ( (0 3 11 8) (3 6 14 11) ); } outlet { type patch; faces ( (10 13 5 2) ); } side { type wall; faces ( (0 1 4 3) (1 2 5 4) (3 4 7 6) (11 12 9 8) (12 13 10 9) (14 15 12 11) ); } walls { type wall; faces ( (6 7 15 14) (4 12 15 7) (4 5 13 12) ); } symmetry { type wall; faces ( (0 8 9 1) (1 9 10 2) ); } ); // ************************************************************************* // ================================================ FILE: abruptContraction/pimpleFoam/system/controlDict ================================================ /*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: 4.1 | | \\ / A nd | Web: www.OpenFOAM.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class dictionary; location "system"; object controlDict; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // application pimpleFoam; startFrom latestTime; startTime 0; stopAt endTime; endTime 0.1; deltaT 5e-6; writeControl runTime; writeInterval 0.01; purgeWrite 0; writeFormat ascii; writePrecision 6; writeCompression off; timeFormat general; timePrecision 6; runTimeModifiable yes; adjustTimeStep no; maxCo 5; functions { #includeFunc "probes" #includeFunc "surfaces" } // ************************************************************************* // ================================================ FILE: abruptContraction/pimpleFoam/system/decomposeParDict ================================================ /*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: 4.1 | | \\ / A nd | Web: www.OpenFOAM.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class dictionary; note "mesh decomposition control dictionary"; object decomposeParDict; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // numberOfSubdomains 2; method simple; simpleCoeffs { n (1 2 1); delta 0.001; } // ************************************************************************* // ================================================ FILE: abruptContraction/pimpleFoam/system/fvSchemes ================================================ /*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: 4.1 | | \\ / A nd | Web: www.OpenFOAM.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class dictionary; location "system"; object fvSchemes; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // ddtSchemes { default Euler; } gradSchemes { default Gauss linear; } divSchemes { default none; div(phi,U) bounded Gauss linearUpwind grad(U); div(phi,k) bounded Gauss upwind; div(phi,epsilon) bounded Gauss upwind; div(phi,R) bounded Gauss upwind; div(R) Gauss linear; div(phi,nuTilda) bounded Gauss upwind; div((nuEff*dev2(T(grad(U))))) Gauss linear; } laplacianSchemes { default Gauss linear corrected; } interpolationSchemes { default linear; } snGradSchemes { default corrected; } // ************************************************************************* // ================================================ FILE: abruptContraction/pimpleFoam/system/fvSolution ================================================ /*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: 4.1 | | \\ / A nd | Web: www.OpenFOAM.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class dictionary; location "system"; object fvSolution; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // solvers { p { solver GAMG; tolerance 1e-7; relTol 0.01; smoother DICGaussSeidel; } pFinal { $p; relTol 0; } "(U|k|epsilon)" { solver smoothSolver; smoother symGaussSeidel; tolerance 1e-05; relTol 0.1; } "(U|k|epsilon)Final" { $U; relTol 0; } } PIMPLE { nNonOrthogonalCorrectors 0; nCorrectors 2; } // ************************************************************************* // ================================================ FILE: abruptContraction/pimpleFoam/system/probes ================================================ /*--------------------------------*- C++ -*----------------------------------*\ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | \\ / A nd | Web: www.OpenFOAM.org \\/ M anipulation | ------------------------------------------------------------------------------- Description Writes out values of fields from cells nearest to specified locations. \*---------------------------------------------------------------------------*/ #includeEtc "caseDicts/postProcessing/probes/probes.cfg" fields (p); probeLocations ( (0.1 0 0.09) (0.15 0 0.09) (0.215 0 0) (0.245 0 0) (0.275 0 0) (0.375 0 0) (0.555 0 0) ); // ************************************************************************* // ================================================ FILE: abruptContraction/pimpleFoam/system/surfaces ================================================ /*--------------------------------*- C++ -*----------------------------------*\ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | \\ / A nd | Web: www.OpenFOAM.org \\/ M anipulation | ------------------------------------------------------------------------------- Description Writes out surface files with interpolated field data in VTK format, e.g. cutting planes, iso-surfaces and patch boundary surfaces. This file includes a selection of example surfaces, each of which the user should configure and/or remove. \*---------------------------------------------------------------------------*/ #includeEtc "caseDicts/postProcessing/visualization/surfaces.cfg" fields (p U); surfaces ( yNormal { $cuttingPlane; pointAndNormalDict { normalVector $y; // Overrides default normalVector (1 0 0) } // $y: macro for (0 1 0) } ); // ************************************************************************* // ================================================ FILE: abruptContraction/pisoFoam/0/U ================================================ /*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: 4.1 | | \\ / A nd | Web: www.OpenFOAM.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class volVectorField; object U; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // dimensions [0 1 -1 0 0 0 0]; internalField uniform (0 0 0); boundaryField { inlet { type turbulentInlet; referenceField uniform (5 0 0); fluctuationScale (0.02 0.01 0.01); value uniform (5 0 0); } outlet { type inletOutlet; inletValue uniform (0 0 0); value uniform (0 0 0); } side { type noSlip; } walls { type noSlip; } symmetry { type noSlip; } } // ************************************************************************* // ================================================ FILE: abruptContraction/pisoFoam/0/k ================================================ /*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: 4.1 | | \\ / A nd | Web: www.OpenFOAM.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class volScalarField; object k; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // dimensions [0 2 -2 0 0 0 0]; internalField uniform 0; boundaryField { inlet { type fixedValue; value uniform 2e-05; } outlet { type inletOutlet; inletValue uniform 0; value uniform 0; } side { type fixedValue; value uniform 0; } walls { type fixedValue; value uniform 0; } symmetry { type fixedValue; value uniform 0; } } // ************************************************************************* // ================================================ FILE: abruptContraction/pisoFoam/0/nuTilda ================================================ /*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: 4.1 | | \\ / A nd | Web: www.OpenFOAM.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class volScalarField; object nuTilda; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // dimensions [0 2 -1 0 0 0 0]; internalField uniform 0; boundaryField { inlet { type fixedValue; value uniform 0; } outlet { type inletOutlet; inletValue uniform 0; value uniform 0; } side { type fixedValue; value uniform 0; } walls { type fixedValue; value uniform 0; } symmetry { type fixedValue; value uniform 0; } } // ************************************************************************* // ================================================ FILE: abruptContraction/pisoFoam/0/nut ================================================ /*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: 4.1 | | \\ / A nd | Web: www.OpenFOAM.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class volScalarField; object nut; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // dimensions [0 2 -1 0 0 0 0]; internalField uniform 0; boundaryField { inlet { type zeroGradient; } outlet { type zeroGradient; } side { type zeroGradient; } walls { type zeroGradient; } symmetry { type zeroGradient; } } // ************************************************************************* // ================================================ FILE: abruptContraction/pisoFoam/0/p ================================================ /*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: 4.1 | | \\ / A nd | Web: www.OpenFOAM.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class volScalarField; object p; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // dimensions [0 2 -2 0 0 0 0]; internalField uniform 0; boundaryField { inlet { type zeroGradient; } outlet { type fixedValue; value uniform 72; } walls { type zeroGradient; } side { type zeroGradient; } symmetry { type zeroGradient; } } // ************************************************************************* // ================================================ FILE: abruptContraction/pisoFoam/0/s ================================================ /*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: 4.1 | | \\ / A nd | Web: www.OpenFOAM.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class volScalarField; object s; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // dimensions [0 0 0 0 0 0 0]; internalField uniform 0; boundaryField { inlet { type fixedValue; value uniform 1; } outlet { type inletOutlet; inletValue uniform 0; value uniform 0; } side { type zeroGradient; } walls { type zeroGradient; } symmetry { type zeroGradient; } } // ************************************************************************* // ================================================ FILE: abruptContraction/pisoFoam/Allclean ================================================ #!/bin/sh cd ${0%/*} || exit 1 # Run from this directory # Source tutorial clean functions . $WM_PROJECT_DIR/bin/tools/CleanFunctions cleanCase # ----------------------------------------------------------------- end-of-file ================================================ FILE: abruptContraction/pisoFoam/Allrun ================================================ #!/bin/sh cd ${0%/*} || exit 1 # Run from this directory # Source tutorial run functions . $WM_PROJECT_DIR/bin/tools/RunFunctions # Generate the base block mesh runApplication blockMesh # Run the solver runApplication `getApplication` # ----------------------------------------------------------------- end-of-file ================================================ FILE: abruptContraction/pisoFoam/Allrun.parallel ================================================ #!/bin/sh cd ${0%/*} || exit 1 # Run from this directory # Source tutorial run functions . $WM_PROJECT_DIR/bin/tools/RunFunctions # Generate the base block mesh runApplication blockMesh # Decompose the mesh for parallel runApplication decomposePar # Run the solver in parallel runParallel `getApplication` # Reconstruct the decomposed mesh for postprocessing runApplication reconstructPar # ----------------------------------------------------------------- end-of-file ================================================ FILE: abruptContraction/pisoFoam/constant/transportProperties ================================================ /*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: 4.1 | | \\ / A nd | Web: www.OpenFOAM.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class dictionary; location "constant"; object transportProperties; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // transportModel Newtonian; nu [0 2 -1 0 0 0 0] 9e-07; // ************************************************************************* // ================================================ FILE: abruptContraction/pisoFoam/constant/turbulenceProperties ================================================ /*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: 4.1 | | \\ / A nd | Web: www.OpenFOAM.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class dictionary; location "constant"; object turbulenceProperties; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // simulationType LES; LES { LESModel dynamicKEqn; turbulence on; printCoeffs on; delta cubeRootVol; dynamicKEqnCoeffs { filter simple; } cubeRootVolCoeffs { deltaCoeff 1; } PrandtlCoeffs { delta cubeRootVol; cubeRootVolCoeffs { deltaCoeff 1; } smoothCoeffs { delta cubeRootVol; cubeRootVolCoeffs { deltaCoeff 1; } maxDeltaRatio 1.1; } Cdelta 0.158; } vanDriestCoeffs { delta cubeRootVol; cubeRootVolCoeffs { deltaCoeff 1; } smoothCoeffs { delta cubeRootVol; cubeRootVolCoeffs { deltaCoeff 1; } maxDeltaRatio 1.1; } Aplus 26; Cdelta 0.158; } smoothCoeffs { delta cubeRootVol; cubeRootVolCoeffs { deltaCoeff 1; } maxDeltaRatio 1.1; } } // ************************************************************************* // ================================================ FILE: abruptContraction/pisoFoam/system/blockMeshDict ================================================ /*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: 4.1 | | \\ / A nd | Web: www.OpenFOAM.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class dictionary; object blockMeshDict; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // convertToMeters 0.01; h1 18; //Height of the channel before contraction h2 9; //Height of the channel after contraction l1 20; //Length of the channel before contraction l2 40; //Length of the channel after contraction w1 18; //Width of the channel minX 0; minY -9; minZ 0; midX #calc "$minX+$l1"; midZ #calc "$minZ+$h2"; maxX #calc "$midX+$l2"; maxY #calc "$minY+$w1"; maxZ #calc "$minZ+$h1"; vertices ( ($minX $minY $minZ) //0 ($midX $minY $minZ) ($maxX $minY $minZ) //2 ($minX $minY $midZ) ($midX $minY $midZ) //4 ($maxX $minY $midZ) ($minX $minY $maxZ) //6 ($midX $minY $maxZ) ($minX $maxY $minZ) //8 ($midX $maxY $minZ) ($maxX $maxY $minZ) //10 ($minX $maxY $midZ) ($midX $maxY $midZ) //12 ($maxX $maxY $midZ) ($minX $maxY $maxZ) //14 ($midX $maxY $maxZ) ); blocks ( hex (0 1 9 8 3 4 12 11) (75 40 60) simpleGrading (0.25 1 0.25) hex (3 4 12 11 6 7 15 14) (75 40 60) simpleGrading (0.25 1 4) hex (1 2 10 9 4 5 13 12) (200 40 60) simpleGrading (2 1 0.25) ); edges ( ); boundary ( inlet { type patch; faces ( (0 3 11 8) (3 6 14 11) ); } outlet { type patch; faces ( (10 13 5 2) ); } side { type wall; faces ( (0 1 4 3) (1 2 5 4) (3 4 7 6) (11 12 9 8) (12 13 10 9) (14 15 12 11) ); } walls { type wall; faces ( (6 7 15 14) (4 12 15 7) (4 5 13 12) ); } symmetry { type wall; faces ( (0 8 9 1) (1 9 10 2) ); } ); // ************************************************************************* // ================================================ FILE: abruptContraction/pisoFoam/system/controlDict ================================================ /*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: 4.1 | | \\ / A nd | Web: www.OpenFOAM.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class dictionary; location "system"; object controlDict; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // application pisoFoam; startFrom latestTime; startTime 0; stopAt endTime; endTime 0.1; deltaT 1e-05; writeControl runTime; writeInterval 0.01; purgeWrite 0; writeFormat ascii; writePrecision 6; writeCompression off; timeFormat general; timePrecision 6; runTimeModifiable true; functions { #includeFunc "surfaces" #includeFunc "probes" } // ************************************************************************* // ================================================ FILE: abruptContraction/pisoFoam/system/decomposeParDict ================================================ /*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: 4.1 | | \\ / A nd | Web: www.OpenFOAM.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class dictionary; note "mesh decomposition control dictionary"; object decomposeParDict; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // numberOfSubdomains 2; method simple; simpleCoeffs { n (1 2 1); delta 0.001; } // ************************************************************************* // ================================================ FILE: abruptContraction/pisoFoam/system/fvSchemes ================================================ /*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: 4.1 | | \\ / A nd | Web: www.OpenFOAM.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class dictionary; location "system"; object fvSchemes; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // ddtSchemes { default backward; } gradSchemes { default Gauss linear; } divSchemes { default none; div(phi,U) Gauss LUST grad(U); div(phi,k) Gauss limitedLinear 1; div(phi,s) bounded Gauss limitedLinear 1; div((nuEff*dev2(T(grad(U))))) Gauss linear; } laplacianSchemes { default Gauss linear corrected; } interpolationSchemes { default linear; } snGradSchemes { default corrected; } // ************************************************************************* // ================================================ FILE: abruptContraction/pisoFoam/system/fvSolution ================================================ /*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: 4.1 | | \\ / A nd | Web: www.OpenFOAM.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class dictionary; location "system"; object fvSolution; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // solvers { p { solver GAMG; tolerance 1e-06; relTol 0.1; smoother GaussSeidel; } pFinal { $p; smoother DICGaussSeidel; tolerance 1e-06; relTol 0; } "(U|k|B|nuTilda|s)" { solver smoothSolver; smoother GaussSeidel; tolerance 1e-05; relTol 0; } } PISO { nCorrectors 2; nNonOrthogonalCorrectors 0; } // ************************************************************************* // ================================================ FILE: abruptContraction/pisoFoam/system/probes ================================================ /*--------------------------------*- C++ -*----------------------------------*\ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | \\ / A nd | Web: www.OpenFOAM.org \\/ M anipulation | ------------------------------------------------------------------------------- Description Writes out values of fields from cells nearest to specified locations. \*---------------------------------------------------------------------------*/ #includeEtc "caseDicts/postProcessing/probes/probes.cfg" fields (p); probeLocations ( (0.1 0 0.09) (0.15 0 0.09) (0.215 0 0) (0.245 0 0) (0.275 0 0) (0.375 0 0) (0.555 0 0) ); // ************************************************************************* // ================================================ FILE: abruptContraction/pisoFoam/system/surfaces ================================================ /*--------------------------------*- C++ -*----------------------------------*\ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | \\ / A nd | Web: www.OpenFOAM.org \\/ M anipulation | ------------------------------------------------------------------------------- Description Writes out surface files with interpolated field data in VTK format, e.g. cutting planes, iso-surfaces and patch boundary surfaces. This file includes a selection of example surfaces, each of which the user should configure and/or remove. \*---------------------------------------------------------------------------*/ #includeEtc "caseDicts/postProcessing/visualization/surfaces.cfg" fields (p U); surfaces ( yNormal { $cuttingPlane; pointAndNormalDict { normalVector $y; // Overrides default normalVector (1 0 0) } // $y: macro for (0 1 0) } ); // ************************************************************************* // ================================================ FILE: abruptContraction/simpleFoam/0/U ================================================ /*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: 4.1 | | \\ / A nd | Web: www.OpenFOAM.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class volVectorField; location "0"; object U; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // dimensions [0 1 -1 0 0 0 0]; internalField uniform (0 0 0); boundaryField { inlet { type fixedValue; value uniform (5 0 0); } outlet { type zeroGradient; } side { type noSlip; } walls { type noSlip; } symmetry { type symmetry; } } // ************************************************************************* // ================================================ FILE: abruptContraction/simpleFoam/0/epsilon ================================================ /*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: 5 | | \\ / A nd | Web: www.OpenFOAM.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class volScalarField; location "0"; object epsilon; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // dimensions [0 2 -3 0 0 0 0]; internalField uniform 14.855; boundaryField { inlet { type fixedValue; value uniform 14.855; } outlet { type zeroGradient; } walls { type epsilonWallFunction; value uniform 14.855; } side { type epsilonWallFunction; value uniform 14.855; } symmetry { type symmetry; } } // ************************************************************************* // ================================================ FILE: abruptContraction/simpleFoam/0/k ================================================ /*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: 4.1 | | \\ / A nd | Web: www.OpenFOAM.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class volScalarField; object k; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // dimensions [0 2 -2 0 0 0 0]; internalField uniform 0; boundaryField { inlet { type fixedValue; value uniform 2e-05; } outlet { type inletOutlet; inletValue uniform 0; value uniform 0; } side { type fixedValue; value uniform 0; } walls { type fixedValue; value uniform 0; } symmetry { type symmetry; } } // ************************************************************************* // ================================================ FILE: abruptContraction/simpleFoam/0/nut ================================================ /*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: 4.1 | | \\ / A nd | Web: www.OpenFOAM.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class volScalarField; object nut; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // dimensions [0 2 -1 0 0 0 0]; internalField uniform 0; boundaryField { inlet { type zeroGradient; } outlet { type zeroGradient; } side { type zeroGradient; } walls { type zeroGradient; } symmetry { type symmetry; } } // ************************************************************************* // ================================================ FILE: abruptContraction/simpleFoam/0/p ================================================ /*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: 3.0.0 | | \\ / A nd | Web: www.OpenFOAM.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class volScalarField; location "0"; object p_rgh; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // dimensions [0 2 -2 0 0]; internalField uniform 72; boundaryField { inlet { type zeroGradient; } outlet { type fixedValue; value uniform 72; //experimental value } walls { type zeroGradient; } side { type zeroGradient; } symmetry { type symmetry; } } // ************************************************************************* // ================================================ FILE: abruptContraction/simpleFoam/Allclean ================================================ #!/bin/sh cd ${0%/*} || exit 1 # Run from this directory # Source tutorial clean functions . $WM_PROJECT_DIR/bin/tools/CleanFunctions # Remove copy of 0.org # rm -rf 0 cleanCase # ----------------------------------------------------------------- end-of-file ================================================ FILE: abruptContraction/simpleFoam/Allrun ================================================ #!/bin/sh cd ${0%/*} || exit 1 # Run from this directory # Source tutorial run functions . $WM_PROJECT_DIR/bin/tools/RunFunctions # Generate the base block mesh and refine runApplication blockMesh # Run the solver in parallel runApplication `getApplication` # ----------------------------------------------------------------- end-of-file ================================================ FILE: abruptContraction/simpleFoam/constant/transportProperties ================================================ /*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: 4.1 | | \\ / A nd | Web: www.OpenFOAM.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class dictionary; location "constant"; object transportProperties; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // transportModel Newtonian; nu [0 2 -1 0 0 0 0] 9e-07; // ************************************************************************* // ================================================ FILE: abruptContraction/simpleFoam/constant/turbulenceProperties ================================================ /*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: 5 | | \\ / A nd | Web: www.OpenFOAM.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class dictionary; location "constant"; object turbulenceProperties; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // simulationType RAS; RAS { RASModel kEpsilon; turbulence on; printCoeffs on; } // ************************************************************************* // ================================================ FILE: abruptContraction/simpleFoam/system/blockMeshDict ================================================ /*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: 4.1 | | \\ / A nd | Web: www.OpenFOAM.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class dictionary; object blockMeshDict; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // convertToMeters 0.01; h1 18; //Height of the channel before contraction h2 9; //Height of the channel after contraction l1 40; //Length of the channel before contraction l2 40; //Length of the channel after contraction w1 18; //Width of the channel minX 0; minY -9; minZ 0; midX #calc "$minX+$l1"; midZ #calc "$minZ+$h2"; maxX #calc "$midX+$l2"; maxY #calc "$minY+$w1"; maxZ #calc "$minZ+$h1"; vertices ( ($minX $minY $minZ) //0 ($midX $minY $minZ) ($maxX $minY $minZ) //2 ($minX $minY $midZ) ($midX $minY $midZ) //4 ($maxX $minY $midZ) ($minX $minY $maxZ) //6 ($midX $minY $maxZ) ($minX $maxY $minZ) //8 ($midX $maxY $minZ) ($maxX $maxY $minZ) //10 ($minX $maxY $midZ) ($midX $maxY $midZ) //12 ($maxX $maxY $midZ) ($minX $maxY $maxZ) //14 ($midX $maxY $maxZ) ); blocks ( hex (0 1 9 8 3 4 12 11) (40 20 10) simpleGrading (0.5 1 0.5) hex (3 4 12 11 6 7 15 14) (40 20 10) simpleGrading (0.5 1 2) hex (1 2 10 9 4 5 13 12) (40 20 10) simpleGrading (2 1 0.5) ); edges ( ); boundary ( inlet { type patch; faces ( (0 3 11 8) (3 6 14 11) ); } outlet { type patch; faces ( (10 13 5 2) ); } side { type wall; faces ( (0 1 4 3) (1 2 5 4) (3 4 7 6) (11 12 9 8) (12 13 10 9) (14 15 12 11) ); } walls { type wall; faces ( (6 7 15 14) (4 12 15 7) (4 5 13 12) ); } symmetry { type symmetry; faces ( (0 8 9 1) (1 9 10 2) ); } ); // ************************************************************************* // ================================================ FILE: abruptContraction/simpleFoam/system/controlDict ================================================ /*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: 5 | | \\ / A nd | Web: www.OpenFOAM.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class dictionary; location "system"; object controlDict; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // application simpleFoam; startFrom startTime; startTime 0; stopAt endTime; endTime 2000; deltaT 1; writeControl timeStep; writeInterval 100; purgeWrite 1; writeFormat ascii; writePrecision 6; writeCompression off; timeFormat general; timePrecision 6; runTimeModifiable true; // ************************************************************************* // ================================================ FILE: abruptContraction/simpleFoam/system/fvSchemes ================================================ /*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: 5 | | \\ / A nd | Web: www.OpenFOAM.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class dictionary; location "system"; object fvSchemes; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // ddtSchemes { default steadyState; } gradSchemes { default Gauss linear; } divSchemes { default none; div(phi,U) bounded Gauss linearUpwind grad(U); div(phi,k) bounded Gauss limitedLinear 1; div(phi,epsilon) bounded Gauss limitedLinear 1; div(phi,omega) bounded Gauss limitedLinear 1; div(phi,v2) bounded Gauss limitedLinear 1; div((nuEff*dev2(T(grad(U))))) Gauss linear; div(nonlinearStress) Gauss linear; } laplacianSchemes { default Gauss linear corrected; } interpolationSchemes { default linear; } snGradSchemes { default corrected; } wallDist { method meshWave; } // ************************************************************************* // ================================================ FILE: abruptContraction/simpleFoam/system/fvSolution ================================================ /*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: 5 | | \\ / A nd | Web: www.OpenFOAM.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class dictionary; location "system"; object fvSolution; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // solvers { p { solver GAMG; tolerance 1e-06; relTol 0.1; smoother GaussSeidel; } "(U|k|epsilon|omega|f|v2)" { solver smoothSolver; smoother symGaussSeidel; tolerance 1e-05; relTol 0.1; } } SIMPLE { nNonOrthogonalCorrectors 0; consistent yes; residualControl { p 1e-2; U 1e-3; "(k|epsilon|omega|f|v2)" 1e-3; } } relaxationFactors { equations { U 0.1; // 0.9 is more stable but 0.95 more convergent ".*" 0.1; // 0.9 is more stable but 0.95 more convergent } } // ************************************************************************* // ================================================ FILE: cavitatingBullet/0/U ================================================ /*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: 5 | | \\ / A nd | Web: www.OpenFOAM.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class volVectorField; location "0"; object U; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // dimensions [0 1 -1 0 0]; internalField uniform (0 0 20); boundaryField { inlet { type fixedValue; value $internalField; } outlet { type pressureInletOutletVelocity; value $internalField; } walls { type symmetry; } bullet { type noSlip; } } // ************************************************************************* // ================================================ FILE: cavitatingBullet/0/alpha.water ================================================ /*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: 5 | | \\ / A nd | Web: www.OpenFOAM.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class volScalarField; location "0"; object alpha.water; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // dimensions [0 0 0 0 0]; internalField uniform 1; boundaryField { inlet { type fixedValue; value $internalField; } outlet { type inletOutlet; inletValue $internalField; } walls { type symmetry; } bullet { type zeroGradient; } } // ************************************************************************* // ================================================ FILE: cavitatingBullet/0/p_rgh ================================================ /*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: 5 | | \\ / A nd | Web: www.OpenFOAM.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class volScalarField; location "0"; object p_rgh; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // dimensions [1 -1 -2 0 0]; internalField uniform 100000; boundaryField { inlet { type zeroGradient; } outlet { type fixedValue; value $internalField; } walls { type symmetry; } bullet { type fixedFluxPressure; } } // ************************************************************************* // ================================================ FILE: cavitatingBullet/Allclean ================================================ #!/bin/sh cd ${0%/*} || exit 1 # Run from this directory # Source tutorial clean functions . $WM_PROJECT_DIR/bin/tools/CleanFunctions # Remove surface rm -f constant/triSurface/bullet.stl.gz cleanCase #------------------------------------------------------------------------------ ================================================ FILE: cavitatingBullet/Allrun ================================================ #!/bin/sh cd ${0%/*} || exit 1 # Run from this directory # Source tutorial run functions . $WM_PROJECT_DIR/bin/tools/RunFunctions # Copy bullet surface from resources directory cp $FOAM_TUTORIALS/resources/geometry/bullet.stl.gz constant/triSurface/ # Generate the base block mesh runApplication blockMesh # Generate the snappy mesh runApplication snappyHexMesh -overwrite # Run the solver runApplication `getApplication` #------------------------------------------------------------------------------ ================================================ FILE: cavitatingBullet/constant/g ================================================ /*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: 5 | | \\ / A nd | Web: www.OpenFOAM.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class uniformDimensionedVectorField; location "constant"; object g; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // dimensions [0 1 -2 0 0 0 0]; value (0 -9.81 0); // ************************************************************************* // ================================================ FILE: cavitatingBullet/constant/transportProperties ================================================ /*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: 5 | | \\ / A nd | Web: www.OpenFOAM.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class dictionary; object transportProperties; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // phases (water vapour); phaseChangeTwoPhaseMixture SchnerrSauer; pSat 2300; // Saturation pressure sigma 0.07; water { transportModel Newtonian; nu 9e-07; rho 1000; } vapour { transportModel Newtonian; nu 4.273e-04; rho 0.02308; } KunzCoeffs { UInf U20.0; tInf t0.005; // L = 0.1 m Cc C1000; Cv C1000; } MerkleCoeffs { UInf 20.0; tInf 0.005; // L = 0.1 m Cc 80; Cv 1e-03; } SchnerrSauerCoeffs { n 1.6e+13; dNuc 2.0e-06; Cc 1; Cv 1; } // ************************************************************************* // ================================================ FILE: cavitatingBullet/constant/triSurface/README ================================================ Directory to house tri-surfaces The Allrun script copies the surface from the $FOAM_TUTORIALS/resources/geometry directory ================================================ FILE: cavitatingBullet/constant/turbulenceProperties ================================================ /*--------------------------------*- C++ -*----------------------------------* \ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: 5 | | \\ / A nd | Web: www.OpenFOAM.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class dictionary; object turbulenceProperties; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // simulationType laminar; // ************************************************************************* // ================================================ FILE: cavitatingBullet/system/blockMeshDict ================================================ /*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: 5 | | \\ / A nd | Web: www.OpenFOAM.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class dictionary; object blockMeshDict; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // convertToMeters 1e-3; vertices ( (-15 -15 -15) (15 -15 -15) (15 15 -15) (-15 15 -15) (-15 -15 100) (15 -15 100) (15 15 100) (-15 15 100) ); blocks ( hex (0 1 2 3 4 5 6 7) (15 15 50) simpleGrading (1 1 1) ); boundary ( inlet { type patch; faces ( (0 3 2 1) ); } outlet { type patch; faces ( (4 5 6 7) ); } walls { type symmetry; faces ( (0 4 7 3) (2 6 5 1) (1 5 4 0) (3 7 6 2) ); } ); // ************************************************************************* // ================================================ FILE: cavitatingBullet/system/controlDict ================================================ /*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: 5 | | \\ / A nd | Web: www.OpenFOAM.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class dictionary; object controlDict; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // application interPhaseChangeFoam; startFrom latestTime; startTime 0; stopAt endTime; endTime 0.05; deltaT 1e-8; writeControl adjustableRunTime; writeInterval 0.001; purgeWrite 0; writeFormat ascii; writePrecision 6; writeCompression uncompressed; timeFormat general; runTimeModifiable yes; adjustTimeStep on; maxCo 5; // ************************************************************************* // ================================================ FILE: cavitatingBullet/system/decomposeParDict ================================================ /*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: 5 | | \\ / A nd | Web: www.OpenFOAM.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class dictionary; location "system"; object decomposeParDict; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // numberOfSubdomains 4; method simple; simpleCoeffs { n (2 2 1); delta 0.001; } hierarchicalCoeffs { n (1 1 1); delta 0.001; order xyz; } manualCoeffs { dataFile ""; } distributed no; roots ( ); // ************************************************************************* // ================================================ FILE: cavitatingBullet/system/fvSchemes ================================================ /*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: 5 | | \\ / A nd | Web: www.OpenFOAM.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class dictionary; object fvSchemes; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // ddtSchemes { default Euler; } interpolationSchemes { default linear; } divSchemes { default none; div(rhoPhi,U) Gauss linearUpwind grad(U); div(phi,omega) Gauss linearUpwind grad(omega); div(phi,k) Gauss linearUpwind grad(k); div(phi,alpha) Gauss vanLeer; div(phirb,alpha) Gauss linear; div(((rho*nuEff)*dev2(T(grad(U))))) Gauss linear; } gradSchemes { default Gauss linear; } laplacianSchemes { default Gauss linear limited corrected 0.5; } snGradSchemes { default limited corrected 0.5; } // ************************************************************************* // ================================================ FILE: cavitatingBullet/system/fvSolution ================================================ /*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: 5 | | \\ / A nd | Web: www.OpenFOAM.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class dictionary; object fvSolution; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // solvers { "alpha.water.*" { cAlpha 0; nAlphaCorr 2; nAlphaSubCycles 1; MULESCorr yes; nLimiterIter 5; solver smoothSolver; smoother symGaussSeidel; tolerance 1e-8; relTol 0; maxIter 10; }; "U.*" { solver smoothSolver; smoother symGaussSeidel; tolerance 1e-6; relTol 0; }; p_rgh { solver GAMG; tolerance 1e-8; relTol 0.1; smoother DICGaussSeidel; maxIter 50; }; p_rghFinal { solver PCG; preconditioner { preconditioner GAMG; tolerance 1e-6; relTol 0; nVcycles 2; smoother DICGaussSeidel; }; tolerance 1e-7; relTol 0; maxIter 50; }; "pcorr.*" { $p_rgh; relTol 0; }; Phi { $p_rgh; relTol 0; }; } potentialFlow { nNonOrthogonalCorrectors 3; } PIMPLE { momentumPredictor no; nOuterCorrectors 1; nCorrectors 3; nNonOrthogonalCorrectors 0; } relaxationFactors { equations { "U.*" 1; } } // ************************************************************************* // ================================================ FILE: cavitatingBullet/system/snappyHexMeshDict ================================================ /*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: 5 | | \\ / A nd | Web: www.OpenFOAM.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class dictionary; object snappyHexMeshDict; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // Which of the steps to run castellatedMesh true; snap true; addLayers true; // Geometry. Definition of all surfaces. All surfaces are of class // searchableSurface. // Surfaces are used // - to specify refinement for any mesh cell intersecting it // - to specify refinement for any mesh cell inside/outside/near // - to 'snap' the mesh boundary to the surface geometry { bullet { type triSurfaceMesh; file "bullet.stl"; regions { bullet { name bullet; } } } refinement1 { type searchableSphere; centre (0 0 0.0025); radius 0.0075; } refinement2 { type searchableCylinder; point1 (0 0 0); point2 (0 0 0.03); radius 0.0075; } }; // Settings for the castellatedMesh generation. castellatedMeshControls { // Refinement parameters // ~~~~~~~~~~~~~~~~~~~~~ // If local number of cells is >= maxLocalCells on any processor // switches from from refinement followed by balancing // (current method) to (weighted) balancing before refinement. maxLocalCells 100000; // Overall cell limit (approximately). Refinement will stop immediately // upon reaching this number so a refinement level might not complete. // Note that this is the number of cells before removing the part which // is not 'visible' from the keepPoint. The final number of cells might // actually be a lot less. maxGlobalCells 2000000; // The surface refinement loop might spend lots of iterations refining just a // few cells. This setting will cause refinement to stop if <= minimumRefine // are selected for refinement. Note: it will at least do one iteration // (unless the number of cells to refine is 0) minRefinementCells 10; // Number of buffer layers between different levels. // 1 means normal 2:1 refinement restriction, larger means slower // refinement. nCellsBetweenLevels 2; // Explicit feature edge refinement // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // Specifies a level for any cell intersected by its edges. // This is a featureEdgeMesh, read from constant/triSurface for now. features ( //{ // file "someLine.eMesh"; // level 2; //} ); // Surface based refinement // ~~~~~~~~~~~~~~~~~~~~~~~~ // Specifies two levels for every surface. The first is the minimum level, // every cell intersecting a surface gets refined up to the minimum level. // The second level is the maximum level. Cells that 'see' multiple // intersections where the intersections make an // angle > resolveFeatureAngle get refined up to the maximum level. refinementSurfaces { bullet { // Surface-wise min and max refinement level level (4 4); } } // Resolve sharp angles resolveFeatureAngle -1; // Region-wise refinement // ~~~~~~~~~~~~~~~~~~~~~~ // Specifies refinement level for cells in relation to a surface. One of // three modes // - distance. 'levels' specifies per distance to the surface the // wanted refinement level. The distances need to be specified in // descending order. // - inside. 'levels' is only one entry and only the level is used. All // cells inside the surface get refined up to the level. The surface // needs to be closed for this to be possible. // - outside. Same but cells outside. refinementRegions { refinement1 { mode inside; levels ((0.0 3)); } refinement2 { mode inside; levels ((0.0 3)); } } // Mesh selection // ~~~~~~~~~~~~~~ // After refinement patches get added for all refinementSurfaces and // all cells intersecting the surfaces get put into these patches. The // section reachable from the locationInMesh is kept. // NOTE: This point should never be on a face, always inside a cell, even // after refinement. locationInMesh (0 0 -10e-3); allowFreeStandingZoneFaces false; } // Settings for the snapping. snapControls { //- Number of patch smoothing iterations before finding correspondence // to surface nSmoothPatch 3; //- Relative distance for points to be attracted by surface feature point // or edge. True distance is this factor times local // maximum edge length. tolerance 4.0; //- Number of mesh displacement relaxation iterations. nSolveIter 30; //- Maximum number of snapping relaxation iterations. Should stop // before upon reaching a correct mesh. nRelaxIter 5; } // Settings for the layer addition. addLayersControls { // Are the thickness parameters below relative to the undistorted // size of the refined cell outside layer (true) or absolute sizes (false). relativeSizes true; // Per final patch (so not geometry!) the layer information layers { } // Expansion factor for layer mesh expansionRatio 1.0; // Wanted thickness of final added cell layer. If multiple layers // is the thickness of the layer furthest away from the wall. // Relative to undistorted size of cell outside layer. // See relativeSizes parameter. finalLayerThickness 0.3; // Minimum thickness of cell layer. If for any reason layer // cannot be above minThickness do not add layer. // Relative to undistorted size of cell outside layer. minThickness 0.1; // If points get not extruded do nGrow layers of connected faces that are // also not grown. This helps convergence of the layer addition process // close to features. // Note: changed(corrected) w.r.t 17x! (didn't do anything in 17x) nGrow 0; // Advanced settings // When not to extrude surface. 0 is flat surface, 90 is when two faces // are perpendicular featureAngle 30; // Maximum number of snapping relaxation iterations. Should stop // before upon reaching a correct mesh. nRelaxIter 3; // Number of smoothing iterations of surface normals nSmoothSurfaceNormals 1; // Number of smoothing iterations of interior mesh movement direction nSmoothNormals 3; // Smooth layer thickness over surface patches nSmoothThickness 10; // Stop layer growth on highly warped cells maxFaceThicknessRatio 0.5; // Reduce layer growth where ratio thickness to medial // distance is large maxThicknessToMedialRatio 0.3; // Angle used to pick up medial axis points // Note: changed(corrected) w.r.t 17x! 90 degrees corresponds to 130 in 17x. minMedianAxisAngle 90; // Create buffer region for new layer terminations nBufferCellsNoExtrude 0; // Overall max number of layer addition iterations. The mesher will exit // if it reaches this number of iterations; possibly with an illegal // mesh. nLayerIter 50; // Max number of iterations after which relaxed meshQuality controls // get used. Up to nRelaxIter it uses the settings in meshQualityControls, // after nRelaxIter it uses the values in meshQualityControls::relaxed. nRelaxedIter 20; } // Generic mesh quality settings. At any undoable phase these determine // where to undo. meshQualityControls { //- Maximum non-orthogonality allowed. Set to 180 to disable. maxNonOrtho 65; //- Max skewness allowed. Set to <0 to disable. maxBoundarySkewness 20; maxInternalSkewness 4; //- Max concaveness allowed. Is angle (in degrees) below which concavity // is allowed. 0 is straight face, <0 would be convex face. // Set to 180 to disable. maxConcave 80; //- Minimum pyramid volume. Is absolute volume of cell pyramid. // Set to very negative number (e.g. -1E30) to disable. minVol 1e-20; //- Minimum quality of the tet formed by the face-centre // and variable base point minimum decomposition triangles and // the cell centre. Set to very negative number (e.g. -1E30) to // disable. // <0 = inside out tet, // 0 = flat tet // 1 = regular tet minTetQuality 1e-30; //- Minimum face area. Set to <0 to disable. minArea -1; //- Minimum face twist. Set to <-1 to disable. dot product of face normal // and face centre triangles normal minTwist 0.02; //- Minimum normalised cell determinant // 1 = hex, <= 0 = folded or flattened illegal cell minDeterminant 0.001; //- minFaceWeight (0 -> 0.5) minFaceWeight 0.02; //- minVolRatio (0 -> 1) minVolRatio 0.01; //must be >0 for Fluent compatibility minTriangleTwist -1; // Advanced //- Number of error distribution iterations nSmoothScale 4; //- Amount to scale back displacement at error points errorReduction 0.75; } // Advanced // Merge tolerance. Is fraction of overall bounding box of initial mesh. // Note: the write tolerance needs to be higher than this. mergeTolerance 1e-6; // ************************************************************************* // ================================================ FILE: fishChannel/0/alpha.water.orig ================================================ /*--------------------------------*- C++ -*----------------------------------*\ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org \\ / A nd | Version: 7 \\/ M anipulation | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class volScalarField; object alpha.water; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // dimensions [0 0 0 0 0 0 0]; internalField uniform 0; boundaryField { inlet { type fixedValue; value uniform 1; } walls { type zeroGradient; } "baffle.*" { type zeroGradient; } outlet { type zeroGradient; value uniform 0; } outlet2 { type zeroGradient; value uniform 0; } atmosphere { type inletOutlet; inletValue uniform 0; value uniform 0; } } // ************************************************************************* // ================================================ FILE: fishChannel/0/epsilon ================================================ /*--------------------------------*- C++ -*----------------------------------*\ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org \\ / A nd | Version: 7 \\/ M anipulation | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format binary; class volScalarField; location "0"; object epsilon; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // dimensions [0 2 -3 0 0 0 0]; internalField uniform 0.001; boundaryField { inlet { type turbulentMixingLengthDissipationRateInlet; mixingLength 0.001; value uniform 0; } walls { type epsilonWallFunction; value uniform 0; } outlet { type zeroGradient; } atmosphere { type zeroGradient; } outlet2 { type zeroGradient; } baffle1 { type epsilonWallFunction; value uniform 0; } baffle2 { type epsilonWallFunction; value uniform 0; } baffle3 { type epsilonWallFunction; value uniform 0; } baffle4 { type epsilonWallFunction; value uniform 0; } baffle5 { type epsilonWallFunction; value uniform 0; } baffle6 { type epsilonWallFunction; value uniform 0; } baffle7 { type epsilonWallFunction; value uniform 0; } baffle8 { type epsilonWallFunction; value uniform 0; } baffle9 { type epsilonWallFunction; value uniform 0; } baffle10 { type epsilonWallFunction; value uniform 0; } baffle11 { type epsilonWallFunction; value uniform 0; } baffle12 { type epsilonWallFunction; value uniform 0; } baffle13 { type epsilonWallFunction; value uniform 0; } baffle14 { type epsilonWallFunction; value uniform 0; } baffle15 { type epsilonWallFunction; value uniform 0; } baffle16 { type epsilonWallFunction; value uniform 0; } baffle17 { type epsilonWallFunction; value uniform 0; } baffle18 { type epsilonWallFunction; value uniform 0; } baffle19 { type epsilonWallFunction; value uniform 0; } baffle20 { type epsilonWallFunction; value uniform 0; } baffle21 { type epsilonWallFunction; value uniform 0; } baffle22 { type epsilonWallFunction; value uniform 0; } baffle23 { type epsilonWallFunction; value uniform 0; } baffle24 { type epsilonWallFunction; value uniform 0; } baffle25 { type epsilonWallFunction; value uniform 0; } } // ************************************************************************* // ================================================ FILE: fishChannel/0/k ================================================ /*--------------------------------*- C++ -*----------------------------------*\ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org \\ / A nd | Version: 7 \\/ M anipulation | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format binary; class volScalarField; location "0"; object k; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // dimensions [0 2 -2 0 0 0 0]; internalField uniform 0.0001; boundaryField { inlet { type fixedValue; value uniform 0.0001; } walls { type kqRWallFunction; value uniform 0.0001; } outlet { type inletOutlet; inletValue uniform 0.0001; value uniform 0.0001; } atmosphere { type inletOutlet; inletValue uniform 0.0001; value uniform 0.0001; } outlet2 { type inletOutlet; inletValue uniform 0.0001; value uniform 0.0001; } baffle1 { type inletOutlet; inletValue uniform 0.0001; value uniform 0.0001; } baffle2 { type inletOutlet; inletValue uniform 0.0001; value uniform 0.0001; } baffle3 { type inletOutlet; inletValue uniform 0.0001; value uniform 0.0001; } baffle4 { type inletOutlet; inletValue uniform 0.0001; value uniform 0.0001; } baffle5 { type inletOutlet; inletValue uniform 0.0001; value uniform 0.0001; } baffle6 { type inletOutlet; inletValue uniform 0.0001; value uniform 0.0001; } baffle7 { type inletOutlet; inletValue uniform 0.0001; value uniform 0.0001; } baffle8 { type inletOutlet; inletValue uniform 0.0001; value uniform 0.0001; } baffle9 { type inletOutlet; inletValue uniform 0.0001; value uniform 0.0001; } baffle10 { type inletOutlet; inletValue uniform 0.0001; value uniform 0.0001; } baffle11 { type inletOutlet; inletValue uniform 0.0001; value uniform 0.0001; } baffle12 { type inletOutlet; inletValue uniform 0.0001; value uniform 0.0001; } baffle13 { type inletOutlet; inletValue uniform 0.0001; value uniform 0.0001; } baffle14 { type inletOutlet; inletValue uniform 0.0001; value uniform 0.0001; } baffle15 { type inletOutlet; inletValue uniform 0.0001; value uniform 0.0001; } baffle16 { type inletOutlet; inletValue uniform 0.0001; value uniform 0.0001; } baffle17 { type inletOutlet; inletValue uniform 0.0001; value uniform 0.0001; } baffle18 { type inletOutlet; inletValue uniform 0.0001; value uniform 0.0001; } baffle19 { type inletOutlet; inletValue uniform 0.0001; value uniform 0.0001; } baffle20 { type inletOutlet; inletValue uniform 0.0001; value uniform 0.0001; } baffle21 { type inletOutlet; inletValue uniform 0.0001; value uniform 0.0001; } baffle22 { type inletOutlet; inletValue uniform 0.0001; value uniform 0.0001; } baffle23 { type inletOutlet; inletValue uniform 0.0001; value uniform 0.0001; } baffle24 { type inletOutlet; inletValue uniform 0.0001; value uniform 0.0001; } baffle25 { type inletOutlet; inletValue uniform 0.0001; value uniform 0.0001; } } // ************************************************************************* // ================================================ FILE: fishChannel/0/nut ================================================ /*--------------------------------*- C++ -*----------------------------------*\ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org \\ / A nd | Version: 7 \\/ M anipulation | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format binary; class volScalarField; location "0"; object nut; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // dimensions [0 2 -1 0 0 0 0]; internalField uniform 0; boundaryField { inlet { type calculated; value uniform 0; } walls { type nutLowReWallFunction; value uniform 0; } outlet { type calculated; value uniform 0; } atmosphere { type calculated; value uniform 0; } outlet2 { type calculated; value uniform 0; } baffle1 { type calculated; value uniform 0; } baffle2 { type calculated; value uniform 0; } baffle3 { type calculated; value uniform 0; } baffle4 { type calculated; value uniform 0; } baffle5 { type calculated; value uniform 0; } baffle6 { type calculated; value uniform 0; } baffle7 { type calculated; value uniform 0; } baffle8 { type calculated; value uniform 0; } baffle9 { type calculated; value uniform 0; } baffle10 { type calculated; value uniform 0; } baffle11 { type calculated; value uniform 0; } baffle12 { type calculated; value uniform 0; } baffle13 { type calculated; value uniform 0; } baffle14 { type calculated; value uniform 0; } baffle15 { type calculated; value uniform 0; } baffle16 { type calculated; value uniform 0; } baffle17 { type calculated; value uniform 0; } baffle18 { type calculated; value uniform 0; } baffle19 { type calculated; value uniform 0; } baffle20 { type calculated; value uniform 0; } baffle21 { type calculated; value uniform 0; } baffle22 { type calculated; value uniform 0; } baffle23 { type calculated; value uniform 0; } baffle24 { type calculated; value uniform 0; } baffle25 { type calculated; value uniform 0; } } // ************************************************************************* // ================================================ FILE: fishChannel/0/omega ================================================ /*--------------------------------*- C++ -*----------------------------------*\ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org \\ / A nd | Version: 7 \\/ M anipulation | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format binary; class volScalarField; location "0"; object omega; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // dimensions [0 0 -1 0 0 0 0]; internalField uniform 0.003; boundaryField { inlet { type fixedValue; value uniform 0.003; } walls { type omegaWallFunction; value uniform 0.003; } outlet { type inletOutlet; inletValue uniform 0.003; value uniform 0.003; } atmosphere { type inletOutlet; inletValue uniform 0.003; value uniform 0.003; } outlet2 { type inletOutlet; inletValue uniform 0.003; value uniform 0.003; } baffle1 { type inletOutlet; inletValue uniform 0.003; value uniform 0.003; } baffle2 { type inletOutlet; inletValue uniform 0.003; value uniform 0.003; } baffle3 { type inletOutlet; inletValue uniform 0.003; value uniform 0.003; } baffle4 { type inletOutlet; inletValue uniform 0.003; value uniform 0.003; } baffle5 { type inletOutlet; inletValue uniform 0.003; value uniform 0.003; } baffle6 { type inletOutlet; inletValue uniform 0.003; value uniform 0.003; } baffle7 { type inletOutlet; inletValue uniform 0.003; value uniform 0.003; } baffle8 { type inletOutlet; inletValue uniform 0.003; value uniform 0.003; } baffle9 { type inletOutlet; inletValue uniform 0.003; value uniform 0.003; } baffle10 { type inletOutlet; inletValue uniform 0.003; value uniform 0.003; } baffle11 { type inletOutlet; inletValue uniform 0.003; value uniform 0.003; } baffle12 { type inletOutlet; inletValue uniform 0.003; value uniform 0.003; } baffle13 { type inletOutlet; inletValue uniform 0.003; value uniform 0.003; } baffle14 { type inletOutlet; inletValue uniform 0.003; value uniform 0.003; } baffle15 { type inletOutlet; inletValue uniform 0.003; value uniform 0.003; } baffle16 { type inletOutlet; inletValue uniform 0.003; value uniform 0.003; } baffle17 { type inletOutlet; inletValue uniform 0.003; value uniform 0.003; } baffle18 { type inletOutlet; inletValue uniform 0.003; value uniform 0.003; } baffle19 { type inletOutlet; inletValue uniform 0.003; value uniform 0.003; } baffle20 { type inletOutlet; inletValue uniform 0.003; value uniform 0.003; } baffle21 { type inletOutlet; inletValue uniform 0.003; value uniform 0.003; } baffle22 { type inletOutlet; inletValue uniform 0.003; value uniform 0.003; } baffle23 { type inletOutlet; inletValue uniform 0.003; value uniform 0.003; } baffle24 { type inletOutlet; inletValue uniform 0.003; value uniform 0.003; } baffle25 { type inletOutlet; inletValue uniform 0.003; value uniform 0.003; } } // ************************************************************************* // ================================================ FILE: fishChannel/0/p_rgh ================================================ /*--------------------------------*- C++ -*----------------------------------*\ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org \\ / A nd | Version: 7 \\/ M anipulation | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format binary; class volScalarField; location "0"; object p_rgh; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // dimensions [1 -1 -2 0 0 0 0]; internalField uniform 0; boundaryField { inlet { type fixedFluxPressure; gradient uniform 0; value uniform 0; } walls { type fixedFluxPressure; gradient uniform 0; value uniform 0; } outlet { type fixedFluxPressure; gradient uniform 0; value uniform 0; } atmosphere { type totalPressure; rho rho; psi none; gamma 1; p0 uniform 0; value uniform 0; } outlet2 { type fixedFluxPressure; gradient uniform 0; value uniform 0; } baffle1 { type fixedFluxPressure; gradient uniform 0; value uniform 0; } baffle2 { type fixedFluxPressure; gradient uniform 0; value uniform 0; } baffle3 { type fixedFluxPressure; gradient uniform 0; value uniform 0; } baffle4 { type fixedFluxPressure; gradient uniform 0; value uniform 0; } baffle5 { type fixedFluxPressure; gradient uniform 0; value uniform 0; } baffle6 { type fixedFluxPressure; gradient uniform 0; value uniform 0; } baffle7 { type fixedFluxPressure; gradient uniform 0; value uniform 0; } baffle8 { type fixedFluxPressure; gradient uniform 0; value uniform 0; } baffle9 { type fixedFluxPressure; gradient uniform 0; value uniform 0; } baffle10 { type fixedFluxPressure; gradient uniform 0; value uniform 0; } baffle11 { type fixedFluxPressure; gradient uniform 0; value uniform 0; } baffle12 { type fixedFluxPressure; gradient uniform 0; value uniform 0; } baffle13 { type fixedFluxPressure; gradient uniform 0; value uniform 0; } baffle14 { type fixedFluxPressure; gradient uniform 0; value uniform 0; } baffle15 { type fixedFluxPressure; gradient uniform 0; value uniform 0; } baffle16 { type fixedFluxPressure; gradient uniform 0; value uniform 0; } baffle17 { type fixedFluxPressure; gradient uniform 0; value uniform 0; } baffle18 { type fixedFluxPressure; gradient uniform 0; value uniform 0; } baffle19 { type fixedFluxPressure; gradient uniform 0; value uniform 0; } baffle20 { type fixedFluxPressure; gradient uniform 0; value uniform 0; } baffle21 { type fixedFluxPressure; gradient uniform 0; value uniform 0; } baffle22 { type fixedFluxPressure; gradient uniform 0; value uniform 0; } baffle23 { type fixedFluxPressure; gradient uniform 0; value uniform 0; } baffle24 { type fixedFluxPressure; gradient uniform 0; value uniform 0; } baffle25 { type fixedFluxPressure; gradient uniform 0; value uniform 0; } } // ************************************************************************* // ================================================ FILE: fishChannel/Allclean ================================================ #!/bin/sh cd ${0%/*} || exit 1 # Run from this directory # Source tutorial clean functions . $WM_PROJECT_DIR/bin/tools/CleanFunctions # rm 0/alpha.water.gz 0/alpha.water 2>/dev/null # rm -rf *Flux cleanCase ================================================ FILE: fishChannel/Allmesh ================================================ #!/bin/sh cd ${0%/*} || exit 1 # run from this directory # Source tutorial run functions . $WM_PROJECT_DIR/bin/tools/RunFunctions runApplication blockMesh # Refine Mesh Near Outlet Section i=1 while [ "$i" -lt 3 ] ; do # refine each baffle echo "Refine outlet section mesh." ${i} cp system/topoSetDict.section${i} system/topoSetDict cp system/refineMeshDict.section${i} system/refineMeshDict runApplication topoSet runApplication refineMesh -overwrite mv log.topoSet log.topoSet.section${i} mv log.refineMesh log.refineMesh.section${i} i=$((i + 1)) done # Create Outlet2 cp system/topoSetDict.outlet2 system/topoSetDict runApplication topoSet runApplication createPatch -overwrite mv log.topoSet log.topoSet.outlet2 # Clean up rm system/topoSetDict # Create Baffles runApplication createBaffles -overwrite # Refine Boundary Layer Mesh runApplication refineWallLayer -overwrite "(walls)" 0.3 mv log.refineWallLayer log.refineWallLayer.walls i=1 while [ "$i" -lt 26 ] ; do # refine each baffle echo "Refine baffle mesh." ${i} refineWallLayer -overwrite "(baffle${i})" 0.3 >> log.refineWallLayer.baffle${i} refineWallLayer -overwrite "(baffle${i})" 0.3 >> log.refineWallLayer.baffle${i} i=$((i + 1)) done # Renumber Mesh runApplication renumberMesh -overwrite #------------------------------------------------------------------------------ ================================================ FILE: fishChannel/Allrun ================================================ #!/bin/sh cd ${0%/*} || exit 1 # Run from this directory # Source tutorial run functions . $WM_PROJECT_DIR/bin/tools/RunFunctions application=$(getApplication) ./Allmesh runApplication setFields runApplication $application #------------------------------------------------------------------------------ ================================================ FILE: fishChannel/constant/g ================================================ /*--------------------------------*- C++ -*----------------------------------*\ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org \\ / A nd | Version: 7 \\/ M anipulation | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class uniformDimensionedVectorField; location "constant"; object g; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // dimensions [0 1 -2 0 0 0 0]; value (0 0 -9.81); // ************************************************************************* // ================================================ FILE: fishChannel/constant/transportProperties ================================================ /*--------------------------------*- C++ -*----------------------------------*\ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org \\ / A nd | Version: 7 \\/ M anipulation | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class dictionary; location "constant"; object transportProperties; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // phases (water air); water { transportModel Newtonian; nu 1e-06; rho 1000; } air { transportModel Newtonian; nu 1.48e-05; rho 1; } sigma 0.07; // ************************************************************************* // ================================================ FILE: fishChannel/constant/turbulenceProperties ================================================ /*--------------------------------*- C++ -*----------------------------------*\ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org \\ / A nd | Version: 7 \\/ M anipulation | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class dictionary; location "constant"; object turbulenceProperties; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // simulationType RAS; RAS { RASModel kOmegaSST; // RASModel RNGkEpsilon; turbulence on; printCoeffs on; } // ************************************************************************* // ================================================ FILE: fishChannel/showCase.pvsm ================================================ ================================================ FILE: fishChannel/system/blockMeshDict ================================================ /*--------------------------------*- C++ -*----------------------------------*\ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org \\ / A nd | Version: 7 \\/ M anipulation | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class dictionary; object blockMeshDict; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // convertToMeters 1; upstreamBottomElevation 372.8; downstreamBottomElevation 372.2; length 121; height 2; width 1; upstreamMiddleElevation #calc "$upstreamBottomElevation+$height/2"; downstreamMiddleElevation #calc "$downstreamBottomElevation+$height/2"; upstreamTopElevation #calc "$upstreamBottomElevation+$height"; downstreamTopElevation #calc "$downstreamBottomElevation+$height"; leftSideWall #calc "$width"; rightSideWall 0; vertices ( (0 $leftSideWall $upstreamBottomElevation) // 0 (0 $leftSideWall $upstreamMiddleElevation) // 1 (0 $leftSideWall $upstreamTopElevation) //2 (0 $rightSideWall $upstreamBottomElevation) // 3 (0 $rightSideWall $upstreamMiddleElevation) // 4 (0 $rightSideWall $upstreamTopElevation) // 5 (1 $leftSideWall $upstreamBottomElevation) // 6 (1 $leftSideWall $upstreamMiddleElevation) // 7 (1 $leftSideWall $upstreamTopElevation) // 8 (1 $rightSideWall $upstreamBottomElevation) // 9 (1 $rightSideWall $upstreamMiddleElevation) // 10 (1 $rightSideWall $upstreamTopElevation) // 11 ($length $leftSideWall $downstreamBottomElevation) // 12 ($length $leftSideWall $downstreamMiddleElevation) // 13 ($length $leftSideWall $downstreamTopElevation) // 14 ($length $rightSideWall $downstreamBottomElevation) // 15 ($length $rightSideWall $downstreamMiddleElevation) // 16 ($length $rightSideWall $downstreamTopElevation) // 17 ); blocks ( // x = 0 ~ 1 m hex (3 9 6 0 4 10 7 1) (5 10 20) simpleGrading (1 1 1) hex (4 10 7 1 5 11 8 2) (5 10 20) simpleGrading (1 1 1) // x = 1 ~ 120 m hex (9 15 12 6 10 16 13 7) (600 10 20) simpleGrading (1 1 1) hex (10 16 13 7 11 17 14 8) (600 10 20) simpleGrading (1 1 1) ); edges ( ); boundary ( inlet { type patch; faces ( (0 1 7 6) ); } walls { type wall; faces ( // bottom (6 9 3 0) (12 15 9 6) // right side wall (3 9 10 4) (4 10 11 5) (9 15 16 10) (10 16 17 11) // left side wall (2 8 7 1) (7 13 12 6) (8 14 13 7) // upper wall (0 3 4 1) (1 4 5 2) ); } outlet { type patch; faces ( (12 13 16 15) (13 14 17 16) ); } atmosphere { type patch; faces ( (2 5 11 8) (8 11 17 14) ); } ); // ************************************************************************* // ================================================ FILE: fishChannel/system/controlDict ================================================ /*--------------------------------*- C++ -*----------------------------------*\ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org \\ / A nd | Version: 7 \\/ M anipulation | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class dictionary; location "system"; object controlDict; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // application interFoam; startFrom latestTime; startTime 0; stopAt endTime; endTime 200; deltaT 0.001; writeControl adjustableRunTime; writeInterval 10; purgeWrite 0; writeFormat binary; writePrecision 6; writeCompression off; timeFormat general; timePrecision 6; runTimeModifiable yes; adjustTimeStep no; maxCo 1; maxAlphaCo 1; maxDeltaT 0.1; functions { inletFlux { type surfaceFieldValue; libs ("libfieldFunctionObjects.so"); writeControl timeStep; log true; // Output field values as well writeFields false; regionType patch; name inlet; operation sum; fields ( rhoPhi ); } outletFlux { $inletFlux; name outlet; } outlet2Flux { $inletFlux; name outlet2; } atmosphereFlux { $inletFlux; name atmosphere; } } // ************************************************************************* // ================================================ FILE: fishChannel/system/createBafflesDict ================================================ /*--------------------------------*- C++ -*----------------------------------*\ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org \\ / A nd | Version: 7 \\/ M anipulation | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class dictionary; object createBafflesDict; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // Whether to convert internal faces only (so leave boundary faces intact). // This is only relevant if your face selection type can pick up boundary // faces. internalFacesOnly true; fields false; // Baffles to create. baffles { baffle1g { //- Select faces and orientation through a searchableSurface type searchableSurface; surface searchablePlate; origin (5 0.3 372.2); span (0 0.7 3); patches { master { //- Master side patch name baffle1; type wall; } slave { //- Slave side patch ${..master} } } } baffle2g { //- Select faces and orientation through a searchableSurface type searchableSurface; surface searchablePlate; origin (10 0 372.2); span (0 0.7 3); patches { master { //- Master side patch name baffle2; type wall; } slave { //- Slave side patch ${..master} } } } baffle3g { //- Select faces and orientation through a searchableSurface type searchableSurface; surface searchablePlate; origin (15 0.3 372.2); span (0 0.7 3); patches { master { //- Master side patch name baffle3; type wall; } slave { //- Slave side patch ${..master} } } } baffle4g { //- Select faces and orientation through a searchableSurface type searchableSurface; surface searchablePlate; origin (20 0 372.2); span (0 0.7 3); patches { master { //- Master side patch name baffle4; type wall; } slave { //- Slave side patch ${..master} } } } baffle5g { //- Select faces and orientation through a searchableSurface type searchableSurface; surface searchablePlate; origin (25 0.3 372.2); span (0 0.7 3); patches { master { //- Master side patch name baffle5; type wall; } slave { //- Slave side patch ${..master} } } } baffle6g { //- Select faces and orientation through a searchableSurface type searchableSurface; surface searchablePlate; origin (30 0 372.2); span (0 0.7 3); patches { master { //- Master side patch name baffle6; type wall; } slave { //- Slave side patch ${..master} } } } baffle7g { //- Select faces and orientation through a searchableSurface type searchableSurface; surface searchablePlate; origin (35 0.3 372.2); span (0 0.7 3); patches { master { //- Master side patch name baffle7; type wall; } slave { //- Slave side patch ${..master} } } } baffle8g { //- Select faces and orientation through a searchableSurface type searchableSurface; surface searchablePlate; origin (40 0 372.2); span (0 0.7 3); patches { master { //- Master side patch name baffle8; type wall; } slave { //- Slave side patch ${..master} } } } baffle9g { //- Select faces and orientation through a searchableSurface type searchableSurface; surface searchablePlate; origin (45 0.3 372.2); span (0 0.7 3); patches { master { //- Master side patch name baffle9; type wall; } slave { //- Slave side patch ${..master} } } } baffle10g { //- Select faces and orientation through a searchableSurface type searchableSurface; surface searchablePlate; origin (50 0 372.2); span (0 0.7 3); patches { master { //- Master side patch name baffle10; type wall; } slave { //- Slave side patch ${..master} } } } baffle11g { //- Select faces and orientation through a searchableSurface type searchableSurface; surface searchablePlate; origin (55 0.3 372.2); span (0 0.7 3); patches { master { //- Master side patch name baffle11; type wall; } slave { //- Slave side patch ${..master} } } } baffle12g { //- Select faces and orientation through a searchableSurface type searchableSurface; surface searchablePlate; origin (60 0 372.2); span (0 0.7 3); patches { master { //- Master side patch name baffle12; type wall; } slave { //- Slave side patch ${..master} } } } baffle13g { //- Select faces and orientation through a searchableSurface type searchableSurface; surface searchablePlate; origin (65 0.3 372.2); span (0 0.7 3); patches { master { //- Master side patch name baffle13; type wall; } slave { //- Slave side patch ${..master} } } } baffle14g { //- Select faces and orientation through a searchableSurface type searchableSurface; surface searchablePlate; origin (70 0 372.2); span (0 0.7 3); patches { master { //- Master side patch name baffle14; type wall; } slave { //- Slave side patch ${..master} } } } baffle15g { //- Select faces and orientation through a searchableSurface type searchableSurface; surface searchablePlate; origin (75 0.3 372.2); span (0 0.7 3); patches { master { //- Master side patch name baffle15; type wall; } slave { //- Slave side patch ${..master} } } } baffle16g { //- Select faces and orientation through a searchableSurface type searchableSurface; surface searchablePlate; origin (80 0 372.2); span (0 0.7 3); patches { master { //- Master side patch name baffle16; type wall; } slave { //- Slave side patch ${..master} } } } baffle17g { //- Select faces and orientation through a searchableSurface type searchableSurface; surface searchablePlate; origin (85 0.3 372.2); span (0 0.7 3); patches { master { //- Master side patch name baffle17; type wall; } slave { //- Slave side patch ${..master} } } } baffle18g { //- Select faces and orientation through a searchableSurface type searchableSurface; surface searchablePlate; origin (90 0 372.2); span (0 0.7 3); patches { master { //- Master side patch name baffle18; type wall; } slave { //- Slave side patch ${..master} } } } baffle19g { //- Select faces and orientation through a searchableSurface type searchableSurface; surface searchablePlate; origin (95 0.3 372.2); span (0 0.7 3); patches { master { //- Master side patch name baffle19; type wall; } slave { //- Slave side patch ${..master} } } } baffle20g { //- Select faces and orientation through a searchableSurface type searchableSurface; surface searchablePlate; origin (100 0 372.2); span (0 0.7 3); patches { master { //- Master side patch name baffle20; type wall; } slave { //- Slave side patch ${..master} } } } baffle21g { //- Select faces and orientation through a searchableSurface type searchableSurface; surface searchablePlate; origin (105 0.3 372.2); span (0 0.7 3); patches { master { //- Master side patch name baffle21; type wall; } slave { //- Slave side patch ${..master} } } } baffle22g { //- Select faces and orientation through a searchableSurface type searchableSurface; surface searchablePlate; origin (110 0 372.2); span (0 0.7 3); patches { master { //- Master side patch name baffle22; type wall; } slave { //- Slave side patch ${..master} } } } baffle23g { //- Select faces and orientation through a searchableSurface type searchableSurface; surface searchablePlate; origin (115 0.3 372.2); span (0 0.7 3); patches { master { //- Master side patch name baffle23; type wall; } slave { //- Slave side patch ${..master} } } } baffle24g { //- Select faces and orientation through a searchableSurface type searchableSurface; surface searchablePlate; origin (120 0 372.2); span (0 0.35 3); patches { master { //- Master side patch name baffle24; type wall; } slave { //- Slave side patch ${..master} } } } baffle25g { //- Select faces and orientation through a searchableSurface type searchableSurface; surface searchablePlate; origin (120 0.65 372.2); span (0 0.35 3); patches { master { //- Master side patch name baffle25; type wall; } slave { //- Slave side patch ${..master} } } } } // ************************************************************************* // ================================================ FILE: fishChannel/system/createPatchDict ================================================ /*--------------------------------*- C++ -*----------------------------------*\ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org \\ / A nd | Version: 7 \\/ M anipulation | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class dictionary; object createPatchDict; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // pointSync false; patches ( { name outlet2; patchInfo { type patch; } constructFrom set; set outlet2; } ); // ************************************************************************* // ================================================ FILE: fishChannel/system/decomposeParDict ================================================ /*--------------------------------*- C++ -*----------------------------------*\ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org \\ / A nd | Version: 7 \\/ M anipulation | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class dictionary; object decomposeParDict; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // numberOfSubdomains 4; /* Main methods are: 1) Geometric: "simple"; "hierarchical", with ordered sorting, e.g. xyz, yxz 2) Scotch: "scotch", when running in serial; "ptscotch", running in parallel */ method scotch; simpleCoeffs { n (4 2 1); // total must match numberOfSubdomains delta 0.001; } hierarchicalCoeffs { n (4 2 1); // total must match numberOfSubdomains delta 0.001; order xyz; } // ************************************************************************* // ================================================ FILE: fishChannel/system/fvSchemes ================================================ /*--------------------------------*- C++ -*----------------------------------*\ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org \\ / A nd | Version: 7 \\/ M anipulation | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class dictionary; location "system"; object fvSchemes; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // ddtSchemes { default Euler; } gradSchemes { default Gauss linear; } divSchemes { default none; div(rhoPhi,U) Gauss linearUpwind grad(U); div(phi,alpha) Gauss vanLeer; div(phirb,alpha) Gauss linear; "div\(phi,(k|omega)\)" Gauss upwind; div(((rho*nuEff)*dev2(T(grad(U))))) Gauss linear; } laplacianSchemes { default Gauss linear corrected; } interpolationSchemes { default linear; } snGradSchemes { default corrected; } wallDist { method meshWave; } // ************************************************************************* // ================================================ FILE: fishChannel/system/fvSolution ================================================ /*--------------------------------*- C++ -*----------------------------------*\ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org \\ / A nd | Version: 7 \\/ M anipulation | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class dictionary; location "system"; object fvSolution; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // solvers { "alpha.water.*" { nAlphaCorr 1; nAlphaSubCycles 1; cAlpha 1; MULESCorr yes; nLimiterIter 3; solver smoothSolver; smoother symGaussSeidel; tolerance 1e-8; relTol 0; } "pcorr.*" { solver PCG; preconditioner { preconditioner GAMG; tolerance 1e-5; relTol 0; smoother GaussSeidel; } tolerance 1e-5; relTol 0; maxIter 50; } p_rgh { solver GAMG; tolerance 5e-9; relTol 0.01; smoother GaussSeidel; maxIter 50; }; p_rghFinal { $p_rgh; tolerance 5e-9; relTol 0; } "(U|k|omega).*" { solver smoothSolver; smoother symGaussSeidel; nSweeps 1; tolerance 1e-6; relTol 0.1; }; } PIMPLE { momentumPredictor no; nCorrectors 3; nNonOrthogonalCorrectors 1; } relaxationFactors { equations { ".*" 1; } } // ************************************************************************* // ================================================ FILE: fishChannel/system/refineMeshDict ================================================ /*--------------------------------*- C++ -*----------------------------------*\ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org \\ / A nd | Version: 7 \\/ M anipulation | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class dictionary; object refineMeshDict; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // set section2; coordinateSystem global; globalCoeffs { tan1 (1 0 0); tan2 (0 1 0); } directions // comment out as required ( tan1 ); useHexTopology no; geometricCut no; writeMesh no; // ************************************************************************* // ================================================ FILE: fishChannel/system/refineMeshDict.section1 ================================================ /*--------------------------------*- C++ -*----------------------------------*\ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org \\ / A nd | Version: 7 \\/ M anipulation | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class dictionary; object refineMeshDict; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // set section; coordinateSystem global; globalCoeffs { tan1 (1 0 0); tan2 (0 1 0); } directions // comment out as required ( tan2 ); useHexTopology no; geometricCut no; writeMesh no; // ************************************************************************* // ================================================ FILE: fishChannel/system/refineMeshDict.section2 ================================================ /*--------------------------------*- C++ -*----------------------------------*\ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org \\ / A nd | Version: 7 \\/ M anipulation | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class dictionary; object refineMeshDict; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // set section2; coordinateSystem global; globalCoeffs { tan1 (1 0 0); tan2 (0 1 0); } directions // comment out as required ( tan1 ); useHexTopology no; geometricCut no; writeMesh no; // ************************************************************************* // ================================================ FILE: fishChannel/system/setFieldsDict ================================================ /*--------------------------------*- C++ -*----------------------------------*\ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org \\ / A nd | Version: 7 \\/ M anipulation | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class dictionary; location "system"; object setFieldsDict; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // defaultFieldValues ( volScalarFieldValue alpha.water 0 ); regions ( boxToCell { box (0 0 372.2) (121 1 373.8); //WSEL = 373.8 fieldValues ( volScalarFieldValue alpha.water 1 ); } ); // ************************************************************************* // ================================================ FILE: fishChannel/system/topoSetDict.outlet2 ================================================ /*--------------------------------*- C++ -*----------------------------------*\ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org \\ / A nd | Version: 7 \\/ M anipulation | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class dictionary; object topoSetDict; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // actions ( { name outlet2; type faceSet; action new; source boxToFace; sourceInfo { box (4.7 0.999 372.2) (5.0 1.001 374.8); } } ); // ************************************************************************* // ================================================ FILE: fishChannel/system/topoSetDict.section1 ================================================ /*--------------------------------*- C++ -*----------------------------------*\ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org \\ / A nd | Version: 7 \\/ M anipulation | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class dictionary; object topoSetDict; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // actions ( { name section; type cellSet; action new; source boxToCell; sourceInfo { box (119 0 372.2) (121 1 374.8); } } ); // ************************************************************************* // ================================================ FILE: fishChannel/system/topoSetDict.section2 ================================================ /*--------------------------------*- C++ -*----------------------------------*\ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org \\ / A nd | Version: 7 \\/ M anipulation | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class dictionary; object topoSetDict; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // actions ( { name section2; type cellSet; action new; source boxToCell; sourceInfo { box (4.0 0 372.2) (5.0 1 374.8); } } ); // ************************************************************************* // ================================================ FILE: flatPlate/0/U ================================================ /*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: 3.0.0 | | \\ / A nd | Web: www.OpenFOAM.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class volVectorField; object U; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // dimensions [0 1 -1 0 0 0 0]; internalField uniform (1 0 0); boundaryField { inlet { type fixedValue; value uniform (1 0 0); } outlet { type zeroGradient; } farfield { type zeroGradient; } lowerWall { type fixedValue; value uniform (0 0 0); } frontAndBack { type empty; } } // ************************************************************************* // ================================================ FILE: flatPlate/0/U~ ================================================ /*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: 3.0.0 | | \\ / A nd | Web: www.OpenFOAM.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class volVectorField; object U; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // dimensions [0 1 -1 0 0 0 0]; internalField uniform (0 0 0); boundaryField { inlet { type fixedValue; value uniform (1 0 0); } outlet { type zeroGradient; } farfield { type zeroGradient; } lowerWall { type fixedValue; value uniform (0 0 0); } frontAndBack { type empty; } } // ************************************************************************* // ================================================ FILE: flatPlate/0/epsilon ================================================ /*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: 3.0.0 | | \\ / A nd | Web: www.OpenFOAM.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class volScalarField; location "0"; object epsilon; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // dimensions [0 2 -3 0 0 0 0]; internalField uniform 14.855; boundaryField { inlet { type fixedValue; value uniform 14.855; } outlet { type zeroGradient; } farfield { type zeroGradient; } lowerWall { type epsilonWallFunction; value uniform 14.855; } frontAndBack { type empty; } } // ************************************************************************* // ================================================ FILE: flatPlate/0/k ================================================ /*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: 3.0.0 | | \\ / A nd | Web: www.OpenFOAM.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class volScalarField; location "0"; object k; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // dimensions [0 2 -2 0 0 0 0]; internalField uniform 0.375; boundaryField { inlet { type fixedValue; value uniform 0.375; } outlet { type zeroGradient; } farfield { type zeroGradient; } lowerWall { type kqRWallFunction; value uniform 0.375; } frontAndBack { type empty; } } // ************************************************************************* // ================================================ FILE: flatPlate/0/nut ================================================ /*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: 3.0.0 | | \\ / A nd | Web: www.OpenFOAM.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class volScalarField; location "0"; object nut; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // dimensions [0 2 -1 0 0 0 0]; internalField uniform 0; boundaryField { inlet { type calculated; value uniform 0; } outlet { type calculated; value uniform 0; } farfield { type zeroGradient; } lowerWall { type nutkWallFunction; value uniform 0; } frontAndBack { type empty; } } // ************************************************************************* // ================================================ FILE: flatPlate/0/p ================================================ /*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: 3.0.0 | | \\ / A nd | Web: www.OpenFOAM.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class volScalarField; object p; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // dimensions [0 2 -2 0 0 0 0]; internalField uniform 0; boundaryField { inlet { type zeroGradient; } outlet { type fixedValue; value uniform 0; } farfield { type zeroGradient; } lowerWall { type zeroGradient; } frontAndBack { type empty; } } // ************************************************************************* // ================================================ FILE: flatPlate/Allclean ================================================ #!/bin/sh cd ${0%/*} || exit 1 # Run from this directory # Source tutorial clean functions . $WM_PROJECT_DIR/bin/tools/CleanFunctions cleanCase # ----------------------------------------------------------------- end-of-file ================================================ FILE: flatPlate/Allrun ================================================ #!/bin/sh cd ${0%/*} || exit 1 # Run from this directory # Source tutorial run functions . $WM_PROJECT_DIR/bin/tools/RunFunctions # Generate the base block mesh runApplication blockMesh # Run the solver runApplication `getApplication` # ----------------------------------------------------------------- end-of-file ================================================ FILE: flatPlate/constant/transportProperties ================================================ /*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: 3.0.0 | | \\ / A nd | Web: www.OpenFOAM.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class dictionary; location "constant"; object transportProperties; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // transportModel Newtonian; nu [0 2 -1 0 0 0 0] 1e-6; // ************************************************************************* // ================================================ FILE: flatPlate/constant/turbulenceProperties ================================================ /*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: 3.0.0 | | \\ / A nd | Web: www.OpenFOAM.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class dictionary; location "constant"; object turbulenceProperties; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // simulationType RAS; RAS { RASModel kEpsilon; turbulence on; printCoeffs on; } // ************************************************************************* // ================================================ FILE: flatPlate/system/blockMeshDict ================================================ /*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: 3.0.0 | | \\ / A nd | Web: www.OpenFOAM.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class dictionary; object blockMeshDict; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // convertToMeters 1; vertices ( (0 0 0) (3 0 0) (3 0.5 0) (0 0.5 0) (0 0 1) (3 0 1) (3 0.5 1) (0 0.5 1) ); blocks ( hex (0 1 2 3 4 5 6 7) (100 100 1) simpleGrading (1 5 1) ); edges ( ); boundary ( inlet { type patch; faces ( (3 0 4 7) ); } outlet { type patch; faces ( (1 2 6 5) ); } farfield { type patch; faces ( (2 3 7 6) ); } lowerWall { type wall; faces ( (0 1 5 4) ); } frontAndBack { type empty; faces ( (3 2 1 0) (4 5 6 7) ); } ); mergePatchPairs ( ); // ************************************************************************* // ================================================ FILE: flatPlate/system/controlDict ================================================ /*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: 3.0.0 | | \\ / A nd | Web: www.OpenFOAM.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class dictionary; location "system"; object controlDict; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // application simpleFoam; startFrom startTime; startTime 0; stopAt endTime; endTime 5000; deltaT 1; writeControl timeStep; writeInterval 100; purgeWrite 0; writeFormat ascii; writePrecision 6; writeCompression off; timeFormat general; timePrecision 6; runTimeModifiable true; ================================================ FILE: flatPlate/system/fvSchemes ================================================ /*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: 3.0.0 | | \\ / A nd | Web: www.OpenFOAM.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class dictionary; location "system"; object fvSchemes; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // ddtSchemes { default steadyState; } gradSchemes { default Gauss linear; } divSchemes { default none; div(phi,U) bounded Gauss linearUpwind grad(U); div(phi,k) bounded Gauss limitedLinear 1; div(phi,epsilon) bounded Gauss limitedLinear 1; div(phi,omega) bounded Gauss limitedLinear 1; div(phi,v2) bounded Gauss limitedLinear 1; div((nuEff*dev2(T(grad(U))))) Gauss linear; div(nonlinearStress) Gauss linear; } laplacianSchemes { default Gauss linear corrected; } interpolationSchemes { default linear; } snGradSchemes { default corrected; } wallDist { method meshWave; } // ************************************************************************* // ================================================ FILE: flatPlate/system/fvSolution ================================================ /*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: 3.0.0 | | \\ / A nd | Web: www.OpenFOAM.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class dictionary; location "system"; object fvSolution; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // solvers { p { solver GAMG; tolerance 1e-06; relTol 0.1; smoother GaussSeidel; nPreSweeps 0; nPostSweeps 2; cacheAgglomeration on; agglomerator faceAreaPair; nCellsInCoarsestLevel 10; mergeLevels 1; } "(U|k|epsilon)" { solver smoothSolver; smoother symGaussSeidel; tolerance 1e-05; relTol 0.1; } } SIMPLE { nNonOrthogonalCorrectors 0; consistent yes; residualControl { p 1e-3; U 1e-3; "(k|epsilon)" 1e-3; } } relaxationFactors { equations { U 0.9; // 0.9 is more stable but 0.95 more convergent ".*" 0.9; // 0.9 is more stable but 0.95 more convergent } } // ************************************************************************* // ================================================ FILE: linuxCheatSheet/Common linux command in OpenFoam.md ================================================ # OpenFOAM Linux Cheat Sheet ## contents 1. File & Directory 2. Text 3. Binary & Package 4. Process & Environment 5. Redirection ## File & Directory **mkdir   [OPTION]... DIRECTORY...** * **-p**   make parent directories. 用于创建递归的路径 ```bash $ mkdir -vp test2/{test2.1,test2.2} # 创建文件夹test2,并在test2中创建test2.1和test2.2. $ mkdir -p $FOAM_RUN # 创建$FOAM_RUN文件夹。如果安装成功openFOAM,$FOAM_RUN代表的是一个让用户跑case的路径。用这个方式来把这个路径真实的创造出来。 ``` **cp & mv**   **[OPTION]... [-T] SOURCE DEST**         **[OPTION]...SOURCE...DIRECTORY** > forest comment: 在markdown语法中,想要实现两个连着的空格,可以用中文的空格。用两个(or以上)英文空格的效果还是一个空格。 * **-b**   make a backup of each existing destination file * **-n**   do not overwrite an existing file * **-i**   prompt before overwrite # 实际上是非常重要的. 因为复制会默认覆盖,所以复制重要文件时,注意用-i来提醒自己是否要覆盖当前的文件。 * **-r**   copy(move) directories recursively ```bash $ cp -r $FOAM_TUTORIALS . #注意$FOAM_TUTORIALS也是openFoam指定的路径,这个意思是把tutorial文件下的所有case复制到当前文件下。 ``` **rm**   [OPTION]... FILE... * **-f**   never prompt * **-i**   prompt before every removal * **-r**   remove directories recursively ```bash $ rm -rf fileName ``` > 较为危险的指令,很容易就gg了。可是用起来无比惬意,一次性彻底删除不要的东西。所以建议大家还是经常备份重要数据,一不小心删错了,那就很捉急了。温馨提示,如果误删,请不要再进行任何操作,还是有挽救的办法,请自行google/baidu. **ln   source_file...target_file * **-s**    create a soft link; ```bash $ ln -s /opt/openfoam30/doc/Guides-a4/UserGuide.pdf ~/Desktop/UserGuide.pdf ``` **touch   [OPTION]... FILE...** ```bash $ touch cavity.OpenFOAM # 新建一个算例的数据文件,可以用paraview打开。 ``` **chmod   [OPTION]...MODE[,MODE]...FILE...       [OPTION]...OCTAL-MODE FILE...** ```bash $ chmod +x Allrun # 提高Allrun文件的执行权限 ``` ================================================ FILE: magnusEffect/0/.svn/all-wcprops ================================================ K 25 svn:wc:ra_dav:version-url V 98 /svnroot/openfoam-extend/!svn/ver/1160/trunk/Core/OpenFOAM-1.5-dev/tutorials/icoDyMFoam/mixerGgi/0 END p K 25 svn:wc:ra_dav:version-url V 100 /svnroot/openfoam-extend/!svn/ver/1160/trunk/Core/OpenFOAM-1.5-dev/tutorials/icoDyMFoam/mixerGgi/0/p END U K 25 svn:wc:ra_dav:version-url V 100 /svnroot/openfoam-extend/!svn/ver/1160/trunk/Core/OpenFOAM-1.5-dev/tutorials/icoDyMFoam/mixerGgi/0/U END ================================================ FILE: magnusEffect/0/.svn/entries ================================================ 10 dir 1824 https://openfoam-extend.svn.sourceforge.net/svnroot/openfoam-extend/trunk/Core/OpenFOAM-1.5-dev/tutorials/icoDyMFoam/mixerGgi/0 https://openfoam-extend.svn.sourceforge.net/svnroot/openfoam-extend 2009-04-02T10:19:15.967477Z 1160 hjasak e4e07f05-0c2f-0410-a05a-b8ba57e0c909 p file 2010-09-12T03:25:12.586382Z dd2b863de322b1d9c35faef303f89f85 2009-04-02T10:19:15.967477Z 1160 hjasak 1312 U file 2010-09-12T03:25:12.586382Z c1b8734ca81431daedfa5badc1f03002 2009-04-02T10:19:15.967477Z 1160 hjasak 1416 ================================================ FILE: magnusEffect/0/.svn/text-base/U.svn-base ================================================ /*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: 1.5-dev | | \\ / A nd | Web: http://www.OpenFOAM.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class volVectorField; location "0"; object U; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // dimensions [0 1 -1 0 0 0 0]; internalField uniform (0 0 0); boundaryField { impellerWall { type movingWallVelocity; value uniform (0 0 0); } baffleWall { type fixedValue; value uniform (0 0 0); } insideSlider { type ggi; value uniform (0 0 0); } outsideSlider { type ggi; value uniform (0 0 0); } defaultFaces { type empty; } } // ************************************************************************* // ================================================ FILE: magnusEffect/0/.svn/text-base/p.svn-base ================================================ /*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: 1.5-dev | | \\ / A nd | Web: http://www.OpenFOAM.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class volScalarField; location "0"; object p; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // dimensions [0 2 -2 0 0 0 0]; internalField uniform 0; boundaryField { impellerWall { type zeroGradient; } baffleWall { type zeroGradient; } insideSlider { type ggi; value uniform 0; } outsideSlider { type ggi; value uniform 0; } defaultFaces { type empty; } } // ************************************************************************* // ================================================ FILE: magnusEffect/0/U ================================================ /*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: 2.3.1 | | \\ / A nd | Web: www.OpenFOAM.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class volVectorField; location "0"; object U; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // dimensions [0 1 -1 0 0 0 0]; internalField uniform (10 0 0); boundaryField { frontAndBack { type empty; } domain_boundary { type freestream; freestreamValue uniform (10 0 0); } cylinder { type rotatingWallVelocity; origin ( 0 0 0 ); axis ( 0 0 1 ); omega -200; } } // ************************************************************************* // ================================================ FILE: magnusEffect/0/epsilon ================================================ /*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: 2.3.1 | | \\ / A nd | Web: www.OpenFOAM.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class volScalarField; location "0"; object epsilon; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // dimensions [0 2 -3 0 0 0 0]; internalField uniform 0.000765; boundaryField { frontAndBack { type empty; } domain_boundary { type freestream; freestreamValue uniform 0.000765; } cylinder { type epsilonWallFunction; value uniform 0; } } // ************************************************************************* // ================================================ FILE: magnusEffect/0/k ================================================ /*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: 2.3.1 | | \\ / A nd | Web: www.OpenFOAM.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class volScalarField; location "0"; object k; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // dimensions [0 2 -2 0 0 0 0]; internalField uniform 0.00325; boundaryField { frontAndBack { type empty; } domain_boundary { type freestream; freestreamValue uniform 0.00325; } cylinder { type kqRWallFunction; value uniform 0; } } // ************************************************************************* // ================================================ FILE: magnusEffect/0/nuTilda ================================================ /*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: 2.3.1 | | \\ / A nd | Web: www.OpenFOAM.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class volScalarField; location "0"; object nuTilda; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // dimensions [0 2 -1 0 0 0 0]; internalField uniform 0; boundaryField { frontAndBack { type empty; } domain_boundary { type freestream; freestreamValue uniform 0; } cylinder { type zeroGradient; } } // ************************************************************************* // ================================================ FILE: magnusEffect/0/nut ================================================ /*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: 2.3.1 | | \\ / A nd | Web: www.OpenFOAM.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class volScalarField; location "0"; object nut; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // dimensions [0 2 -1 0 0 0 0]; internalField uniform 0; boundaryField { frontAndBack { type empty; } domain_boundary { type freestream; freestreamValue uniform 0.14; } cylinder { type nutkWallFunction; value uniform 0; } } // ************************************************************************* // ================================================ FILE: magnusEffect/0/p ================================================ /*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: 2.3.1 | | \\ / A nd | Web: www.OpenFOAM.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class volScalarField; location "0"; object p; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // dimensions [0 2 -2 0 0 0 0]; internalField uniform 0; boundaryField { frontAndBack { type empty; } domain_boundary { type zeroGradient; } cylinder { type zeroGradient; } } // ************************************************************************* // ================================================ FILE: magnusEffect/Allclean ================================================ #!/bin/sh cd ${0%/*} || exit 1 # Run from this directory # Source tutorial clean functions . $WM_PROJECT_DIR/bin/tools/CleanFunctions cleanCase # ----------------------------------------------------------------- end-of-file ================================================ FILE: magnusEffect/Allrun ================================================ #!/bin/sh cd ${0%/*} || exit 1 # Run from this directory # Source tutorial run functions . $WM_PROJECT_DIR/bin/tools/RunFunctions # Generate the mesh runApplication gmsh -3 magnus.geo runApplication gmshToFoam magnus.msh # Modify the boundary conditions sed -i '22s/patch/empty/' constant/polyMesh/boundary sed -i '29s/patch/wall/' constant/polyMesh/boundary # Run the solver runApplication `getApplication` # ----------------------------------------------------------------- end-of-file ================================================ FILE: magnusEffect/README.md ================================================ **Magnus Effect Simulation in OpenFOAM** Forked from [openfoamtutorials/openfoam_tutorials](https://github.com/openfoamtutorials/openfoam_tutorials) Description 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. Outline -Gmsh mesh overview. -Mesh generation and conversion to OpenFOAM. -Simulation using pimpleFoam. -Inspect flow field. This tutorial was run successfully on -Ubuntu 16.04 64-bit -OpenFOAM 6.x -Gmsh 3.x ================================================ FILE: magnusEffect/constant/transportProperties ================================================ /*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: 2.3.1 | | \\ / A nd | Web: www.OpenFOAM.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class dictionary; location "constant"; object transportProperties; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // transportModel Newtonian; nu nu [ 0 2 -1 0 0 0 0 ] 1e-05; CrossPowerLawCoeffs { nu0 nu0 [ 0 2 -1 0 0 0 0 ] 1e-06; nuInf nuInf [ 0 2 -1 0 0 0 0 ] 1e-06; m m [ 0 0 1 0 0 0 0 ] 1; n n [ 0 0 0 0 0 0 0 ] 1; } BirdCarreauCoeffs { nu0 nu0 [ 0 2 -1 0 0 0 0 ] 1e-06; nuInf nuInf [ 0 2 -1 0 0 0 0 ] 1e-06; k k [ 0 0 1 0 0 0 0 ] 0; n n [ 0 0 0 0 0 0 0 ] 1; } // ************************************************************************* // ================================================ FILE: magnusEffect/constant/turbulenceProperties ================================================ /*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: 2.3.1 | | \\ / A nd | Web: www.OpenFOAM.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class dictionary; location "constant"; object turbulenceProperties; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // simulationType RAS; RAS { RASModel kEpsilon; turbulence on; printCoeffs on; } // ************************************************************************* // ================================================ FILE: magnusEffect/magnus.geo ================================================ //Inputs (units are metric) cylinder_radius = 0.1; boundarylayer_height = 0.2*cylinder_radius; boundarylayer_cells = 10; boundarylayer_progression = 1.1; surface_gridsize = 0.1*cylinder_radius; domain_radius = 20*cylinder_radius; domain_gridsize = 0.1*domain_radius; cell_depth = cylinder_radius; Point(1) = {0,0,0}; Point(2) = {cylinder_radius,0,0}; Point(3) = {0,cylinder_radius,0}; Point(4) = {-cylinder_radius,0,0}; Point(5) = {0,-cylinder_radius,0}; Point(6) = {cylinder_radius+boundarylayer_height,0,0}; Point(7) = {0,cylinder_radius+boundarylayer_height,0}; Point(8) = {-(cylinder_radius+boundarylayer_height),0,0}; Point(9) = {0,-(cylinder_radius+boundarylayer_height),0}; Circle(10) = {2,1,3}; Circle(11) = {3,1,4}; Circle(12) = {4,1,5}; Circle(13) = {5,1,2}; Circle(14) = {6,1,7}; Circle(15) = {7,1,8}; Circle(16) = {8,1,9}; Circle(17) = {9,1,6}; Line(18) = {2,6}; Line(19) = {3,7}; Line(20) = {4,8}; Line(21) = {5,9}; Line Loop(22) = {18,14,-19,-10}; Line Loop(23) = {19,15,-20,-11}; Line Loop(24) = {20,16,-21,-12}; Line Loop(25) = {21,17,-18,-13}; Plane Surface(26) = 22; Plane Surface(27) = 23; Plane Surface(28) = 24; Plane Surface(29) = 25; Transfinite Line{10:17} = cylinder_radius*2*Pi/surface_gridsize; Transfinite Line{18,19,20,21} = boundarylayer_cells Using Progression boundarylayer_progression; Transfinite Surface{26,27,28,29}; Recombine Surface{26}; Recombine Surface{27}; Recombine Surface{28}; Recombine Surface{29}; Line Loop(30) = {14:17}; Point(31) = {domain_radius,0,0,domain_gridsize}; Point(32) = {0,domain_radius,0,domain_gridsize}; Point(33) = {-domain_radius,0,0,domain_gridsize}; Point(34) = {0,-domain_radius,0,domain_gridsize}; Circle(35) = {31,1,32}; Circle(36) = {32,1,33}; Circle(37) = {33,1,34}; Circle(38) = {34,1,31}; Line Loop(39) = {35:38}; Plane Surface(40) = {39,30}; new_entities1[] = Extrude{0,0,cell_depth} { Surface{26}; Layers{1}; Recombine; }; new_entities2[] = Extrude{0,0,cell_depth} { Surface{27}; Layers{1}; Recombine; }; new_entities3[] = Extrude{0,0,cell_depth} { Surface{28}; Layers{1}; Recombine; }; new_entities4[] = Extrude{0,0,cell_depth} { Surface{29}; Layers{1}; Recombine; }; new_entities5[] = Extrude{0,0,cell_depth} { Surface{40}; Layers{1}; Recombine; }; Physical Surface("cylinder") = {new_entities1[5],new_entities2[5],new_entities3[5],new_entities4[5]}; Physical Surface("domain_boundary") = {new_entities5[{2:5}]}; Physical Surface("frontAndBack") = {26:29,40,new_entities1[0],new_entities2[0],new_entities3[0],new_entities4[0],new_entities5[0]}; Physical Volume(1000) = {new_entities1[1],new_entities2[1],new_entities3[1],new_entities4[1],new_entities5[1]}; ================================================ FILE: magnusEffect/system/controlDict ================================================ /*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: 2.3.1 | | \\ / A nd | Web: www.OpenFOAM.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class dictionary; location "system"; object controlDict; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // application pimpleFoam; startFrom latestTime; endTime 0.5; stopAt endTime; deltaT 1; writeControl adjustableRunTime; writeInterval 0.01; writeFormat ascii; writePrecision 6; writeCompression uncompressed; timeFormat general; timePrecision 6; runTimeModifiable yes; adjustTimeStep yes; maxCo 2; maxDeltaT 1; // ************************************************************************* // ================================================ FILE: magnusEffect/system/fvSchemes ================================================ /*--------------------------------*- C++ -*----------------------------------*\ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org \\ / A nd | Version: 6 \\/ M anipulation | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class dictionary; object fvSchemes; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // ddtSchemes { default Euler; } gradSchemes { default Gauss linear; grad(p) Gauss linear; grad(U) Gauss linear; } divSchemes { default Gauss upwind; div(phi,U) Gauss linearUpwind grad(U); // div(phi,k) Gauss limitedLinear 1; // div(phi,epsilon) Gauss limitedLinear 1; div((nuEff*dev2(T(grad(U))))) Gauss linear; } laplacianSchemes { default Gauss linear limited corrected 0.5; } interpolationSchemes { default linear; } snGradSchemes { default corrected; } // ************************************************************************* // ================================================ FILE: magnusEffect/system/fvSolution ================================================ /*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: 2.3.1 | | \\ / A nd | Web: http://www.OpenFOAM.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class dictionary; object fvSolution; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // //The following variables must have line numbers of 17-18. myPTolerance 1e-2; myUTolerance 1e-5; myTurbTolerance 1e-6; myRelaxation 1; solvers { "(p|pFinal|pcorr)" { solver GAMG; mergeLevels 1; smoother GaussSeidel; agglomerator faceAreaPair; nCellsInCoarsestLevel 1500; tolerance $myPTolerance; relTol 0.1; } "(k|kFinal|omega|omegaFinal|epsilon|epsilonFinal|nuTilda|nuTildaFinal)" { solver smoothSolver;//PBiCG smoother GaussSeidel;//preconditioner DILU; tolerance $myTurbTolerance; relTol 0.1; } "(U|UFinal)" { solver smoothSolver;//PBiCG smoother GaussSeidel;//preconditioner DILU; tolerance $myUTolerance; relTol 0.1; } } PIMPLE { correctPhi no; nOuterCorrectors 1; nCorrectors 3; nNonOrthogonalCorrectors 1; pRefCell 0; pRefValue 0; } relaxationFactors { fields { p $myRelaxation; } equations { k $myRelaxation; U $myRelaxation; omega $myRelaxation; epsilon $myRelaxation; nuTilda $myRelaxation; } } // ************************************************************************* // ================================================ FILE: mpiTest/Alltest ================================================ #!/bin/sh mpiCase (){ cp -r damBreak4phaseFine damBreak4phaseFine$1 \ >> /dev/null sed -i '18cnumberOfSubdomains '$1';' \ damBreak4phaseFine$1/system/decomposeParDict sed -i 's/2/'$1'/g' \ damBreak4phaseFine$1/Allsbatch sed -i 's/damBreak4phaseFine/damBreak4phaseFine'$1'/g' \ damBreak4phaseFine$1/Allsbatch # sbatch ./damBreak4phaseFine$1/Allsbatch } serialCase (){ cp -r damBreak4phaseFine damBreak4phaseFine1 \ >> /dev/null rm damBreak4phaseFine1/system/decomposeParDict sed -i '15cmultiphaseEulerFoam' \ damBreak4phaseFine1/Allsbatch sed -i 's/damBreak4phaseFine/damBreak4phaseFine1/' \ damBreak4phaseFine1/Allsbatch sed -i '14d' \ damBreak4phaseFine1/Allsbatch sed -i '3d' \ damBreak4phaseFine1/Allsbatch # sbatch ./damBreak4phaseFine1/Allsbatch } mpiCase 16 serialCase #------------------------------------------------------------------------------ ================================================ FILE: mpiTest/damBreak4phaseFine/0/U ================================================ /*--------------------------------*- C++ -*----------------------------------*\ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org \\ / A nd | Version: 6 \\/ M anipulation | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format binary; class volVectorField; location "0"; object U; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // dimensions [0 1 -1 0 0 0 0]; internalField uniform (0 0 0); boundaryField { leftWall { type noSlip; } rightWall { type noSlip; } lowerWall { type noSlip; } atmosphere { type fluxCorrectedVelocity; value uniform (0 0 0); } defaultFaces { type empty; } } // ************************************************************************* // ================================================ FILE: mpiTest/damBreak4phaseFine/0/U.air ================================================ /*--------------------------------*- C++ -*----------------------------------*\ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org \\ / A nd | Version: 6 \\/ M anipulation | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class volVectorField; location "0"; object U.air; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // dimensions [0 1 -1 0 0 0 0]; internalField uniform (0 0 0); boundaryField { leftWall { type noSlip; } rightWall { type noSlip; } lowerWall { type noSlip; } atmosphere { type fluxCorrectedVelocity; value uniform (0 0 0); } defaultFaces { type empty; } } // ************************************************************************* // ================================================ FILE: mpiTest/damBreak4phaseFine/0/U.mercury ================================================ /*--------------------------------*- C++ -*----------------------------------*\ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org \\ / A nd | Version: 6 \\/ M anipulation | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class volVectorField; location "0"; object U.mercury; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // dimensions [0 1 -1 0 0 0 0]; internalField uniform (0 0 0); boundaryField { leftWall { type noSlip; } rightWall { type noSlip; } lowerWall { type noSlip; } atmosphere { type fluxCorrectedVelocity; value uniform (0 0 0); } defaultFaces { type empty; } } // ************************************************************************* // ================================================ FILE: mpiTest/damBreak4phaseFine/0/U.oil ================================================ /*--------------------------------*- C++ -*----------------------------------*\ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org \\ / A nd | Version: 6 \\/ M anipulation | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class volVectorField; location "0"; object U.oil; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // dimensions [0 1 -1 0 0 0 0]; internalField uniform (0 0 0); boundaryField { leftWall { type noSlip; } rightWall { type noSlip; } lowerWall { type noSlip; } atmosphere { type fluxCorrectedVelocity; value uniform (0 0 0); } defaultFaces { type empty; } } // ************************************************************************* // ================================================ FILE: mpiTest/damBreak4phaseFine/0/U.water ================================================ /*--------------------------------*- C++ -*----------------------------------*\ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org \\ / A nd | Version: 6 \\/ M anipulation | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class volVectorField; location "0"; object Uwater; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // dimensions [0 1 -1 0 0 0 0]; internalField uniform (0 0 0); boundaryField { leftWall { type noSlip; } rightWall { type noSlip; } lowerWall { type noSlip; } atmosphere { type fluxCorrectedVelocity; value uniform (0 0 0); } defaultFaces { type empty; } } // ************************************************************************* // ================================================ FILE: mpiTest/damBreak4phaseFine/0/alpha.air.orig ================================================ /*--------------------------------*- C++ -*----------------------------------*\ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org \\ / A nd | Version: 6 \\/ M anipulation | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class volScalarField; location "0"; object alpha.air; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // dimensions [0 0 0 0 0 0 0]; internalField uniform 0; boundaryField { leftWall { type alphaContactAngle; thetaProperties ( ( water air ) 90 0 0 0 ( oil air ) 90 0 0 0 ( mercury air ) 90 0 0 0 ( water oil ) 90 0 0 0 ( water mercury ) 90 0 0 0 ( oil mercury ) 90 0 0 0 ); value uniform 0; } rightWall { type alphaContactAngle; thetaProperties ( ( water air ) 90 0 0 0 ( oil air ) 90 0 0 0 ( mercury air ) 90 0 0 0 ( water oil ) 90 0 0 0 ( water mercury ) 90 0 0 0 ( oil mercury ) 90 0 0 0 ); value uniform 1; } lowerWall { type alphaContactAngle; thetaProperties ( ( water air ) 90 0 0 0 ( oil air ) 90 0 0 0 ( mercury air ) 90 0 0 0 ( water oil ) 90 0 0 0 ( water mercury ) 90 0 0 0 ( oil mercury ) 90 0 0 0 ); value uniform 0; } atmosphere { type inletOutlet; inletValue uniform 1; value uniform 1; } defaultFaces { type empty; } } // ************************************************************************* // ================================================ FILE: mpiTest/damBreak4phaseFine/0/alpha.mercury.orig ================================================ /*--------------------------------*- C++ -*----------------------------------*\ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org \\ / A nd | Version: 6 \\/ M anipulation | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class volScalarField; location "0"; object alpha.mercury; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // dimensions [0 0 0 0 0 0 0]; internalField uniform 0; boundaryField { leftWall { type zeroGradient; } rightWall { type zeroGradient; } lowerWall { type zeroGradient; } atmosphere { type inletOutlet; inletValue uniform 0; value uniform 0; } defaultFaces { type empty; } } // ************************************************************************* // ================================================ FILE: mpiTest/damBreak4phaseFine/0/alpha.oil.orig ================================================ /*--------------------------------*- C++ -*----------------------------------*\ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org \\ / A nd | Version: 6 \\/ M anipulation | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class volScalarField; location "0"; object alpha.oil; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // dimensions [0 0 0 0 0 0 0]; internalField uniform 0; boundaryField { leftWall { type zeroGradient; } rightWall { type zeroGradient; } lowerWall { type zeroGradient; } atmosphere { type inletOutlet; inletValue uniform 0; value uniform 0; } defaultFaces { type empty; } } // ************************************************************************* // ================================================ FILE: mpiTest/damBreak4phaseFine/0/alpha.water.orig ================================================ /*--------------------------------*- C++ -*----------------------------------*\ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org \\ / A nd | Version: 6 \\/ M anipulation | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class volScalarField; location "0"; object alpha.water; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // dimensions [0 0 0 0 0 0 0]; internalField uniform 0; boundaryField { leftWall { type zeroGradient; } rightWall { type zeroGradient; } lowerWall { type zeroGradient; } atmosphere { type inletOutlet; inletValue uniform 0; value uniform 0; } defaultFaces { type empty; } } // ************************************************************************* // ================================================ FILE: mpiTest/damBreak4phaseFine/0/p_rgh ================================================ /*--------------------------------*- C++ -*----------------------------------*\ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org \\ / A nd | Version: 6 \\/ M anipulation | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class volScalarField; object p_rgh; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // dimensions [1 -1 -2 0 0 0 0]; internalField uniform 0; boundaryField { leftWall { type fixedFluxPressure; value uniform 0; } rightWall { type fixedFluxPressure; value uniform 0; } lowerWall { type fixedFluxPressure; value uniform 0; } atmosphere { type totalPressure; p0 uniform 0; } defaultFaces { type empty; } } // ************************************************************************* // ================================================ FILE: mpiTest/damBreak4phaseFine/Allclean ================================================ #!/bin/sh cd ${0%/*} || exit 1 # Run from this directory # Source tutorial clean functions . $WM_PROJECT_DIR/bin/tools/CleanFunctions cleanVoFCase #------------------------------------------------------------------------------ ================================================ FILE: mpiTest/damBreak4phaseFine/Allsbatch ================================================ #!/bin/sh #SBATCH --ntasks=2 #SBATCH --time=03:00:00 #SBATCH --mem-per-cpu=0 #SBATCH --job-name=mpiTest #SBATCH --output=job-2-core-%J.out #SBATCH --account=def-account cd $FOAM_RUN/mpiTest/damBreak4phaseFine/ blockMesh setFields decomposePar mpirun -n 2 multiphaseEulerFoam -parallel #------------------------------------------------------------------------------ ================================================ FILE: mpiTest/damBreak4phaseFine/constant/g ================================================ /*--------------------------------*- C++ -*----------------------------------*\ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org \\ / A nd | Version: 6 \\/ M anipulation | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class uniformDimensionedVectorField; location "constant"; object g; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // dimensions [0 1 -2 0 0 0 0]; value (0 -9.81 0); // ************************************************************************* // ================================================ FILE: mpiTest/damBreak4phaseFine/constant/motionProperties ================================================ /*--------------------------------*- C++ -*----------------------------------*\ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org \\ / A nd | Version: 6 \\/ M anipulation | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class dictionary; location "constant"; object motionProperties; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // movingFvMesh staticFvMesh; // ************************************************************************* // ================================================ FILE: mpiTest/damBreak4phaseFine/constant/transportProperties ================================================ /*--------------------------------*- C++ -*----------------------------------*\ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org \\ / A nd | Version: 6 \\/ M anipulation | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class dictionary; location "constant"; object transportProperties; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // phases ( water { nu 1e-06; kappa 1e-06; Cp 4195; rho 1000; diameterModel constant; constantCoeffs { d 1e-3; } } oil { nu 1e-06; kappa 1e-06; Cp 4195; rho 500; diameterModel constant; constantCoeffs { d 1e-3; } } mercury { nu 1.125e-07; kappa 1e-06; Cp 4195; rho 13529; diameterModel constant; constantCoeffs { d 1e-3; } } air { nu 1.48e-05; kappa 2.63e-2; Cp 1007; rho 1; diameterModel constant; constantCoeffs { d 3e-3; } } ); sigmas ( (air water) 0.07 (air oil) 0.07 (air mercury) 0.07 ); interfaceCompression ( (air water) 1 (air oil) 1 (air mercury) 1 ); virtualMass ( ); drag ( (air water) { type blended; air { type SchillerNaumann; residualPhaseFraction 0; residualSlip 0; } water { type SchillerNaumann; residualPhaseFraction 0; residualSlip 0; } residualPhaseFraction 1e-3; residualSlip 1e-3; } (air oil) { type blended; air { type SchillerNaumann; residualPhaseFraction 0; residualSlip 0; } oil { type SchillerNaumann; residualPhaseFraction 0; residualSlip 0; } residualPhaseFraction 1e-3; residualSlip 1e-3; } (air mercury) { type blended; air { type SchillerNaumann; residualPhaseFraction 0; residualSlip 0; } mercury { type SchillerNaumann; residualPhaseFraction 0; residualSlip 0; } residualPhaseFraction 1e-3; residualSlip 1e-3; } (water oil) { type blended; water { type SchillerNaumann; residualPhaseFraction 0; residualSlip 0; } oil { type SchillerNaumann; residualPhaseFraction 0; residualSlip 0; } residualPhaseFraction 1e-3; residualSlip 1e-3; } (water mercury) { type blended; water { type SchillerNaumann; residualPhaseFraction 0; residualSlip 0; } mercury { type SchillerNaumann; residualPhaseFraction 0; residualSlip 0; } residualPhaseFraction 1e-3; residualSlip 1e-3; } (oil mercury) { type blended; oil { type SchillerNaumann; residualPhaseFraction 0; residualSlip 0; } mercury { type SchillerNaumann; residualPhaseFraction 0; residualSlip 0; } residualPhaseFraction 1e-3; residualSlip 1e-3; } ); // This is a dummy to support the Smagorinsky model transportModel Newtonian; nu [0 2 -1 0 0 0 0] 0; // ************************************************************************* // ================================================ FILE: mpiTest/damBreak4phaseFine/constant/turbulenceProperties ================================================ /*--------------------------------*- C++ -*----------------------------------*\ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org \\ / A nd | Version: 6 \\/ M anipulation | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class dictionary; location "constant"; object turbulenceProperties; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // simulationType laminar; // ************************************************************************* // ================================================ FILE: mpiTest/damBreak4phaseFine/system/blockMeshDict ================================================ /*--------------------------------*- C++ -*----------------------------------*\ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org \\ / A nd | Version: 6 \\/ M anipulation | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class dictionary; object blockMeshDict; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // convertToMeters 0.146; vertices ( (0 0 0) (2 0 0) (2.16438 0 0) (4 0 0) (0 0.32876 0) (2 0.32876 0) (2.16438 0.32876 0) (4 0.32876 0) (0 4 0) (2 4 0) (2.16438 4 0) (4 4 0) (0 0 0.1) (2 0 0.1) (2.16438 0 0.1) (4 0 0.1) (0 0.32876 0.1) (2 0.32876 0.1) (2.16438 0.32876 0.1) (4 0.32876 0.1) (0 4 0.1) (2 4 0.1) (2.16438 4 0.1) (4 4 0.1) ); blocks ( hex (0 1 5 4 12 13 17 16) (92 15 1) simpleGrading (1 1 1) hex (2 3 7 6 14 15 19 18) (76 15 1) simpleGrading (1 1 1) hex (4 5 9 8 16 17 21 20) (92 180 1) simpleGrading (1 1 1) hex (5 6 10 9 17 18 22 21) (8 180 1) simpleGrading (1 1 1) hex (6 7 11 10 18 19 23 22) (76 180 1) simpleGrading (1 1 1) ); edges ( ); boundary ( leftWall { type wall; faces ( (0 12 16 4) (4 16 20 8) ); } rightWall { type wall; faces ( (7 19 15 3) (11 23 19 7) ); } lowerWall { type wall; faces ( (0 1 13 12) (1 5 17 13) (5 6 18 17) (2 14 18 6) (2 3 15 14) ); } atmosphere { type patch; faces ( (8 20 21 9) (9 21 22 10) (10 22 23 11) ); } ); mergePatchPairs ( ); // ************************************************************************* // ================================================ FILE: mpiTest/damBreak4phaseFine/system/controlDict ================================================ /*--------------------------------*- C++ -*----------------------------------*\ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org \\ / A nd | Version: 6 \\/ M anipulation | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class dictionary; location "system"; object controlDict; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // application multiphaseEulerFoam; startFrom startTime; startTime 0; stopAt endTime; endTime 6; deltaT 0.001; writeControl adjustableRunTime; writeInterval 0.01; purgeWrite 0; writeFormat binary; writePrecision 6; writeCompression off; timeFormat general; timePrecision 6; runTimeModifiable yes; adjustTimeStep yes; maxCo 0.5; maxAlphaCo 0.5; maxDeltaT 1; // ************************************************************************* // ================================================ FILE: mpiTest/damBreak4phaseFine/system/decomposeParDict ================================================ /*--------------------------------*- C++ -*----------------------------------*\ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org \\ / A nd | Version: 6 \\/ M anipulation | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class dictionary; location "system"; object decomposeParDict; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // numberOfSubdomains 2; method scotch; // ************************************************************************* // ================================================ FILE: mpiTest/damBreak4phaseFine/system/fvSchemes ================================================ /*--------------------------------*- C++ -*----------------------------------*\ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org \\ / A nd | Version: 6 \\/ M anipulation | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class dictionary; location "system"; object fvSchemes; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // ddtSchemes { default Euler; } gradSchemes { default Gauss linear; } divSchemes { "div\(phi,alpha.*\)" Gauss vanLeer; "div\(phir,alpha.*,alpha.*\)" Gauss vanLeer; "div\(alphaPhi.*,U.*\)" Gauss limitedLinearV 1; div(Rc) Gauss linear; "div\(phi.*,U.*\)" Gauss limitedLinearV 1; } laplacianSchemes { default Gauss linear corrected; } interpolationSchemes { default linear; } snGradSchemes { default corrected; } // ************************************************************************* // ================================================ FILE: mpiTest/damBreak4phaseFine/system/fvSolution ================================================ /*--------------------------------*- C++ -*----------------------------------*\ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org \\ / A nd | Version: 6 \\/ M anipulation | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class dictionary; location "system"; object fvSolution; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // solvers { "alpha.*" { nAlphaSubCycles 3; } p_rgh { solver GAMG; tolerance 1e-7; relTol 0.05; smoother GaussSeidel; } p_rghFinal { solver PCG; preconditioner { preconditioner GAMG; tolerance 1e-7; relTol 0; nVcycles 2; smoother GaussSeidel; } tolerance 1e-7; relTol 0; maxIter 20; } "pcorr.*" { $p_rghFinal; tolerance 1e-5; relTol 0; } U { solver smoothSolver; smoother GaussSeidel; tolerance 1e-8; relTol 0.1; nSweeps 1; } UFinal { $U; tolerance 1e-7; relTol 0; } } PIMPLE { nCorrectors 3; nNonOrthogonalCorrectors 0; } relaxationFactors { "U.*" 1; } // ************************************************************************* // ================================================ FILE: mpiTest/damBreak4phaseFine/system/setFieldsDict ================================================ /*--------------------------------*- C++ -*----------------------------------*\ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org \\ / A nd | Version: 6 \\/ M anipulation | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class dictionary; location "system"; object setFieldsDict; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // defaultFieldValues ( volScalarFieldValue alpha.air 1 volScalarFieldValue alpha.water 0 volScalarFieldValue alpha.oil 0 volScalarFieldValue alpha.mercury 0 volVectorFieldValue U (0 0 0) ); regions ( boxToCell { box (0 0 -1) (0.1461 0.292 1); fieldValues ( volScalarFieldValue alpha.water 1 volScalarFieldValue alpha.oil 0 volScalarFieldValue alpha.mercury 0 volScalarFieldValue alpha.air 0 ); } boxToCell { box (0.1461 0 -1) (0.2922 0.292 1); fieldValues ( volScalarFieldValue alpha.water 0 volScalarFieldValue alpha.oil 1 volScalarFieldValue alpha.mercury 0 volScalarFieldValue alpha.air 0 ); } boxToCell { box (0 0 -1) (0.1461 0.1 1); fieldValues ( volScalarFieldValue alpha.water 0 volScalarFieldValue alpha.oil 0 volScalarFieldValue alpha.mercury 1 volScalarFieldValue alpha.air 0 ); } ); // ************************************************************************* // ================================================ FILE: programmingTutorials/.gitignore ================================================ # git-ls-files --others --exclude-from=.git/info/exclude # Lines that start with '#' are comments. # Editor and misc backup files - anywhere *~ .*~ *.bak *.bak[0-9][0-9] \#*\# # File-browser settings - anywhere .directory # CVS recovered versions - anywhere .#* # Objects and archives - anywhere *.[oa] *.la *.so # Derived files lex.yy.c # Corefiles core # Dependency files - anywhere *.dep # lnInclude (symlink) directories - anywhere lnInclude # Build directories - anywhere linux*Clang*/ linux*Gcc*/ linux*Icc*/ solaris*Gcc*/ SunOS*Gcc*/ platforms/ # Reinstate wmake/rules that might look like build directories !wmake/rules/*/ # doxygen generated documentation doc/Doxygen/html doc/Doxygen/latex doc/Doxygen/man doc/Doxygen/DTAGS # Generated files in the main directory (e.g. ReleaseNotes-?.?.html) # and in the doc directory /*.html /doc/*.html # Untracked configuration files /etc/prefs.csh /etc/prefs.sh /etc/config.csh/prefs.csh /etc/config.sh/prefs.sh # Source packages - anywhere *.tar.bz2 *.tar.gz *.tar *.tgz *.gtgz # Ignore the persistent .build tag in the main directory /.build # Ignore .timeStamp in the main directory /.timeStamp # Ignore .tags in the main directory /.tags # Ignore project files in the main directory /.cproject /.project /.dir-locals.el /.dropbox # Ignore the test directory /tutorialsTest ================================================ FILE: programmingTutorials/LICENSE ================================================ GNU GENERAL PUBLIC LICENSE Version 3, 29 June 2007 Copyright (C) 2007 Free Software Foundation, Inc. Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The GNU General Public License is a free, copyleft license for software and other kinds of works. The licenses for most software and other practical works are designed to take away your freedom to share and change the works. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change all versions of a program--to make sure it remains free software for all its users. We, the Free Software Foundation, use the GNU General Public License for most of our software; it applies also to any other work released this way by its authors. You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for them if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs, and that you know you can do these things. To protect your rights, we need to prevent others from denying you these rights or asking you to surrender the rights. Therefore, you have certain responsibilities if you distribute copies of the software, or if you modify it: responsibilities to respect the freedom of others. For example, if you distribute copies of such a program, whether gratis or for a fee, you must pass on to the recipients the same freedoms that you received. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. Developers that use the GNU GPL protect your rights with two steps: (1) assert copyright on the software, and (2) offer you this License giving you legal permission to copy, distribute and/or modify it. For the developers' and authors' protection, the GPL clearly explains that there is no warranty for this free software. For both users' and authors' sake, the GPL requires that modified versions be marked as changed, so that their problems will not be attributed erroneously to authors of previous versions. Some devices are designed to deny users access to install or run modified versions of the software inside them, although the manufacturer can do so. This is fundamentally incompatible with the aim of protecting users' freedom to change the software. The systematic pattern of such abuse occurs in the area of products for individuals to use, which is precisely where it is most unacceptable. Therefore, we have designed this version of the GPL to prohibit the practice for those products. If such problems arise substantially in other domains, we stand ready to extend this provision to those domains in future versions of the GPL, as needed to protect the freedom of users. Finally, every program is threatened constantly by software patents. States should not allow patents to restrict development and use of software on general-purpose computers, but in those that do, we wish to avoid the special danger that patents applied to a free program could make it effectively proprietary. To prevent this, the GPL assures that patents cannot be used to render the program non-free. The precise terms and conditions for copying, distribution and modification follow. TERMS AND CONDITIONS 0. Definitions. "This License" refers to version 3 of the GNU General Public License. "Copyright" also means copyright-like laws that apply to other kinds of works, such as semiconductor masks. "The Program" refers to any copyrightable work licensed under this License. Each licensee is addressed as "you". "Licensees" and "recipients" may be individuals or organizations. To "modify" a work means to copy from or adapt all or part of the work in a fashion requiring copyright permission, other than the making of an exact copy. The resulting work is called a "modified version" of the earlier work or a work "based on" the earlier work. A "covered work" means either the unmodified Program or a work based on the Program. To "propagate" a work means to do anything with it that, without permission, would make you directly or secondarily liable for infringement under applicable copyright law, except executing it on a computer or modifying a private copy. Propagation includes copying, distribution (with or without modification), making available to the public, and in some countries other activities as well. To "convey" a work means any kind of propagation that enables other parties to make or receive copies. Mere interaction with a user through a computer network, with no transfer of a copy, is not conveying. An interactive user interface displays "Appropriate Legal Notices" to the extent that it includes a convenient and prominently visible feature that (1) displays an appropriate copyright notice, and (2) tells the user that there is no warranty for the work (except to the extent that warranties are provided), that licensees may convey the work under this License, and how to view a copy of this License. If the interface presents a list of user commands or options, such as a menu, a prominent item in the list meets this criterion. 1. Source Code. The "source code" for a work means the preferred form of the work for making modifications to it. "Object code" means any non-source form of a work. A "Standard Interface" means an interface that either is an official standard defined by a recognized standards body, or, in the case of interfaces specified for a particular programming language, one that is widely used among developers working in that language. The "System Libraries" of an executable work include anything, other than the work as a whole, that (a) is included in the normal form of packaging a Major Component, but which is not part of that Major Component, and (b) serves only to enable use of the work with that Major Component, or to implement a Standard Interface for which an implementation is available to the public in source code form. A "Major Component", in this context, means a major essential component (kernel, window system, and so on) of the specific operating system (if any) on which the executable work runs, or a compiler used to produce the work, or an object code interpreter used to run it. The "Corresponding Source" for a work in object code form means all the source code needed to generate, install, and (for an executable work) run the object code and to modify the work, including scripts to control those activities. However, it does not include the work's System Libraries, or general-purpose tools or generally available free programs which are used unmodified in performing those activities but which are not part of the work. For example, Corresponding Source includes interface definition files associated with source files for the work, and the source code for shared libraries and dynamically linked subprograms that the work is specifically designed to require, such as by intimate data communication or control flow between those subprograms and other parts of the work. The Corresponding Source need not include anything that users can regenerate automatically from other parts of the Corresponding Source. The Corresponding Source for a work in source code form is that same work. 2. Basic Permissions. All rights granted under this License are granted for the term of copyright on the Program, and are irrevocable provided the stated conditions are met. This License explicitly affirms your unlimited permission to run the unmodified Program. The output from running a covered work is covered by this License only if the output, given its content, constitutes a covered work. This License acknowledges your rights of fair use or other equivalent, as provided by copyright law. You may make, run and propagate covered works that you do not convey, without conditions so long as your license otherwise remains in force. You may convey covered works to others for the sole purpose of having them make modifications exclusively for you, or provide you with facilities for running those works, provided that you comply with the terms of this License in conveying all material for which you do not control copyright. Those thus making or running the covered works for you must do so exclusively on your behalf, under your direction and control, on terms that prohibit them from making any copies of your copyrighted material outside their relationship with you. Conveying under any other circumstances is permitted solely under the conditions stated below. Sublicensing is not allowed; section 10 makes it unnecessary. 3. Protecting Users' Legal Rights From Anti-Circumvention Law. No covered work shall be deemed part of an effective technological measure under any applicable law fulfilling obligations under article 11 of the WIPO copyright treaty adopted on 20 December 1996, or similar laws prohibiting or restricting circumvention of such measures. When you convey a covered work, you waive any legal power to forbid circumvention of technological measures to the extent such circumvention is effected by exercising rights under this License with respect to the covered work, and you disclaim any intention to limit operation or modification of the work as a means of enforcing, against the work's users, your or third parties' legal rights to forbid circumvention of technological measures. 4. Conveying Verbatim Copies. You may convey verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice; keep intact all notices stating that this License and any non-permissive terms added in accord with section 7 apply to the code; keep intact all notices of the absence of any warranty; and give all recipients a copy of this License along with the Program. You may charge any price or no price for each copy that you convey, and you may offer support or warranty protection for a fee. 5. Conveying Modified Source Versions. You may convey a work based on the Program, or the modifications to produce it from the Program, in the form of source code under the terms of section 4, provided that you also meet all of these conditions: a) The work must carry prominent notices stating that you modified it, and giving a relevant date. b) The work must carry prominent notices stating that it is released under this License and any conditions added under section 7. This requirement modifies the requirement in section 4 to "keep intact all notices". c) You must license the entire work, as a whole, under this License to anyone who comes into possession of a copy. This License will therefore apply, along with any applicable section 7 additional terms, to the whole of the work, and all its parts, regardless of how they are packaged. This License gives no permission to license the work in any other way, but it does not invalidate such permission if you have separately received it. d) If the work has interactive user interfaces, each must display Appropriate Legal Notices; however, if the Program has interactive interfaces that do not display Appropriate Legal Notices, your work need not make them do so. A compilation of a covered work with other separate and independent works, which are not by their nature extensions of the covered work, and which are not combined with it such as to form a larger program, in or on a volume of a storage or distribution medium, is called an "aggregate" if the compilation and its resulting copyright are not used to limit the access or legal rights of the compilation's users beyond what the individual works permit. Inclusion of a covered work in an aggregate does not cause this License to apply to the other parts of the aggregate. 6. Conveying Non-Source Forms. You may convey a covered work in object code form under the terms of sections 4 and 5, provided that you also convey the machine-readable Corresponding Source under the terms of this License, in one of these ways: a) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by the Corresponding Source fixed on a durable physical medium customarily used for software interchange. b) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by a written offer, valid for at least three years and valid for as long as you offer spare parts or customer support for that product model, to give anyone who possesses the object code either (1) a copy of the Corresponding Source for all the software in the product that is covered by this License, on a durable physical medium customarily used for software interchange, for a price no more than your reasonable cost of physically performing this conveying of source, or (2) access to copy the Corresponding Source from a network server at no charge. c) Convey individual copies of the object code with a copy of the written offer to provide the Corresponding Source. This alternative is allowed only occasionally and noncommercially, and only if you received the object code with such an offer, in accord with subsection 6b. d) Convey the object code by offering access from a designated place (gratis or for a charge), and offer equivalent access to the Corresponding Source in the same way through the same place at no further charge. You need not require recipients to copy the Corresponding Source along with the object code. If the place to copy the object code is a network server, the Corresponding Source may be on a different server (operated by you or a third party) that supports equivalent copying facilities, provided you maintain clear directions next to the object code saying where to find the Corresponding Source. Regardless of what server hosts the Corresponding Source, you remain obligated to ensure that it is available for as long as needed to satisfy these requirements. e) Convey the object code using peer-to-peer transmission, provided you inform other peers where the object code and Corresponding Source of the work are being offered to the general public at no charge under subsection 6d. A separable portion of the object code, whose source code is excluded from the Corresponding Source as a System Library, need not be included in conveying the object code work. A "User Product" is either (1) a "consumer product", which means any tangible personal property which is normally used for personal, family, or household purposes, or (2) anything designed or sold for incorporation into a dwelling. In determining whether a product is a consumer product, doubtful cases shall be resolved in favor of coverage. For a particular product received by a particular user, "normally used" refers to a typical or common use of that class of product, regardless of the status of the particular user or of the way in which the particular user actually uses, or expects or is expected to use, the product. A product is a consumer product regardless of whether the product has substantial commercial, industrial or non-consumer uses, unless such uses represent the only significant mode of use of the product. "Installation Information" for a User Product means any methods, procedures, authorization keys, or other information required to install and execute modified versions of a covered work in that User Product from a modified version of its Corresponding Source. The information must suffice to ensure that the continued functioning of the modified object code is in no case prevented or interfered with solely because modification has been made. If you convey an object code work under this section in, or with, or specifically for use in, a User Product, and the conveying occurs as part of a transaction in which the right of possession and use of the User Product is transferred to the recipient in perpetuity or for a fixed term (regardless of how the transaction is characterized), the Corresponding Source conveyed under this section must be accompanied by the Installation Information. But this requirement does not apply if neither you nor any third party retains the ability to install modified object code on the User Product (for example, the work has been installed in ROM). The requirement to provide Installation Information does not include a requirement to continue to provide support service, warranty, or updates for a work that has been modified or installed by the recipient, or for the User Product in which it has been modified or installed. Access to a network may be denied when the modification itself materially and adversely affects the operation of the network or violates the rules and protocols for communication across the network. Corresponding Source conveyed, and Installation Information provided, in accord with this section must be in a format that is publicly documented (and with an implementation available to the public in source code form), and must require no special password or key for unpacking, reading or copying. 7. Additional Terms. "Additional permissions" are terms that supplement the terms of this License by making exceptions from one or more of its conditions. Additional permissions that are applicable to the entire Program shall be treated as though they were included in this License, to the extent that they are valid under applicable law. If additional permissions apply only to part of the Program, that part may be used separately under those permissions, but the entire Program remains governed by this License without regard to the additional permissions. When you convey a copy of a covered work, you may at your option remove any additional permissions from that copy, or from any part of it. (Additional permissions may be written to require their own removal in certain cases when you modify the work.) You may place additional permissions on material, added by you to a covered work, for which you have or can give appropriate copyright permission. Notwithstanding any other provision of this License, for material you add to a covered work, you may (if authorized by the copyright holders of that material) supplement the terms of this License with terms: a) Disclaiming warranty or limiting liability differently from the terms of sections 15 and 16 of this License; or b) Requiring preservation of specified reasonable legal notices or author attributions in that material or in the Appropriate Legal Notices displayed by works containing it; or c) Prohibiting misrepresentation of the origin of that material, or requiring that modified versions of such material be marked in reasonable ways as different from the original version; or d) Limiting the use for publicity purposes of names of licensors or authors of the material; or e) Declining to grant rights under trademark law for use of some trade names, trademarks, or service marks; or f) Requiring indemnification of licensors and authors of that material by anyone who conveys the material (or modified versions of it) with contractual assumptions of liability to the recipient, for any liability that these contractual assumptions directly impose on those licensors and authors. All other non-permissive additional terms are considered "further restrictions" within the meaning of section 10. If the Program as you received it, or any part of it, contains a notice stating that it is governed by this License along with a term that is a further restriction, you may remove that term. If a license document contains a further restriction but permits relicensing or conveying under this License, you may add to a covered work material governed by the terms of that license document, provided that the further restriction does not survive such relicensing or conveying. If you add terms to a covered work in accord with this section, you must place, in the relevant source files, a statement of the additional terms that apply to those files, or a notice indicating where to find the applicable terms. Additional terms, permissive or non-permissive, may be stated in the form of a separately written license, or stated as exceptions; the above requirements apply either way. 8. Termination. You may not propagate or modify a covered work except as expressly provided under this License. Any attempt otherwise to propagate or modify it is void, and will automatically terminate your rights under this License (including any patent licenses granted under the third paragraph of section 11). However, if you cease all violation of this License, then your license from a particular copyright holder is reinstated (a) provisionally, unless and until the copyright holder explicitly and finally terminates your license, and (b) permanently, if the copyright holder fails to notify you of the violation by some reasonable means prior to 60 days after the cessation. Moreover, your license from a particular copyright holder is reinstated permanently if the copyright holder notifies you of the violation by some reasonable means, this is the first time you have received notice of violation of this License (for any work) from that copyright holder, and you cure the violation prior to 30 days after your receipt of the notice. Termination of your rights under this section does not terminate the licenses of parties who have received copies or rights from you under this License. If your rights have been terminated and not permanently reinstated, you do not qualify to receive new licenses for the same material under section 10. 9. Acceptance Not Required for Having Copies. You are not required to accept this License in order to receive or run a copy of the Program. Ancillary propagation of a covered work occurring solely as a consequence of using peer-to-peer transmission to receive a copy likewise does not require acceptance. However, nothing other than this License grants you permission to propagate or modify any covered work. These actions infringe copyright if you do not accept this License. Therefore, by modifying or propagating a covered work, you indicate your acceptance of this License to do so. 10. Automatic Licensing of Downstream Recipients. Each time you convey a covered work, the recipient automatically receives a license from the original licensors, to run, modify and propagate that work, subject to this License. You are not responsible for enforcing compliance by third parties with this License. An "entity transaction" is a transaction transferring control of an organization, or substantially all assets of one, or subdividing an organization, or merging organizations. If propagation of a covered work results from an entity transaction, each party to that transaction who receives a copy of the work also receives whatever licenses to the work the party's predecessor in interest had or could give under the previous paragraph, plus a right to possession of the Corresponding Source of the work from the predecessor in interest, if the predecessor has it or can get it with reasonable efforts. You may not impose any further restrictions on the exercise of the rights granted or affirmed under this License. For example, you may not impose a license fee, royalty, or other charge for exercise of rights granted under this License, and you may not initiate litigation (including a cross-claim or counterclaim in a lawsuit) alleging that any patent claim is infringed by making, using, selling, offering for sale, or importing the Program or any portion of it. 11. Patents. A "contributor" is a copyright holder who authorizes use under this License of the Program or a work on which the Program is based. The work thus licensed is called the contributor's "contributor version". A contributor's "essential patent claims" are all patent claims owned or controlled by the contributor, whether already acquired or hereafter acquired, that would be infringed by some manner, permitted by this License, of making, using, or selling its contributor version, but do not include claims that would be infringed only as a consequence of further modification of the contributor version. For purposes of this definition, "control" includes the right to grant patent sublicenses in a manner consistent with the requirements of this License. Each contributor grants you a non-exclusive, worldwide, royalty-free patent license under the contributor's essential patent claims, to make, use, sell, offer for sale, import and otherwise run, modify and propagate the contents of its contributor version. In the following three paragraphs, a "patent license" is any express agreement or commitment, however denominated, not to enforce a patent (such as an express permission to practice a patent or covenant not to sue for patent infringement). To "grant" such a patent license to a party means to make such an agreement or commitment not to enforce a patent against the party. If you convey a covered work, knowingly relying on a patent license, and the Corresponding Source of the work is not available for anyone to copy, free of charge and under the terms of this License, through a publicly available network server or other readily accessible means, then you must either (1) cause the Corresponding Source to be so available, or (2) arrange to deprive yourself of the benefit of the patent license for this particular work, or (3) arrange, in a manner consistent with the requirements of this License, to extend the patent license to downstream recipients. "Knowingly relying" means you have actual knowledge that, but for the patent license, your conveying the covered work in a country, or your recipient's use of the covered work in a country, would infringe one or more identifiable patents in that country that you have reason to believe are valid. If, pursuant to or in connection with a single transaction or arrangement, you convey, or propagate by procuring conveyance of, a covered work, and grant a patent license to some of the parties receiving the covered work authorizing them to use, propagate, modify or convey a specific copy of the covered work, then the patent license you grant is automatically extended to all recipients of the covered work and works based on it. A patent license is "discriminatory" if it does not include within the scope of its coverage, prohibits the exercise of, or is conditioned on the non-exercise of one or more of the rights that are specifically granted under this License. You may not convey a covered work if you are a party to an arrangement with a third party that is in the business of distributing software, under which you make payment to the third party based on the extent of your activity of conveying the work, and under which the third party grants, to any of the parties who would receive the covered work from you, a discriminatory patent license (a) in connection with copies of the covered work conveyed by you (or copies made from those copies), or (b) primarily for and in connection with specific products or compilations that contain the covered work, unless you entered into that arrangement, or that patent license was granted, prior to 28 March 2007. Nothing in this License shall be construed as excluding or limiting any implied license or other defenses to infringement that may otherwise be available to you under applicable patent law. 12. No Surrender of Others' Freedom. If conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot convey a covered work so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not convey it at all. For example, if you agree to terms that obligate you to collect a royalty for further conveying from those to whom you convey the Program, the only way you could satisfy both those terms and this License would be to refrain entirely from conveying the Program. 13. Use with the GNU Affero General Public License. Notwithstanding any other provision of this License, you have permission to link or combine any covered work with a work licensed under version 3 of the GNU Affero General Public License into a single combined work, and to convey the resulting work. The terms of this License will continue to apply to the part which is the covered work, but the special requirements of the GNU Affero General Public License, section 13, concerning interaction through a network will apply to the combination as such. 14. Revised Versions of this License. The Free Software Foundation may publish revised and/or new versions of the GNU General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies that a certain numbered version of the GNU General Public License "or any later version" applies to it, you have the option of following the terms and conditions either of that numbered version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of the GNU General Public License, you may choose any version ever published by the Free Software Foundation. If the Program specifies that a proxy can decide which future versions of the GNU General Public License can be used, that proxy's public statement of acceptance of a version permanently authorizes you to choose that version for the Program. Later license versions may give you additional or different permissions. However, no additional obligations are imposed on any author or copyright holder as a result of your choosing to follow a later version. 15. Disclaimer of Warranty. THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 16. Limitation of Liability. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. 17. Interpretation of Sections 15 and 16. If the disclaimer of warranty and limitation of liability provided above cannot be given local legal effect according to their terms, reviewing courts shall apply local law that most closely approximates an absolute waiver of all civil liability in connection with the Program, unless a warranty or assumption of liability accompanies a copy of the Program in return for a fee. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively state the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. {one line to give the program's name and a brief idea of what it does.} Copyright (C) {year} {name of author} This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . Also add information on how to contact you by electronic and paper mail. If the program does terminal interaction, make it output a short notice like this when it starts in an interactive mode: {project} Copyright (C) {year} {fullname} This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, your program's commands might be different; for a GUI interface, you would use an "about box". You should also get your employer (if you work as a programmer) or school, if any, to sign a "copyright disclaimer" for the program, if necessary. For more information on this, and how to apply and follow the GNU GPL, see . The GNU General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Lesser General Public License instead of this License. But first, please read . ================================================ FILE: programmingTutorials/OFtutorial00_helloWorld/Allwclean ================================================ #!/bin/bash wclean ================================================ FILE: programmingTutorials/OFtutorial00_helloWorld/Allwmake ================================================ #!/bin/bash wmake ================================================ FILE: programmingTutorials/OFtutorial00_helloWorld/Make/files ================================================ OFtutorial0.C EXE = $(FOAM_USER_APPBIN)/ofTutorial0 ================================================ FILE: programmingTutorials/OFtutorial00_helloWorld/Make/options ================================================ EXE_INC = \ -I$(LIB_SRC)/finiteVolume/lnInclude \ -I$(LIB_SRC)/meshTools/lnInclude EXE_LIBS = \ -lfiniteVolume \ -lmeshTools ================================================ FILE: programmingTutorials/OFtutorial00_helloWorld/OFtutorial0.C ================================================ /*---------------------------------------------------------------------------*\ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License This file is part of OpenFOAM. OpenFOAM is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. OpenFOAM is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenFOAM. If not, see . \*---------------------------------------------------------------------------*/ #include "fvCFD.H" int main(int argc, char *argv[]) { // Checks the basic folder structure, verifies there is a control dict present, etc.; // also deals with parsing command line arguments and options. // It works by taking an external piece of code, written in $FOAM_SRC/OpenFOAM/include. // The contents of the include file actually look like this: /*Foam::argList args(argc, argv); - deciphers the arguments passed to the program if (!args.checkRootCase()) - verifies the folder structure { Foam::FatalError.exit(); }*/ #include "setRootCase.H" // OpenFOAM screen output is very similar to rudimentary C++ with its std::cout, std::nl and std::endl // being replaced with Foam::Info, Foam::nl, and Foam::endl. Info << "Hello there, I'm an OpenFOAM program!" << nl << "You don't need a mesh or anything to run it, just a bare OpenFOAM case will do." << nl << tab << "This is me again, just creating a tabulated new line, move along." << nl << endl; Info<< "End\n" << endl; return 0; } // ************************************************************************* // ================================================ FILE: programmingTutorials/OFtutorial00_helloWorld/testCase/0/U ================================================ /*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: 3.0.1 | | \\ / A nd | Web: www.OpenFOAM.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class volVectorField; object U; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // dimensions [0 1 -1 0 0 0 0]; internalField uniform (0 0 0); boundaryField { movingWall { type fixedValue; value uniform (1 0 0); } fixedWalls { type fixedValue; value uniform (0 0 0); } frontAndBack { type empty; } } // ************************************************************************* // ================================================ FILE: programmingTutorials/OFtutorial00_helloWorld/testCase/0/p ================================================ /*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: 3.0.1 | | \\ / A nd | Web: www.OpenFOAM.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class volScalarField; object p; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // dimensions [0 2 -2 0 0 0 0]; internalField uniform 0; boundaryField { movingWall { type zeroGradient; } fixedWalls { type zeroGradient; } frontAndBack { type empty; } } // ************************************************************************* // ================================================ FILE: programmingTutorials/OFtutorial00_helloWorld/testCase/Allclean ================================================ #!/bin/bash rm -r 1* 2* 3* 4* 5* 6* 7* 8* 9* 0.* constant/polyMesh/* processor* log.* 2>/dev/null ================================================ FILE: programmingTutorials/OFtutorial00_helloWorld/testCase/Allrun ================================================ #!/bin/bash ofTutorial0 ================================================ FILE: programmingTutorials/OFtutorial00_helloWorld/testCase/constant/transportProperties ================================================ /*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: 3.0.1 | | \\ / A nd | Web: www.OpenFOAM.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class dictionary; location "constant"; object transportProperties; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // nu [0 2 -1 0 0 0 0] 0.01; // ************************************************************************* // ================================================ FILE: programmingTutorials/OFtutorial00_helloWorld/testCase/system/blockMeshDict ================================================ /*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: 3.0.1 | | \\ / A nd | Web: www.OpenFOAM.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class dictionary; object blockMeshDict; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // convertToMeters 0.1; vertices ( (0 0 0) (1 0 0) (1 1 0) (0 1 0) (0 0 0.1) (1 0 0.1) (1 1 0.1) (0 1 0.1) ); blocks ( hex (0 1 2 3 4 5 6 7) (20 20 1) simpleGrading (1 1 1) ); edges ( ); boundary ( movingWall { type wall; faces ( (3 7 6 2) ); } fixedWalls { type wall; faces ( (0 4 7 3) (2 6 5 1) (1 5 4 0) ); } frontAndBack { type empty; faces ( (0 3 2 1) (4 5 6 7) ); } ); mergePatchPairs ( ); // ************************************************************************* // ================================================ FILE: programmingTutorials/OFtutorial00_helloWorld/testCase/system/controlDict ================================================ /*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: 3.0.1 | | \\ / A nd | Web: www.OpenFOAM.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class dictionary; location "system"; object controlDict; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // application icoFoam; startFrom startTime; startTime 0; stopAt endTime; endTime 0.5; deltaT 0.005; writeControl timeStep; writeInterval 20; purgeWrite 0; writeFormat ascii; writePrecision 6; writeCompression off; timeFormat general; timePrecision 6; runTimeModifiable true; // ************************************************************************* // ================================================ FILE: programmingTutorials/OFtutorial00_helloWorld/testCase/system/fvSchemes ================================================ /*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: 3.0.1 | | \\ / A nd | Web: www.OpenFOAM.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class dictionary; location "system"; object fvSchemes; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // ddtSchemes { default Euler; } gradSchemes { default Gauss linear; grad(p) Gauss linear; } divSchemes { default none; div(phi,U) Gauss linear; } laplacianSchemes { default Gauss linear orthogonal; } interpolationSchemes { default linear; } snGradSchemes { default orthogonal; } // ************************************************************************* // ================================================ FILE: programmingTutorials/OFtutorial00_helloWorld/testCase/system/fvSolution ================================================ /*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: 3.0.1 | | \\ / A nd | Web: www.OpenFOAM.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class dictionary; location "system"; object fvSolution; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // solvers { p { solver PCG; preconditioner DIC; tolerance 1e-06; relTol 0; } U { solver smoothSolver; smoother symGaussSeidel; tolerance 1e-05; relTol 0; } } PISO { nCorrectors 2; nNonOrthogonalCorrectors 0; pRefCell 0; pRefValue 0; } // ************************************************************************* // ================================================ FILE: programmingTutorials/OFtutorial01_inputOutput/Allwclean ================================================ #!/bin/bash wclean ================================================ FILE: programmingTutorials/OFtutorial01_inputOutput/Allwmake ================================================ #!/bin/bash wmake ================================================ FILE: programmingTutorials/OFtutorial01_inputOutput/Make/files ================================================ OFtutorial1.C EXE = $(FOAM_USER_APPBIN)/ofTutorial1 ================================================ FILE: programmingTutorials/OFtutorial01_inputOutput/Make/options ================================================ EXE_INC = \ -I$(LIB_SRC)/finiteVolume/lnInclude \ -I$(LIB_SRC)/meshTools/lnInclude EXE_LIBS = \ -lfiniteVolume \ -lmeshTools ================================================ FILE: programmingTutorials/OFtutorial01_inputOutput/OFtutorial1.C ================================================ /*---------------------------------------------------------------------------*\ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License This file is part of OpenFOAM. OpenFOAM is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. OpenFOAM is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenFOAM. If not, see . \*---------------------------------------------------------------------------*/ #include "fvCFD.H" int main(int argc, char *argv[]) { // Initialise OF case #include "setRootCase.H" // These two create the time system (instance called runTime) and fvMesh (instance called mesh). #include "createTime.H" #include "createMesh.H" // --- // Get access to a custom dictionary dictionary customDict; const word dictName("customProperties"); // Create and input-output object - this holds the path to the dict and its name IOobject dictIO ( dictName, // name of the file mesh.time().constant(), // path to where the file is mesh, // reference to the mesh needed by the constructor IOobject::MUST_READ // indicate that reading this dictionary is compulsory ); // Check the if the dictionary is present and follows the OF format if (!dictIO.typeHeaderOk(true)) FatalErrorIn(args.executable()) << "Cannot open specified refinement dictionary " << dictName << exit(FatalError); // Initialise the dictionary object customDict = IOdictionary(dictIO); // --- // Read various pieces of information from the main part of the dictionary // Lookup which does not need to be told what type of variable we're looking for and // uses the standard C++ stringstream syntax word someWord; customDict.lookup("someWord") >> someWord; // This template method needs to know the type of the variable and can provide // a default value if the entry is not found in the dictionary scalar someScalar( customDict.lookupOrDefault("someScalar", 1.0) ); // A switch is a neat feature allowing boolean values to be read from a dict, // it supports the OpenFOAM yes/on/true/1 and no/off/false/0 values automatically. bool someBool ( customDict.lookupOrDefault("someBool",true) ); // Lists of values may also be read in the same way List someList ( customDict.lookup("someList") ); // This type of container is particularly interesting - it associates entries with // given key values (here of word type but can be anything); useful when // associating things by indices in a list is less handy HashTable someHashTable ( customDict.lookup("someHashTable") ); // Summarise what's been read and print in the console Info << nl << "Read the following:" << nl << nl << "someWord " << someWord << nl << nl << "someScalar " << someScalar << nl << nl << "someList " << someList << nl << nl << "someHashTable " << someHashTable << nl << nl << "someBool " << someBool << nl << nl << endl; // --- // Create a custom directory and write an output file // Create the output path directory fileName outputDir = mesh.time().path()/"postProcessing"; // Creathe the directory mkDir(outputDir); // File pointer to direct the output to autoPtr outputFilePtr; // Open the file in the newly created directory outputFilePtr.reset(new OFstream(outputDir/"customOutputFile.dat")); // Write stuff outputFilePtr() << "# This is a header" << endl; outputFilePtr() << "0 1 2 3 4 5" << endl; // Append to the imported hash table and wirte it too someHashTable.insert("newKey", vector(1., 0., 0.)); outputFilePtr() << someHashTable << endl; Info<< "End\n" << endl; return 0; } // ************************************************************************* // ================================================ FILE: programmingTutorials/OFtutorial01_inputOutput/testCase/0/U ================================================ /*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: 3.0.1 | | \\ / A nd | Web: www.OpenFOAM.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class volVectorField; object U; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // dimensions [0 1 -1 0 0 0 0]; internalField uniform (0 0 0); boundaryField { movingWall { type fixedValue; value uniform (1 0 0); } fixedWalls { type fixedValue; value uniform (0 0 0); } frontAndBack { type empty; } } // ************************************************************************* // ================================================ FILE: programmingTutorials/OFtutorial01_inputOutput/testCase/0/p ================================================ /*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: 3.0.1 | | \\ / A nd | Web: www.OpenFOAM.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class volScalarField; object p; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // dimensions [0 2 -2 0 0 0 0]; internalField uniform 0; boundaryField { movingWall { type zeroGradient; } fixedWalls { type zeroGradient; } frontAndBack { type empty; } } // ************************************************************************* // ================================================ FILE: programmingTutorials/OFtutorial01_inputOutput/testCase/Allclean ================================================ #!/bin/bash rm -r 1* 2* 3* 4* 5* 6* 7* 8* 9* 0.* constant/polyMesh/* processor* log.* postProcessing 2>/dev/null ================================================ FILE: programmingTutorials/OFtutorial01_inputOutput/testCase/Allrun ================================================ #!/bin/bash blockMesh > log.blockMesh ofTutorial1 ================================================ FILE: programmingTutorials/OFtutorial01_inputOutput/testCase/constant/customProperties ================================================ /*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: 3.0.1 | | \\ / A nd | Web: www.OpenFOAM.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class dictionary; location "constant"; object transportProperties; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // someWord myWord; someScalar 0.01; someBool on; someList ( 0 1 2 ); someHashTable ( key0 (0 0 0) key1 (1 0 0) ); // ************************************************************************* // ================================================ FILE: programmingTutorials/OFtutorial01_inputOutput/testCase/constant/transportProperties ================================================ /*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: 3.0.1 | | \\ / A nd | Web: www.OpenFOAM.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class dictionary; location "constant"; object transportProperties; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // nu [0 2 -1 0 0 0 0] 0.01; // ************************************************************************* // ================================================ FILE: programmingTutorials/OFtutorial01_inputOutput/testCase/system/blockMeshDict ================================================ /*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: 3.0.1 | | \\ / A nd | Web: www.OpenFOAM.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class dictionary; object blockMeshDict; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // convertToMeters 0.1; vertices ( (0 0 0) (1 0 0) (1 1 0) (0 1 0) (0 0 0.1) (1 0 0.1) (1 1 0.1) (0 1 0.1) ); blocks ( hex (0 1 2 3 4 5 6 7) (20 20 1) simpleGrading (1 1 1) ); edges ( ); boundary ( movingWall { type wall; faces ( (3 7 6 2) ); } fixedWalls { type wall; faces ( (0 4 7 3) (2 6 5 1) (1 5 4 0) ); } frontAndBack { type empty; faces ( (0 3 2 1) (4 5 6 7) ); } ); mergePatchPairs ( ); // ************************************************************************* // ================================================ FILE: programmingTutorials/OFtutorial01_inputOutput/testCase/system/controlDict ================================================ /*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: 3.0.1 | | \\ / A nd | Web: www.OpenFOAM.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class dictionary; location "system"; object controlDict; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // application icoFoam; startFrom startTime; startTime 0; stopAt endTime; endTime 0.5; deltaT 0.005; writeControl timeStep; writeInterval 20; purgeWrite 0; writeFormat ascii; writePrecision 6; writeCompression off; timeFormat general; timePrecision 6; runTimeModifiable true; // ************************************************************************* // ================================================ FILE: programmingTutorials/OFtutorial01_inputOutput/testCase/system/fvSchemes ================================================ /*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: 3.0.1 | | \\ / A nd | Web: www.OpenFOAM.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class dictionary; location "system"; object fvSchemes; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // ddtSchemes { default Euler; } gradSchemes { default Gauss linear; grad(p) Gauss linear; } divSchemes { default none; div(phi,U) Gauss linear; } laplacianSchemes { default Gauss linear orthogonal; } interpolationSchemes { default linear; } snGradSchemes { default orthogonal; } // ************************************************************************* // ================================================ FILE: programmingTutorials/OFtutorial01_inputOutput/testCase/system/fvSolution ================================================ /*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: 3.0.1 | | \\ / A nd | Web: www.OpenFOAM.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class dictionary; location "system"; object fvSolution; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // solvers { p { solver PCG; preconditioner DIC; tolerance 1e-06; relTol 0; } U { solver smoothSolver; smoother symGaussSeidel; tolerance 1e-05; relTol 0; } } PISO { nCorrectors 2; nNonOrthogonalCorrectors 0; pRefCell 0; pRefValue 0; } // ************************************************************************* // ================================================ FILE: programmingTutorials/OFtutorial02_commandLineArgumentsAndOptions/Allwclean ================================================ #!/bin/bash wclean ================================================ FILE: programmingTutorials/OFtutorial02_commandLineArgumentsAndOptions/Allwmake ================================================ #!/bin/bash wmake ================================================ FILE: programmingTutorials/OFtutorial02_commandLineArgumentsAndOptions/Make/files ================================================ OFtutorial2.C EXE = $(FOAM_USER_APPBIN)/ofTutorial2 ================================================ FILE: programmingTutorials/OFtutorial02_commandLineArgumentsAndOptions/Make/options ================================================ EXE_INC = \ -I$(LIB_SRC)/finiteVolume/lnInclude \ -I$(LIB_SRC)/meshTools/lnInclude EXE_LIBS = \ -lfiniteVolume \ -lmeshTools ================================================ FILE: programmingTutorials/OFtutorial02_commandLineArgumentsAndOptions/OFtutorial2.C ================================================ /*---------------------------------------------------------------------------*\ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License This file is part of OpenFOAM. OpenFOAM is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. OpenFOAM is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenFOAM. If not, see . \*---------------------------------------------------------------------------*/ #include "fvCFD.H" int main(int argc, char *argv[]) { // === // Define the help message for this application argList::addNote ( "Demonstrates how to handle command line options.\n" "\n" "Input arguments:\n" "----------------\n" " someWord - does stuff\n" " someScalar - does more things\n" ); // prepare argument list argList::noParallel(); argList::validArgs.append("someWord"); argList::validArgs.append("someScalar"); // prepare options argList::addOption // string variable ( "dict", "word", "Path to an additional dictionary (not really used now)" ); argList::addBoolOption // on/off depending on whether option is given or not ( "someSwitch", "Switches from A to B" ); argList::addOption // integer variable ( "someInt", "label", "Optional integer" ); // === // create argument list // This is normally defined inside setRootCase.H // #include "setRootCase.H" Foam::argList args(argc, argv); if (!args.checkRootCase()) { Foam::FatalError.exit(); } // === // read arguments const word someWord = args[1]; // NOTE: the built-in method for converting strings to other data types const scalar someScalar = args.argRead(2); Info << "Got argument word " << someWord << " and scalar " << someScalar << endl; // === // read options // default path to some dictionary fileName dictPath("./system/defaultDict"); // conditional execution based on an option being passed if (args.optionFound("dict")) { args.optionReadIfPresent("dict", dictPath); Info << "Got an override flag for dictionary path" << endl; } Info << "Would read dict from " << dictPath << endl; // switch option const bool someConstBool = args.optionFound("someSwitch"); Info << "Boolean switch set to " << someConstBool << endl; // numeric value option - same as string variables really label someInt(0); args.optionReadIfPresent("someInt", someInt); Info << "Integer option value " << someInt << endl; Info<< "End\n" << endl; return 0; } // ************************************************************************* // ================================================ FILE: programmingTutorials/OFtutorial02_commandLineArgumentsAndOptions/testCase/0/U ================================================ /*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: 3.0.1 | | \\ / A nd | Web: www.OpenFOAM.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class volVectorField; object U; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // dimensions [0 1 -1 0 0 0 0]; internalField uniform (0 0 0); boundaryField { movingWall { type fixedValue; value uniform (1 0 0); } fixedWalls { type fixedValue; value uniform (0 0 0); } frontAndBack { type empty; } } // ************************************************************************* // ================================================ FILE: programmingTutorials/OFtutorial02_commandLineArgumentsAndOptions/testCase/0/p ================================================ /*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: 3.0.1 | | \\ / A nd | Web: www.OpenFOAM.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class volScalarField; object p; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // dimensions [0 2 -2 0 0 0 0]; internalField uniform 0; boundaryField { movingWall { type zeroGradient; } fixedWalls { type zeroGradient; } frontAndBack { type empty; } } // ************************************************************************* // ================================================ FILE: programmingTutorials/OFtutorial02_commandLineArgumentsAndOptions/testCase/Allclean ================================================ #!/bin/bash rm -r 1* 2* 3* 4* 5* 6* 7* 8* 9* 0.* constant/polyMesh/* processor* log.* 2>/dev/null ================================================ FILE: programmingTutorials/OFtutorial02_commandLineArgumentsAndOptions/testCase/Allrun ================================================ #!/bin/bash ofTutorial2 someWordIPassed 5. -someSwitch -someInt 2 -dict path_to_nowhere_in_particular ================================================ FILE: programmingTutorials/OFtutorial02_commandLineArgumentsAndOptions/testCase/constant/transportProperties ================================================ /*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: 3.0.1 | | \\ / A nd | Web: www.OpenFOAM.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class dictionary; location "constant"; object transportProperties; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // nu [0 2 -1 0 0 0 0] 0.01; // ************************************************************************* // ================================================ FILE: programmingTutorials/OFtutorial02_commandLineArgumentsAndOptions/testCase/system/blockMeshDict ================================================ /*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: 3.0.1 | | \\ / A nd | Web: www.OpenFOAM.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class dictionary; object blockMeshDict; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // convertToMeters 0.1; vertices ( (0 0 0) (1 0 0) (1 1 0) (0 1 0) (0 0 0.1) (1 0 0.1) (1 1 0.1) (0 1 0.1) ); blocks ( hex (0 1 2 3 4 5 6 7) (20 20 1) simpleGrading (1 1 1) ); edges ( ); boundary ( movingWall { type wall; faces ( (3 7 6 2) ); } fixedWalls { type wall; faces ( (0 4 7 3) (2 6 5 1) (1 5 4 0) ); } frontAndBack { type empty; faces ( (0 3 2 1) (4 5 6 7) ); } ); mergePatchPairs ( ); // ************************************************************************* // ================================================ FILE: programmingTutorials/OFtutorial02_commandLineArgumentsAndOptions/testCase/system/controlDict ================================================ /*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: 3.0.1 | | \\ / A nd | Web: www.OpenFOAM.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class dictionary; location "system"; object controlDict; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // application icoFoam; startFrom startTime; startTime 0; stopAt endTime; endTime 0.5; deltaT 0.005; writeControl timeStep; writeInterval 20; purgeWrite 0; writeFormat ascii; writePrecision 6; writeCompression off; timeFormat general; timePrecision 6; runTimeModifiable true; // ************************************************************************* // ================================================ FILE: programmingTutorials/OFtutorial02_commandLineArgumentsAndOptions/testCase/system/fvSchemes ================================================ /*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: 3.0.1 | | \\ / A nd | Web: www.OpenFOAM.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class dictionary; location "system"; object fvSchemes; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // ddtSchemes { default Euler; } gradSchemes { default Gauss linear; grad(p) Gauss linear; } divSchemes { default none; div(phi,U) Gauss linear; } laplacianSchemes { default Gauss linear orthogonal; } interpolationSchemes { default linear; } snGradSchemes { default orthogonal; } // ************************************************************************* // ================================================ FILE: programmingTutorials/OFtutorial02_commandLineArgumentsAndOptions/testCase/system/fvSolution ================================================ /*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: 3.0.1 | | \\ / A nd | Web: www.OpenFOAM.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class dictionary; location "system"; object fvSolution; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // solvers { p { solver PCG; preconditioner DIC; tolerance 1e-06; relTol 0; } U { solver smoothSolver; smoother symGaussSeidel; tolerance 1e-05; relTol 0; } } PISO { nCorrectors 2; nNonOrthogonalCorrectors 0; pRefCell 0; pRefValue 0; } // ************************************************************************* // ================================================ FILE: programmingTutorials/OFtutorial03_understandingTheMesh/Allwclean ================================================ #!/bin/bash wclean ================================================ FILE: programmingTutorials/OFtutorial03_understandingTheMesh/Allwmake ================================================ #!/bin/bash wmake ================================================ FILE: programmingTutorials/OFtutorial03_understandingTheMesh/Make/files ================================================ OFtutorial3.C EXE = $(FOAM_USER_APPBIN)/ofTutorial3 ================================================ FILE: programmingTutorials/OFtutorial03_understandingTheMesh/Make/options ================================================ EXE_INC = \ -I$(LIB_SRC)/finiteVolume/lnInclude \ -I$(LIB_SRC)/meshTools/lnInclude EXE_LIBS = \ -lfiniteVolume \ -lmeshTools ================================================ FILE: programmingTutorials/OFtutorial03_understandingTheMesh/OFtutorial3.C ================================================ /*---------------------------------------------------------------------------*\ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License This file is part of OpenFOAM. OpenFOAM is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. OpenFOAM is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenFOAM. If not, see . \*---------------------------------------------------------------------------*/ #include "fvCFD.H" int main(int argc, char *argv[]) { #include "setRootCase.H" // These two create the time system (instance called runTime) and fvMesh (instance called mesh). #include "createTime.H" #include "createMesh.H" // runTime and mesh are instances of objects (or classes). // If you are not familiar with what a class or object is, it is HIGHLY RECOMMENDED you visit this // website and only come back once you've read everything about classes, inheritance and polymorphism: // http://www.cplusplus.com/doc/tutorial/classes/ // Note how the next lines call functions .timeName(), .C() and .Cf() implemented in the objects. // It is also important to realise that mesh.C() and .Cf() return vector fields denoting centres of each // cell and internal face. // Calling the mesh.C().size() method therefore yields the total size of the mesh. Info << "Hello there, the most recent time folder found is " << runTime.timeName() << nl << "The mesh has " << mesh.C().size() << " cells and " << mesh.Cf().size() << " internal faces in it. Wubalubadubdub!" << nl << endl; // It's possible to iterate over every cell in a standard C++ for loop for (label cellI = 0; cellI < mesh.C().size(); cellI++) if (cellI%20 == 0) // only show every twentieth cell not to spam the screen too much Info << "Cell " << cellI << " with centre at " << mesh.C()[cellI] << endl; Info << endl; // spacer // Each cell is constructed of faces - these may either be internal or constitute a // boundary, or a patch in OpenFOAM terms; internal faces have an owner cell // and a neighbour. for (label faceI = 0; faceI < mesh.owner().size(); faceI++) if (faceI%40 == 0) Info << "Internal face " << faceI << " with centre at " << mesh.Cf()[faceI] << " with owner cell " << mesh.owner()[faceI] << " and neighbour " << mesh.neighbour()[faceI] << endl; Info << endl; // Boundary conditions may be accessed through the boundaryMesh object. // In reality, each boundary face is also included in the constant/polyMesh/faces // description. But, in that file, the internal faces are defined first. // In addition, the constant/polyMesh/boundary file defines the starting faceI // indices from which boundary face definitions start. // OpenFOAM also provides a macro definition for for loops over all entries // in a field or a list, which saves up on the amount of typing. forAll(mesh.boundaryMesh(), patchI) Info << "Patch " << patchI << ": " << mesh.boundary()[patchI].name() << " with " << mesh.boundary()[patchI].Cf().size() << " faces. Starts at total face " << mesh.boundary()[patchI].start() << endl; Info << endl; // Faces adjacent to boundaries may be accessed as follows. // Also, a useful thing to know about a face is its normal vector and face area. label patchFaceI(0); forAll(mesh.boundaryMesh(), patchI) Info << "Patch " << patchI << " has its face " << patchFaceI << " adjacent to cell " << mesh.boundary()[patchI].patch().faceCells()[patchFaceI] << ". It has normal vector " << mesh.boundary()[patchI].Sf()[patchFaceI] << " and surface area " << mag(mesh.boundary()[patchI].Sf()[patchFaceI]) << endl; Info << endl; // For internal faces, method .Sf() can be called directly on the mesh instance. // Moreover, there is a shorthand method .magSf() which returns the surface area // as a scalar. // For internal faces, the normal vector points from the owner to the neighbour // and the owner has a smaller cellI index than the neighbour. For boundary faces, // the normals always point outside of the domain (they have "imaginary" neighbours // which do not exist). // It is possible to look at the points making up each face in more detail. // First, we define a few shorthands by getting references to the respective // objects in the mesh. These are defined as constants since we do not aim to // alter the mesh in any way. // NOTE: these lists refer to the physical definition of the mesh and thus // include boundary faces. Use can be made of the mesh.boundary()[patchI].Cf().size() // and mesh.boundary()[patchI].start() methods to check whether the face is internal // or lies on a boundary. const faceList& fcs = mesh.faces(); const List& pts = mesh.points(); const List& cents = mesh.faceCentres(); forAll(fcs,faceI) if (faceI%80==0) { if (faceI(pp)) { // patch patchID is of type "empty". Info << "You will not see this." << endl; } // Patches may also be retrieved from the mesh using their name. This could be // useful if the user were to refer to a particular patch from a dictionary // (like when you do when calculating forces on a particular patch). word patchName("movingWall"); patchID = mesh.boundaryMesh().findPatchID(patchName); Info << "Retrieved patch " << patchName << " at index " << patchID << " using its name only." << nl << endl; Info<< "End\n" << endl; return 0; } // ************************************************************************* // ================================================ FILE: programmingTutorials/OFtutorial03_understandingTheMesh/testCase/0/U ================================================ /*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: 3.0.1 | | \\ / A nd | Web: www.OpenFOAM.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class volVectorField; object U; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // dimensions [0 1 -1 0 0 0 0]; internalField uniform (0 0 0); boundaryField { movingWall { type fixedValue; value uniform (1 0 0); } fixedWalls { type fixedValue; value uniform (0 0 0); } frontAndBack { type empty; } } // ************************************************************************* // ================================================ FILE: programmingTutorials/OFtutorial03_understandingTheMesh/testCase/0/p ================================================ /*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: 3.0.1 | | \\ / A nd | Web: www.OpenFOAM.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class volScalarField; object p; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // dimensions [0 2 -2 0 0 0 0]; internalField uniform 0; boundaryField { movingWall { type zeroGradient; } fixedWalls { type zeroGradient; } frontAndBack { type empty; } } // ************************************************************************* // ================================================ FILE: programmingTutorials/OFtutorial03_understandingTheMesh/testCase/Allclean ================================================ #!/bin/bash rm -r 1* 2* 3* 4* 5* 6* 7* 8* 9* 0.* constant/polyMesh/* processor* log.* 2>/dev/null ================================================ FILE: programmingTutorials/OFtutorial03_understandingTheMesh/testCase/Allrun ================================================ #!/bin/bash blockMesh > log.blockMesh ofTutorial3 ================================================ FILE: programmingTutorials/OFtutorial03_understandingTheMesh/testCase/constant/transportProperties ================================================ /*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: 3.0.1 | | \\ / A nd | Web: www.OpenFOAM.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class dictionary; location "constant"; object transportProperties; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // nu [0 2 -1 0 0 0 0] 0.01; // ************************************************************************* // ================================================ FILE: programmingTutorials/OFtutorial03_understandingTheMesh/testCase/system/blockMeshDict ================================================ /*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: 3.0.1 | | \\ / A nd | Web: www.OpenFOAM.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class dictionary; object blockMeshDict; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // convertToMeters 0.1; vertices ( (0 0 0) (1 0 0) (1 1 0) (0 1 0) (0 0 0.1) (1 0 0.1) (1 1 0.1) (0 1 0.1) ); blocks ( hex (0 1 2 3 4 5 6 7) (20 20 1) simpleGrading (1 1 1) ); edges ( ); boundary ( movingWall { type wall; faces ( (3 7 6 2) ); } fixedWalls { type wall; faces ( (0 4 7 3) (2 6 5 1) (1 5 4 0) ); } frontAndBack { type patch; faces ( (0 3 2 1) (4 5 6 7) ); } ); mergePatchPairs ( ); // ************************************************************************* // ================================================ FILE: programmingTutorials/OFtutorial03_understandingTheMesh/testCase/system/controlDict ================================================ /*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: 3.0.1 | | \\ / A nd | Web: www.OpenFOAM.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class dictionary; location "system"; object controlDict; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // application icoFoam; startFrom startTime; startTime 0; stopAt endTime; endTime 0.5; deltaT 0.005; writeControl timeStep; writeInterval 20; purgeWrite 0; writeFormat ascii; writePrecision 6; writeCompression off; timeFormat general; timePrecision 6; runTimeModifiable true; // ************************************************************************* // ================================================ FILE: programmingTutorials/OFtutorial03_understandingTheMesh/testCase/system/fvSchemes ================================================ /*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: 3.0.1 | | \\ / A nd | Web: www.OpenFOAM.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class dictionary; location "system"; object fvSchemes; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // ddtSchemes { default Euler; } gradSchemes { default Gauss linear; grad(p) Gauss linear; } divSchemes { default none; div(phi,U) Gauss linear; } laplacianSchemes { default Gauss linear orthogonal; } interpolationSchemes { default linear; } snGradSchemes { default orthogonal; } // ************************************************************************* // ================================================ FILE: programmingTutorials/OFtutorial03_understandingTheMesh/testCase/system/fvSolution ================================================ /*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: 3.0.1 | | \\ / A nd | Web: www.OpenFOAM.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class dictionary; location "system"; object fvSolution; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // solvers { p { solver PCG; preconditioner DIC; tolerance 1e-06; relTol 0; } U { solver smoothSolver; smoother symGaussSeidel; tolerance 1e-05; relTol 0; } } PISO { nCorrectors 2; nNonOrthogonalCorrectors 0; pRefCell 0; pRefValue 0; } // ************************************************************************* // ================================================ FILE: programmingTutorials/OFtutorial04_basicFieldOperations/Allwclean ================================================ #!/bin/bash wclean ================================================ FILE: programmingTutorials/OFtutorial04_basicFieldOperations/Allwmake ================================================ #!/bin/bash wmake ================================================ FILE: programmingTutorials/OFtutorial04_basicFieldOperations/Make/files ================================================ OFtutorial4.C EXE = $(FOAM_USER_APPBIN)/ofTutorial4 ================================================ FILE: programmingTutorials/OFtutorial04_basicFieldOperations/Make/options ================================================ EXE_INC = \ -I$(LIB_SRC)/finiteVolume/lnInclude \ -I$(LIB_SRC)/meshTools/lnInclude EXE_LIBS = \ -lfiniteVolume \ -lmeshTools ================================================ FILE: programmingTutorials/OFtutorial04_basicFieldOperations/OFtutorial4.C ================================================ /*---------------------------------------------------------------------------*\ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License This file is part of OpenFOAM. OpenFOAM is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. OpenFOAM is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenFOAM. If not, see . \*---------------------------------------------------------------------------*/ #include "fvCFD.H" // This is a function declaration; this method will calculate some scalar value // given the current time, location in space x, and a reference point x0. The // function also accepts a scaling factor, scale. // The actual implementation, or definition, is below. scalar calculatePressure(scalar t, vector x, vector x0, scalar scale); int main(int argc, char *argv[]) { #include "setRootCase.H" #include "createTime.H" #include "createMesh.H" // This reads a dictionary file. Info << "Reading transportProperties\n" << endl; IOdictionary transportProperties ( IOobject ( "transportProperties", // name of the dictionary runTime.constant(), // location in the case - this one is in constant mesh, // needs the mesh object reference to do some voodoo - unimportant now IOobject::MUST_READ_IF_MODIFIED, // the file will be re-read if it gets modified during time stepping IOobject::NO_WRITE // read-only ) ); // Create a scalar constant for kinematic viscosity by reading the value from the dictionary. dimensionedScalar nu ( "nu", // name of the variable dimViscosity, // dimensions // TIP: to check how this is defined, run: // grep -r dimViscosity $FOAM_SRC/OpenFOAM/ // This returns: /*/opt/openfoam30/src/OpenFOAM/dimensionSet/dimensionSets.C:const dimensionSet dimViscosity(dimArea/dimTime); /opt/openfoam30/src/OpenFOAM/dimensionSet/dimensionSets.C:const dimensionSet dimDynamicViscosity(dimDensity*dimViscosity); /opt/openfoam30/src/OpenFOAM/dimensionSet/dimensionSets.H:extern const dimensionSet dimViscosity;*/ // So, it becomes apparent we should check dimensionSets.C, which contain: /*const dimensionSet dimLength(0, 1, 0, 0, 0, 0, 0); const dimensionSet dimTime(0, 0, 1, 0, 0, 0, 0); const dimensionSet dimArea(sqr(dimLength)); const dimensionSet dimViscosity(dimArea/dimTime);*/ // This is what gets used here. But, an alternative would be to type in the units directly: // dimensionSet(0,2,-1,0,0,0,0), transportProperties.lookup("nu") // this takes the value from the dictionary and returns it, passing it to the object constructor as an argument ); // These read the fields p and U from the time folders, as specified in system/controlDict (i.e. latestTime, startTime, etc.) Info<< "Reading field p\n" << endl; volScalarField p // note that pressure is a scalar field ( IOobject ( "p", // name of the field runTime.timeName(), // name of the current time, i.e. the time folder to read from mesh, IOobject::MUST_READ, // always gets imported, will throw an error if the field is missing IOobject::AUTO_WRITE // will get saved automatically when the controlDict parameters will request it ), mesh // initialises the field to match the size of the mesh with default (0) values ); Info<< "Reading field U\n" << endl; volVectorField U // note that velocity is a vector field ( IOobject ( "U", runTime.timeName(), mesh, IOobject::MUST_READ, IOobject::AUTO_WRITE ), mesh ); // Let us define a vector whose values will not change over the course of the program execution. const vector originVector(0.05,0.05,0.005); // Calculate the distance from the origin to the cell centre furthest away. // In Python, this is equivalent to: // np.sqrt(np.sum((x0-x)**2)) // The .value() method is called to convert from a dimensionedScalar to a regular scalar. const scalar rFarCell = max( // find the maximum value from all distances // compute distance of each cell centre from x0; units of mesh.C() are those of length, as this field // describes position in the Cartesian reference frame. mag(dimensionedVector("x0",dimLength,originVector)-mesh.C()) ).value(); // convert to dim-less scalar // This part of the code performs time stepping for as long as is required by the simulation. Info<< "\nStarting time loop\n" << endl; // This will increment the current time automatically while (runTime.loop()) { Info<< "Time = " << runTime.timeName() << nl << endl; // Loop over all cells in the mesh and calculate the pressure value. for (label cellI=0; cellI/dev/null ================================================ FILE: programmingTutorials/OFtutorial04_basicFieldOperations/testCase/Allrun ================================================ #!/bin/bash blockMesh > log.blockMesh ofTutorial4 ================================================ FILE: programmingTutorials/OFtutorial04_basicFieldOperations/testCase/constant/transportProperties ================================================ /*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: 3.0.1 | | \\ / A nd | Web: www.OpenFOAM.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class dictionary; location "constant"; object transportProperties; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // nu [0 2 -1 0 0 0 0] 0.01; // ************************************************************************* // ================================================ FILE: programmingTutorials/OFtutorial04_basicFieldOperations/testCase/system/blockMeshDict ================================================ /*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: 3.0.1 | | \\ / A nd | Web: www.OpenFOAM.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class dictionary; object blockMeshDict; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // convertToMeters 0.1; vertices ( (0 0 0) (1 0 0) (1 1 0) (0 1 0) (0 0 0.1) (1 0 0.1) (1 1 0.1) (0 1 0.1) ); blocks ( hex (0 1 2 3 4 5 6 7) (20 20 1) simpleGrading (1 1 1) ); edges ( ); boundary ( movingWall { type wall; faces ( (3 7 6 2) ); } fixedWalls { type wall; faces ( (0 4 7 3) (2 6 5 1) (1 5 4 0) ); } frontAndBack { type empty; faces ( (0 3 2 1) (4 5 6 7) ); } ); mergePatchPairs ( ); // ************************************************************************* // ================================================ FILE: programmingTutorials/OFtutorial04_basicFieldOperations/testCase/system/controlDict ================================================ /*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: 3.0.1 | | \\ / A nd | Web: www.OpenFOAM.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class dictionary; location "system"; object controlDict; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // application icoFoam; startFrom startTime; startTime 0; stopAt endTime; endTime 1; deltaT 0.05; writeControl timeStep; writeInterval 1; purgeWrite 0; writeFormat ascii; writePrecision 6; writeCompression off; timeFormat general; timePrecision 6; runTimeModifiable true; // ************************************************************************* // ================================================ FILE: programmingTutorials/OFtutorial04_basicFieldOperations/testCase/system/fvSchemes ================================================ /*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: 3.0.1 | | \\ / A nd | Web: www.OpenFOAM.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class dictionary; location "system"; object fvSchemes; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // ddtSchemes { default Euler; } gradSchemes { default Gauss linear; grad(p) Gauss linear; } divSchemes { default none; div(phi,U) Gauss linear; } laplacianSchemes { default Gauss linear orthogonal; } interpolationSchemes { default linear; } snGradSchemes { default orthogonal; } // ************************************************************************* // ================================================ FILE: programmingTutorials/OFtutorial04_basicFieldOperations/testCase/system/fvSolution ================================================ /*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: 3.0.1 | | \\ / A nd | Web: www.OpenFOAM.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class dictionary; location "system"; object fvSolution; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // solvers { p { solver PCG; preconditioner DIC; tolerance 1e-06; relTol 0; } U { solver smoothSolver; smoother symGaussSeidel; tolerance 1e-05; relTol 0; } } PISO { nCorrectors 2; nNonOrthogonalCorrectors 0; pRefCell 0; pRefValue 0; } // ************************************************************************* // ================================================ FILE: programmingTutorials/OFtutorial05_basicParallelComputing/Allwclean ================================================ #!/bin/bash wclean ================================================ FILE: programmingTutorials/OFtutorial05_basicParallelComputing/Allwmake ================================================ #!/bin/bash wmake ================================================ FILE: programmingTutorials/OFtutorial05_basicParallelComputing/Make/files ================================================ OFtutorial5.C EXE = $(FOAM_USER_APPBIN)/ofTutorial5 ================================================ FILE: programmingTutorials/OFtutorial05_basicParallelComputing/Make/options ================================================ EXE_INC = \ -I$(LIB_SRC)/finiteVolume/lnInclude \ -I$(LIB_SRC)/meshTools/lnInclude EXE_LIBS = \ -lfiniteVolume \ -lmeshTools ================================================ FILE: programmingTutorials/OFtutorial05_basicParallelComputing/OFtutorial5.C ================================================ /*---------------------------------------------------------------------------*\ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License This file is part of OpenFOAM. OpenFOAM is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. OpenFOAM is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenFOAM. If not, see . \*---------------------------------------------------------------------------*/ #include "fvCFD.H" int main(int argc, char *argv[]) { #include "setRootCase.H" #include "createTime.H" #include "createMesh.H" // For a case being run in parallel, the domain is decomposed into several // processor meshes. Each of them is run in a separate process and holds // instances of objects like mesh, U or p just as in a single-threaded (serial) // computation. These will have different sizes, of course, as they hold // fewer elements than the whole, undecomposed, mesh. // Pout is a stream to which each processor can write, unlike Info which only // gets used by the head process (processor0) Pout << "Hello from processor " << Pstream::myProcNo() << "! I am working on " << mesh.C().size() << " cells" << endl; // To exchange information between processes, special OpenMPI routines need // to be called. // This goes over each cell in the subdomain and integrates their volume. scalar meshVolume(0.); forAll(mesh.V(),cellI) meshVolume += mesh.V()[cellI]; // Add the values from all processes together Pout << "Mesh volume on this processor: " << meshVolume << endl; reduce(meshVolume, sumOp()); Info << "Total mesh volume on all processors: " << meshVolume // Note how the reudction operation may be done in place without defning // a temporary variable, where appropriate. << " over " << returnReduce(mesh.C().size(), sumOp