Merge branch 'master' of /home/dm4/OpenFOAM/OpenFOAM-dev

This commit is contained in:
Sergio Ferraris
2011-10-17 14:33:50 +01:00
7 changed files with 162 additions and 23 deletions

View File

@ -520,7 +520,7 @@ SGIMPI)
export FOAM_MPI=${MPI_ROOT##*/} export FOAM_MPI=${MPI_ROOT##*/}
export MPI_ARCH_PATH=$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 then
echo "Warning in $WM_PROJECT_DIR/etc/config/settings.sh:" 1>&2 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 echo " MPI_ROOT not a valid mpt installation directory or ending in a '/'." 1>&2

View File

@ -124,11 +124,7 @@ DimensionedField<Type, GeoMesh>::DimensionedField
const DimensionedField<Type, GeoMesh>& df const DimensionedField<Type, GeoMesh>& df
) )
: :
# ifdef ConstructFromTmp
regIOobject(df), regIOobject(df),
# else
regIOobject(df, true),
# endif
Field<Type>(df), Field<Type>(df),
mesh_(df.mesh_), mesh_(df.mesh_),
dimensions_(df.dimensions_) dimensions_(df.dimensions_)
@ -142,7 +138,7 @@ DimensionedField<Type, GeoMesh>::DimensionedField
bool reUse bool reUse
) )
: :
regIOobject(df, true), regIOobject(df, reUse),
Field<Type>(df, reUse), Field<Type>(df, reUse),
mesh_(df.mesh_), mesh_(df.mesh_),
dimensions_(df.dimensions_) dimensions_(df.dimensions_)
@ -169,7 +165,7 @@ DimensionedField<Type, GeoMesh>::DimensionedField
const tmp<DimensionedField<Type, GeoMesh> >& tdf const tmp<DimensionedField<Type, GeoMesh> >& tdf
) )
: :
regIOobject(tdf(), true), regIOobject(tdf(), tdf.isTmp()),
Field<Type> Field<Type>
( (
const_cast<DimensionedField<Type, GeoMesh>&>(tdf()), const_cast<DimensionedField<Type, GeoMesh>&>(tdf()),

View File

@ -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;
}
}
}
// ************************************************************************* //

View File

@ -33,6 +33,7 @@ License
#include "sampledSet.H" #include "sampledSet.H"
#include "globalIndex.H" #include "globalIndex.H"
#include "mapDistribute.H" #include "mapDistribute.H"
#include "interpolationCellPoint.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
@ -75,9 +76,9 @@ void Foam::streamLine::track()
// Read or lookup fields // Read or lookup fields
PtrList<volScalarField> vsFlds; PtrList<volScalarField> vsFlds;
PtrList<interpolationCellPoint<scalar> > vsInterp; PtrList<interpolation<scalar> > vsInterp;
PtrList<volVectorField> vvFlds; PtrList<volVectorField> vvFlds;
PtrList<interpolationCellPoint<vector> > vvInterp; PtrList<interpolation<vector> > vvInterp;
label UIndex = -1; label UIndex = -1;
@ -95,13 +96,29 @@ void Foam::streamLine::track()
vsInterp.setSize(vsFlds.size()); vsInterp.setSize(vsFlds.size());
forAll(vsFlds, i) forAll(vsFlds, i)
{ {
vsInterp.set(i, new interpolationCellPoint<scalar>(vsFlds[i])); vsInterp.set
(
i,
interpolation<scalar>::New
(
interpolationScheme_,
vsFlds[i]
)
);
} }
ReadFields(mesh, objects, vvFlds); ReadFields(mesh, objects, vvFlds);
vvInterp.setSize(vvFlds.size()); vvInterp.setSize(vvFlds.size());
forAll(vvFlds, i) forAll(vvFlds, i)
{ {
vvInterp.set(i, new interpolationCellPoint<vector>(vvFlds[i])); vvInterp.set
(
i,
interpolation<vector>::New
(
interpolationScheme_,
vvFlds[i]
)
);
} }
} }
else else
@ -146,7 +163,12 @@ void Foam::streamLine::track()
vsInterp.set vsInterp.set
( (
nScalar++, nScalar++,
new interpolationCellPoint<scalar>(f) //new interpolationCellPoint<scalar>(f)
interpolation<scalar>::New
(
interpolationScheme_,
f
)
); );
} }
else if (mesh.foundObject<volVectorField>(fields_[i])) else if (mesh.foundObject<volVectorField>(fields_[i]))
@ -164,7 +186,12 @@ void Foam::streamLine::track()
vvInterp.set vvInterp.set
( (
nVector++, nVector++,
new interpolationCellPoint<vector>(f) //new interpolationCellPoint<vector>(f)
interpolation<vector>::New
(
interpolationScheme_,
f
)
); );
} }
} }
@ -307,6 +334,15 @@ void Foam::streamLine::read(const dictionary& dict)
nSubCycle_ = 1; nSubCycle_ = 1;
} }
interpolationScheme_ = dict.lookupOrDefault
(
"interpolationScheme",
interpolationCellPoint<scalar>::typeName
);
//Info<< typeName << " using interpolation " << interpolationScheme_
// << endl;
cloudName_ = dict.lookupOrDefault<word>("cloudName", "streamLine"); cloudName_ = dict.lookupOrDefault<word>("cloudName", "streamLine");
dict.lookup("seedSampleSet") >> seedSet_; dict.lookup("seedSampleSet") >> seedSet_;

View File

@ -86,6 +86,9 @@ class streamLine
//- Field to transport particle with //- Field to transport particle with
word UName_; word UName_;
//- Interpolation scheme to use
word interpolationScheme_;
//- Whether to use +u or -u //- Whether to use +u or -u
bool trackForward_; bool trackForward_;

View File

@ -38,7 +38,7 @@ SourceFiles
#include "particle.H" #include "particle.H"
#include "autoPtr.H" #include "autoPtr.H"
#include "interpolationCellPoint.H" #include "interpolation.H"
#include "vectorList.H" #include "vectorList.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -68,8 +68,8 @@ public:
public: public:
const PtrList<interpolationCellPoint<scalar> >& vsInterp_; const PtrList<interpolation<scalar> >& vsInterp_;
const PtrList<interpolationCellPoint<vector> >& vvInterp_; const PtrList<interpolation<vector> >& vvInterp_;
const label UIndex_; const label UIndex_;
const bool trackForward_; const bool trackForward_;
const label nSubCycle_; const label nSubCycle_;
@ -84,8 +84,8 @@ public:
trackingData trackingData
( (
Cloud<streamLineParticle>& cloud, Cloud<streamLineParticle>& cloud,
const PtrList<interpolationCellPoint<scalar> >& vsInterp, const PtrList<interpolation<scalar> >& vsInterp,
const PtrList<interpolationCellPoint<vector> >& vvInterp, const PtrList<interpolation<vector> >& vvInterp,
const label UIndex, const label UIndex,
const bool trackForward, const bool trackForward,
const label nSubCycle, const label nSubCycle,

View File

@ -26,6 +26,16 @@ License
#include "pyrolysisModelCollection.H" #include "pyrolysisModelCollection.H"
#include "volFields.H" #include "volFields.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
defineTemplateTypeNameAndDebug
(
Foam::IOPtrList<Foam::regionModels::pyrolysisModels::pyrolysisModel>,
0
);
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam namespace Foam
{ {
namespace regionModels namespace regionModels
@ -33,11 +43,6 @@ namespace regionModels
namespace pyrolysisModels namespace pyrolysisModels
{ {
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
defineTemplateTypeNameAndDebug(IOPtrList<pyrolysisModel>, 0);
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
pyrolysisModelCollection::pyrolysisModelCollection pyrolysisModelCollection::pyrolysisModelCollection