From 81670ff8e0e804bc44263b7f3f114a04a750617b Mon Sep 17 00:00:00 2001 From: mattijs Date: Thu, 23 Jan 2014 09:51:57 +0000 Subject: [PATCH 1/2] ENH: propeller: added renumbering and vorticity --- tutorials/incompressible/pimpleDyMFoam/propeller/Allrun | 2 ++ tutorials/incompressible/pimpleDyMFoam/propeller/Allrun.pre | 3 +++ 2 files changed, 5 insertions(+) diff --git a/tutorials/incompressible/pimpleDyMFoam/propeller/Allrun b/tutorials/incompressible/pimpleDyMFoam/propeller/Allrun index b57761bc1d..5bd4bbf11d 100755 --- a/tutorials/incompressible/pimpleDyMFoam/propeller/Allrun +++ b/tutorials/incompressible/pimpleDyMFoam/propeller/Allrun @@ -10,4 +10,6 @@ runApplication decomposePar runParallel `getApplication` 4 +runParallel vorticity 4 + runApplication reconstructPar diff --git a/tutorials/incompressible/pimpleDyMFoam/propeller/Allrun.pre b/tutorials/incompressible/pimpleDyMFoam/propeller/Allrun.pre index e3b951232b..793ccb9c4f 100755 --- a/tutorials/incompressible/pimpleDyMFoam/propeller/Allrun.pre +++ b/tutorials/incompressible/pimpleDyMFoam/propeller/Allrun.pre @@ -15,6 +15,9 @@ runApplication blockMesh runApplication surfaceFeatureExtract runApplication snappyHexMesh -overwrite + +runApplication renumberMesh -overwrite + # force removal of fields generated by snappy \rm -rf 0 cp -rf 0.org 0 From cb01bcec31a0f091ff57afacbb77e27b0b71c829 Mon Sep 17 00:00:00 2001 From: mattijs Date: Thu, 23 Jan 2014 10:53:24 +0000 Subject: [PATCH 2/2] ENH: propeller: use functionObjects --- .../pimpleDyMFoam/propeller/Allrun | 2 - .../pimpleDyMFoam/propeller/system/Q | 22 ++++++++ .../propeller/system/controlDict | 8 +++ .../pimpleDyMFoam/propeller/system/forces | 32 ++++++++++++ .../pimpleDyMFoam/propeller/system/readFields | 21 ++++++++ .../pimpleDyMFoam/propeller/system/surfaces | 52 +++++++++++++++++++ 6 files changed, 135 insertions(+), 2 deletions(-) create mode 100644 tutorials/incompressible/pimpleDyMFoam/propeller/system/Q create mode 100644 tutorials/incompressible/pimpleDyMFoam/propeller/system/forces create mode 100644 tutorials/incompressible/pimpleDyMFoam/propeller/system/readFields create mode 100644 tutorials/incompressible/pimpleDyMFoam/propeller/system/surfaces diff --git a/tutorials/incompressible/pimpleDyMFoam/propeller/Allrun b/tutorials/incompressible/pimpleDyMFoam/propeller/Allrun index 5bd4bbf11d..b57761bc1d 100755 --- a/tutorials/incompressible/pimpleDyMFoam/propeller/Allrun +++ b/tutorials/incompressible/pimpleDyMFoam/propeller/Allrun @@ -10,6 +10,4 @@ runApplication decomposePar runParallel `getApplication` 4 -runParallel vorticity 4 - runApplication reconstructPar diff --git a/tutorials/incompressible/pimpleDyMFoam/propeller/system/Q b/tutorials/incompressible/pimpleDyMFoam/propeller/system/Q new file mode 100644 index 0000000000..aaf32f8a3b --- /dev/null +++ b/tutorials/incompressible/pimpleDyMFoam/propeller/system/Q @@ -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 | | +\*---------------------------------------------------------------------------*/ + +// Calculate Q (from U) +Q +{ + // Where to load it from + functionObjectLibs ("libutilityFunctionObjects.so"); + + type Q; + + // Output every + outputControl outputTime; +} + + +// ************************************************************************* // diff --git a/tutorials/incompressible/pimpleDyMFoam/propeller/system/controlDict b/tutorials/incompressible/pimpleDyMFoam/propeller/system/controlDict index 2dd542c3d5..264b5c1c1b 100644 --- a/tutorials/incompressible/pimpleDyMFoam/propeller/system/controlDict +++ b/tutorials/incompressible/pimpleDyMFoam/propeller/system/controlDict @@ -58,4 +58,12 @@ adjustTimeStep yes; maxCo 2; +functions +{ + #include "readFields" + #include "Q" + #include "surfaces" + #include "forces" +} + // ************************************************************************* // diff --git a/tutorials/incompressible/pimpleDyMFoam/propeller/system/forces b/tutorials/incompressible/pimpleDyMFoam/propeller/system/forces new file mode 100644 index 0000000000..0349e3e87e --- /dev/null +++ b/tutorials/incompressible/pimpleDyMFoam/propeller/system/forces @@ -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 | | +\*---------------------------------------------------------------------------*/ + +forces +{ + type forces; + + functionObjectLibs ( "libforces.so" ); + + outputControl timeStep; + timeInterval 1; + + log yes; + + patches ( "propeller.*" ); + pName p; + UName U; + rhoName rhoInf; // Indicates incompressible + log true; + rhoInf 1; // Redundant for incompressible + + CofR (0 0 0); // Rotation around centre line of propeller + pitchAxis (0 1 0); +} + + +// ************************************************************************* // diff --git a/tutorials/incompressible/pimpleDyMFoam/propeller/system/readFields b/tutorials/incompressible/pimpleDyMFoam/propeller/system/readFields new file mode 100644 index 0000000000..57a93256db --- /dev/null +++ b/tutorials/incompressible/pimpleDyMFoam/propeller/system/readFields @@ -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 | | +\*---------------------------------------------------------------------------*/ + +// Make sure all fields for functionObjects are loaded. Prevents any +// problems running with execFlowFunctionObjects. +readFields +{ + // Where to load it from (if not already in solver) + functionObjectLibs ("libfieldFunctionObjects.so"); + + type readFields; + fields (p U k); +} + + +// ************************************************************************* // diff --git a/tutorials/incompressible/pimpleDyMFoam/propeller/system/surfaces b/tutorials/incompressible/pimpleDyMFoam/propeller/system/surfaces new file mode 100644 index 0000000000..16d7041a89 --- /dev/null +++ b/tutorials/incompressible/pimpleDyMFoam/propeller/system/surfaces @@ -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 | | +\*---------------------------------------------------------------------------*/ + +surfaces +{ + type surfaces; + functionObjectLibs ("libsampling.so"); + outputControl outputTime; + + surfaceFormat vtk; + fields ( p U Q); + + interpolationScheme cellPoint; + + surfaces + ( + zNormal + { + type cuttingPlane; + planeType pointAndNormal; + pointAndNormalDict + { + basePoint (0 0 0); + normalVector (0 0 1); + } + interpolate true; + } + + isoQ + { + type isoSurface; + isoField Q; + isoValue 1000; + interpolate true; + } + + propeller + { + type patch; + patches ( "propeller.*" ); + interpolate true; + } + ); +} + + +// ************************************************************************* //