diff --git a/etc/config/settings.sh b/etc/config/settings.sh index 837dc7c5f9..bf8f58a34a 100644 --- a/etc/config/settings.sh +++ b/etc/config/settings.sh @@ -520,7 +520,7 @@ SGIMPI) export FOAM_MPI=${MPI_ROOT##*/} export MPI_ARCH_PATH=$MPI_ROOT - if [ -d "$MPI_ROOT" -o -z "$MPI_ARCH_PATH" ] + if [ ! -d "$MPI_ROOT" -o -z "$MPI_ARCH_PATH" ] then echo "Warning in $WM_PROJECT_DIR/etc/config/settings.sh:" 1>&2 echo " MPI_ROOT not a valid mpt installation directory or ending in a '/'." 1>&2 diff --git a/src/OpenFOAM/fields/DimensionedFields/DimensionedField/DimensionedField.C b/src/OpenFOAM/fields/DimensionedFields/DimensionedField/DimensionedField.C index 75bc1cb4dd..b2ba573dde 100644 --- a/src/OpenFOAM/fields/DimensionedFields/DimensionedField/DimensionedField.C +++ b/src/OpenFOAM/fields/DimensionedFields/DimensionedField/DimensionedField.C @@ -124,11 +124,7 @@ DimensionedField::DimensionedField const DimensionedField& df ) : -# ifdef ConstructFromTmp regIOobject(df), -# else - regIOobject(df, true), -# endif Field(df), mesh_(df.mesh_), dimensions_(df.dimensions_) @@ -142,7 +138,7 @@ DimensionedField::DimensionedField bool reUse ) : - regIOobject(df, true), + regIOobject(df, reUse), Field(df, reUse), mesh_(df.mesh_), dimensions_(df.dimensions_) @@ -169,7 +165,7 @@ DimensionedField::DimensionedField const tmp >& tdf ) : - regIOobject(tdf(), true), + regIOobject(tdf(), tdf.isTmp()), Field ( const_cast&>(tdf()), diff --git a/src/postProcessing/functionObjects/field/streamLine/controlDict b/src/postProcessing/functionObjects/field/streamLine/controlDict new file mode 100644 index 0000000000..048b7af4f3 --- /dev/null +++ b/src/postProcessing/functionObjects/field/streamLine/controlDict @@ -0,0 +1,99 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 2.0.0 | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object controlDict; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +application icoFoam; + +startFrom startTime; + +startTime 0; + +stopAt endTime; + +endTime 0.5; + +deltaT 0.005; + +writeControl timeStep; + +writeInterval 20; + +purgeWrite 0; + +writeFormat ascii; + +writePrecision 6; + +writeCompression off; + +timeFormat general; + +timePrecision 6; + +runTimeModifiable true; + +functions +{ + streamLines + { + type streamLine; + + // Where to load it from (if not already in solver) + functionObjectLibs ("libfieldFunctionObjects.so"); + + // Output every + outputControl outputTime; + // outputInterval 10; + + setFormat vtk; //gnuplot; //xmgr; //raw; //jplot; + + // Velocity field to use for tracking. + U U; + + // Interpolation method. Default is cellPoint. See sampleDict. + //interpolationScheme pointMVC; + + // Tracked forwards (+U) or backwards (-U) + trackForward true; + + // Names of fields to sample. Should contain above velocity field! + fields (p U); + + // 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; + + start (-0.0205 0.0001 0.00001); + end (-0.0205 0.0005 0.00001); + nPoints 100; + } + } +} + + +// ************************************************************************* // diff --git a/src/postProcessing/functionObjects/field/streamLine/streamLine.C b/src/postProcessing/functionObjects/field/streamLine/streamLine.C index fd57762a9f..ae902f9c54 100644 --- a/src/postProcessing/functionObjects/field/streamLine/streamLine.C +++ b/src/postProcessing/functionObjects/field/streamLine/streamLine.C @@ -33,6 +33,7 @@ License #include "sampledSet.H" #include "globalIndex.H" #include "mapDistribute.H" +#include "interpolationCellPoint.H" // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // @@ -75,9 +76,9 @@ void Foam::streamLine::track() // Read or lookup fields PtrList vsFlds; - PtrList > vsInterp; + PtrList > vsInterp; PtrList vvFlds; - PtrList > vvInterp; + PtrList > vvInterp; label UIndex = -1; @@ -95,13 +96,29 @@ void Foam::streamLine::track() vsInterp.setSize(vsFlds.size()); forAll(vsFlds, i) { - vsInterp.set(i, new interpolationCellPoint(vsFlds[i])); + vsInterp.set + ( + i, + interpolation::New + ( + interpolationScheme_, + vsFlds[i] + ) + ); } ReadFields(mesh, objects, vvFlds); vvInterp.setSize(vvFlds.size()); forAll(vvFlds, i) { - vvInterp.set(i, new interpolationCellPoint(vvFlds[i])); + vvInterp.set + ( + i, + interpolation::New + ( + interpolationScheme_, + vvFlds[i] + ) + ); } } else @@ -146,7 +163,12 @@ void Foam::streamLine::track() vsInterp.set ( nScalar++, - new interpolationCellPoint(f) + //new interpolationCellPoint(f) + interpolation::New + ( + interpolationScheme_, + f + ) ); } else if (mesh.foundObject(fields_[i])) @@ -164,7 +186,12 @@ void Foam::streamLine::track() vvInterp.set ( nVector++, - new interpolationCellPoint(f) + //new interpolationCellPoint(f) + interpolation::New + ( + interpolationScheme_, + f + ) ); } } @@ -307,6 +334,15 @@ void Foam::streamLine::read(const dictionary& dict) nSubCycle_ = 1; } + interpolationScheme_ = dict.lookupOrDefault + ( + "interpolationScheme", + interpolationCellPoint::typeName + ); + + //Info<< typeName << " using interpolation " << interpolationScheme_ + // << endl; + cloudName_ = dict.lookupOrDefault("cloudName", "streamLine"); dict.lookup("seedSampleSet") >> seedSet_; diff --git a/src/postProcessing/functionObjects/field/streamLine/streamLine.H b/src/postProcessing/functionObjects/field/streamLine/streamLine.H index e43fdd7936..9fc981034c 100644 --- a/src/postProcessing/functionObjects/field/streamLine/streamLine.H +++ b/src/postProcessing/functionObjects/field/streamLine/streamLine.H @@ -86,6 +86,9 @@ class streamLine //- Field to transport particle with word UName_; + //- Interpolation scheme to use + word interpolationScheme_; + //- Whether to use +u or -u bool trackForward_; diff --git a/src/postProcessing/functionObjects/field/streamLine/streamLineParticle.H b/src/postProcessing/functionObjects/field/streamLine/streamLineParticle.H index d01353c46f..b1ee9acf88 100644 --- a/src/postProcessing/functionObjects/field/streamLine/streamLineParticle.H +++ b/src/postProcessing/functionObjects/field/streamLine/streamLineParticle.H @@ -38,7 +38,7 @@ SourceFiles #include "particle.H" #include "autoPtr.H" -#include "interpolationCellPoint.H" +#include "interpolation.H" #include "vectorList.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -68,8 +68,8 @@ public: public: - const PtrList >& vsInterp_; - const PtrList >& vvInterp_; + const PtrList >& vsInterp_; + const PtrList >& vvInterp_; const label UIndex_; const bool trackForward_; const label nSubCycle_; @@ -84,8 +84,8 @@ public: trackingData ( Cloud& cloud, - const PtrList >& vsInterp, - const PtrList >& vvInterp, + const PtrList >& vsInterp, + const PtrList >& vvInterp, const label UIndex, const bool trackForward, const label nSubCycle, diff --git a/src/regionModels/pyrolysisModels/pyrolysisModel/pyrolysisModelCollection.C b/src/regionModels/pyrolysisModels/pyrolysisModel/pyrolysisModelCollection.C index 4ec1871f88..4bc3ca977e 100644 --- a/src/regionModels/pyrolysisModels/pyrolysisModel/pyrolysisModelCollection.C +++ b/src/regionModels/pyrolysisModels/pyrolysisModel/pyrolysisModelCollection.C @@ -26,6 +26,16 @@ License #include "pyrolysisModelCollection.H" #include "volFields.H" +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +defineTemplateTypeNameAndDebug +( + Foam::IOPtrList, + 0 +); + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + namespace Foam { namespace regionModels @@ -33,11 +43,6 @@ namespace regionModels namespace pyrolysisModels { -// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // - -defineTemplateTypeNameAndDebug(IOPtrList, 0); - - // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // pyrolysisModelCollection::pyrolysisModelCollection