From dfa2c676022ea13b56149523c1299a1bd08d8817 Mon Sep 17 00:00:00 2001 From: mattijs Date: Fri, 16 Apr 2010 13:15:12 +0100 Subject: [PATCH 1/5] ENH: Allow specification of defaultFaces boundary type --- .../meshes/polyMesh/polyMeshFromShapeMesh.C | 63 ++++++++++++++----- 1 file changed, 49 insertions(+), 14 deletions(-) diff --git a/src/OpenFOAM/meshes/polyMesh/polyMeshFromShapeMesh.C b/src/OpenFOAM/meshes/polyMesh/polyMeshFromShapeMesh.C index 464ed465b0..fe9b8e45a4 100644 --- a/src/OpenFOAM/meshes/polyMesh/polyMeshFromShapeMesh.C +++ b/src/OpenFOAM/meshes/polyMesh/polyMeshFromShapeMesh.C @@ -577,21 +577,56 @@ Foam::polyMesh::polyMesh << "Found " << nFaces - defaultPatchStart << " undefined faces in mesh; adding to default patch." << endl; - boundary_.set - ( - nAllPatches, - polyPatch::New - ( - defaultBoundaryPatchType, - defaultBoundaryPatchName, - nFaces - defaultPatchStart, - defaultPatchStart, - boundary_.size() - 1, - boundary_ - ) - ); + // Check if there already exists a defaultFaces patch as last patch + // and reuse it. + label patchI = findIndex(boundaryPatchNames, defaultBoundaryPatchName); - nAllPatches++; + if (patchI != -1) + { + if (patchI != boundaryFaces.size()-1 || boundary_[patchI].size()) + { + FatalErrorIn("polyMesh::polyMesh(... construct from shapes...)") + << "Default patch " << boundary_[patchI].name() + << " already has faces in it or is not" + << " last in list of patches." << exit(FatalError); + } + + WarningIn("polyMesh::polyMesh(... construct from shapes...)") + << "Reusing existing patch " << patchI + << " for undefined faces." << endl; + + boundary_.set + ( + patchI, + polyPatch::New + ( + boundaryPatchTypes[patchI], + boundaryPatchNames[patchI], + nFaces - defaultPatchStart, + defaultPatchStart, + patchI, + boundary_ + ) + ); + } + else + { + boundary_.set + ( + nAllPatches, + polyPatch::New + ( + defaultBoundaryPatchType, + defaultBoundaryPatchName, + nFaces - defaultPatchStart, + defaultPatchStart, + boundary_.size() - 1, + boundary_ + ) + ); + + nAllPatches++; + } } // Reset the size of the boundary From af095081b731c609ae39039eda9a05e9b459e9a1 Mon Sep 17 00:00:00 2001 From: mattijs Date: Fri, 16 Apr 2010 13:16:26 +0100 Subject: [PATCH 2/5] ENH: Added baffles and fan cyclic --- .../incompressible/pimpleFoam/t-junction/0/U | 19 +++++++++---- .../pimpleFoam/t-junction/0/epsilon | 16 ++++++++--- .../incompressible/pimpleFoam/t-junction/0/k | 15 +++++++++-- .../pimpleFoam/t-junction/0/nuTilda | 10 ++++++- .../pimpleFoam/t-junction/0/nut | 11 +++++++- .../incompressible/pimpleFoam/t-junction/0/p | 18 ++++++++++--- .../pimpleFoam/t-junction/Allrun | 27 +++++++++++++++++++ .../pimpleFoam/t-junction/README.txt | 3 ++- .../constant/polyMesh/blockMeshDict | 10 +++++++ .../t-junction/constant/polyMesh/boundary | 17 ++++++++++-- .../t-junction/selectBaffles.setSet | 4 +++ .../t-junction/selectCyclics.setSet | 3 +++ .../pimpleFoam/t-junction/system/controlDict | 4 ++- 13 files changed, 137 insertions(+), 20 deletions(-) create mode 100755 tutorials/incompressible/pimpleFoam/t-junction/Allrun create mode 100644 tutorials/incompressible/pimpleFoam/t-junction/selectBaffles.setSet create mode 100644 tutorials/incompressible/pimpleFoam/t-junction/selectCyclics.setSet diff --git a/tutorials/incompressible/pimpleFoam/t-junction/0/U b/tutorials/incompressible/pimpleFoam/t-junction/0/U index 937d3966b2..8b3863aff9 100644 --- a/tutorials/incompressible/pimpleFoam/t-junction/0/U +++ b/tutorials/incompressible/pimpleFoam/t-junction/0/U @@ -20,27 +20,36 @@ internalField uniform (0 0 0); boundaryField { - inlet + inlet { type pressureInletOutletVelocity; value uniform (0 0 0); } - outlet1 + outlet1 { type inletOutlet; inletValue uniform (0 0 0); value uniform (0 0 0); } - outlet2 + outlet2 { type inletOutlet; inletValue uniform (0 0 0); value uniform (0 0 0); } - - defaultFaces + baffles + { + type fixedValue; + value uniform ( 0 0 0 ); + } + fan + { + type cyclic; + value uniform ( 0 0 0 ); + } + defaultFaces { type fixedValue; value uniform (0 0 0); diff --git a/tutorials/incompressible/pimpleFoam/t-junction/0/epsilon b/tutorials/incompressible/pimpleFoam/t-junction/0/epsilon index 98515b441d..35ddfed661 100644 --- a/tutorials/incompressible/pimpleFoam/t-junction/0/epsilon +++ b/tutorials/incompressible/pimpleFoam/t-junction/0/epsilon @@ -27,23 +27,33 @@ boundaryField mixingLength 0.01; // 1cm - half channel height value uniform 1; } - outlet1 { type inletOutlet; inletValue uniform 1; + value uniform 1; } outlet2 { type inletOutlet; inletValue uniform 1; + value uniform 1; + } + baffles + { + type epsilonWallFunction; + value uniform 1; + } + fan + { + type cyclic; + value uniform 1; } - defaultFaces { type epsilonWallFunction; - value uniform 0; + value uniform 1; } } diff --git a/tutorials/incompressible/pimpleFoam/t-junction/0/k b/tutorials/incompressible/pimpleFoam/t-junction/0/k index 35f4e42f32..e87a5855d2 100644 --- a/tutorials/incompressible/pimpleFoam/t-junction/0/k +++ b/tutorials/incompressible/pimpleFoam/t-junction/0/k @@ -27,23 +27,34 @@ boundaryField intensity 0.05; // 5% turbulent intensity value uniform 1; } - outlet1 { type inletOutlet; inletValue uniform 1; + value uniform 1; } outlet2 { type inletOutlet; inletValue uniform 1; + value uniform 1; + } + baffles + { + type kqRWallFunction; + value uniform 1; + } + fan + { + type cyclic; + value uniform 1; } defaultFaces { type kqRWallFunction; - value uniform 0; + value uniform 1; } } diff --git a/tutorials/incompressible/pimpleFoam/t-junction/0/nuTilda b/tutorials/incompressible/pimpleFoam/t-junction/0/nuTilda index fe8744b398..ff51eab08c 100644 --- a/tutorials/incompressible/pimpleFoam/t-junction/0/nuTilda +++ b/tutorials/incompressible/pimpleFoam/t-junction/0/nuTilda @@ -34,7 +34,15 @@ boundaryField { type zeroGradient; } - + baffles + { + type zeroGradient; + } + fan + { + type cyclic; + value uniform 0; + } defaultFaces { type zeroGradient; diff --git a/tutorials/incompressible/pimpleFoam/t-junction/0/nut b/tutorials/incompressible/pimpleFoam/t-junction/0/nut index b4a42336aa..570f1f90ac 100644 --- a/tutorials/incompressible/pimpleFoam/t-junction/0/nut +++ b/tutorials/incompressible/pimpleFoam/t-junction/0/nut @@ -38,7 +38,16 @@ boundaryField type calculated; value uniform 0; } - + baffles + { + type nutkWallFunction; + value uniform 0; + } + fan + { + type cyclic; + value uniform 0; + } defaultFaces { type nutkWallFunction; diff --git a/tutorials/incompressible/pimpleFoam/t-junction/0/p b/tutorials/incompressible/pimpleFoam/t-junction/0/p index 93170d7a0c..d9873e5b7a 100644 --- a/tutorials/incompressible/pimpleFoam/t-junction/0/p +++ b/tutorials/incompressible/pimpleFoam/t-junction/0/p @@ -20,7 +20,7 @@ internalField uniform 100000; boundaryField { - inlet + inlet { //type totalPressure; //p0 uniform 100040; @@ -38,18 +38,28 @@ boundaryField value uniform 100040; } - outlet1 + outlet1 { type fixedValue; value uniform 100010; } - outlet2 + outlet2 { type fixedValue; value uniform 100000; } - + baffles + { + type zeroGradient; + } + fan + { + type fan; + patchType cyclic; + f 2 ( 50 -0.1 ); + value uniform 100000; + } defaultFaces { type zeroGradient; diff --git a/tutorials/incompressible/pimpleFoam/t-junction/Allrun b/tutorials/incompressible/pimpleFoam/t-junction/Allrun new file mode 100755 index 0000000000..54e4a04edd --- /dev/null +++ b/tutorials/incompressible/pimpleFoam/t-junction/Allrun @@ -0,0 +1,27 @@ +#!/bin/sh + +# Source tutorial run functions +. $WM_PROJECT_DIR/bin/tools/RunFunctions + +# Get application name +application=`getApplication` + +runApplication blockMesh + + +# Creating patches 'out of nothing' so willl get undefined value which +# might cause floating point error +unset FOAM_SIGFPE +unset FOAM_SETNAN + +# Add cyclic baffles for fan +runApplication setSet -batch selectCyclics.setSet +runApplication createBaffles cyclicFaces fan -overwrite + +# Add wall baffles +rm log.setSet +runApplication setSet -batch selectBaffles.setSet +rm log.createBaffles +runApplication createBaffles baffleFaces baffles -overwrite + +runApplication $application diff --git a/tutorials/incompressible/pimpleFoam/t-junction/README.txt b/tutorials/incompressible/pimpleFoam/t-junction/README.txt index 0905f8784d..fd3f970be5 100644 --- a/tutorials/incompressible/pimpleFoam/t-junction/README.txt +++ b/tutorials/incompressible/pimpleFoam/t-junction/README.txt @@ -1,2 +1,3 @@ -15/8/8 Simple T-junction. Inlet on left, one outlet at bottom, one at top. +300-04-16 T-junction with baffles and fan. +Inlet on left, one outlet at bottom, one at top. To test multiple outlets. diff --git a/tutorials/incompressible/pimpleFoam/t-junction/constant/polyMesh/blockMeshDict b/tutorials/incompressible/pimpleFoam/t-junction/constant/polyMesh/blockMeshDict index e0f5358021..5e97f00deb 100644 --- a/tutorials/incompressible/pimpleFoam/t-junction/constant/polyMesh/blockMeshDict +++ b/tutorials/incompressible/pimpleFoam/t-junction/constant/polyMesh/blockMeshDict @@ -100,6 +100,16 @@ patches ( (8 18 19 9) ) + + wall baffles + () + + cyclic fan + () + + wall defaultFaces + () + ); mergePatchPairs diff --git a/tutorials/incompressible/pimpleFoam/t-junction/constant/polyMesh/boundary b/tutorials/incompressible/pimpleFoam/t-junction/constant/polyMesh/boundary index 85c7a93237..24c53efd55 100644 --- a/tutorials/incompressible/pimpleFoam/t-junction/constant/polyMesh/boundary +++ b/tutorials/incompressible/pimpleFoam/t-junction/constant/polyMesh/boundary @@ -1,7 +1,7 @@ /*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | -| \\ / O peration | Version: 1.6 | +| \\ / O peration | Version: dev | | \\ / A nd | Web: www.OpenFOAM.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ @@ -15,7 +15,7 @@ FoamFile } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -4 +6 ( inlet { @@ -35,6 +35,19 @@ FoamFile nFaces 25; startFace 10100; } + baffles + { + type wall; + nFaces 0; + startFace 10125; + } + fan + { + type cyclic; + nFaces 0; + startFace 10125; + featureCos 0.9; + } defaultFaces { type wall; diff --git a/tutorials/incompressible/pimpleFoam/t-junction/selectBaffles.setSet b/tutorials/incompressible/pimpleFoam/t-junction/selectBaffles.setSet new file mode 100644 index 0000000000..b3e31fc713 --- /dev/null +++ b/tutorials/incompressible/pimpleFoam/t-junction/selectBaffles.setSet @@ -0,0 +1,4 @@ +faceSet baffleFaces new boxToFace (0.099 -10 -10)(0.101 10 10) +# Remove the centre faces that become fan +faceSet baffleFaces delete boxToFace (0.099 -0.006 0.004)(0.101 0.006 0.016) +faceZoneSet baffleFaces new setToFaceZone baffleFaces diff --git a/tutorials/incompressible/pimpleFoam/t-junction/selectCyclics.setSet b/tutorials/incompressible/pimpleFoam/t-junction/selectCyclics.setSet new file mode 100644 index 0000000000..4dc1033bd2 --- /dev/null +++ b/tutorials/incompressible/pimpleFoam/t-junction/selectCyclics.setSet @@ -0,0 +1,3 @@ +faceSet cyclicFaces new boxToFace (0.099 -0.006 0.004)(0.101 0.006 0.016) +cellSet cyclicFacesSlaveCells new boxToCell (-10 -10 -10)(0.1 10 10) +faceZoneSet cyclicFaces new setsToFaceZone cyclicFaces cyclicFacesSlaveCells diff --git a/tutorials/incompressible/pimpleFoam/t-junction/system/controlDict b/tutorials/incompressible/pimpleFoam/t-junction/system/controlDict index 14ca5f3091..a966fe894b 100644 --- a/tutorials/incompressible/pimpleFoam/t-junction/system/controlDict +++ b/tutorials/incompressible/pimpleFoam/t-junction/system/controlDict @@ -15,6 +15,8 @@ FoamFile } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +libs ("libOpenFOAM.so" "libincompressibleTurbulenceModel.so" "libincompressibleRASModels.so"); + application pimpleFoam; startFrom startTime; @@ -37,7 +39,7 @@ writeFormat ascii; writePrecision 6; -writeCompression off; +writeCompression uncompressed; timeFormat general; From 1c7d6c1b2cd165623af29903dee35a1955027a03 Mon Sep 17 00:00:00 2001 From: mattijs Date: Fri, 16 Apr 2010 16:51:25 +0100 Subject: [PATCH 3/5] ENH: Restored old t-junction case. Renamed baffle case to t-junction-with-baffle --- .../pimpleFoam/t-junction-with-fan/0/U | 59 +++++++++ .../pimpleFoam/t-junction-with-fan/0/epsilon | 61 +++++++++ .../pimpleFoam/t-junction-with-fan/0/k | 62 +++++++++ .../pimpleFoam/t-junction-with-fan/0/nuTilda | 52 ++++++++ .../pimpleFoam/t-junction-with-fan/0/nut | 59 +++++++++ .../pimpleFoam/t-junction-with-fan/0/p | 69 ++++++++++ .../Allrun | 0 .../pimpleFoam/t-junction-with-fan/README.txt | 3 + .../constant/RASProperties | 25 ++++ .../t-junction-with-fan/constant/p0vsTime | 4 + .../constant/polyMesh/blockMeshDict | 119 ++++++++++++++++++ .../constant/polyMesh/boundary | 0 .../constant/transportProperties | 39 ++++++ .../constant/turbulenceProperties | 20 +++ .../selectBaffles.setSet | 0 .../selectCyclics.setSet | 0 .../t-junction-with-fan/system/controlDict | 86 +++++++++++++ .../t-junction-with-fan/system/fvSchemes | 71 +++++++++++ .../t-junction-with-fan/system/fvSolution | 94 ++++++++++++++ .../incompressible/pimpleFoam/t-junction/0/U | 19 +-- .../pimpleFoam/t-junction/0/epsilon | 16 +-- .../incompressible/pimpleFoam/t-junction/0/k | 15 +-- .../pimpleFoam/t-junction/0/nuTilda | 10 +- .../pimpleFoam/t-junction/0/nut | 11 +- .../incompressible/pimpleFoam/t-junction/0/p | 18 +-- .../pimpleFoam/t-junction/README.txt | 3 +- .../constant/polyMesh/blockMeshDict | 6 - 27 files changed, 840 insertions(+), 81 deletions(-) create mode 100644 tutorials/incompressible/pimpleFoam/t-junction-with-fan/0/U create mode 100644 tutorials/incompressible/pimpleFoam/t-junction-with-fan/0/epsilon create mode 100644 tutorials/incompressible/pimpleFoam/t-junction-with-fan/0/k create mode 100644 tutorials/incompressible/pimpleFoam/t-junction-with-fan/0/nuTilda create mode 100644 tutorials/incompressible/pimpleFoam/t-junction-with-fan/0/nut create mode 100644 tutorials/incompressible/pimpleFoam/t-junction-with-fan/0/p rename tutorials/incompressible/pimpleFoam/{t-junction => t-junction-with-fan}/Allrun (100%) create mode 100644 tutorials/incompressible/pimpleFoam/t-junction-with-fan/README.txt create mode 100644 tutorials/incompressible/pimpleFoam/t-junction-with-fan/constant/RASProperties create mode 100644 tutorials/incompressible/pimpleFoam/t-junction-with-fan/constant/p0vsTime create mode 100644 tutorials/incompressible/pimpleFoam/t-junction-with-fan/constant/polyMesh/blockMeshDict rename tutorials/incompressible/pimpleFoam/{t-junction => t-junction-with-fan}/constant/polyMesh/boundary (100%) create mode 100644 tutorials/incompressible/pimpleFoam/t-junction-with-fan/constant/transportProperties create mode 100644 tutorials/incompressible/pimpleFoam/t-junction-with-fan/constant/turbulenceProperties rename tutorials/incompressible/pimpleFoam/{t-junction => t-junction-with-fan}/selectBaffles.setSet (100%) rename tutorials/incompressible/pimpleFoam/{t-junction => t-junction-with-fan}/selectCyclics.setSet (100%) create mode 100644 tutorials/incompressible/pimpleFoam/t-junction-with-fan/system/controlDict create mode 100644 tutorials/incompressible/pimpleFoam/t-junction-with-fan/system/fvSchemes create mode 100644 tutorials/incompressible/pimpleFoam/t-junction-with-fan/system/fvSolution diff --git a/tutorials/incompressible/pimpleFoam/t-junction-with-fan/0/U b/tutorials/incompressible/pimpleFoam/t-junction-with-fan/0/U new file mode 100644 index 0000000000..8b3863aff9 --- /dev/null +++ b/tutorials/incompressible/pimpleFoam/t-junction-with-fan/0/U @@ -0,0 +1,59 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 1.6 | +| \\ / A nd | Web: http://www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volVectorField; + object U; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 1 -1 0 0 0 0]; + +internalField uniform (0 0 0); + +boundaryField +{ + inlet + { + type pressureInletOutletVelocity; + value uniform (0 0 0); + } + + outlet1 + { + type inletOutlet; + inletValue uniform (0 0 0); + value uniform (0 0 0); + } + + outlet2 + { + type inletOutlet; + inletValue uniform (0 0 0); + value uniform (0 0 0); + } + baffles + { + type fixedValue; + value uniform ( 0 0 0 ); + } + fan + { + type cyclic; + value uniform ( 0 0 0 ); + } + defaultFaces + { + type fixedValue; + value uniform (0 0 0); + } +} + +// ************************************************************************* // diff --git a/tutorials/incompressible/pimpleFoam/t-junction-with-fan/0/epsilon b/tutorials/incompressible/pimpleFoam/t-junction-with-fan/0/epsilon new file mode 100644 index 0000000000..35ddfed661 --- /dev/null +++ b/tutorials/incompressible/pimpleFoam/t-junction-with-fan/0/epsilon @@ -0,0 +1,61 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 1.6 | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + location "0"; + object epsilon; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [ 0 2 -3 0 0 0 0 ]; + +internalField uniform 1; + +boundaryField +{ + inlet + { + type turbulentMixingLengthDissipationRateInlet; + mixingLength 0.01; // 1cm - half channel height + value uniform 1; + } + outlet1 + { + type inletOutlet; + inletValue uniform 1; + value uniform 1; + } + + outlet2 + { + type inletOutlet; + inletValue uniform 1; + value uniform 1; + } + baffles + { + type epsilonWallFunction; + value uniform 1; + } + fan + { + type cyclic; + value uniform 1; + } + defaultFaces + { + type epsilonWallFunction; + value uniform 1; + } +} + + +// ************************************************************************* // diff --git a/tutorials/incompressible/pimpleFoam/t-junction-with-fan/0/k b/tutorials/incompressible/pimpleFoam/t-junction-with-fan/0/k new file mode 100644 index 0000000000..e87a5855d2 --- /dev/null +++ b/tutorials/incompressible/pimpleFoam/t-junction-with-fan/0/k @@ -0,0 +1,62 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 1.6 | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + location "0"; + object k; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [ 0 2 -2 0 0 0 0 ]; + +internalField uniform 1; + +boundaryField +{ + inlet + { + type turbulentIntensityKineticEnergyInlet; + intensity 0.05; // 5% turbulent intensity + value uniform 1; + } + outlet1 + { + type inletOutlet; + inletValue uniform 1; + value uniform 1; + } + + outlet2 + { + type inletOutlet; + inletValue uniform 1; + value uniform 1; + } + baffles + { + type kqRWallFunction; + value uniform 1; + } + fan + { + type cyclic; + value uniform 1; + } + + defaultFaces + { + type kqRWallFunction; + value uniform 1; + } +} + + +// ************************************************************************* // diff --git a/tutorials/incompressible/pimpleFoam/t-junction-with-fan/0/nuTilda b/tutorials/incompressible/pimpleFoam/t-junction-with-fan/0/nuTilda new file mode 100644 index 0000000000..ff51eab08c --- /dev/null +++ b/tutorials/incompressible/pimpleFoam/t-junction-with-fan/0/nuTilda @@ -0,0 +1,52 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 1.6 | +| \\ / A nd | Web: http://www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + object nuTilda; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 2 -1 0 0 0 0]; + +internalField uniform 0; + +boundaryField +{ + inlet + { + type zeroGradient; + } + + outlet1 + { + type zeroGradient; + } + + outlet2 + { + type zeroGradient; + } + baffles + { + type zeroGradient; + } + fan + { + type cyclic; + value uniform 0; + } + defaultFaces + { + type zeroGradient; + } +} + +// ************************************************************************* // diff --git a/tutorials/incompressible/pimpleFoam/t-junction-with-fan/0/nut b/tutorials/incompressible/pimpleFoam/t-junction-with-fan/0/nut new file mode 100644 index 0000000000..570f1f90ac --- /dev/null +++ b/tutorials/incompressible/pimpleFoam/t-junction-with-fan/0/nut @@ -0,0 +1,59 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 1.6 | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + location "0"; + object nut; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [ 0 2 -1 0 0 0 0 ]; + +internalField uniform 0; + +boundaryField +{ + inlet + { + type calculated; + value uniform 0; + } + + outlet1 + { + type calculated; + value uniform 0; + } + + outlet2 + { + type calculated; + value uniform 0; + } + baffles + { + type nutkWallFunction; + value uniform 0; + } + fan + { + type cyclic; + value uniform 0; + } + defaultFaces + { + type nutkWallFunction; + value uniform 0; + } +} + + +// ************************************************************************* // diff --git a/tutorials/incompressible/pimpleFoam/t-junction-with-fan/0/p b/tutorials/incompressible/pimpleFoam/t-junction-with-fan/0/p new file mode 100644 index 0000000000..d9873e5b7a --- /dev/null +++ b/tutorials/incompressible/pimpleFoam/t-junction-with-fan/0/p @@ -0,0 +1,69 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 1.6 | +| \\ / A nd | Web: http://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 100000; + +boundaryField +{ + inlet + { + //type totalPressure; + //p0 uniform 100040; + + type timeVaryingTotalPressure; + p0 100040; // only used for restarts + outOfBounds clamp; + fileName "$FOAM_CASE/constant/p0vsTime"; + + U U; + phi phi; + rho none; + psi none; + gamma 1; + value uniform 100040; + } + + outlet1 + { + type fixedValue; + value uniform 100010; + } + + outlet2 + { + type fixedValue; + value uniform 100000; + } + baffles + { + type zeroGradient; + } + fan + { + type fan; + patchType cyclic; + f 2 ( 50 -0.1 ); + value uniform 100000; + } + defaultFaces + { + type zeroGradient; + } +} + +// ************************************************************************* // diff --git a/tutorials/incompressible/pimpleFoam/t-junction/Allrun b/tutorials/incompressible/pimpleFoam/t-junction-with-fan/Allrun similarity index 100% rename from tutorials/incompressible/pimpleFoam/t-junction/Allrun rename to tutorials/incompressible/pimpleFoam/t-junction-with-fan/Allrun diff --git a/tutorials/incompressible/pimpleFoam/t-junction-with-fan/README.txt b/tutorials/incompressible/pimpleFoam/t-junction-with-fan/README.txt new file mode 100644 index 0000000000..fd3f970be5 --- /dev/null +++ b/tutorials/incompressible/pimpleFoam/t-junction-with-fan/README.txt @@ -0,0 +1,3 @@ +300-04-16 T-junction with baffles and fan. +Inlet on left, one outlet at bottom, one at top. +To test multiple outlets. diff --git a/tutorials/incompressible/pimpleFoam/t-junction-with-fan/constant/RASProperties b/tutorials/incompressible/pimpleFoam/t-junction-with-fan/constant/RASProperties new file mode 100644 index 0000000000..81b1ec9115 --- /dev/null +++ b/tutorials/incompressible/pimpleFoam/t-junction-with-fan/constant/RASProperties @@ -0,0 +1,25 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 1.6 | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "constant"; + object RASProperties; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +RASModel kEpsilon; + +turbulence on; + +printCoeffs on; + + +// ************************************************************************* // diff --git a/tutorials/incompressible/pimpleFoam/t-junction-with-fan/constant/p0vsTime b/tutorials/incompressible/pimpleFoam/t-junction-with-fan/constant/p0vsTime new file mode 100644 index 0000000000..a9ee6bb3e7 --- /dev/null +++ b/tutorials/incompressible/pimpleFoam/t-junction-with-fan/constant/p0vsTime @@ -0,0 +1,4 @@ +( + (0 100010) + (1 100040) +) diff --git a/tutorials/incompressible/pimpleFoam/t-junction-with-fan/constant/polyMesh/blockMeshDict b/tutorials/incompressible/pimpleFoam/t-junction-with-fan/constant/polyMesh/blockMeshDict new file mode 100644 index 0000000000..5e97f00deb --- /dev/null +++ b/tutorials/incompressible/pimpleFoam/t-junction-with-fan/constant/polyMesh/blockMeshDict @@ -0,0 +1,119 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 1.6 | +| \\ / A nd | Web: http://www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object blockMeshDict; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +// outlet1 +// +-+ +// | | +// | | +// | | +// | | +// +-----------+ | +// |inlet | +// +-----------+ | +// | | +// | | +// | | +// | | +// +-+ +// outlet2 + +convertToMeters 1; + +vertices +( + (0.0 -0.01 0) //0 + (0.2 -0.01 0) + (0.2 0.01 0) //2 + (0.0 0.01 0) + + (0.22 -0.01 0) //4 + (0.22 0.01 0) + + (0.2 -0.21 0) //6 + (0.22 -0.21 0) + + (0.2 0.21 0) //8 + (0.22 0.21 0) + + // Z + (0.0 -0.01 0.02) //0 + (0.2 -0.01 0.02) + (0.2 0.01 0.02) //2 + (0.0 0.01 0.02) + + (0.22 -0.01 0.02) //4 + (0.22 0.01 0.02) + + (0.2 -0.21 0.02) //6 + (0.22 -0.21 0.02) + + (0.2 0.21 0.02) //8 + (0.22 0.21 0.02) + +); + +blocks +( + // inlet block + hex (0 1 2 3 10 11 12 13) (50 5 5) simpleGrading (1 1 1) + + // central block + hex (1 4 5 2 11 14 15 12) (5 5 5) simpleGrading (1 1 1) + + // bottom block + hex (6 7 4 1 16 17 14 11) (5 50 5) simpleGrading (1 1 1) + + // top block + hex (2 5 9 8 12 15 19 18) (5 50 5) simpleGrading (1 1 1) +); + +edges +( +); + +patches +( + patch inlet + ( + (0 10 13 3) + ) + + patch outlet1 + ( + (6 7 17 16) + ) + + patch outlet2 + ( + (8 18 19 9) + ) + + wall baffles + () + + cyclic fan + () + + wall defaultFaces + () + +); + +mergePatchPairs +( +); + +// ************************************************************************* // diff --git a/tutorials/incompressible/pimpleFoam/t-junction/constant/polyMesh/boundary b/tutorials/incompressible/pimpleFoam/t-junction-with-fan/constant/polyMesh/boundary similarity index 100% rename from tutorials/incompressible/pimpleFoam/t-junction/constant/polyMesh/boundary rename to tutorials/incompressible/pimpleFoam/t-junction-with-fan/constant/polyMesh/boundary diff --git a/tutorials/incompressible/pimpleFoam/t-junction-with-fan/constant/transportProperties b/tutorials/incompressible/pimpleFoam/t-junction-with-fan/constant/transportProperties new file mode 100644 index 0000000000..36e9669391 --- /dev/null +++ b/tutorials/incompressible/pimpleFoam/t-junction-with-fan/constant/transportProperties @@ -0,0 +1,39 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 1.6 | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "constant"; + object transportProperties; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +transportModel Newtonian; + +nu nu [ 0 2 -1 0 0 0 0 ] 1e-05; + +CrossPowerLawCoeffs +{ + nu0 nu0 [ 0 2 -1 0 0 0 0 ] 1e-06; + nuInf nuInf [ 0 2 -1 0 0 0 0 ] 1e-06; + m m [ 0 0 1 0 0 0 0 ] 1; + n n [ 0 0 0 0 0 0 0 ] 1; +} + +BirdCarreauCoeffs +{ + nu0 nu0 [ 0 2 -1 0 0 0 0 ] 1e-06; + nuInf nuInf [ 0 2 -1 0 0 0 0 ] 1e-06; + k k [ 0 0 1 0 0 0 0 ] 0; + n n [ 0 0 0 0 0 0 0 ] 1; +} + + +// ************************************************************************* // diff --git a/tutorials/incompressible/pimpleFoam/t-junction-with-fan/constant/turbulenceProperties b/tutorials/incompressible/pimpleFoam/t-junction-with-fan/constant/turbulenceProperties new file mode 100644 index 0000000000..70e87dd27b --- /dev/null +++ b/tutorials/incompressible/pimpleFoam/t-junction-with-fan/constant/turbulenceProperties @@ -0,0 +1,20 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 1.6 | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "constant"; + object turbulenceProperties; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +simulationType RASModel; + +// ************************************************************************* // diff --git a/tutorials/incompressible/pimpleFoam/t-junction/selectBaffles.setSet b/tutorials/incompressible/pimpleFoam/t-junction-with-fan/selectBaffles.setSet similarity index 100% rename from tutorials/incompressible/pimpleFoam/t-junction/selectBaffles.setSet rename to tutorials/incompressible/pimpleFoam/t-junction-with-fan/selectBaffles.setSet diff --git a/tutorials/incompressible/pimpleFoam/t-junction/selectCyclics.setSet b/tutorials/incompressible/pimpleFoam/t-junction-with-fan/selectCyclics.setSet similarity index 100% rename from tutorials/incompressible/pimpleFoam/t-junction/selectCyclics.setSet rename to tutorials/incompressible/pimpleFoam/t-junction-with-fan/selectCyclics.setSet diff --git a/tutorials/incompressible/pimpleFoam/t-junction-with-fan/system/controlDict b/tutorials/incompressible/pimpleFoam/t-junction-with-fan/system/controlDict new file mode 100644 index 0000000000..a966fe894b --- /dev/null +++ b/tutorials/incompressible/pimpleFoam/t-junction-with-fan/system/controlDict @@ -0,0 +1,86 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 1.6 | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "system"; + object controlDict; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +libs ("libOpenFOAM.so" "libincompressibleTurbulenceModel.so" "libincompressibleRASModels.so"); + +application pimpleFoam; + +startFrom startTime; + +startTime 0; + +stopAt endTime; + +endTime 1; + +deltaT 0.001; + +writeControl adjustableRunTime; + +writeInterval 0.1; + +purgeWrite 0; + +writeFormat ascii; + +writePrecision 6; + +writeCompression uncompressed; + +timeFormat general; + +timePrecision 6; + +runTimeModifiable true; + +adjustTimeStep yes; + +maxCo 5; + +functions +{ + probes + { + // Where to load it from + functionObjectLibs ( "libsampling.so" ); + + type probes; + + // Name of the directory for probe data + name probes; + + // Write at same frequency as fields + outputControl outputTime; + outputInterval 1; + + // Fields to be probed + fields + ( + p U + ); + + probeLocations + ( + ( 1e-06 0 0.01 ) // at inlet + ( 0.21 -0.20999 0.01 ) // at outlet1 + ( 0.21 0.20999 0.01 ) // at outlet2 + ( 0.21 0 0.01 ) // at central block + ); + } +} + +// ************************************************************************* // diff --git a/tutorials/incompressible/pimpleFoam/t-junction-with-fan/system/fvSchemes b/tutorials/incompressible/pimpleFoam/t-junction-with-fan/system/fvSchemes new file mode 100644 index 0000000000..6b14062252 --- /dev/null +++ b/tutorials/incompressible/pimpleFoam/t-junction-with-fan/system/fvSchemes @@ -0,0 +1,71 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 1.6 | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "system"; + object fvSchemes; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +ddtSchemes +{ + default Euler; +} + +gradSchemes +{ + default Gauss linear; + grad(p) Gauss linear; + grad(U) Gauss linear; +} + +divSchemes +{ + default none; + div(phi,U) Gauss limitedLinearV 1; + div(phi,k) Gauss limitedLinear 1; + div(phi,epsilon) Gauss limitedLinear 1; + div(phi,R) Gauss limitedLinear 1; + div(R) Gauss linear; + div(phi,nuTilda) Gauss limitedLinear 1; + div((nuEff*dev(grad(U).T()))) Gauss linear; +} + +laplacianSchemes +{ + default none; + laplacian(nuEff,U) Gauss linear corrected; + laplacian((1|A(U)),p) Gauss linear corrected; + laplacian(DkEff,k) Gauss linear corrected; + laplacian(DepsilonEff,epsilon) Gauss linear corrected; + laplacian(DREff,R) Gauss linear corrected; + laplacian(DnuTildaEff,nuTilda) Gauss linear corrected; +} + +interpolationSchemes +{ + default linear; + interpolate(U) linear; +} + +snGradSchemes +{ + default corrected; +} + +fluxRequired +{ + default no; + p ; +} + + +// ************************************************************************* // diff --git a/tutorials/incompressible/pimpleFoam/t-junction-with-fan/system/fvSolution b/tutorials/incompressible/pimpleFoam/t-junction-with-fan/system/fvSolution new file mode 100644 index 0000000000..5a9f970576 --- /dev/null +++ b/tutorials/incompressible/pimpleFoam/t-junction-with-fan/system/fvSolution @@ -0,0 +1,94 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 1.6 | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "system"; + object fvSolution; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +solvers +{ + p + { + solver GAMG; + tolerance 1e-06; + relTol 0.01; + smoother GaussSeidel; + cacheAgglomeration true; + nCellsInCoarsestLevel 10; + agglomerator faceAreaPair; + mergeLevels 1; + } + + pFinal + { + solver GAMG; + tolerance 1e-06; + relTol 0; + smoother GaussSeidel; + cacheAgglomeration true; + nCellsInCoarsestLevel 10; + agglomerator faceAreaPair; + mergeLevels 1; + } + + U + { + solver PBiCG; + preconditioner DILU; + tolerance 1e-05; + relTol 0.1; + } + + UFinal + { + solver PBiCG; + preconditioner DILU; + tolerance 1e-05; + relTol 0; + } + + k + { + solver PBiCG; + preconditioner DILU; + tolerance 1e-05; + relTol 0; + } + + epsilon + { + solver PBiCG; + preconditioner DILU; + tolerance 1e-05; + relTol 0; + } +} + +PIMPLE +{ + nOuterCorrectors 2; + nCorrectors 2; + nNonOrthogonalCorrectors 0; + pRefCell 0; + pRefValue 0; +} + +relaxationFactors +{ + U 1; + k 1; + epsilon 1; +} + + +// ************************************************************************* // diff --git a/tutorials/incompressible/pimpleFoam/t-junction/0/U b/tutorials/incompressible/pimpleFoam/t-junction/0/U index 8b3863aff9..937d3966b2 100644 --- a/tutorials/incompressible/pimpleFoam/t-junction/0/U +++ b/tutorials/incompressible/pimpleFoam/t-junction/0/U @@ -20,36 +20,27 @@ internalField uniform (0 0 0); boundaryField { - inlet + inlet { type pressureInletOutletVelocity; value uniform (0 0 0); } - outlet1 + outlet1 { type inletOutlet; inletValue uniform (0 0 0); value uniform (0 0 0); } - outlet2 + outlet2 { type inletOutlet; inletValue uniform (0 0 0); value uniform (0 0 0); } - baffles - { - type fixedValue; - value uniform ( 0 0 0 ); - } - fan - { - type cyclic; - value uniform ( 0 0 0 ); - } - defaultFaces + + defaultFaces { type fixedValue; value uniform (0 0 0); diff --git a/tutorials/incompressible/pimpleFoam/t-junction/0/epsilon b/tutorials/incompressible/pimpleFoam/t-junction/0/epsilon index 35ddfed661..98515b441d 100644 --- a/tutorials/incompressible/pimpleFoam/t-junction/0/epsilon +++ b/tutorials/incompressible/pimpleFoam/t-junction/0/epsilon @@ -27,33 +27,23 @@ boundaryField mixingLength 0.01; // 1cm - half channel height value uniform 1; } + outlet1 { type inletOutlet; inletValue uniform 1; - value uniform 1; } outlet2 { type inletOutlet; inletValue uniform 1; - value uniform 1; - } - baffles - { - type epsilonWallFunction; - value uniform 1; - } - fan - { - type cyclic; - value uniform 1; } + defaultFaces { type epsilonWallFunction; - value uniform 1; + value uniform 0; } } diff --git a/tutorials/incompressible/pimpleFoam/t-junction/0/k b/tutorials/incompressible/pimpleFoam/t-junction/0/k index e87a5855d2..35f4e42f32 100644 --- a/tutorials/incompressible/pimpleFoam/t-junction/0/k +++ b/tutorials/incompressible/pimpleFoam/t-junction/0/k @@ -27,34 +27,23 @@ boundaryField intensity 0.05; // 5% turbulent intensity value uniform 1; } + outlet1 { type inletOutlet; inletValue uniform 1; - value uniform 1; } outlet2 { type inletOutlet; inletValue uniform 1; - value uniform 1; - } - baffles - { - type kqRWallFunction; - value uniform 1; - } - fan - { - type cyclic; - value uniform 1; } defaultFaces { type kqRWallFunction; - value uniform 1; + value uniform 0; } } diff --git a/tutorials/incompressible/pimpleFoam/t-junction/0/nuTilda b/tutorials/incompressible/pimpleFoam/t-junction/0/nuTilda index ff51eab08c..fe8744b398 100644 --- a/tutorials/incompressible/pimpleFoam/t-junction/0/nuTilda +++ b/tutorials/incompressible/pimpleFoam/t-junction/0/nuTilda @@ -34,15 +34,7 @@ boundaryField { type zeroGradient; } - baffles - { - type zeroGradient; - } - fan - { - type cyclic; - value uniform 0; - } + defaultFaces { type zeroGradient; diff --git a/tutorials/incompressible/pimpleFoam/t-junction/0/nut b/tutorials/incompressible/pimpleFoam/t-junction/0/nut index 570f1f90ac..b4a42336aa 100644 --- a/tutorials/incompressible/pimpleFoam/t-junction/0/nut +++ b/tutorials/incompressible/pimpleFoam/t-junction/0/nut @@ -38,16 +38,7 @@ boundaryField type calculated; value uniform 0; } - baffles - { - type nutkWallFunction; - value uniform 0; - } - fan - { - type cyclic; - value uniform 0; - } + defaultFaces { type nutkWallFunction; diff --git a/tutorials/incompressible/pimpleFoam/t-junction/0/p b/tutorials/incompressible/pimpleFoam/t-junction/0/p index d9873e5b7a..93170d7a0c 100644 --- a/tutorials/incompressible/pimpleFoam/t-junction/0/p +++ b/tutorials/incompressible/pimpleFoam/t-junction/0/p @@ -20,7 +20,7 @@ internalField uniform 100000; boundaryField { - inlet + inlet { //type totalPressure; //p0 uniform 100040; @@ -38,28 +38,18 @@ boundaryField value uniform 100040; } - outlet1 + outlet1 { type fixedValue; value uniform 100010; } - outlet2 + outlet2 { type fixedValue; value uniform 100000; } - baffles - { - type zeroGradient; - } - fan - { - type fan; - patchType cyclic; - f 2 ( 50 -0.1 ); - value uniform 100000; - } + defaultFaces { type zeroGradient; diff --git a/tutorials/incompressible/pimpleFoam/t-junction/README.txt b/tutorials/incompressible/pimpleFoam/t-junction/README.txt index fd3f970be5..0905f8784d 100644 --- a/tutorials/incompressible/pimpleFoam/t-junction/README.txt +++ b/tutorials/incompressible/pimpleFoam/t-junction/README.txt @@ -1,3 +1,2 @@ -300-04-16 T-junction with baffles and fan. -Inlet on left, one outlet at bottom, one at top. +15/8/8 Simple T-junction. Inlet on left, one outlet at bottom, one at top. To test multiple outlets. diff --git a/tutorials/incompressible/pimpleFoam/t-junction/constant/polyMesh/blockMeshDict b/tutorials/incompressible/pimpleFoam/t-junction/constant/polyMesh/blockMeshDict index 5e97f00deb..7f78827df0 100644 --- a/tutorials/incompressible/pimpleFoam/t-junction/constant/polyMesh/blockMeshDict +++ b/tutorials/incompressible/pimpleFoam/t-junction/constant/polyMesh/blockMeshDict @@ -101,12 +101,6 @@ patches (8 18 19 9) ) - wall baffles - () - - cyclic fan - () - wall defaultFaces () From 4437361674e47e9e574569b4bdc1377675933a81 Mon Sep 17 00:00:00 2001 From: henry Date: Mon, 19 Apr 2010 12:05:25 +0100 Subject: [PATCH 4/5] thermodynamicProperties: Added comment to explain the "normalisedGas" used. --- .../forwardStep/constant/thermophysicalProperties | 5 ++++- .../forwardStep/constant/thermodynamicProperties | 4 +++- .../laminar/forwardStep/constant/thermophysicalProperties | 7 +++++-- 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/tutorials/compressible/rhoCentralFoam/forwardStep/constant/thermophysicalProperties b/tutorials/compressible/rhoCentralFoam/forwardStep/constant/thermophysicalProperties index e2ad38ed54..89911f12d8 100644 --- a/tutorials/compressible/rhoCentralFoam/forwardStep/constant/thermophysicalProperties +++ b/tutorials/compressible/rhoCentralFoam/forwardStep/constant/thermophysicalProperties @@ -15,8 +15,11 @@ FoamFile } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -thermoType ePsiThermo>>>>; +thermoType ePsiThermo>>>>; +// Note: these are the properties for a "normalised" inviscid gas +// for which the speed of sound is 1 m/s at a temperature of 1K +// and gamma = 7/5 mixture normalisedGas 1 11640.3 2.5 0 0 1; diff --git a/tutorials/compressible/rhoSonicFoam/forwardStep/constant/thermodynamicProperties b/tutorials/compressible/rhoSonicFoam/forwardStep/constant/thermodynamicProperties index 1d7d089e31..d014c6739f 100644 --- a/tutorials/compressible/rhoSonicFoam/forwardStep/constant/thermodynamicProperties +++ b/tutorials/compressible/rhoSonicFoam/forwardStep/constant/thermodynamicProperties @@ -15,8 +15,10 @@ FoamFile } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +// Note: these are the properties for a "normalised" inviscid gas +// for which the speed of sound is 1 m/s at a temperature of 1K +// and gamma = 7/5 Cv Cv [ 0 2 -2 -1 0 0 0 ] 1.78571; - R R [ 0 2 -2 -1 0 0 0 ] 0.714286; diff --git a/tutorials/compressible/sonicFoam/laminar/forwardStep/constant/thermophysicalProperties b/tutorials/compressible/sonicFoam/laminar/forwardStep/constant/thermophysicalProperties index c504181d21..6558fda69e 100644 --- a/tutorials/compressible/sonicFoam/laminar/forwardStep/constant/thermophysicalProperties +++ b/tutorials/compressible/sonicFoam/laminar/forwardStep/constant/thermophysicalProperties @@ -15,9 +15,12 @@ FoamFile } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -thermoType ePsiThermo>>>>; +thermoType ePsiThermo>>>>; -mixture air 1 11640.31 1.78571 0 0 0.7; +// Note: these are the properties for a "normalised" inviscid gas +// for which the speed of sound is 1 m/s at a temperature of 1K +// and gamma = 7/5 +mixture normalisedGas 1 11640.31 2.5 0 0 1; // ************************************************************************* // From 5f0538eccaed55d339753b3aca63aa2e5319c533 Mon Sep 17 00:00:00 2001 From: andy Date: Wed, 21 Apr 2010 12:22:22 +0100 Subject: [PATCH 5/5] ENH: Added active flag to KinematicParcel - used during parcel calc() function to flag whether the parcel should be tracked - if false, parcel not tracked, but sub-models are still active - useful, e.g. for particle 'stick' condition - NOTE: stored as a bool, but read/written as a label for restarts/post-processing --- .../KinematicParcel/KinematicParcel.C | 6 +++++- .../KinematicParcel/KinematicParcel.H | 11 ++++++++++- .../KinematicParcel/KinematicParcelI.H | 18 +++++++++++++++++- .../KinematicParcel/KinematicParcelIO.C | 19 ++++++++++++++++--- .../LocalInteraction/LocalInteraction.C | 4 ++++ .../LocalInteraction/LocalInteraction.H | 1 + .../PatchInteractionModel.H | 1 + .../PatchInteractionModel/Rebound/Rebound.C | 2 ++ .../PatchInteractionModel/Rebound/Rebound.H | 1 + .../StandardWallInteraction.C | 4 ++++ .../StandardWallInteraction.H | 1 + 11 files changed, 62 insertions(+), 6 deletions(-) diff --git a/src/lagrangian/intermediate/parcels/Templates/KinematicParcel/KinematicParcel.C b/src/lagrangian/intermediate/parcels/Templates/KinematicParcel/KinematicParcel.C index e17e7138d6..b11d693d95 100644 --- a/src/lagrangian/intermediate/parcels/Templates/KinematicParcel/KinematicParcel.C +++ b/src/lagrangian/intermediate/parcels/Templates/KinematicParcel/KinematicParcel.C @@ -258,7 +258,10 @@ bool Foam::KinematicParcel::move(TrackData& td) // face is hit label cellI = p.cell(); - dt *= p.trackToFace(p.position() + dt*U_, td); + if (p.active()) + { + dt *= p.trackToFace(p.position() + dt*U_, td); + } tEnd -= dt; p.stepFraction() = 1.0 - tEnd/deltaT; @@ -322,6 +325,7 @@ bool Foam::KinematicParcel::hitPatch pp, this->face(), td.keepParticle, + active_, U_ ); } diff --git a/src/lagrangian/intermediate/parcels/Templates/KinematicParcel/KinematicParcel.H b/src/lagrangian/intermediate/parcels/Templates/KinematicParcel/KinematicParcel.H index 5316ea2280..a154bac88b 100644 --- a/src/lagrangian/intermediate/parcels/Templates/KinematicParcel/KinematicParcel.H +++ b/src/lagrangian/intermediate/parcels/Templates/KinematicParcel/KinematicParcel.H @@ -194,6 +194,9 @@ protected: // Parcel properties + //- Active flag - tracking inactive when active = false + bool active_; + //- Parcel type id label typeId_; @@ -308,6 +311,9 @@ public: // Access + //- Return const access to active flag + inline bool active() const; + //- Return const access to type id inline label typeId() const; @@ -332,8 +338,11 @@ public: // Edit + //- Return const access to active flag + inline bool& active(); + //- Return access to type id - inline label typeId(); + inline label& typeId(); //- Return access to number of particles inline scalar& nParticle(); diff --git a/src/lagrangian/intermediate/parcels/Templates/KinematicParcel/KinematicParcelI.H b/src/lagrangian/intermediate/parcels/Templates/KinematicParcel/KinematicParcelI.H index 7c4b759760..6eca153546 100644 --- a/src/lagrangian/intermediate/parcels/Templates/KinematicParcel/KinematicParcelI.H +++ b/src/lagrangian/intermediate/parcels/Templates/KinematicParcel/KinematicParcelI.H @@ -75,6 +75,7 @@ inline Foam::KinematicParcel::KinematicParcel ) : Particle(owner, position, cellI), + active_(false), typeId_(owner.parcelTypeId()), nParticle_(0), d_(0.0), @@ -102,6 +103,7 @@ inline Foam::KinematicParcel::KinematicParcel ) : Particle(owner, position, cellI), + active_(true), typeId_(typeId), nParticle_(nParticle0), d_(d0), @@ -201,6 +203,13 @@ Foam::KinematicParcel::trackData::g() const // * * * * * * * * * * KinematicParcel Member Functions * * * * * * * * * * // +template +inline bool Foam::KinematicParcel::active() const +{ + return active_; +} + + template inline Foam::label Foam::KinematicParcel::typeId() const { @@ -251,7 +260,14 @@ inline const Foam::vector& Foam::KinematicParcel::UTurb() const template -inline Foam::label Foam::KinematicParcel::typeId() +inline bool& Foam::KinematicParcel::active() +{ + return active_; +} + + +template +inline Foam::label& Foam::KinematicParcel::typeId() { return typeId_; } diff --git a/src/lagrangian/intermediate/parcels/Templates/KinematicParcel/KinematicParcelIO.C b/src/lagrangian/intermediate/parcels/Templates/KinematicParcel/KinematicParcelIO.C index bbf5d46412..a334e8b880 100644 --- a/src/lagrangian/intermediate/parcels/Templates/KinematicParcel/KinematicParcelIO.C +++ b/src/lagrangian/intermediate/parcels/Templates/KinematicParcel/KinematicParcelIO.C @@ -33,6 +33,7 @@ License template Foam::string Foam::KinematicParcel::propHeader = Particle::propHeader + + " active" + " typeId" + " nParticle" + " d" @@ -53,6 +54,7 @@ Foam::KinematicParcel::KinematicParcel ) : Particle(cloud, is, readFields), + active_(false), typeId_(0), nParticle_(0.0), d_(0.0), @@ -68,6 +70,7 @@ Foam::KinematicParcel::KinematicParcel { if (is.format() == IOstream::ASCII) { + active_ = readBool(is); typeId_ = readLabel(is); nParticle_ = readScalar(is); d_ = readScalar(is); @@ -81,7 +84,8 @@ Foam::KinematicParcel::KinematicParcel is.read ( reinterpret_cast(&typeId_), - sizeof(typeId_) + sizeof(active_) + + sizeof(typeId_) + sizeof(nParticle_) + sizeof(d_) + sizeof(U_) @@ -111,6 +115,9 @@ void Foam::KinematicParcel::readFields(Cloud& c) Particle::readFields(c); + IOField