diff --git a/etc/templates/closedVolumeRotating/README b/etc/templates/closedVolumeRotating/README index 1b4173ae83..3cfd1adbb9 100644 --- a/etc/templates/closedVolumeRotating/README +++ b/etc/templates/closedVolumeRotating/README @@ -1,11 +1,11 @@ Overview ======== + Template case for rotating geometry flow for a closed geometry -+ Can be used for MRF or AMI simulations -+ Setup to run the simpleFoam solver for MRF, pimpleDyMFoam for AMI ++ Can be used for MRF or NCC simulations. Also supports AMI. ++ Setup to run the simpleFoam solver for MRF, pimpleFoam for NCC + The case is designed to be meshed with snappyHexMesh + snappyHexMesh is setup to use 3 trisurface files - + fixed.obj: CAD of the stationary geometry + + fixed.obj: CAD of the stationary (external) geometry + rotating.obj: CAD of the rotating geometry + rotatingZone.obj: CAD of surface bounding the rotating region + Copy the *.obj files to the constant/geometry directory @@ -55,8 +55,26 @@ Initialisation + Initialise the field files in the 0 directory + Set the viscosity in constant/transportProperties + Rotating properties are set in constant/rotatingZoneProperties - + For MRF, this file is included from system/fvModels - + For AMI, this file is included from constant/dynamicMeshDict + + For MRF, this file is included from constant/MRFProperties + + For NCC, this file is included from constant/dynamicMeshDict + Ensure settings are appropriate in controlDict, fvSchemes, fvSolution, for - relevant simulation; for AMI, in particular, ensure that deltaT, ddtSchemes + relevant simulation; for NCC, in particular, ensure that deltaT, ddtSchemes and relaxationFactors are set for transient simulation + +NCC Simulation +============== ++ After the mesh is generated, the couple must be created at the boundary + of the rotatingZone ++ createBaffles must first be run to generate two non-coupled patches from + the faces in the faceZone bounding the rotatingZone, e.g. by + createBaffles -overwrite ++ splitBaffles must then be run to duplicate the vertices shared by the + non-coupled patches to enable them to move independently, e.g. by + splitBaffles -overwrite ++ createNonConformalCouples must then be run to generate the couple patches + required by NCC, e.g. by + createNonConformalCouples -overwrite ++ To use AMI instead of NCC, the patches must be generated by createBaffles + using a suitable configuration file, provided by createBafflesDict-AMI + createBaffles -overwrite -dict system/createBafflesDict-AMI + The interface is completed by running splitBaffles, see above diff --git a/etc/templates/closedVolumeRotating/constant/dynamicMeshDict b/etc/templates/closedVolumeRotating/constant/dynamicMeshDict index 3987b54f5c..2fbda092fe 100644 --- a/etc/templates/closedVolumeRotating/constant/dynamicMeshDict +++ b/etc/templates/closedVolumeRotating/constant/dynamicMeshDict @@ -13,16 +13,19 @@ FoamFile } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -mover motionSolver; +mover +{ + type motionSolver; -libs ("libfvMeshMovers.so" "libfvMotionSolvers.so"); + libs ("libfvMeshMovers.so" "libfvMotionSolvers.so"); -motionSolver solidBody; + motionSolver solidBody; -cellZone rotatingZone; + cellZone rotatingZone; -solidBodyMotionFunction rotatingMotion; + solidBodyMotionFunction rotatingMotion; -#include "rotatingZoneProperties" + #include "rotatingZoneProperties" +} // ************************************************************************* // diff --git a/etc/templates/closedVolumeRotating/system/createBafflesDict b/etc/templates/closedVolumeRotating/system/createBafflesDict index b207bc3cf8..091a91d613 100644 --- a/etc/templates/closedVolumeRotating/system/createBafflesDict +++ b/etc/templates/closedVolumeRotating/system/createBafflesDict @@ -28,16 +28,23 @@ baffles { master { - name AMI1; - type cyclicAMI; - neighbourPatch AMI2; + name nonCouple1; + type patch; + patchFields + { + #include "nonCouplePatchFields" + } + inGroups (nonCouple); } slave { - $master; - name AMI2; - type cyclicAMI; - neighbourPatch AMI1; + name nonCouple2; + type patch; + patchFields + { + #include "nonCouplePatchFields" + } + inGroups (nonCouple); } } } diff --git a/etc/templates/closedVolumeRotating/system/createBafflesDict-AMI b/etc/templates/closedVolumeRotating/system/createBafflesDict-AMI new file mode 100644 index 0000000000..7e5e4d275b --- /dev/null +++ b/etc/templates/closedVolumeRotating/system/createBafflesDict-AMI @@ -0,0 +1,45 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: dev + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + format ascii; + class dictionary; + object createBafflesDict; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +internalFacesOnly true; + +fields true; + +baffles +{ + baffleFaces + { + type faceZone; + zoneName rotatingZone; + + patches + { + master + { + name AMI1; + type cyclicAMI; + neighbourPatch AMI2; + } + slave + { + name AMI2; + type cyclicAMI; + neighbourPatch AMI1; + } + } + } +} + +// ************************************************************************* // diff --git a/etc/templates/closedVolumeRotating/system/createNonConformalCouplesDict b/etc/templates/closedVolumeRotating/system/createNonConformalCouplesDict new file mode 100644 index 0000000000..b7740938b3 --- /dev/null +++ b/etc/templates/closedVolumeRotating/system/createNonConformalCouplesDict @@ -0,0 +1,25 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: dev + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + format ascii; + class dictionary; + location "system"; + object createNonConformalCouplesDict; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +fields true; + +NCC +{ + patches (nonCouple1 nonCouple2); + transform none; +} + +// ************************************************************************* // diff --git a/etc/templates/closedVolumeRotating/system/fvSolution b/etc/templates/closedVolumeRotating/system/fvSolution index 9b1d1b819c..60e0b0cdfa 100644 --- a/etc/templates/closedVolumeRotating/system/fvSolution +++ b/etc/templates/closedVolumeRotating/system/fvSolution @@ -42,6 +42,14 @@ solvers $p; } + MeshPhi + { + solver smoothSolver; + smoother symGaussSeidel; + tolerance 1e-2; + relTol 0; + } + "(U|k|omega|epsilon)" { solver smoothSolver; @@ -53,18 +61,19 @@ solvers "(U|k|omega|epsilon)Final" { $U; - relTol 0; } } "(PIMPLE|PISO)" { - nOuterCorrectors 1; - nCorrectors 2; + correctPhi yes; + correctMeshPhi yes; + nOuterCorrectors 1; + nCorrectors 2; nNonOrthogonalCorrectors 1; - pRefCell 0; - pRefValue 0; + pRefCell 0; + pRefValue 0; } SIMPLE @@ -99,4 +108,9 @@ relaxationFactors } } +cache +{ + grad(U); +} + // ************************************************************************* // diff --git a/etc/templates/closedVolumeRotating/system/nonCouplePatchFields b/etc/templates/closedVolumeRotating/system/nonCouplePatchFields new file mode 100644 index 0000000000..4b993ffe50 --- /dev/null +++ b/etc/templates/closedVolumeRotating/system/nonCouplePatchFields @@ -0,0 +1,33 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: dev + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + format ascii; + class dictionary; + object nonCouplePatchFields; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +U +{ + type movingWallSlipVelocity; + value uniform (0 0 0); +} + +nut +{ + type calculated; + value uniform 0; +} + +"(p|k|omega|epsilon)" +{ + type zeroGradient; +} + +// ************************************************************************* // diff --git a/etc/templates/inflowOutflowRotating/README b/etc/templates/inflowOutflowRotating/README index d9d80fbf29..0d85b3cbdf 100644 --- a/etc/templates/inflowOutflowRotating/README +++ b/etc/templates/inflowOutflowRotating/README @@ -1,11 +1,11 @@ Overview ======== + Template case for rotating geometry flow with single inlet and outlet -+ Can be used for MRF or AMI simulations -+ Setup to run the simpleFoam solver for MRF, pimpleDyMFoam for AMI ++ Can be used for MRF or NCC simulations. Also supports AMI. ++ Setup to run the simpleFoam solver for MRF, pimpleFoam for NCC + The case is designed to be meshed with snappyHexMesh + snappyHexMesh is setup to use 3 trisurface files - + fixed.obj: CAD of the stationary geometry + + fixed.obj: CAD of the stationary (external) geometry + rotating.obj: CAD of the rotating geometry + rotatingZone.obj: CAD of surface bounding the rotating region + Copy the *.obj files to the constant/geometry directory @@ -61,8 +61,26 @@ Initialisation + For example, in 0/U, set the inlet velocity Uinlet + Set the viscosity in constant/transportProperties + Rotating properties are set in constant/rotatingZoneProperties - + For MRF, this file is included from system/fvModels - + For AMI, this file is included from constant/dynamicMeshDict + + For MRF, this file is included from constant/MRFProperties + + For NCC, this file is included from constant/dynamicMeshDict + Ensure settings are appropriate in controlDict, fvSchemes, fvSolution, for - relevant simulation; for AMI, in particular, ensure that deltaT, ddtSchemes + relevant simulation; for NCC, in particular, ensure that deltaT, ddtSchemes and relaxationFactors are set for transient simulation + +NCC Simulation +============== ++ After the mesh is generated, the couple must be created at the boundary + of the rotatingZone ++ createBaffles must first be run to generate two non-coupled patches from + the faces in the faceZone bounding the rotatingZone, e.g. by + createBaffles -overwrite ++ splitBaffles must then be run to duplicate the vertices shared by the + non-coupled patches to enable them to move independently, e.g. by + splitBaffles -overwrite ++ createNonConformalCouples must then be run to generate the couple patches + required by NCC, e.g. by + createNonConformalCouples -overwrite ++ To use AMI instead of NCC, the patches must be generated by createBaffles + using a suitable configuration file, provided by createBafflesDict-AMI + createBaffles -overwrite -dict system/createBafflesDict-AMI + The interface is completed by running splitBaffles, see above diff --git a/etc/templates/inflowOutflowRotating/constant/dynamicMeshDict b/etc/templates/inflowOutflowRotating/constant/dynamicMeshDict index 3987b54f5c..2fbda092fe 100644 --- a/etc/templates/inflowOutflowRotating/constant/dynamicMeshDict +++ b/etc/templates/inflowOutflowRotating/constant/dynamicMeshDict @@ -13,16 +13,19 @@ FoamFile } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -mover motionSolver; +mover +{ + type motionSolver; -libs ("libfvMeshMovers.so" "libfvMotionSolvers.so"); + libs ("libfvMeshMovers.so" "libfvMotionSolvers.so"); -motionSolver solidBody; + motionSolver solidBody; -cellZone rotatingZone; + cellZone rotatingZone; -solidBodyMotionFunction rotatingMotion; + solidBodyMotionFunction rotatingMotion; -#include "rotatingZoneProperties" + #include "rotatingZoneProperties" +} // ************************************************************************* // diff --git a/etc/templates/inflowOutflowRotating/system/createBafflesDict b/etc/templates/inflowOutflowRotating/system/createBafflesDict index 7e5e4d275b..091a91d613 100644 --- a/etc/templates/inflowOutflowRotating/system/createBafflesDict +++ b/etc/templates/inflowOutflowRotating/system/createBafflesDict @@ -28,15 +28,23 @@ baffles { master { - name AMI1; - type cyclicAMI; - neighbourPatch AMI2; + name nonCouple1; + type patch; + patchFields + { + #include "nonCouplePatchFields" + } + inGroups (nonCouple); } slave { - name AMI2; - type cyclicAMI; - neighbourPatch AMI1; + name nonCouple2; + type patch; + patchFields + { + #include "nonCouplePatchFields" + } + inGroups (nonCouple); } } } diff --git a/etc/templates/inflowOutflowRotating/system/createBafflesDict-AMI b/etc/templates/inflowOutflowRotating/system/createBafflesDict-AMI new file mode 100644 index 0000000000..7e5e4d275b --- /dev/null +++ b/etc/templates/inflowOutflowRotating/system/createBafflesDict-AMI @@ -0,0 +1,45 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: dev + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + format ascii; + class dictionary; + object createBafflesDict; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +internalFacesOnly true; + +fields true; + +baffles +{ + baffleFaces + { + type faceZone; + zoneName rotatingZone; + + patches + { + master + { + name AMI1; + type cyclicAMI; + neighbourPatch AMI2; + } + slave + { + name AMI2; + type cyclicAMI; + neighbourPatch AMI1; + } + } + } +} + +// ************************************************************************* // diff --git a/etc/templates/inflowOutflowRotating/system/createNonConformalCouplesDict b/etc/templates/inflowOutflowRotating/system/createNonConformalCouplesDict new file mode 100644 index 0000000000..b7740938b3 --- /dev/null +++ b/etc/templates/inflowOutflowRotating/system/createNonConformalCouplesDict @@ -0,0 +1,25 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: dev + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + format ascii; + class dictionary; + location "system"; + object createNonConformalCouplesDict; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +fields true; + +NCC +{ + patches (nonCouple1 nonCouple2); + transform none; +} + +// ************************************************************************* // diff --git a/etc/templates/inflowOutflowRotating/system/fvSolution b/etc/templates/inflowOutflowRotating/system/fvSolution index d3851fd7ab..60e0b0cdfa 100644 --- a/etc/templates/inflowOutflowRotating/system/fvSolution +++ b/etc/templates/inflowOutflowRotating/system/fvSolution @@ -42,6 +42,14 @@ solvers $p; } + MeshPhi + { + solver smoothSolver; + smoother symGaussSeidel; + tolerance 1e-2; + relTol 0; + } + "(U|k|omega|epsilon)" { solver smoothSolver; @@ -59,11 +67,13 @@ solvers "(PIMPLE|PISO)" { - nOuterCorrectors 1; - nCorrectors 2; + correctPhi yes; + correctMeshPhi yes; + nOuterCorrectors 1; + nCorrectors 2; nNonOrthogonalCorrectors 1; - pRefCell 0; - pRefValue 0; + pRefCell 0; + pRefValue 0; } SIMPLE @@ -98,4 +108,9 @@ relaxationFactors } } +cache +{ + grad(U); +} + // ************************************************************************* // diff --git a/etc/templates/inflowOutflowRotating/system/nonCouplePatchFields b/etc/templates/inflowOutflowRotating/system/nonCouplePatchFields new file mode 100644 index 0000000000..4b993ffe50 --- /dev/null +++ b/etc/templates/inflowOutflowRotating/system/nonCouplePatchFields @@ -0,0 +1,33 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: dev + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + format ascii; + class dictionary; + object nonCouplePatchFields; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +U +{ + type movingWallSlipVelocity; + value uniform (0 0 0); +} + +nut +{ + type calculated; + value uniform 0; +} + +"(p|k|omega|epsilon)" +{ + type zeroGradient; +} + +// ************************************************************************* //