From 6f82273f8cd490630cadbbd77eae4449a6c23e2a Mon Sep 17 00:00:00 2001 From: Chris Greenshields <http://cfd.direct> Date: Mon, 18 May 2015 18:34:01 +0100 Subject: [PATCH] Template case files to help general setup of OpenFOAM cases The templates include a stategy to simplify meshing with snappyHexMesh, particularly to help generate an initial mesh quickly that can subsequently be improved. The templates are setup to enable rapid initial simulations, typically with simpleFoam. The initial templates cover simple inflow-outflow and closed domains, including rotating geometry, and an example axisymmetric flow. For more details, consult the README file accompanying each template case. The cases are located in $FOAM_ETC/templates --- etc/templates/axisymmetricJet/0/U | 40 +++++ etc/templates/axisymmetricJet/0/epsilon | 35 +++++ etc/templates/axisymmetricJet/0/k | 42 +++++ etc/templates/axisymmetricJet/0/nut | 38 +++++ etc/templates/axisymmetricJet/0/omega | 35 +++++ etc/templates/axisymmetricJet/0/p | 38 +++++ etc/templates/axisymmetricJet/Allclean | 8 + etc/templates/axisymmetricJet/Allrun | 14 ++ etc/templates/axisymmetricJet/README | 25 +++ .../axisymmetricJet/constant/RASProperties | 23 +++ .../constant/polyMesh/blockMeshDict | 109 +++++++++++++ .../constant/transportProperties | 21 +++ .../constant/turbulenceProperties | 19 +++ .../axisymmetricJet/system/controlDict | 56 +++++++ .../axisymmetricJet/system/extrudeMeshDict | 35 +++++ .../axisymmetricJet/system/fvSchemes | 67 ++++++++ .../axisymmetricJet/system/fvSolution | 93 +++++++++++ etc/templates/axisymmetricJet/system/graph | 42 +++++ etc/templates/closedVolume/0/T | 36 +++++ etc/templates/closedVolume/0/U | 30 ++++ etc/templates/closedVolume/0/alphat | 31 ++++ etc/templates/closedVolume/0/epsilon | 32 ++++ etc/templates/closedVolume/0/k | 32 ++++ etc/templates/closedVolume/0/nut | 30 ++++ etc/templates/closedVolume/0/omega | 32 ++++ etc/templates/closedVolume/0/p | 29 ++++ etc/templates/closedVolume/0/p_rgh | 31 ++++ etc/templates/closedVolume/README | 24 +++ .../closedVolume/constant/RASProperties | 23 +++ etc/templates/closedVolume/constant/g | 20 +++ .../constant/polyMesh/blockMeshDict | 68 ++++++++ .../closedVolume/constant/transportProperties | 34 ++++ .../closedVolume/constant/triSurface/.keep | 0 .../constant/turbulenceProperties | 19 +++ etc/templates/closedVolume/system/controlDict | 55 +++++++ etc/templates/closedVolume/system/fvSchemes | 69 ++++++++ etc/templates/closedVolume/system/fvSolution | 95 +++++++++++ .../closedVolume/system/meshQualityDict | 22 +++ .../closedVolume/system/snappyHexMeshDict | 104 +++++++++++++ .../system/surfaceFeatureExtractDict | 35 +++++ etc/templates/closedVolumeRotating/0/U | 35 +++++ etc/templates/closedVolumeRotating/0/k | 32 ++++ etc/templates/closedVolumeRotating/0/nut | 30 ++++ etc/templates/closedVolumeRotating/0/omega | 32 ++++ etc/templates/closedVolumeRotating/0/p | 29 ++++ etc/templates/closedVolumeRotating/README | 7 + .../constant/RASProperties | 23 +++ .../constant/dynamicMeshDict | 30 ++++ .../constant/polyMesh/blockMeshDict | 68 ++++++++ .../constant/rotatingZoneProperties | 22 +++ .../constant/transportProperties | 21 +++ .../constant/triSurface/.keep | 0 .../constant/turbulenceProperties | 19 +++ .../closedVolumeRotating/system/controlDict | 55 +++++++ .../system/createBafflesDict | 46 ++++++ .../closedVolumeRotating/system/fvOptions | 30 ++++ .../closedVolumeRotating/system/fvSchemes | 67 ++++++++ .../closedVolumeRotating/system/fvSolution | 93 +++++++++++ .../system/meshQualityDict | 22 +++ .../system/snappyHexMeshDict | 126 +++++++++++++++ .../system/surfaceFeatureExtractDict | 32 ++++ etc/templates/inflowOutflow/0/U | 46 ++++++ etc/templates/inflowOutflow/0/k | 47 ++++++ etc/templates/inflowOutflow/0/nut | 44 ++++++ etc/templates/inflowOutflow/0/omega | 47 ++++++ etc/templates/inflowOutflow/0/p | 42 +++++ etc/templates/inflowOutflow/README | 54 +++++++ .../inflowOutflow/constant/RASProperties | 23 +++ .../constant/polyMesh/blockMeshDict | 68 ++++++++ .../polyMesh/blockMeshDict.extPatches | 121 ++++++++++++++ .../constant/transportProperties | 21 +++ .../inflowOutflow/constant/triSurface/.keep | 0 .../constant/turbulenceProperties | 19 +++ .../inflowOutflow/system/controlDict | 55 +++++++ etc/templates/inflowOutflow/system/fvSchemes | 67 ++++++++ etc/templates/inflowOutflow/system/fvSolution | 93 +++++++++++ .../inflowOutflow/system/meshQualityDict | 22 +++ .../inflowOutflow/system/snappyHexMeshDict | 120 ++++++++++++++ .../system/surfaceFeatureExtractDict | 35 +++++ etc/templates/inflowOutflowRotating/0/U | 52 +++++++ etc/templates/inflowOutflowRotating/0/k | 47 ++++++ etc/templates/inflowOutflowRotating/0/nut | 44 ++++++ etc/templates/inflowOutflowRotating/0/omega | 47 ++++++ etc/templates/inflowOutflowRotating/0/p | 42 +++++ etc/templates/inflowOutflowRotating/README | 32 ++++ .../constant/RASProperties | 23 +++ .../constant/dynamicMeshDict | 30 ++++ .../constant/polyMesh/blockMeshDict | 68 ++++++++ .../polyMesh/blockMeshDict.extPatches | 121 ++++++++++++++ .../constant/rotatingZoneProperties | 22 +++ .../constant/transportProperties | 21 +++ .../constant/triSurface/.keep | 0 .../constant/turbulenceProperties | 19 +++ .../inflowOutflowRotating/system/controlDict | 55 +++++++ .../system/createBafflesDict | 46 ++++++ .../inflowOutflowRotating/system/fvOptions | 30 ++++ .../inflowOutflowRotating/system/fvSchemes | 67 ++++++++ .../inflowOutflowRotating/system/fvSolution | 93 +++++++++++ .../system/meshQualityDict | 22 +++ .../system/snappyHexMeshDict | 147 ++++++++++++++++++ .../system/surfaceFeatureExtractDict | 32 ++++ 101 files changed, 4394 insertions(+) create mode 100644 etc/templates/axisymmetricJet/0/U create mode 100644 etc/templates/axisymmetricJet/0/epsilon create mode 100644 etc/templates/axisymmetricJet/0/k create mode 100644 etc/templates/axisymmetricJet/0/nut create mode 100644 etc/templates/axisymmetricJet/0/omega create mode 100644 etc/templates/axisymmetricJet/0/p create mode 100755 etc/templates/axisymmetricJet/Allclean create mode 100755 etc/templates/axisymmetricJet/Allrun create mode 100644 etc/templates/axisymmetricJet/README create mode 100644 etc/templates/axisymmetricJet/constant/RASProperties create mode 100644 etc/templates/axisymmetricJet/constant/polyMesh/blockMeshDict create mode 100644 etc/templates/axisymmetricJet/constant/transportProperties create mode 100644 etc/templates/axisymmetricJet/constant/turbulenceProperties create mode 100644 etc/templates/axisymmetricJet/system/controlDict create mode 100644 etc/templates/axisymmetricJet/system/extrudeMeshDict create mode 100644 etc/templates/axisymmetricJet/system/fvSchemes create mode 100644 etc/templates/axisymmetricJet/system/fvSolution create mode 100644 etc/templates/axisymmetricJet/system/graph create mode 100644 etc/templates/closedVolume/0/T create mode 100644 etc/templates/closedVolume/0/U create mode 100644 etc/templates/closedVolume/0/alphat create mode 100644 etc/templates/closedVolume/0/epsilon create mode 100644 etc/templates/closedVolume/0/k create mode 100644 etc/templates/closedVolume/0/nut create mode 100644 etc/templates/closedVolume/0/omega create mode 100644 etc/templates/closedVolume/0/p create mode 100644 etc/templates/closedVolume/0/p_rgh create mode 100644 etc/templates/closedVolume/README create mode 100644 etc/templates/closedVolume/constant/RASProperties create mode 100644 etc/templates/closedVolume/constant/g create mode 100644 etc/templates/closedVolume/constant/polyMesh/blockMeshDict create mode 100644 etc/templates/closedVolume/constant/transportProperties create mode 100644 etc/templates/closedVolume/constant/triSurface/.keep create mode 100644 etc/templates/closedVolume/constant/turbulenceProperties create mode 100644 etc/templates/closedVolume/system/controlDict create mode 100644 etc/templates/closedVolume/system/fvSchemes create mode 100644 etc/templates/closedVolume/system/fvSolution create mode 100644 etc/templates/closedVolume/system/meshQualityDict create mode 100644 etc/templates/closedVolume/system/snappyHexMeshDict create mode 100644 etc/templates/closedVolume/system/surfaceFeatureExtractDict create mode 100644 etc/templates/closedVolumeRotating/0/U create mode 100644 etc/templates/closedVolumeRotating/0/k create mode 100644 etc/templates/closedVolumeRotating/0/nut create mode 100644 etc/templates/closedVolumeRotating/0/omega create mode 100644 etc/templates/closedVolumeRotating/0/p create mode 100644 etc/templates/closedVolumeRotating/README create mode 100644 etc/templates/closedVolumeRotating/constant/RASProperties create mode 100644 etc/templates/closedVolumeRotating/constant/dynamicMeshDict create mode 100644 etc/templates/closedVolumeRotating/constant/polyMesh/blockMeshDict create mode 100644 etc/templates/closedVolumeRotating/constant/rotatingZoneProperties create mode 100644 etc/templates/closedVolumeRotating/constant/transportProperties create mode 100644 etc/templates/closedVolumeRotating/constant/triSurface/.keep create mode 100644 etc/templates/closedVolumeRotating/constant/turbulenceProperties create mode 100644 etc/templates/closedVolumeRotating/system/controlDict create mode 100644 etc/templates/closedVolumeRotating/system/createBafflesDict create mode 100644 etc/templates/closedVolumeRotating/system/fvOptions create mode 100644 etc/templates/closedVolumeRotating/system/fvSchemes create mode 100644 etc/templates/closedVolumeRotating/system/fvSolution create mode 100644 etc/templates/closedVolumeRotating/system/meshQualityDict create mode 100644 etc/templates/closedVolumeRotating/system/snappyHexMeshDict create mode 100644 etc/templates/closedVolumeRotating/system/surfaceFeatureExtractDict create mode 100644 etc/templates/inflowOutflow/0/U create mode 100644 etc/templates/inflowOutflow/0/k create mode 100644 etc/templates/inflowOutflow/0/nut create mode 100644 etc/templates/inflowOutflow/0/omega create mode 100644 etc/templates/inflowOutflow/0/p create mode 100644 etc/templates/inflowOutflow/README create mode 100644 etc/templates/inflowOutflow/constant/RASProperties create mode 100644 etc/templates/inflowOutflow/constant/polyMesh/blockMeshDict create mode 100644 etc/templates/inflowOutflow/constant/polyMesh/blockMeshDict.extPatches create mode 100644 etc/templates/inflowOutflow/constant/transportProperties create mode 100644 etc/templates/inflowOutflow/constant/triSurface/.keep create mode 100644 etc/templates/inflowOutflow/constant/turbulenceProperties create mode 100644 etc/templates/inflowOutflow/system/controlDict create mode 100644 etc/templates/inflowOutflow/system/fvSchemes create mode 100644 etc/templates/inflowOutflow/system/fvSolution create mode 100644 etc/templates/inflowOutflow/system/meshQualityDict create mode 100644 etc/templates/inflowOutflow/system/snappyHexMeshDict create mode 100644 etc/templates/inflowOutflow/system/surfaceFeatureExtractDict create mode 100644 etc/templates/inflowOutflowRotating/0/U create mode 100644 etc/templates/inflowOutflowRotating/0/k create mode 100644 etc/templates/inflowOutflowRotating/0/nut create mode 100644 etc/templates/inflowOutflowRotating/0/omega create mode 100644 etc/templates/inflowOutflowRotating/0/p create mode 100644 etc/templates/inflowOutflowRotating/README create mode 100644 etc/templates/inflowOutflowRotating/constant/RASProperties create mode 100644 etc/templates/inflowOutflowRotating/constant/dynamicMeshDict create mode 100644 etc/templates/inflowOutflowRotating/constant/polyMesh/blockMeshDict create mode 100644 etc/templates/inflowOutflowRotating/constant/polyMesh/blockMeshDict.extPatches create mode 100644 etc/templates/inflowOutflowRotating/constant/rotatingZoneProperties create mode 100644 etc/templates/inflowOutflowRotating/constant/transportProperties create mode 100644 etc/templates/inflowOutflowRotating/constant/triSurface/.keep create mode 100644 etc/templates/inflowOutflowRotating/constant/turbulenceProperties create mode 100644 etc/templates/inflowOutflowRotating/system/controlDict create mode 100644 etc/templates/inflowOutflowRotating/system/createBafflesDict create mode 100644 etc/templates/inflowOutflowRotating/system/fvOptions create mode 100644 etc/templates/inflowOutflowRotating/system/fvSchemes create mode 100644 etc/templates/inflowOutflowRotating/system/fvSolution create mode 100644 etc/templates/inflowOutflowRotating/system/meshQualityDict create mode 100644 etc/templates/inflowOutflowRotating/system/snappyHexMeshDict create mode 100644 etc/templates/inflowOutflowRotating/system/surfaceFeatureExtractDict diff --git a/etc/templates/axisymmetricJet/0/U b/etc/templates/axisymmetricJet/0/U new file mode 100644 index 00000000000..cc273e63215 --- /dev/null +++ b/etc/templates/axisymmetricJet/0/U @@ -0,0 +1,40 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volVectorField; + object U; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +Uinlet (10 0 0); + +dimensions [0 1 -1 0 0 0 0]; + +internalField uniform (0 0 0); + +boundaryField +{ + inlet + { + type fixedValue; + value uniform $Uinlet; + } + + atmosphere + { + type pressureInletOutletVelocity; + value uniform (0 0 0); + } + + #includeEtc "caseDicts/setConstraintTypes" +} + +// ************************************************************************* // diff --git a/etc/templates/axisymmetricJet/0/epsilon b/etc/templates/axisymmetricJet/0/epsilon new file mode 100644 index 00000000000..0869fb8b601 --- /dev/null +++ b/etc/templates/axisymmetricJet/0/epsilon @@ -0,0 +1,35 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + object omega; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +epsilonInlet 0.002; + +dimensions [0 2 -3 0 0 0 0]; + +internalField uniform $epsilonInlet; + +boundaryField +{ + "(inlet|atmosphere)" + { + type turbulentMixingLengthDissipationRateInlet; + mixingLength 0.1; + value uniform $epsilonInlet; + } + + #includeEtc "caseDicts/setConstraintTypes" +} + +// ************************************************************************* // diff --git a/etc/templates/axisymmetricJet/0/k b/etc/templates/axisymmetricJet/0/k new file mode 100644 index 00000000000..a1f6af1feb5 --- /dev/null +++ b/etc/templates/axisymmetricJet/0/k @@ -0,0 +1,42 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + object k; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +kInlet 0.01; + +dimensions [0 2 -2 0 0 0 0]; + +internalField uniform $kInlet; + +boundaryField +{ + inlet + { + type turbulentIntensityKineticEnergyInlet; + intensity 0.02; + value uniform $kInlet; + } + + atmosphere + { + type inletOutlet; + inletValue uniform $kInlet; + value uniform $kInlet; + } + + #includeEtc "caseDicts/setConstraintTypes" +} + +// ************************************************************************* // diff --git a/etc/templates/axisymmetricJet/0/nut b/etc/templates/axisymmetricJet/0/nut new file mode 100644 index 00000000000..07359957474 --- /dev/null +++ b/etc/templates/axisymmetricJet/0/nut @@ -0,0 +1,38 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / 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 calculated; + value uniform 0; + } + + atmosphere + { + type calculated; + value uniform 0; + } + + #includeEtc "caseDicts/setConstraintTypes" +} + +// ************************************************************************* // diff --git a/etc/templates/axisymmetricJet/0/omega b/etc/templates/axisymmetricJet/0/omega new file mode 100644 index 00000000000..3c40b00c11a --- /dev/null +++ b/etc/templates/axisymmetricJet/0/omega @@ -0,0 +1,35 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + object omega; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +omegaInlet 1.0; + +dimensions [0 0 -1 0 0 0 0]; + +internalField uniform $omegaInlet; + +boundaryField +{ + "(inlet|atmosphere)" + { + type turbulentMixingLengthFrequencyInlet; + mixingLength 0.1; + value uniform $omegaInlet; + } + + #includeEtc "caseDicts/setConstraintTypes" +} + +// ************************************************************************* // diff --git a/etc/templates/axisymmetricJet/0/p b/etc/templates/axisymmetricJet/0/p new file mode 100644 index 00000000000..a7ad7abf891 --- /dev/null +++ b/etc/templates/axisymmetricJet/0/p @@ -0,0 +1,38 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / 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; + } + + atmosphere + { + type totalPressure; + gamma 1.4; + p0 uniform 0; + } + + #includeEtc "caseDicts/setConstraintTypes" +} + +// ************************************************************************* // diff --git a/etc/templates/axisymmetricJet/Allclean b/etc/templates/axisymmetricJet/Allclean new file mode 100755 index 00000000000..ce8bcabbfc4 --- /dev/null +++ b/etc/templates/axisymmetricJet/Allclean @@ -0,0 +1,8 @@ +#!/bin/sh +cd ${0%/*} || exit 1 # run from this directory + +# Source tutorial clean functions +. $WM_PROJECT_DIR/bin/tools/CleanFunctions + +cleanCase +rm constant/polyMesh/boundary diff --git a/etc/templates/axisymmetricJet/Allrun b/etc/templates/axisymmetricJet/Allrun new file mode 100755 index 00000000000..2f68265be98 --- /dev/null +++ b/etc/templates/axisymmetricJet/Allrun @@ -0,0 +1,14 @@ +#!/bin/sh +cd ${0%/*} || exit 1 # run from this directory + +# Source tutorial run functions +. $WM_PROJECT_DIR/bin/tools/RunFunctions + +application=`getApplication` + +runApplication blockMesh +runApplication extrudeMesh + +runApplication $application + +# ----------------------------------------------------------------- end-of-file diff --git a/etc/templates/axisymmetricJet/README b/etc/templates/axisymmetricJet/README new file mode 100644 index 00000000000..d8bc496bf3e --- /dev/null +++ b/etc/templates/axisymmetricJet/README @@ -0,0 +1,25 @@ +Overview +======== ++ Template case for axisymmetric jet flow ++ The main purpose of this template is to demonstrate a simple, reliable meshing + strategy for axisymmetric flow + +Meshing +======= ++ The blockMeshDict file contains a backgroundMesh subditionary ++ In backgroundMesh set the geometry radius and length and jet radius ++ Set the number of cells in the length and radial directions ++ Run blockMesh to generate a 2D "slab" mesh ++ Run extrudeMesh to convert the mesh into a 2D axisymmetric mesh with wedge + front and back patches + +Initialisation +============== ++ In the field files in the 0 directory, set inlet values ++ For example, in 0/U, set the inlet velocity Uinlet ++ Set the viscosity in constant/transportProperties + +Output +====== ++ Graph data of field values along the centreline are written to files in + postProcessing/graph \ No newline at end of file diff --git a/etc/templates/axisymmetricJet/constant/RASProperties b/etc/templates/axisymmetricJet/constant/RASProperties new file mode 100644 index 00000000000..fefd567bebe --- /dev/null +++ b/etc/templates/axisymmetricJet/constant/RASProperties @@ -0,0 +1,23 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object RASProperties; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +RASModel kOmegaSST; + +turbulence on; + +printCoeffs on; + +// ************************************************************************* // diff --git a/etc/templates/axisymmetricJet/constant/polyMesh/blockMeshDict b/etc/templates/axisymmetricJet/constant/polyMesh/blockMeshDict new file mode 100644 index 00000000000..253d10ae765 --- /dev/null +++ b/etc/templates/axisymmetricJet/constant/polyMesh/blockMeshDict @@ -0,0 +1,109 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object blockMeshDict; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +backgroundMesh +{ + length 25; + rA 0.5; // radius of inlet patch + rB 4; // outer radius + lengthCells 250; + rAcells 10; + rBcells 50; +} + +convertToMeters 1; + +vertices +( + ( 0 0 -1) + ($:backgroundMesh.length 0 -1) + ( 0 $:backgroundMesh.rA -1) + ($:backgroundMesh.length $:backgroundMesh.rA -1) + ( 0 $:backgroundMesh.rB -1) + ($:backgroundMesh.length $:backgroundMesh.rB -1) + + ( 0 0 0) + ($:backgroundMesh.length 0 0) + ( 0 $:backgroundMesh.rA 0) + ($:backgroundMesh.length $:backgroundMesh.rA 0) + ( 0 $:backgroundMesh.rB 0) + ($:backgroundMesh.length $:backgroundMesh.rB 0) +); + +blocks +( + hex (0 1 3 2 6 7 9 8) + ($:backgroundMesh.lengthCells $:backgroundMesh.rAcells 1) + simpleGrading (1 1 1) + + hex (2 3 5 4 8 9 11 10) + ($:backgroundMesh.lengthCells $:backgroundMesh.rBcells 1) + simpleGrading (1 1 1) +); + +edges +( +); + +boundary +( + inlet + { + type patch; + faces + ( + (0 6 8 2) + ); + } + + front + { + type symmetry; + faces + ( + (6 7 9 8) + (8 9 11 10) + ); + } + + back + { + type symmetry; + faces + ( + (0 1 3 2) + (2 3 5 4) + ); + } + + atmosphere + { + type patch; + faces + ( + (2 8 10 4) + (4 5 11 10) + (5 3 9 11) + (3 1 7 9) + ); + } +); + +mergePatchPairs +( +); + +// ************************************************************************* // diff --git a/etc/templates/axisymmetricJet/constant/transportProperties b/etc/templates/axisymmetricJet/constant/transportProperties new file mode 100644 index 00000000000..59110123306 --- /dev/null +++ b/etc/templates/axisymmetricJet/constant/transportProperties @@ -0,0 +1,21 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object transportProperties; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +transportModel Newtonian; + +nu nu [ 0 2 -1 0 0 0 0 ] 1.5e-05; + +// ************************************************************************* // diff --git a/etc/templates/axisymmetricJet/constant/turbulenceProperties b/etc/templates/axisymmetricJet/constant/turbulenceProperties new file mode 100644 index 00000000000..dc0e00cc54f --- /dev/null +++ b/etc/templates/axisymmetricJet/constant/turbulenceProperties @@ -0,0 +1,19 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object turbulenceProperties; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +simulationType RASModel; + +// ************************************************************************* // diff --git a/etc/templates/axisymmetricJet/system/controlDict b/etc/templates/axisymmetricJet/system/controlDict new file mode 100644 index 00000000000..8ce37aec888 --- /dev/null +++ b/etc/templates/axisymmetricJet/system/controlDict @@ -0,0 +1,56 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object controlDict; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +application simpleFoam; + +startFrom latestTime; + +startTime 0; + +stopAt endTime; + +endTime 1000; + +deltaT 1; + +writeControl timeStep; + +writeInterval 50; + +purgeWrite 0; + +writeFormat ascii; + +writePrecision 12; + +writeCompression off; + +timeFormat general; + +timePrecision 6; + +runTimeModifiable true; + +// adjustTimeStep yes; + +// maxCo 1; + +functions +{ + #include "graph" +} + +// ************************************************************************* // diff --git a/etc/templates/axisymmetricJet/system/extrudeMeshDict b/etc/templates/axisymmetricJet/system/extrudeMeshDict new file mode 100644 index 00000000000..2cd06d38465 --- /dev/null +++ b/etc/templates/axisymmetricJet/system/extrudeMeshDict @@ -0,0 +1,35 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object extrudeProperties; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +constructFrom patch; +sourceCase "$FOAM_CASE"; + +sourcePatches (front); +exposedPatchName back; + +extrudeModel wedge; + +sectorCoeffs +{ + axisPt (0 0 0); + axis (1 0 0); + angle 1; +} + +flipNormals false; +mergeFaces false; + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/etc/templates/axisymmetricJet/system/fvSchemes b/etc/templates/axisymmetricJet/system/fvSchemes new file mode 100644 index 00000000000..ddcdf027dc5 --- /dev/null +++ b/etc/templates/axisymmetricJet/system/fvSchemes @@ -0,0 +1,67 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object fvSchemes; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +ddtSchemes +{ + default steadyState; +} + +gradSchemes +{ + default Gauss linear; + + limited cellLimited Gauss linear 1; + grad(U) $limited; + grad(k) $limited; + grad(omega) $limited; +} + +divSchemes +{ + default none; + + div(phi,U) bounded Gauss linearUpwind limited; + + turbulence bounded Gauss limitedLinear 1; + div(phi,k) $turbulence; + div(phi,omega) $turbulence; + div(phi,epsilon) $turbulence; + + div((nuEff*dev(T(grad(U))))) Gauss linear; +} + +laplacianSchemes +{ + default Gauss linear corrected; +} + +interpolationSchemes +{ + default linear; +} + +snGradSchemes +{ + default corrected; +} + +fluxRequired +{ + default no; + p ; +} + +// ************************************************************************* // diff --git a/etc/templates/axisymmetricJet/system/fvSolution b/etc/templates/axisymmetricJet/system/fvSolution new file mode 100644 index 00000000000..f1e5a8fb417 --- /dev/null +++ b/etc/templates/axisymmetricJet/system/fvSolution @@ -0,0 +1,93 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object fvSolution; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +solvers +{ + p + { + solver GAMG; + smoother GaussSeidel; + cacheAgglomeration on; // Need to make this default? + agglomerator faceAreaPair; // Need to make this default? + nCellsInCoarsestLevel 10; // Need to make this default? + mergeLevels 1; // Need to make this default + tolerance 1e-6; + relTol 0.1; + } + + "(U|k|omega|epsilon)" + { + solver smoothSolver; + smoother symGaussSeidel; + tolerance 1e-6; + relTol 0.1; + } + + pFinal + { + $p; + relTol 0; + } + + "(U|k|omega|epsilon)Final" + { + $U; + relTol 0; + } +} + +"(PIMPLE|PISO)" +{ + nOuterCorrectors 1; + nCorrectors 2; + nNonOrthogonalCorrectors 1; + pRefCell 0; + pRefValue 0; +} + +SIMPLE +{ + residualControl + { + p 1e-4; + U 1e-4; + "(k|omega|epsilon)" 1e-4; + } + nNonOrthogonalCorrectors 0; + pRefCell 0; + pRefValue 0; + +} + +potentialFlow +{ + nNonOrthogonalCorrectors 10; +} + +relaxationFactors +{ + fields + { + p 0.3; + } + equations + { + U 0.7; + "(k|omega|epsilon)" 0.7; + } +} + +// ************************************************************************* // diff --git a/etc/templates/axisymmetricJet/system/graph b/etc/templates/axisymmetricJet/system/graph new file mode 100644 index 00000000000..b8a7cdf2ebc --- /dev/null +++ b/etc/templates/axisymmetricJet/system/graph @@ -0,0 +1,42 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object ; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +graph +{ + type sets; + functionObjectLibs ("libsampling.so"); + outputControl outputTime; + + interpolationScheme cellPointFace; + + setFormat raw; + + sets + ( + centreline + { + type uniform; + axis x; + start ( 0 1e-6 0); + end (25 1e-6 0); + nPoints 250; + } + ); + + fields ( U ); +} + +// ************************************************************************* // diff --git a/etc/templates/closedVolume/0/T b/etc/templates/closedVolume/0/T new file mode 100644 index 00000000000..0ce9d571866 --- /dev/null +++ b/etc/templates/closedVolume/0/T @@ -0,0 +1,36 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + object T; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 0 0 1 0 0 0]; + +internalField uniform 300; + +boundaryField +{ + <patchName> + { + type fixedValue; + value uniform 400; + } + + wall + { + type fixedValue; + value $internalField; + } +} + +// ************************************************************************* // diff --git a/etc/templates/closedVolume/0/U b/etc/templates/closedVolume/0/U new file mode 100644 index 00000000000..b279dc1f787 --- /dev/null +++ b/etc/templates/closedVolume/0/U @@ -0,0 +1,30 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / 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 +{ + wall + { + type fixedValue; + value uniform (0 0 0); + } +} + +// ************************************************************************* // diff --git a/etc/templates/closedVolume/0/alphat b/etc/templates/closedVolume/0/alphat new file mode 100644 index 00000000000..bd91fb69fbf --- /dev/null +++ b/etc/templates/closedVolume/0/alphat @@ -0,0 +1,31 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + object alphat; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 2 -1 0 0 0 0]; + +internalField uniform 0; + +boundaryField +{ + wall + { + type alphatJayatillekeWallFunction; + Prt 0.85; + value $internalField; + } +} + +// ************************************************************************* // diff --git a/etc/templates/closedVolume/0/epsilon b/etc/templates/closedVolume/0/epsilon new file mode 100644 index 00000000000..568d7ae2937 --- /dev/null +++ b/etc/templates/closedVolume/0/epsilon @@ -0,0 +1,32 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + object epsilon; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +epsilonInitial 0.001; + +dimensions [0 2 -3 0 0 0 0]; + +internalField uniform $epsilonInitial; + +boundaryField +{ + wall + { + type epsilonWallFunction; + value uniform $epsilonInitial; + } +} + +// ************************************************************************* // diff --git a/etc/templates/closedVolume/0/k b/etc/templates/closedVolume/0/k new file mode 100644 index 00000000000..8392b825758 --- /dev/null +++ b/etc/templates/closedVolume/0/k @@ -0,0 +1,32 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + object k; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +kInitial 0.005; + +dimensions [0 2 -2 0 0 0 0]; + +internalField uniform $kInitial; + +boundaryField +{ + wall + { + type kqRWallFunction; + value uniform $kInitial; + } +} + +// ************************************************************************* // diff --git a/etc/templates/closedVolume/0/nut b/etc/templates/closedVolume/0/nut new file mode 100644 index 00000000000..65d838bc112 --- /dev/null +++ b/etc/templates/closedVolume/0/nut @@ -0,0 +1,30 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / 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 +{ + wall + { + type nutkWallFunction; + value uniform 0; + } +} + +// ************************************************************************* // diff --git a/etc/templates/closedVolume/0/omega b/etc/templates/closedVolume/0/omega new file mode 100644 index 00000000000..0c7b1fc50b6 --- /dev/null +++ b/etc/templates/closedVolume/0/omega @@ -0,0 +1,32 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + object omega; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +omegaInitial 0.1; + +dimensions [0 0 -1 0 0 0 0]; + +internalField uniform $omegaInitial; + +boundaryField +{ + wall + { + type omegaWallFunction; + value uniform $omegaInitial; + } +} + +// ************************************************************************* // diff --git a/etc/templates/closedVolume/0/p b/etc/templates/closedVolume/0/p new file mode 100644 index 00000000000..13408a92b19 --- /dev/null +++ b/etc/templates/closedVolume/0/p @@ -0,0 +1,29 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / 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 +{ + wall + { + type zeroGradient; + } +} + +// ************************************************************************* // diff --git a/etc/templates/closedVolume/0/p_rgh b/etc/templates/closedVolume/0/p_rgh new file mode 100644 index 00000000000..1f21394c577 --- /dev/null +++ b/etc/templates/closedVolume/0/p_rgh @@ -0,0 +1,31 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / 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 +{ + wall + { + type fixedFluxPressure; + rho rhok; + value $internalField; + } +} + +// ************************************************************************* // diff --git a/etc/templates/closedVolume/README b/etc/templates/closedVolume/README new file mode 100644 index 00000000000..e82f1320ee6 --- /dev/null +++ b/etc/templates/closedVolume/README @@ -0,0 +1,24 @@ +Overview +======= ++ This is a template case for a closed volume ++ Setup to run buoyantBoussinesqSimpleFoam ++ The case is designed to be meshed with snappyHexMesh ++ snappyHexMesh is setup to use a single trisurface file named CAD.obj ++ Copy the CAD.obj file to the constant/triSurface directory ++ The CAD.obj can contain one or more regions to create patches in the mesh ++ The user can then specify different boundary condition on T on these patches + +Meshing +======= ++ Meshing is setup as in the inflowOutflow template ++ See $FOAM_ETC/templates/inflowOutflow/README for details ++ The setup includes an example for one named patch to be generated in the mesh ++ In snappyHexMeshDict, replace <CADregionName> with the name of region in the + trisurface; replace <patchName> with the name of the resulting mesh patch + +Initialisation +============== ++ In the field files in the 0 directory, set initial values ++ The template includes a fixedValue boundary condition on <patchName> in 0/T ++ The user can replace <patchName> with a real mesh patch name and apply a + fixed temperature on that patch \ No newline at end of file diff --git a/etc/templates/closedVolume/constant/RASProperties b/etc/templates/closedVolume/constant/RASProperties new file mode 100644 index 00000000000..496ee3b41cc --- /dev/null +++ b/etc/templates/closedVolume/constant/RASProperties @@ -0,0 +1,23 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object RASProperties; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +RASModel kEpsilon; + +turbulence on; + +printCoeffs on; + +// ************************************************************************* // diff --git a/etc/templates/closedVolume/constant/g b/etc/templates/closedVolume/constant/g new file mode 100644 index 00000000000..1d3e30dc5be --- /dev/null +++ b/etc/templates/closedVolume/constant/g @@ -0,0 +1,20 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class uniformDimensionedVectorField; + object g; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 1 -2 0 0 0 0]; +value ( 0 -9.81 0 ); + +// ************************************************************************* // diff --git a/etc/templates/closedVolume/constant/polyMesh/blockMeshDict b/etc/templates/closedVolume/constant/polyMesh/blockMeshDict new file mode 100644 index 00000000000..de6aabcfd15 --- /dev/null +++ b/etc/templates/closedVolume/constant/polyMesh/blockMeshDict @@ -0,0 +1,68 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object blockMeshDict; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +backgroundMesh +{ + xMin -1; + xMax 1; + yMin -1; + yMax 1; + zMin -1; + zMax 1; + xCells 20; + yCells 20; + zCells 20; +} + +convertToMeters 1; + +vertices +( + ($:backgroundMesh.xMin $:backgroundMesh.yMin $:backgroundMesh.zMin) + ($:backgroundMesh.xMax $:backgroundMesh.yMin $:backgroundMesh.zMin) + ($:backgroundMesh.xMax $:backgroundMesh.yMax $:backgroundMesh.zMin) + ($:backgroundMesh.xMin $:backgroundMesh.yMax $:backgroundMesh.zMin) + + ($:backgroundMesh.xMin $:backgroundMesh.yMin $:backgroundMesh.zMax) + ($:backgroundMesh.xMax $:backgroundMesh.yMin $:backgroundMesh.zMax) + ($:backgroundMesh.xMax $:backgroundMesh.yMax $:backgroundMesh.zMax) + ($:backgroundMesh.xMin $:backgroundMesh.yMax $:backgroundMesh.zMax) +); + +blocks +( + hex (0 1 2 3 4 5 6 7) + ( + $:backgroundMesh.xCells + $:backgroundMesh.yCells + $:backgroundMesh.zCells + ) + simpleGrading (1 1 1) +); + +edges +( +); + +boundary +( +); + +mergePatchPairs +( +); + +// ************************************************************************* // diff --git a/etc/templates/closedVolume/constant/transportProperties b/etc/templates/closedVolume/constant/transportProperties new file mode 100644 index 00000000000..e51fc898337 --- /dev/null +++ b/etc/templates/closedVolume/constant/transportProperties @@ -0,0 +1,34 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object transportProperties; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +transportModel Newtonian; + +// Laminar viscosity +nu nu [0 2 -1 0 0 0 0] 1e-05; + +// Thermal expansion coefficient +beta beta [0 0 0 -1 0 0 0] 3e-03; + +// Reference temperature +TRef TRef [0 0 0 1 0 0 0] 300; + +// Laminar Prandtl number +Pr Pr [0 0 0 0 0 0 0] 0.9; + +// Turbulent Prandtl number +Prt Prt [0 0 0 0 0 0 0] 0.7; + +// ************************************************************************* // diff --git a/etc/templates/closedVolume/constant/triSurface/.keep b/etc/templates/closedVolume/constant/triSurface/.keep new file mode 100644 index 00000000000..e69de29bb2d diff --git a/etc/templates/closedVolume/constant/turbulenceProperties b/etc/templates/closedVolume/constant/turbulenceProperties new file mode 100644 index 00000000000..dc0e00cc54f --- /dev/null +++ b/etc/templates/closedVolume/constant/turbulenceProperties @@ -0,0 +1,19 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object turbulenceProperties; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +simulationType RASModel; + +// ************************************************************************* // diff --git a/etc/templates/closedVolume/system/controlDict b/etc/templates/closedVolume/system/controlDict new file mode 100644 index 00000000000..097662ad96c --- /dev/null +++ b/etc/templates/closedVolume/system/controlDict @@ -0,0 +1,55 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object controlDict; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +application buoyantBoussinesqSimpleFoam; + +startFrom latestTime; + +startTime 0; + +stopAt endTime; + +endTime 1000; + +deltaT 1; + +writeControl timeStep; + +writeInterval 50; + +purgeWrite 0; + +writeFormat ascii; + +writePrecision 8; + +writeCompression off; + +timeFormat general; + +timePrecision 6; + +runTimeModifiable true; + +// adjustTimeStep yes; + +// maxCo 1; + +functions +{ +} + +// ************************************************************************* // diff --git a/etc/templates/closedVolume/system/fvSchemes b/etc/templates/closedVolume/system/fvSchemes new file mode 100644 index 00000000000..bd2779fb8ba --- /dev/null +++ b/etc/templates/closedVolume/system/fvSchemes @@ -0,0 +1,69 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object fvSchemes; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +ddtSchemes +{ + default steadyState; +} + +gradSchemes +{ + default Gauss linear; + + limited cellLimited Gauss linear 1; + grad(U) $limited; + grad(k) $limited; + grad(omega) $limited; +} + +divSchemes +{ + default none; + + div(phi,U) bounded Gauss linearUpwind limited; + + turbulence bounded Gauss limitedLinear 1; + div(phi,k) $turbulence; + div(phi,omega) $turbulence; + div(phi,epsilon) $turbulence; + + div(phi,T) $turbulence; + + div((nuEff*dev(T(grad(U))))) Gauss linear; +} + +laplacianSchemes +{ + default Gauss linear corrected; +} + +interpolationSchemes +{ + default linear; +} + +snGradSchemes +{ + default corrected; +} + +fluxRequired +{ + default no; + p_rgh ; +} + +// ************************************************************************* // diff --git a/etc/templates/closedVolume/system/fvSolution b/etc/templates/closedVolume/system/fvSolution new file mode 100644 index 00000000000..c00261a959c --- /dev/null +++ b/etc/templates/closedVolume/system/fvSolution @@ -0,0 +1,95 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object fvSolution; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +solvers +{ + p_rgh + { + solver GAMG; + smoother GaussSeidel; + cacheAgglomeration on; // Need to make this default? + agglomerator faceAreaPair; // Need to make this default? + nCellsInCoarsestLevel 10; // Need to make this default? + mergeLevels 1; // Need to make this default + tolerance 1e-6; + relTol 0.1; + } + + "(U|T|k|omega|epsilon)" + { + solver smoothSolver; + smoother symGaussSeidel; + tolerance 1e-6; + relTol 0.1; + } + + p_rghFinal + { + $p; + relTol 0; + } + + "(U|k|omega|epsilon)Final" + { + $U; + relTol 0; + } +} + +"(PIMPLE|PISO)" +{ + nOuterCorrectors 1; + nCorrectors 2; + nNonOrthogonalCorrectors 1; + pRefCell 0; + pRefValue 0; +} + +SIMPLE +{ + residualControl + { + p 1e-4; + U 1e-4; + T 1e-4; + "(k|omega|epsilon)" 1e-4; + } + nNonOrthogonalCorrectors 0; + pRefCell 0; + pRefValue 0; + +} + +potentialFlow +{ + nNonOrthogonalCorrectors 10; +} + +relaxationFactors +{ + fields + { + p_rgh 0.7; + } + equations + { + U 0.3; + T 0.5; + "(k|omega|epsilon)" 0.7; + } +} + +// ************************************************************************* // diff --git a/etc/templates/closedVolume/system/meshQualityDict b/etc/templates/closedVolume/system/meshQualityDict new file mode 100644 index 00000000000..c38396d7102 --- /dev/null +++ b/etc/templates/closedVolume/system/meshQualityDict @@ -0,0 +1,22 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object meshQualityDict; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#includeEtc "caseDicts/mesh/generation/meshQualityDict.cfg" + +//- minFaceWeight (0 -> 0.5) +//minFaceWeight 0.02; + +// ************************************************************************* // diff --git a/etc/templates/closedVolume/system/snappyHexMeshDict b/etc/templates/closedVolume/system/snappyHexMeshDict new file mode 100644 index 00000000000..2bc7718a524 --- /dev/null +++ b/etc/templates/closedVolume/system/snappyHexMeshDict @@ -0,0 +1,104 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object snappyHexMeshDict; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#includeEtc "caseDicts/mesh/generation/snappyHexMeshDict.cfg" + +castellatedMesh on; +snap off; +addLayers off; + +geometry +{ + CAD.obj + { + type triSurfaceMesh; + name CAD; + regions + { + <CADregionName> { name <patchName>; } + } + } +}; + +castellatedMeshControls +{ + features + ( +// { file "CAD.eMesh"; level 1; } + ); + + refinementSurfaces + { + CAD + { + level (2 2); + patchInfo { type wall; } + } + } + + refinementRegions + { + CAD + { + mode inside; + levels ((1E15 2)); + } + } + + locationInMesh (1e-5 1e-5 1e-5); // Offset from (0 0 0) to avoid + // coinciding with face or edge +} + +snapControls +{ +// explicitFeatureSnap true; +// implicitFeatureSnap false; +} + +addLayersControls +{ + layers + { + "CAD.*" + { + nSurfaceLayers 2; + } + } + + relativeSizes true; // false, usually with firstLayerThickness + expansionRatio 1.2; + finalLayerThickness 0.5; + minThickness 1e-3; +// firstLayerThickness 0.01; + +// maxThicknessToMedialRatio 0.6; +} + +meshQualityControls +{ +// minTetQuality -1e+30; +} + +writeFlags +( + scalarLevels + layerSets + layerFields +); + +mergeTolerance 1e-6; + +// ************************************************************************* // diff --git a/etc/templates/closedVolume/system/surfaceFeatureExtractDict b/etc/templates/closedVolume/system/surfaceFeatureExtractDict new file mode 100644 index 00000000000..bd9bdd52c92 --- /dev/null +++ b/etc/templates/closedVolume/system/surfaceFeatureExtractDict @@ -0,0 +1,35 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object surfaceFeatureExtractDict; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +CAD.obj +{ + extractionMethod extractFromSurface; + + extractFromSurfaceCoeffs + { + includedAngle 150; + } + + subsetFeatures + { + nonManifoldEdges yes; + openEdges yes; + } + + writeObj yes; +} + +// ************************************************************************* // diff --git a/etc/templates/closedVolumeRotating/0/U b/etc/templates/closedVolumeRotating/0/U new file mode 100644 index 00000000000..ca3c572c860 --- /dev/null +++ b/etc/templates/closedVolumeRotating/0/U @@ -0,0 +1,35 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / 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 +{ + rotating + { + type movingWallVelocity; + value uniform (0 0 0); + } + wall + { + type fixedValue; + value uniform (0 0 0); + } +} + +// ************************************************************************* // diff --git a/etc/templates/closedVolumeRotating/0/k b/etc/templates/closedVolumeRotating/0/k new file mode 100644 index 00000000000..d7858735b9e --- /dev/null +++ b/etc/templates/closedVolumeRotating/0/k @@ -0,0 +1,32 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + object k; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +kInitial 0.1; + +dimensions [0 2 -2 0 0 0 0]; + +internalField uniform $kInitial; + +boundaryField +{ + wall + { + type kqRWallFunction; + value uniform $kInitial; + } +} + +// ************************************************************************* // diff --git a/etc/templates/closedVolumeRotating/0/nut b/etc/templates/closedVolumeRotating/0/nut new file mode 100644 index 00000000000..65d838bc112 --- /dev/null +++ b/etc/templates/closedVolumeRotating/0/nut @@ -0,0 +1,30 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / 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 +{ + wall + { + type nutkWallFunction; + value uniform 0; + } +} + +// ************************************************************************* // diff --git a/etc/templates/closedVolumeRotating/0/omega b/etc/templates/closedVolumeRotating/0/omega new file mode 100644 index 00000000000..c752ed6d6ef --- /dev/null +++ b/etc/templates/closedVolumeRotating/0/omega @@ -0,0 +1,32 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + object omega; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +omegaInitial 1.0; + +dimensions [0 0 -1 0 0 0 0]; + +internalField uniform $omegaInitial; + +boundaryField +{ + wall + { + type omegaWallFunction; + value uniform $omegaInitial; + } +} + +// ************************************************************************* // diff --git a/etc/templates/closedVolumeRotating/0/p b/etc/templates/closedVolumeRotating/0/p new file mode 100644 index 00000000000..13408a92b19 --- /dev/null +++ b/etc/templates/closedVolumeRotating/0/p @@ -0,0 +1,29 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / 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 +{ + wall + { + type zeroGradient; + } +} + +// ************************************************************************* // diff --git a/etc/templates/closedVolumeRotating/README b/etc/templates/closedVolumeRotating/README new file mode 100644 index 00000000000..d238875658b --- /dev/null +++ b/etc/templates/closedVolumeRotating/README @@ -0,0 +1,7 @@ +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 ++ Set up is like inflowOutflowRotating but without inlet and outlet ++ See $FOAM_ETC/templates/closedVolumeRotating/README for details of use diff --git a/etc/templates/closedVolumeRotating/constant/RASProperties b/etc/templates/closedVolumeRotating/constant/RASProperties new file mode 100644 index 00000000000..fefd567bebe --- /dev/null +++ b/etc/templates/closedVolumeRotating/constant/RASProperties @@ -0,0 +1,23 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object RASProperties; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +RASModel kOmegaSST; + +turbulence on; + +printCoeffs on; + +// ************************************************************************* // diff --git a/etc/templates/closedVolumeRotating/constant/dynamicMeshDict b/etc/templates/closedVolumeRotating/constant/dynamicMeshDict new file mode 100644 index 00000000000..b269d757d53 --- /dev/null +++ b/etc/templates/closedVolumeRotating/constant/dynamicMeshDict @@ -0,0 +1,30 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object dynamicMeshDict; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dynamicFvMesh solidBodyMotionFvMesh; + +solidBodyMotionFvMeshCoeffs +{ + cellZone rotatingZone; + + solidBodyMotionFunction rotatingMotion; + rotatingMotionCoeffs + { + #include "rotatingZoneProperties" + } +} + +// ************************************************************************* // diff --git a/etc/templates/closedVolumeRotating/constant/polyMesh/blockMeshDict b/etc/templates/closedVolumeRotating/constant/polyMesh/blockMeshDict new file mode 100644 index 00000000000..de6aabcfd15 --- /dev/null +++ b/etc/templates/closedVolumeRotating/constant/polyMesh/blockMeshDict @@ -0,0 +1,68 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object blockMeshDict; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +backgroundMesh +{ + xMin -1; + xMax 1; + yMin -1; + yMax 1; + zMin -1; + zMax 1; + xCells 20; + yCells 20; + zCells 20; +} + +convertToMeters 1; + +vertices +( + ($:backgroundMesh.xMin $:backgroundMesh.yMin $:backgroundMesh.zMin) + ($:backgroundMesh.xMax $:backgroundMesh.yMin $:backgroundMesh.zMin) + ($:backgroundMesh.xMax $:backgroundMesh.yMax $:backgroundMesh.zMin) + ($:backgroundMesh.xMin $:backgroundMesh.yMax $:backgroundMesh.zMin) + + ($:backgroundMesh.xMin $:backgroundMesh.yMin $:backgroundMesh.zMax) + ($:backgroundMesh.xMax $:backgroundMesh.yMin $:backgroundMesh.zMax) + ($:backgroundMesh.xMax $:backgroundMesh.yMax $:backgroundMesh.zMax) + ($:backgroundMesh.xMin $:backgroundMesh.yMax $:backgroundMesh.zMax) +); + +blocks +( + hex (0 1 2 3 4 5 6 7) + ( + $:backgroundMesh.xCells + $:backgroundMesh.yCells + $:backgroundMesh.zCells + ) + simpleGrading (1 1 1) +); + +edges +( +); + +boundary +( +); + +mergePatchPairs +( +); + +// ************************************************************************* // diff --git a/etc/templates/closedVolumeRotating/constant/rotatingZoneProperties b/etc/templates/closedVolumeRotating/constant/rotatingZoneProperties new file mode 100644 index 00000000000..e0a4a97d205 --- /dev/null +++ b/etc/templates/closedVolumeRotating/constant/rotatingZoneProperties @@ -0,0 +1,22 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object rotatingZoneProperties; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +origin (0 0 0); +axis (0 0 1); +omega constant <rad/s>; +nonRotatingPatches (fixed); + +// ************************************************************************* // diff --git a/etc/templates/closedVolumeRotating/constant/transportProperties b/etc/templates/closedVolumeRotating/constant/transportProperties new file mode 100644 index 00000000000..59110123306 --- /dev/null +++ b/etc/templates/closedVolumeRotating/constant/transportProperties @@ -0,0 +1,21 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object transportProperties; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +transportModel Newtonian; + +nu nu [ 0 2 -1 0 0 0 0 ] 1.5e-05; + +// ************************************************************************* // diff --git a/etc/templates/closedVolumeRotating/constant/triSurface/.keep b/etc/templates/closedVolumeRotating/constant/triSurface/.keep new file mode 100644 index 00000000000..e69de29bb2d diff --git a/etc/templates/closedVolumeRotating/constant/turbulenceProperties b/etc/templates/closedVolumeRotating/constant/turbulenceProperties new file mode 100644 index 00000000000..dc0e00cc54f --- /dev/null +++ b/etc/templates/closedVolumeRotating/constant/turbulenceProperties @@ -0,0 +1,19 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object turbulenceProperties; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +simulationType RASModel; + +// ************************************************************************* // diff --git a/etc/templates/closedVolumeRotating/system/controlDict b/etc/templates/closedVolumeRotating/system/controlDict new file mode 100644 index 00000000000..bfda3b05c7a --- /dev/null +++ b/etc/templates/closedVolumeRotating/system/controlDict @@ -0,0 +1,55 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object controlDict; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +application simpleFoam; + +startFrom latestTime; + +startTime 0; + +stopAt endTime; + +endTime 1000; + +deltaT 1; + +writeControl timeStep; + +writeInterval 50; + +purgeWrite 0; + +writeFormat ascii; + +writePrecision 8; + +writeCompression off; + +timeFormat general; + +timePrecision 6; + +runTimeModifiable true; + +// adjustTimeStep yes; + +// maxCo 1; + +functions +{ +} + +// ************************************************************************* // diff --git a/etc/templates/closedVolumeRotating/system/createBafflesDict b/etc/templates/closedVolumeRotating/system/createBafflesDict new file mode 100644 index 00000000000..a7b38ff6b86 --- /dev/null +++ b/etc/templates/closedVolumeRotating/system/createBafflesDict @@ -0,0 +1,46 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object createBafflesDict; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +internalFacesOnly true; + +baffles +{ + baffleFaces + { + type faceZone; + zoneName rotatingZone; + + patches + { + master + { + name AMI1; + type cyclicAMI; + matchTolerance 0.0001; + neighbourPatch AMI2; + transform noOrdering; + } + slave + { + $master; + name AMI2; + neighbourPatch AMI1; + } + } + } +} + +// ************************************************************************* // diff --git a/etc/templates/closedVolumeRotating/system/fvOptions b/etc/templates/closedVolumeRotating/system/fvOptions new file mode 100644 index 00000000000..2d6dfa8e564 --- /dev/null +++ b/etc/templates/closedVolumeRotating/system/fvOptions @@ -0,0 +1,30 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object fvOptions; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +MRF1 +{ + type MRFSource; + selectionMode cellZone; + cellZone rotatingZone; + active yes; + + MRFSourceCoeffs + { + #include "${FOAM_CASE}/constant/rotatingZoneProperties" + } +} + +// ************************************************************************* // diff --git a/etc/templates/closedVolumeRotating/system/fvSchemes b/etc/templates/closedVolumeRotating/system/fvSchemes new file mode 100644 index 00000000000..ddcdf027dc5 --- /dev/null +++ b/etc/templates/closedVolumeRotating/system/fvSchemes @@ -0,0 +1,67 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object fvSchemes; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +ddtSchemes +{ + default steadyState; +} + +gradSchemes +{ + default Gauss linear; + + limited cellLimited Gauss linear 1; + grad(U) $limited; + grad(k) $limited; + grad(omega) $limited; +} + +divSchemes +{ + default none; + + div(phi,U) bounded Gauss linearUpwind limited; + + turbulence bounded Gauss limitedLinear 1; + div(phi,k) $turbulence; + div(phi,omega) $turbulence; + div(phi,epsilon) $turbulence; + + div((nuEff*dev(T(grad(U))))) Gauss linear; +} + +laplacianSchemes +{ + default Gauss linear corrected; +} + +interpolationSchemes +{ + default linear; +} + +snGradSchemes +{ + default corrected; +} + +fluxRequired +{ + default no; + p ; +} + +// ************************************************************************* // diff --git a/etc/templates/closedVolumeRotating/system/fvSolution b/etc/templates/closedVolumeRotating/system/fvSolution new file mode 100644 index 00000000000..f1e5a8fb417 --- /dev/null +++ b/etc/templates/closedVolumeRotating/system/fvSolution @@ -0,0 +1,93 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object fvSolution; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +solvers +{ + p + { + solver GAMG; + smoother GaussSeidel; + cacheAgglomeration on; // Need to make this default? + agglomerator faceAreaPair; // Need to make this default? + nCellsInCoarsestLevel 10; // Need to make this default? + mergeLevels 1; // Need to make this default + tolerance 1e-6; + relTol 0.1; + } + + "(U|k|omega|epsilon)" + { + solver smoothSolver; + smoother symGaussSeidel; + tolerance 1e-6; + relTol 0.1; + } + + pFinal + { + $p; + relTol 0; + } + + "(U|k|omega|epsilon)Final" + { + $U; + relTol 0; + } +} + +"(PIMPLE|PISO)" +{ + nOuterCorrectors 1; + nCorrectors 2; + nNonOrthogonalCorrectors 1; + pRefCell 0; + pRefValue 0; +} + +SIMPLE +{ + residualControl + { + p 1e-4; + U 1e-4; + "(k|omega|epsilon)" 1e-4; + } + nNonOrthogonalCorrectors 0; + pRefCell 0; + pRefValue 0; + +} + +potentialFlow +{ + nNonOrthogonalCorrectors 10; +} + +relaxationFactors +{ + fields + { + p 0.3; + } + equations + { + U 0.7; + "(k|omega|epsilon)" 0.7; + } +} + +// ************************************************************************* // diff --git a/etc/templates/closedVolumeRotating/system/meshQualityDict b/etc/templates/closedVolumeRotating/system/meshQualityDict new file mode 100644 index 00000000000..c38396d7102 --- /dev/null +++ b/etc/templates/closedVolumeRotating/system/meshQualityDict @@ -0,0 +1,22 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object meshQualityDict; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#includeEtc "caseDicts/mesh/generation/meshQualityDict.cfg" + +//- minFaceWeight (0 -> 0.5) +//minFaceWeight 0.02; + +// ************************************************************************* // diff --git a/etc/templates/closedVolumeRotating/system/snappyHexMeshDict b/etc/templates/closedVolumeRotating/system/snappyHexMeshDict new file mode 100644 index 00000000000..587e4ad23fc --- /dev/null +++ b/etc/templates/closedVolumeRotating/system/snappyHexMeshDict @@ -0,0 +1,126 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object snappyHexMeshDict; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#includeEtc "caseDicts/mesh/generation/snappyHexMeshDict.cfg" + +castellatedMesh on; +snap on; +addLayers off; + +geometry +{ + fixed.obj + { + type triSurfaceMesh; + name fixed; + } + rotating.obj + { + type triSurfaceMesh; + name rotating; + } + rotatingZone.obj + { + type triSurfaceMesh; + name rotatingZone; + } +}; + +castellatedMeshControls +{ + features + ( + { file "fixed.eMesh"; level 1; } + { file "rotating.eMesh"; level 1; } + { file "rotatingZone.eMesh"; level 1; } + ); + + refinementSurfaces + { + fixed + { + level (2 2); + patchInfo { type wall; } + } + rotating + { + level (2 2); + patchInfo { type wall; } + } + rotatingZone + { + level (2 2); + faceZone rotatingZone; + cellZone rotatingZone; + cellZoneInside inside; + } + + } + + refinementRegions + { + /* + rotatingZone + { + mode inside; + levels ((1E15 2)); + } + */ + } + + locationInMesh (1e-5 1e-5 1e-5); // Offset from (0 0 0) to avoid + // coinciding with face or edge +} + +snapControls +{ + explicitFeatureSnap true; +} + +addLayersControls +{ + layers + { + "(rotating|fixed)" + { + nSurfaceLayers 2; + } + } + + relativeSizes true; // false, usually with firstLayerThickness + expansionRatio 1.2; + finalLayerThickness 0.5; + minThickness 1e-3; +// firstLayerThickness 0.01; + +// maxThicknessToMedialRatio 0.6; +} + +meshQualityControls +{ +// minTetQuality -1e+30; +} + +writeFlags +( + scalarLevels + layerSets + layerFields +); + +mergeTolerance 1e-6; + +// ************************************************************************* // diff --git a/etc/templates/closedVolumeRotating/system/surfaceFeatureExtractDict b/etc/templates/closedVolumeRotating/system/surfaceFeatureExtractDict new file mode 100644 index 00000000000..4c48520a07b --- /dev/null +++ b/etc/templates/closedVolumeRotating/system/surfaceFeatureExtractDict @@ -0,0 +1,32 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object surfaceFeatureExtractDict; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +fixed.obj +{ + #includeEtc "caseDicts/surface/surfaceFeatureExtractDict.cfg" +} + +rotating.obj +{ + #includeEtc "caseDicts/surface/surfaceFeatureExtractDict.cfg" +} + +rotatingZone.obj +{ + #includeEtc "caseDicts/surface/surfaceFeatureExtractDict.cfg" +} + +// ************************************************************************* // diff --git a/etc/templates/inflowOutflow/0/U b/etc/templates/inflowOutflow/0/U new file mode 100644 index 00000000000..8b7d69447af --- /dev/null +++ b/etc/templates/inflowOutflow/0/U @@ -0,0 +1,46 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volVectorField; + object U; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +Uinlet (10 0 0); + +dimensions [0 1 -1 0 0 0 0]; + +internalField uniform (0 0 0); + +boundaryField +{ + inlet + { + type fixedValue; + value uniform $Uinlet; + } + + outlet + { + type pressureInletOutletVelocity; + value uniform (0 0 0); + } + + wall + { + type fixedValue; + value uniform (0 0 0); + } + + #includeEtc "caseDicts/setConstraintTypes" +} + +// ************************************************************************* // diff --git a/etc/templates/inflowOutflow/0/k b/etc/templates/inflowOutflow/0/k new file mode 100644 index 00000000000..4f402e2f44d --- /dev/null +++ b/etc/templates/inflowOutflow/0/k @@ -0,0 +1,47 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + object k; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +kInlet 0.1; + +dimensions [0 2 -2 0 0 0 0]; + +internalField uniform $kInlet; + +boundaryField +{ + inlet + { + type fixedValue; + value uniform $kInlet; + } + + outlet + { + type inletOutlet; + inletValue uniform $kInlet; + value uniform $kInlet; + } + + wall + { + type kqRWallFunction; + value uniform $kInlet; + } + + #includeEtc "caseDicts/setConstraintTypes" +} + +// ************************************************************************* // diff --git a/etc/templates/inflowOutflow/0/nut b/etc/templates/inflowOutflow/0/nut new file mode 100644 index 00000000000..54a56f319ff --- /dev/null +++ b/etc/templates/inflowOutflow/0/nut @@ -0,0 +1,44 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / 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 calculated; + value uniform 0; + } + + outlet + { + type calculated; + value uniform 0; + } + + wall + { + type nutkWallFunction; + value uniform 0; + } + + #includeEtc "caseDicts/setConstraintTypes" +} + +// ************************************************************************* // diff --git a/etc/templates/inflowOutflow/0/omega b/etc/templates/inflowOutflow/0/omega new file mode 100644 index 00000000000..e8e14245763 --- /dev/null +++ b/etc/templates/inflowOutflow/0/omega @@ -0,0 +1,47 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + object omega; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +omegaInlet 1.0; + +dimensions [0 0 -1 0 0 0 0]; + +internalField uniform $omegaInlet; + +boundaryField +{ + inlet + { + type fixedValue; + value uniform $omegaInlet; + } + + outlet + { + type inletOutlet; + inletValue uniform $omegaInlet; + value uniform $omegaInlet; + } + + wall + { + type omegaWallFunction; + value uniform $omegaInlet; + } + + #includeEtc "caseDicts/setConstraintTypes" +} + +// ************************************************************************* // diff --git a/etc/templates/inflowOutflow/0/p b/etc/templates/inflowOutflow/0/p new file mode 100644 index 00000000000..f2d9ffb3b9b --- /dev/null +++ b/etc/templates/inflowOutflow/0/p @@ -0,0 +1,42 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / 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; + } + + wall + { + type zeroGradient; + } + + #includeEtc "caseDicts/setConstraintTypes" +} + +// ************************************************************************* // diff --git a/etc/templates/inflowOutflow/README b/etc/templates/inflowOutflow/README new file mode 100644 index 00000000000..3cac200bdc9 --- /dev/null +++ b/etc/templates/inflowOutflow/README @@ -0,0 +1,54 @@ +Overview +======== ++ This is a template case with single inlet and outlet ++ Setup to run the simpleFoam solver ++ The case is designed to be meshed with snappyHexMesh ++ snappyHexMesh is setup to use a single trisurface file named CAD.obj ++ Copy the CAD.obj file to the constant/triSurface directory ++ The CAD.obj should contain an inlet and outlet region to create the relevant + patches in the mesh + +Background Mesh +=============== ++ The user should establish the bounds of their CAD.obj file ++ The blockMeshDict file contains a backgroundMesh subditionary ++ Set xMin, xMax, etc to be beyond the CAD.obj bounds ++ Set background mesh density with xCells, yCells, zCells ++ Run blockMesh + +Background Mesh (alternative) +============================= ++ The user can adopt the background mesh patches in the mesh ++ For example, the background mesh can provide external patches of an external + flow ++ An alternative blockMeshDict file is set up for this: blockMeshDict.extPatches ++ Simply copy blockMeshDict.extPatches to blockMeshDict and edit inlet, outlet + patches accordingly + +Castellated Mesh +================ ++ In the snappyHexMeshDict file, replace <inletPatch> with the name of the inlet + region in the CAD.obj file ++ Replace <outletPatch> with the name of the outlet region ++ run snappyHexMesh to obtain a castellatedMesh ++ Review the mesh; modify refinement levels and regenerate the mesh as required + (levels are set in refinementSurfaces and refinementRegions) + +Snapped Mesh +============ ++ In snappyHexMeshDict, set castellatedMesh off; snap on; ++ Run the snapping phase of snappyHexMesh ++ Review the mesh + +Layers +====== ++ To add layers to the mesh along wall boundary patches... ++ Switch on addLayers; switch snap off; ++ Run snappyHexMesh ++ The number of layers can be changed by modifying nSurfaceLayers + +Initialisation +============== ++ In the field files in the 0 directory, set inlet values ++ For example, in 0/U, set the inlet velocity Uinlet ++ Set the viscosity in constant/transportProperties \ No newline at end of file diff --git a/etc/templates/inflowOutflow/constant/RASProperties b/etc/templates/inflowOutflow/constant/RASProperties new file mode 100644 index 00000000000..fefd567bebe --- /dev/null +++ b/etc/templates/inflowOutflow/constant/RASProperties @@ -0,0 +1,23 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object RASProperties; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +RASModel kOmegaSST; + +turbulence on; + +printCoeffs on; + +// ************************************************************************* // diff --git a/etc/templates/inflowOutflow/constant/polyMesh/blockMeshDict b/etc/templates/inflowOutflow/constant/polyMesh/blockMeshDict new file mode 100644 index 00000000000..de6aabcfd15 --- /dev/null +++ b/etc/templates/inflowOutflow/constant/polyMesh/blockMeshDict @@ -0,0 +1,68 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object blockMeshDict; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +backgroundMesh +{ + xMin -1; + xMax 1; + yMin -1; + yMax 1; + zMin -1; + zMax 1; + xCells 20; + yCells 20; + zCells 20; +} + +convertToMeters 1; + +vertices +( + ($:backgroundMesh.xMin $:backgroundMesh.yMin $:backgroundMesh.zMin) + ($:backgroundMesh.xMax $:backgroundMesh.yMin $:backgroundMesh.zMin) + ($:backgroundMesh.xMax $:backgroundMesh.yMax $:backgroundMesh.zMin) + ($:backgroundMesh.xMin $:backgroundMesh.yMax $:backgroundMesh.zMin) + + ($:backgroundMesh.xMin $:backgroundMesh.yMin $:backgroundMesh.zMax) + ($:backgroundMesh.xMax $:backgroundMesh.yMin $:backgroundMesh.zMax) + ($:backgroundMesh.xMax $:backgroundMesh.yMax $:backgroundMesh.zMax) + ($:backgroundMesh.xMin $:backgroundMesh.yMax $:backgroundMesh.zMax) +); + +blocks +( + hex (0 1 2 3 4 5 6 7) + ( + $:backgroundMesh.xCells + $:backgroundMesh.yCells + $:backgroundMesh.zCells + ) + simpleGrading (1 1 1) +); + +edges +( +); + +boundary +( +); + +mergePatchPairs +( +); + +// ************************************************************************* // diff --git a/etc/templates/inflowOutflow/constant/polyMesh/blockMeshDict.extPatches b/etc/templates/inflowOutflow/constant/polyMesh/blockMeshDict.extPatches new file mode 100644 index 00000000000..3286dba7e12 --- /dev/null +++ b/etc/templates/inflowOutflow/constant/polyMesh/blockMeshDict.extPatches @@ -0,0 +1,121 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object blockMeshDict; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +backgroundMesh +{ + xMin -1; + xMax 1; + yMin -1; + yMax 1; + zMin -1; + zMax 1; + xCells 20; + yCells 20; + zCells 20; +} + +convertToMeters 1; + +vertices +( + ($:backgroundMesh.xMin $:backgroundMesh.yMin $:backgroundMesh.zMin) + ($:backgroundMesh.xMax $:backgroundMesh.yMin $:backgroundMesh.zMin) + ($:backgroundMesh.xMax $:backgroundMesh.yMax $:backgroundMesh.zMin) + ($:backgroundMesh.xMin $:backgroundMesh.yMax $:backgroundMesh.zMin) + + ($:backgroundMesh.xMin $:backgroundMesh.yMin $:backgroundMesh.zMax) + ($:backgroundMesh.xMax $:backgroundMesh.yMin $:backgroundMesh.zMax) + ($:backgroundMesh.xMax $:backgroundMesh.yMax $:backgroundMesh.zMax) + ($:backgroundMesh.xMin $:backgroundMesh.yMax $:backgroundMesh.zMax) +); + +blocks +( + hex (0 1 2 3 4 5 6 7) + ( + $:backgroundMesh.xCells + $:backgroundMesh.yCells + $:backgroundMesh.zCells + ) + simpleGrading (1 1 1) +); + +edges +( +); + +boundary +( + left + { + type patch; + faces + ( + (0 3 7 4) + ); + } + + right + { + type patch; + faces + ( + (1 5 6 2) + ); + } + + bottom + { + type patch; + faces + ( + (0 1 2 3) + ); + } + + top + { + type patch; + faces + ( + (4 7 6 5) + ); + } + + back + { + type patch; + faces + ( + (0 4 5 1) + ); + } + + front + { + type patch; + faces + ( + (3 2 6 7) + ); + } +); + +mergePatchPairs +( +); + +// ************************************************************************* // diff --git a/etc/templates/inflowOutflow/constant/transportProperties b/etc/templates/inflowOutflow/constant/transportProperties new file mode 100644 index 00000000000..59110123306 --- /dev/null +++ b/etc/templates/inflowOutflow/constant/transportProperties @@ -0,0 +1,21 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object transportProperties; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +transportModel Newtonian; + +nu nu [ 0 2 -1 0 0 0 0 ] 1.5e-05; + +// ************************************************************************* // diff --git a/etc/templates/inflowOutflow/constant/triSurface/.keep b/etc/templates/inflowOutflow/constant/triSurface/.keep new file mode 100644 index 00000000000..e69de29bb2d diff --git a/etc/templates/inflowOutflow/constant/turbulenceProperties b/etc/templates/inflowOutflow/constant/turbulenceProperties new file mode 100644 index 00000000000..dc0e00cc54f --- /dev/null +++ b/etc/templates/inflowOutflow/constant/turbulenceProperties @@ -0,0 +1,19 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object turbulenceProperties; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +simulationType RASModel; + +// ************************************************************************* // diff --git a/etc/templates/inflowOutflow/system/controlDict b/etc/templates/inflowOutflow/system/controlDict new file mode 100644 index 00000000000..bfda3b05c7a --- /dev/null +++ b/etc/templates/inflowOutflow/system/controlDict @@ -0,0 +1,55 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object controlDict; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +application simpleFoam; + +startFrom latestTime; + +startTime 0; + +stopAt endTime; + +endTime 1000; + +deltaT 1; + +writeControl timeStep; + +writeInterval 50; + +purgeWrite 0; + +writeFormat ascii; + +writePrecision 8; + +writeCompression off; + +timeFormat general; + +timePrecision 6; + +runTimeModifiable true; + +// adjustTimeStep yes; + +// maxCo 1; + +functions +{ +} + +// ************************************************************************* // diff --git a/etc/templates/inflowOutflow/system/fvSchemes b/etc/templates/inflowOutflow/system/fvSchemes new file mode 100644 index 00000000000..ddcdf027dc5 --- /dev/null +++ b/etc/templates/inflowOutflow/system/fvSchemes @@ -0,0 +1,67 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object fvSchemes; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +ddtSchemes +{ + default steadyState; +} + +gradSchemes +{ + default Gauss linear; + + limited cellLimited Gauss linear 1; + grad(U) $limited; + grad(k) $limited; + grad(omega) $limited; +} + +divSchemes +{ + default none; + + div(phi,U) bounded Gauss linearUpwind limited; + + turbulence bounded Gauss limitedLinear 1; + div(phi,k) $turbulence; + div(phi,omega) $turbulence; + div(phi,epsilon) $turbulence; + + div((nuEff*dev(T(grad(U))))) Gauss linear; +} + +laplacianSchemes +{ + default Gauss linear corrected; +} + +interpolationSchemes +{ + default linear; +} + +snGradSchemes +{ + default corrected; +} + +fluxRequired +{ + default no; + p ; +} + +// ************************************************************************* // diff --git a/etc/templates/inflowOutflow/system/fvSolution b/etc/templates/inflowOutflow/system/fvSolution new file mode 100644 index 00000000000..f1e5a8fb417 --- /dev/null +++ b/etc/templates/inflowOutflow/system/fvSolution @@ -0,0 +1,93 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object fvSolution; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +solvers +{ + p + { + solver GAMG; + smoother GaussSeidel; + cacheAgglomeration on; // Need to make this default? + agglomerator faceAreaPair; // Need to make this default? + nCellsInCoarsestLevel 10; // Need to make this default? + mergeLevels 1; // Need to make this default + tolerance 1e-6; + relTol 0.1; + } + + "(U|k|omega|epsilon)" + { + solver smoothSolver; + smoother symGaussSeidel; + tolerance 1e-6; + relTol 0.1; + } + + pFinal + { + $p; + relTol 0; + } + + "(U|k|omega|epsilon)Final" + { + $U; + relTol 0; + } +} + +"(PIMPLE|PISO)" +{ + nOuterCorrectors 1; + nCorrectors 2; + nNonOrthogonalCorrectors 1; + pRefCell 0; + pRefValue 0; +} + +SIMPLE +{ + residualControl + { + p 1e-4; + U 1e-4; + "(k|omega|epsilon)" 1e-4; + } + nNonOrthogonalCorrectors 0; + pRefCell 0; + pRefValue 0; + +} + +potentialFlow +{ + nNonOrthogonalCorrectors 10; +} + +relaxationFactors +{ + fields + { + p 0.3; + } + equations + { + U 0.7; + "(k|omega|epsilon)" 0.7; + } +} + +// ************************************************************************* // diff --git a/etc/templates/inflowOutflow/system/meshQualityDict b/etc/templates/inflowOutflow/system/meshQualityDict new file mode 100644 index 00000000000..c38396d7102 --- /dev/null +++ b/etc/templates/inflowOutflow/system/meshQualityDict @@ -0,0 +1,22 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object meshQualityDict; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#includeEtc "caseDicts/mesh/generation/meshQualityDict.cfg" + +//- minFaceWeight (0 -> 0.5) +//minFaceWeight 0.02; + +// ************************************************************************* // diff --git a/etc/templates/inflowOutflow/system/snappyHexMeshDict b/etc/templates/inflowOutflow/system/snappyHexMeshDict new file mode 100644 index 00000000000..0f0e888037d --- /dev/null +++ b/etc/templates/inflowOutflow/system/snappyHexMeshDict @@ -0,0 +1,120 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object snappyHexMeshDict; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#includeEtc "caseDicts/mesh/generation/snappyHexMeshDict.cfg" + +castellatedMesh on; +snap off; +addLayers off; + +geometry +{ + CAD.obj + { + type triSurfaceMesh; + name CAD; + regions + { + <inletPatch> { name inlet; } + <outletPatch> { name outlet; } + } + } +}; + +castellatedMeshControls +{ + features + ( +// { file "CAD.eMesh"; level 1; } + ); + + refinementSurfaces + { + CAD + { + level (2 2); + patchInfo { type wall; } + + regions + { + <inletPatch> + { + level (2 2); + patchInfo { type patch; } + } + + <outletPatch> + { + level (2 2); + patchInfo { type patch; } + } + } + } + } + + refinementRegions + { + CAD + { + mode inside; + levels ((1E15 2)); + } + } + + locationInMesh (1e-5 1e-5 1e-5); // Offset from (0 0 0) to avoid + // coinciding with face or edge +} + +snapControls +{ +// explicitFeatureSnap true; +// implicitFeatureSnap false; +} + +addLayersControls +{ + layers + { + "CAD.*" + { + nSurfaceLayers 2; + } + } + + relativeSizes true; // false, usually with firstLayerThickness + expansionRatio 1.2; + finalLayerThickness 0.5; + minThickness 1e-3; +// firstLayerThickness 0.01; + +// maxThicknessToMedialRatio 0.6; +} + +meshQualityControls +{ +// minTetQuality -1e+30; +} + +writeFlags +( + scalarLevels + layerSets + layerFields +); + +mergeTolerance 1e-6; + +// ************************************************************************* // diff --git a/etc/templates/inflowOutflow/system/surfaceFeatureExtractDict b/etc/templates/inflowOutflow/system/surfaceFeatureExtractDict new file mode 100644 index 00000000000..bd9bdd52c92 --- /dev/null +++ b/etc/templates/inflowOutflow/system/surfaceFeatureExtractDict @@ -0,0 +1,35 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object surfaceFeatureExtractDict; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +CAD.obj +{ + extractionMethod extractFromSurface; + + extractFromSurfaceCoeffs + { + includedAngle 150; + } + + subsetFeatures + { + nonManifoldEdges yes; + openEdges yes; + } + + writeObj yes; +} + +// ************************************************************************* // diff --git a/etc/templates/inflowOutflowRotating/0/U b/etc/templates/inflowOutflowRotating/0/U new file mode 100644 index 00000000000..8c1cfbebf1b --- /dev/null +++ b/etc/templates/inflowOutflowRotating/0/U @@ -0,0 +1,52 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volVectorField; + object U; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +Uinlet (10 0 0); + +dimensions [0 1 -1 0 0 0 0]; + +internalField uniform (0 0 0); + +boundaryField +{ + inlet + { + type fixedValue; + value uniform $Uinlet; + } + + outlet + { + type pressureInletOutletVelocity; + value uniform (0 0 0); + } + + rotating + { + type movingWallVelocity; + value uniform (0 0 0); + } + + wall + { + type fixedValue; + value uniform (0 0 0); + } + + #includeEtc "caseDicts/setConstraintTypes" +} + +// ************************************************************************* // diff --git a/etc/templates/inflowOutflowRotating/0/k b/etc/templates/inflowOutflowRotating/0/k new file mode 100644 index 00000000000..4f402e2f44d --- /dev/null +++ b/etc/templates/inflowOutflowRotating/0/k @@ -0,0 +1,47 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + object k; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +kInlet 0.1; + +dimensions [0 2 -2 0 0 0 0]; + +internalField uniform $kInlet; + +boundaryField +{ + inlet + { + type fixedValue; + value uniform $kInlet; + } + + outlet + { + type inletOutlet; + inletValue uniform $kInlet; + value uniform $kInlet; + } + + wall + { + type kqRWallFunction; + value uniform $kInlet; + } + + #includeEtc "caseDicts/setConstraintTypes" +} + +// ************************************************************************* // diff --git a/etc/templates/inflowOutflowRotating/0/nut b/etc/templates/inflowOutflowRotating/0/nut new file mode 100644 index 00000000000..54a56f319ff --- /dev/null +++ b/etc/templates/inflowOutflowRotating/0/nut @@ -0,0 +1,44 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / 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 calculated; + value uniform 0; + } + + outlet + { + type calculated; + value uniform 0; + } + + wall + { + type nutkWallFunction; + value uniform 0; + } + + #includeEtc "caseDicts/setConstraintTypes" +} + +// ************************************************************************* // diff --git a/etc/templates/inflowOutflowRotating/0/omega b/etc/templates/inflowOutflowRotating/0/omega new file mode 100644 index 00000000000..e8e14245763 --- /dev/null +++ b/etc/templates/inflowOutflowRotating/0/omega @@ -0,0 +1,47 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + object omega; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +omegaInlet 1.0; + +dimensions [0 0 -1 0 0 0 0]; + +internalField uniform $omegaInlet; + +boundaryField +{ + inlet + { + type fixedValue; + value uniform $omegaInlet; + } + + outlet + { + type inletOutlet; + inletValue uniform $omegaInlet; + value uniform $omegaInlet; + } + + wall + { + type omegaWallFunction; + value uniform $omegaInlet; + } + + #includeEtc "caseDicts/setConstraintTypes" +} + +// ************************************************************************* // diff --git a/etc/templates/inflowOutflowRotating/0/p b/etc/templates/inflowOutflowRotating/0/p new file mode 100644 index 00000000000..f2d9ffb3b9b --- /dev/null +++ b/etc/templates/inflowOutflowRotating/0/p @@ -0,0 +1,42 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / 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; + } + + wall + { + type zeroGradient; + } + + #includeEtc "caseDicts/setConstraintTypes" +} + +// ************************************************************************* // diff --git a/etc/templates/inflowOutflowRotating/README b/etc/templates/inflowOutflowRotating/README new file mode 100644 index 00000000000..b1b05eeb425 --- /dev/null +++ b/etc/templates/inflowOutflowRotating/README @@ -0,0 +1,32 @@ +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 ++ The case is designed to be meshed with snappyHexMesh ++ snappyHexMesh is setup to use 3 trisurface files + + fixed.obj: CAD of the stationary geometry + + rotating.obj: CAD of the rotating geometry + + rotatingZone.obj: CAD of surface bounding the rotating region ++ Copy the *.obj files to the constant/triSurface directory ++ The fixed.obj should contain an inlet and outlet region to create the relevant + patches in the mesh + +Meshing +======= ++ Meshing is setup as in the inflowOutflow template ++ See $FOAM_ETC/templates/inflowOutflow/README for details ++ For AMI, the AMI interface can be set up by running createBaffles which uses + the createBafflesDict file + +Initialisation +============== ++ In the field files in the 0 directory, set inlet values ++ 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/fvOptions + + For AMI, 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 + and relaxationFactors are set for transient simulation diff --git a/etc/templates/inflowOutflowRotating/constant/RASProperties b/etc/templates/inflowOutflowRotating/constant/RASProperties new file mode 100644 index 00000000000..fefd567bebe --- /dev/null +++ b/etc/templates/inflowOutflowRotating/constant/RASProperties @@ -0,0 +1,23 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object RASProperties; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +RASModel kOmegaSST; + +turbulence on; + +printCoeffs on; + +// ************************************************************************* // diff --git a/etc/templates/inflowOutflowRotating/constant/dynamicMeshDict b/etc/templates/inflowOutflowRotating/constant/dynamicMeshDict new file mode 100644 index 00000000000..b269d757d53 --- /dev/null +++ b/etc/templates/inflowOutflowRotating/constant/dynamicMeshDict @@ -0,0 +1,30 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object dynamicMeshDict; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dynamicFvMesh solidBodyMotionFvMesh; + +solidBodyMotionFvMeshCoeffs +{ + cellZone rotatingZone; + + solidBodyMotionFunction rotatingMotion; + rotatingMotionCoeffs + { + #include "rotatingZoneProperties" + } +} + +// ************************************************************************* // diff --git a/etc/templates/inflowOutflowRotating/constant/polyMesh/blockMeshDict b/etc/templates/inflowOutflowRotating/constant/polyMesh/blockMeshDict new file mode 100644 index 00000000000..de6aabcfd15 --- /dev/null +++ b/etc/templates/inflowOutflowRotating/constant/polyMesh/blockMeshDict @@ -0,0 +1,68 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object blockMeshDict; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +backgroundMesh +{ + xMin -1; + xMax 1; + yMin -1; + yMax 1; + zMin -1; + zMax 1; + xCells 20; + yCells 20; + zCells 20; +} + +convertToMeters 1; + +vertices +( + ($:backgroundMesh.xMin $:backgroundMesh.yMin $:backgroundMesh.zMin) + ($:backgroundMesh.xMax $:backgroundMesh.yMin $:backgroundMesh.zMin) + ($:backgroundMesh.xMax $:backgroundMesh.yMax $:backgroundMesh.zMin) + ($:backgroundMesh.xMin $:backgroundMesh.yMax $:backgroundMesh.zMin) + + ($:backgroundMesh.xMin $:backgroundMesh.yMin $:backgroundMesh.zMax) + ($:backgroundMesh.xMax $:backgroundMesh.yMin $:backgroundMesh.zMax) + ($:backgroundMesh.xMax $:backgroundMesh.yMax $:backgroundMesh.zMax) + ($:backgroundMesh.xMin $:backgroundMesh.yMax $:backgroundMesh.zMax) +); + +blocks +( + hex (0 1 2 3 4 5 6 7) + ( + $:backgroundMesh.xCells + $:backgroundMesh.yCells + $:backgroundMesh.zCells + ) + simpleGrading (1 1 1) +); + +edges +( +); + +boundary +( +); + +mergePatchPairs +( +); + +// ************************************************************************* // diff --git a/etc/templates/inflowOutflowRotating/constant/polyMesh/blockMeshDict.extPatches b/etc/templates/inflowOutflowRotating/constant/polyMesh/blockMeshDict.extPatches new file mode 100644 index 00000000000..3286dba7e12 --- /dev/null +++ b/etc/templates/inflowOutflowRotating/constant/polyMesh/blockMeshDict.extPatches @@ -0,0 +1,121 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object blockMeshDict; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +backgroundMesh +{ + xMin -1; + xMax 1; + yMin -1; + yMax 1; + zMin -1; + zMax 1; + xCells 20; + yCells 20; + zCells 20; +} + +convertToMeters 1; + +vertices +( + ($:backgroundMesh.xMin $:backgroundMesh.yMin $:backgroundMesh.zMin) + ($:backgroundMesh.xMax $:backgroundMesh.yMin $:backgroundMesh.zMin) + ($:backgroundMesh.xMax $:backgroundMesh.yMax $:backgroundMesh.zMin) + ($:backgroundMesh.xMin $:backgroundMesh.yMax $:backgroundMesh.zMin) + + ($:backgroundMesh.xMin $:backgroundMesh.yMin $:backgroundMesh.zMax) + ($:backgroundMesh.xMax $:backgroundMesh.yMin $:backgroundMesh.zMax) + ($:backgroundMesh.xMax $:backgroundMesh.yMax $:backgroundMesh.zMax) + ($:backgroundMesh.xMin $:backgroundMesh.yMax $:backgroundMesh.zMax) +); + +blocks +( + hex (0 1 2 3 4 5 6 7) + ( + $:backgroundMesh.xCells + $:backgroundMesh.yCells + $:backgroundMesh.zCells + ) + simpleGrading (1 1 1) +); + +edges +( +); + +boundary +( + left + { + type patch; + faces + ( + (0 3 7 4) + ); + } + + right + { + type patch; + faces + ( + (1 5 6 2) + ); + } + + bottom + { + type patch; + faces + ( + (0 1 2 3) + ); + } + + top + { + type patch; + faces + ( + (4 7 6 5) + ); + } + + back + { + type patch; + faces + ( + (0 4 5 1) + ); + } + + front + { + type patch; + faces + ( + (3 2 6 7) + ); + } +); + +mergePatchPairs +( +); + +// ************************************************************************* // diff --git a/etc/templates/inflowOutflowRotating/constant/rotatingZoneProperties b/etc/templates/inflowOutflowRotating/constant/rotatingZoneProperties new file mode 100644 index 00000000000..e0a4a97d205 --- /dev/null +++ b/etc/templates/inflowOutflowRotating/constant/rotatingZoneProperties @@ -0,0 +1,22 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object rotatingZoneProperties; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +origin (0 0 0); +axis (0 0 1); +omega constant <rad/s>; +nonRotatingPatches (fixed); + +// ************************************************************************* // diff --git a/etc/templates/inflowOutflowRotating/constant/transportProperties b/etc/templates/inflowOutflowRotating/constant/transportProperties new file mode 100644 index 00000000000..59110123306 --- /dev/null +++ b/etc/templates/inflowOutflowRotating/constant/transportProperties @@ -0,0 +1,21 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object transportProperties; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +transportModel Newtonian; + +nu nu [ 0 2 -1 0 0 0 0 ] 1.5e-05; + +// ************************************************************************* // diff --git a/etc/templates/inflowOutflowRotating/constant/triSurface/.keep b/etc/templates/inflowOutflowRotating/constant/triSurface/.keep new file mode 100644 index 00000000000..e69de29bb2d diff --git a/etc/templates/inflowOutflowRotating/constant/turbulenceProperties b/etc/templates/inflowOutflowRotating/constant/turbulenceProperties new file mode 100644 index 00000000000..dc0e00cc54f --- /dev/null +++ b/etc/templates/inflowOutflowRotating/constant/turbulenceProperties @@ -0,0 +1,19 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object turbulenceProperties; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +simulationType RASModel; + +// ************************************************************************* // diff --git a/etc/templates/inflowOutflowRotating/system/controlDict b/etc/templates/inflowOutflowRotating/system/controlDict new file mode 100644 index 00000000000..bfda3b05c7a --- /dev/null +++ b/etc/templates/inflowOutflowRotating/system/controlDict @@ -0,0 +1,55 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object controlDict; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +application simpleFoam; + +startFrom latestTime; + +startTime 0; + +stopAt endTime; + +endTime 1000; + +deltaT 1; + +writeControl timeStep; + +writeInterval 50; + +purgeWrite 0; + +writeFormat ascii; + +writePrecision 8; + +writeCompression off; + +timeFormat general; + +timePrecision 6; + +runTimeModifiable true; + +// adjustTimeStep yes; + +// maxCo 1; + +functions +{ +} + +// ************************************************************************* // diff --git a/etc/templates/inflowOutflowRotating/system/createBafflesDict b/etc/templates/inflowOutflowRotating/system/createBafflesDict new file mode 100644 index 00000000000..a7b38ff6b86 --- /dev/null +++ b/etc/templates/inflowOutflowRotating/system/createBafflesDict @@ -0,0 +1,46 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object createBafflesDict; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +internalFacesOnly true; + +baffles +{ + baffleFaces + { + type faceZone; + zoneName rotatingZone; + + patches + { + master + { + name AMI1; + type cyclicAMI; + matchTolerance 0.0001; + neighbourPatch AMI2; + transform noOrdering; + } + slave + { + $master; + name AMI2; + neighbourPatch AMI1; + } + } + } +} + +// ************************************************************************* // diff --git a/etc/templates/inflowOutflowRotating/system/fvOptions b/etc/templates/inflowOutflowRotating/system/fvOptions new file mode 100644 index 00000000000..2d6dfa8e564 --- /dev/null +++ b/etc/templates/inflowOutflowRotating/system/fvOptions @@ -0,0 +1,30 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object fvOptions; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +MRF1 +{ + type MRFSource; + selectionMode cellZone; + cellZone rotatingZone; + active yes; + + MRFSourceCoeffs + { + #include "${FOAM_CASE}/constant/rotatingZoneProperties" + } +} + +// ************************************************************************* // diff --git a/etc/templates/inflowOutflowRotating/system/fvSchemes b/etc/templates/inflowOutflowRotating/system/fvSchemes new file mode 100644 index 00000000000..ddcdf027dc5 --- /dev/null +++ b/etc/templates/inflowOutflowRotating/system/fvSchemes @@ -0,0 +1,67 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object fvSchemes; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +ddtSchemes +{ + default steadyState; +} + +gradSchemes +{ + default Gauss linear; + + limited cellLimited Gauss linear 1; + grad(U) $limited; + grad(k) $limited; + grad(omega) $limited; +} + +divSchemes +{ + default none; + + div(phi,U) bounded Gauss linearUpwind limited; + + turbulence bounded Gauss limitedLinear 1; + div(phi,k) $turbulence; + div(phi,omega) $turbulence; + div(phi,epsilon) $turbulence; + + div((nuEff*dev(T(grad(U))))) Gauss linear; +} + +laplacianSchemes +{ + default Gauss linear corrected; +} + +interpolationSchemes +{ + default linear; +} + +snGradSchemes +{ + default corrected; +} + +fluxRequired +{ + default no; + p ; +} + +// ************************************************************************* // diff --git a/etc/templates/inflowOutflowRotating/system/fvSolution b/etc/templates/inflowOutflowRotating/system/fvSolution new file mode 100644 index 00000000000..f1e5a8fb417 --- /dev/null +++ b/etc/templates/inflowOutflowRotating/system/fvSolution @@ -0,0 +1,93 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object fvSolution; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +solvers +{ + p + { + solver GAMG; + smoother GaussSeidel; + cacheAgglomeration on; // Need to make this default? + agglomerator faceAreaPair; // Need to make this default? + nCellsInCoarsestLevel 10; // Need to make this default? + mergeLevels 1; // Need to make this default + tolerance 1e-6; + relTol 0.1; + } + + "(U|k|omega|epsilon)" + { + solver smoothSolver; + smoother symGaussSeidel; + tolerance 1e-6; + relTol 0.1; + } + + pFinal + { + $p; + relTol 0; + } + + "(U|k|omega|epsilon)Final" + { + $U; + relTol 0; + } +} + +"(PIMPLE|PISO)" +{ + nOuterCorrectors 1; + nCorrectors 2; + nNonOrthogonalCorrectors 1; + pRefCell 0; + pRefValue 0; +} + +SIMPLE +{ + residualControl + { + p 1e-4; + U 1e-4; + "(k|omega|epsilon)" 1e-4; + } + nNonOrthogonalCorrectors 0; + pRefCell 0; + pRefValue 0; + +} + +potentialFlow +{ + nNonOrthogonalCorrectors 10; +} + +relaxationFactors +{ + fields + { + p 0.3; + } + equations + { + U 0.7; + "(k|omega|epsilon)" 0.7; + } +} + +// ************************************************************************* // diff --git a/etc/templates/inflowOutflowRotating/system/meshQualityDict b/etc/templates/inflowOutflowRotating/system/meshQualityDict new file mode 100644 index 00000000000..c38396d7102 --- /dev/null +++ b/etc/templates/inflowOutflowRotating/system/meshQualityDict @@ -0,0 +1,22 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object meshQualityDict; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#includeEtc "caseDicts/mesh/generation/meshQualityDict.cfg" + +//- minFaceWeight (0 -> 0.5) +//minFaceWeight 0.02; + +// ************************************************************************* // diff --git a/etc/templates/inflowOutflowRotating/system/snappyHexMeshDict b/etc/templates/inflowOutflowRotating/system/snappyHexMeshDict new file mode 100644 index 00000000000..c5264154d61 --- /dev/null +++ b/etc/templates/inflowOutflowRotating/system/snappyHexMeshDict @@ -0,0 +1,147 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object snappyHexMeshDict; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#includeEtc "caseDicts/mesh/generation/snappyHexMeshDict.cfg" + +castellatedMesh on; +snap on; +addLayers off; + +geometry +{ + fixed.obj + { + type triSurfaceMesh; + name fixed; + regions + { + <inletPatch> { name inlet; } + <outletPatch> { name outlet; } + } + } + rotating.obj + { + type triSurfaceMesh; + name rotating; + } + rotatingZone.obj + { + type triSurfaceMesh; + name rotatingZone; + } +}; + +castellatedMeshControls +{ + features + ( + { file "fixed.eMesh"; level 1; } + { file "rotating.eMesh"; level 1; } + { file "rotatingZone.eMesh"; level 1; } + ); + + refinementSurfaces + { + fixed + { + level (2 2); + patchInfo { type wall; } + inGroups (fixed); + + regions + { + <inletPatch> + { + level (2 2); + patchInfo { type patch; } + } + + <outletPatch> + { + level (2 2); + patchInfo { type patch; } + } + } + } + rotating + { + level (2 2); + patchInfo { type wall; } + } + rotatingZone + { + level (2 2); + faceZone rotatingZone; + cellZone rotatingZone; + cellZoneInside inside; + } + + } + + refinementRegions + { + /* + rotatingZone + { + mode inside; + levels ((1E15 2)); + } + */ + } + + locationInMesh (1e-5 1e-5 1e-5); // Offset from (0 0 0) to avoid + // coinciding with face or edge +} + +snapControls +{ + explicitFeatureSnap true; +} + +addLayersControls +{ + layers + { + "(rotating|fixed)" + { + nSurfaceLayers 2; + } + } + + relativeSizes true; // false, usually with firstLayerThickness + expansionRatio 1.2; + finalLayerThickness 0.5; + minThickness 1e-3; +// firstLayerThickness 0.01; + +// maxThicknessToMedialRatio 0.6; +} + +meshQualityControls +{ +// minTetQuality -1e+30; +} + +writeFlags +( + scalarLevels + layerSets + layerFields +); + +mergeTolerance 1e-6; + +// ************************************************************************* // diff --git a/etc/templates/inflowOutflowRotating/system/surfaceFeatureExtractDict b/etc/templates/inflowOutflowRotating/system/surfaceFeatureExtractDict new file mode 100644 index 00000000000..4c48520a07b --- /dev/null +++ b/etc/templates/inflowOutflowRotating/system/surfaceFeatureExtractDict @@ -0,0 +1,32 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object surfaceFeatureExtractDict; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +fixed.obj +{ + #includeEtc "caseDicts/surface/surfaceFeatureExtractDict.cfg" +} + +rotating.obj +{ + #includeEtc "caseDicts/surface/surfaceFeatureExtractDict.cfg" +} + +rotatingZone.obj +{ + #includeEtc "caseDicts/surface/surfaceFeatureExtractDict.cfg" +} + +// ************************************************************************* // -- GitLab