From 64648e8b3e1b154750b7a2c21391bcd4254f20ba Mon Sep 17 00:00:00 2001 From: andy Date: Tue, 12 Apr 2011 10:11:08 +0100 Subject: [PATCH] ENH: Updated motorbike tutorial (Chris' updates) --- .../simpleFoam/motorBike/system/controlDict | 61 ++----------------- .../simpleFoam/motorBike/system/cuttingPlane | 35 +++++++++++ .../simpleFoam/motorBike/system/forceCoeffs | 32 ++++++++++ .../simpleFoam/motorBike/system/readFields | 21 +++++++ .../simpleFoam/motorBike/system/streamLines | 53 ++++++++++++++++ 5 files changed, 147 insertions(+), 55 deletions(-) create mode 100644 tutorials/incompressible/simpleFoam/motorBike/system/cuttingPlane create mode 100644 tutorials/incompressible/simpleFoam/motorBike/system/forceCoeffs create mode 100644 tutorials/incompressible/simpleFoam/motorBike/system/readFields create mode 100644 tutorials/incompressible/simpleFoam/motorBike/system/streamLines diff --git a/tutorials/incompressible/simpleFoam/motorBike/system/controlDict b/tutorials/incompressible/simpleFoam/motorBike/system/controlDict index 376080efff..28cd589841 100644 --- a/tutorials/incompressible/simpleFoam/motorBike/system/controlDict +++ b/tutorials/incompressible/simpleFoam/motorBike/system/controlDict @@ -16,7 +16,7 @@ FoamFile application simpleFoam; -startFrom startTime; +startFrom latestTime; startTime 0; @@ -36,7 +36,7 @@ writeFormat ascii; writePrecision 6; -writeCompression off; +writeCompression compressed; timeFormat general; @@ -52,59 +52,10 @@ libs functions { - // 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); - } - - streamLines - { - type streamLine; - - // Output every - outputControl outputTime; - // outputInterval 10; - - setFormat vtk; //gnuplot; //xmgr; //raw; //jplot; - - // Velocity field to use for tracking. - U U; - - // Tracked forwards (+U) or backwards (-U) - trackForward true; - - // Names of fields to sample. Should contain above velocity field! - fields (p U k); - - // Steps particles can travel before being removed - lifeTime 10000; - - // Number of steps per cell (estimate). Set to 1 to disable subcycling. - nSubCycle 5; - - // Cloud name to use - cloudName particleTracks; - - // Seeding method. See the sampleSets in sampleDict. - seedSampleSet uniform; //cloud;//triSurfaceMeshPointSet; - - uniformCoeffs - { - type uniform; - axis x; //distance; - - // Note: tracks slightly offset so as not to be on a face - start (-1.001 1e-7 0.0011); - end (-1.001 1e-7 1.0011); - nPoints 20; - } - } + #include "readFields" + #include "streamLines" + #include "cuttingPlane" + #include "forceCoeffs" } diff --git a/tutorials/incompressible/simpleFoam/motorBike/system/cuttingPlane b/tutorials/incompressible/simpleFoam/motorBike/system/cuttingPlane new file mode 100644 index 0000000000..f7c54aa271 --- /dev/null +++ b/tutorials/incompressible/simpleFoam/motorBike/system/cuttingPlane @@ -0,0 +1,35 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ + +cuttingPlane +{ + type surfaces; + functionObjectLibs ("libsampling.so"); + outputControl outputTime; + + surfaceFormat vtk; + fields ( p U ); + + surfaces + ( + yNormal + { + type cuttingPlane; + planeType pointAndNormal; + pointAndNormalDict + { + basePoint (0 0 0); + normalVector (0 1 0); + } + interpolate true; + } + ); +} + + +// ************************************************************************* // diff --git a/tutorials/incompressible/simpleFoam/motorBike/system/forceCoeffs b/tutorials/incompressible/simpleFoam/motorBike/system/forceCoeffs new file mode 100644 index 0000000000..b8cb538cda --- /dev/null +++ b/tutorials/incompressible/simpleFoam/motorBike/system/forceCoeffs @@ -0,0 +1,32 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ + +forces +{ + type forceCoeffs; + functionObjectLibs ( "libforces.so" ); + outputControl timeStep; + outputInterval 1; + + patches ( "motorBike.*" ); + pName p; + UName U; + rhoName rhoInf; // Indicates incompressible + log true; + rhoInf 1; // Redundant for incompressible + liftDir (0 0 1); + dragDir (1 0 0); + CofR (0.72 0 0); // Axle midpoint on ground + pitchAxis (0 1 0); + magUInf 20; + lRef 1.42; // Wheelbase length + Aref 0.75; // Estimated +} + + +// ************************************************************************* // diff --git a/tutorials/incompressible/simpleFoam/motorBike/system/readFields b/tutorials/incompressible/simpleFoam/motorBike/system/readFields new file mode 100644 index 0000000000..aef5410ebf --- /dev/null +++ b/tutorials/incompressible/simpleFoam/motorBike/system/readFields @@ -0,0 +1,21 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.com | +| \\/ 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/simpleFoam/motorBike/system/streamLines b/tutorials/incompressible/simpleFoam/motorBike/system/streamLines new file mode 100644 index 0000000000..4155012ab1 --- /dev/null +++ b/tutorials/incompressible/simpleFoam/motorBike/system/streamLines @@ -0,0 +1,53 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ + +streamLines +{ + type streamLine; + + // Output every + outputControl outputTime; + // outputInterval 10; + + setFormat vtk; //gnuplot; //xmgr; //raw; //jplot; + + // Velocity field to use for tracking. + U U; + + // Tracked forwards (+U) or backwards (-U) + trackForward true; + + // Names of fields to sample. Should contain above velocity field! + fields (p U k); + + // Steps particles can travel before being removed + lifeTime 10000; + + // Number of steps per cell (estimate). Set to 1 to disable subcycling. + nSubCycle 5; + + // Cloud name to use + cloudName particleTracks; + + // Seeding method. See the sampleSets in sampleDict. + seedSampleSet uniform; //cloud;//triSurfaceMeshPointSet; + + uniformCoeffs + { + type uniform; + axis x; //distance; + + // Note: tracks slightly offset so as not to be on a face + start (-1.001 1e-7 0.0011); + end (-1.001 1e-7 1.0011); + nPoints 20; + } +} + + +// ************************************************************************* //