Merge branch 'master' of ssh://noisy/home/noisy3/OpenFOAM/OpenFOAM-dev

This commit is contained in:
sergio
2011-03-07 12:58:25 +00:00
143 changed files with 229 additions and 40237 deletions

View File

@ -98,6 +98,13 @@ bool Foam::functionEntries::codeStream::execute
// see if library is loaded
void* lib = dlLibraryTable::findLibrary(libPath);
if (!lib)
{
Info<< "Using #codeStream with " << libPath << endl;
}
// nothing loaded
// avoid compilation if possible by loading an existing library
if (!lib && dlLibraryTable::open(libPath, false))

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd.
\\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -64,7 +64,10 @@ void fvMesh::makeSf() const
"S",
pointsInstance(),
meshSubDir,
*this
*this,
IOobject::NO_READ,
IOobject::NO_WRITE,
false
),
*this,
dimArea,

View File

@ -207,7 +207,7 @@ public:
//- Switch to specify if particles of the cloud can return
// non-zero wall distance values. By default, assume
// that they can't (default for wallImpactDistance in
// Particle is 0.0).
// particle is 0.0).
virtual bool hasWallImpactDistance() const
{
return false;

View File

@ -130,6 +130,14 @@ void Foam::particle::transformProperties(const vector&)
{}
Foam::scalar Foam::particle::wallImpactDistance(const vector&) const
{
Info<< "particle::wallImpactDistance" << endl;
return 0.0;
}
// * * * * * * * * * * * * * * Friend Operators * * * * * * * * * * * * * * //
bool Foam::operator==(const particle& pA, const particle& pB)

View File

@ -38,7 +38,6 @@ Description
#include "labelList.H"
#include "pointField.H"
#include "faceList.H"
//#include "typeInfo.H"
#include "OFstream.H"
#include "tetPointRef.H"
#include "FixedList.H"
@ -445,10 +444,6 @@ public:
const label faceI
) const;
//- The nearest distance to a wall that
// the particle can be in the n direction
inline scalar wallImpactDistance(const vector& n) const;
//- Return the fraction of time-step completed
inline scalar& stepFraction();
@ -508,6 +503,10 @@ public:
// according to the given separation vector
virtual void transformProperties(const vector& separation);
//- The nearest distance to a wall that
// the particle can be in the n direction
virtual scalar wallImpactDistance(const vector& n) const;
// Parallel transfer

View File

@ -891,7 +891,6 @@ bool Foam::particle::boundaryFace(const label faceI) const
inline Foam::label Foam::particle::patch(const label faceI) const
{
// return cloud_.facePatch(faceI);
return mesh_.boundaryMesh().whichPatch(faceI);
}
@ -902,18 +901,10 @@ inline Foam::label Foam::particle::patchFace
const label faceI
) const
{
// return cloud_.patchFace(patchI, faceI);
return mesh_.boundaryMesh()[patchI].whichFace(faceI);
}
inline Foam::scalar
Foam::particle::wallImpactDistance(const vector&) const
{
return 0.0;
}
inline Foam::label Foam::particle::faceInterpolation() const
{
return faceI_;

View File

@ -689,11 +689,15 @@ void Foam::particle::hitWallFaces
tetIndices& closestTetIs
)
{
typedef typename CloudType::particleType particleType;
if (!(cloud.hasWallImpactDistance() && cloud.cellHasWallFaces()[cellI_]))
{
return;
}
particleType& p = static_cast<particleType&>(*this);
const faceList& pFaces = mesh_.faces();
const Foam::cell& thisCell = mesh_.cells()[cellI_];
@ -734,7 +738,7 @@ void Foam::particle::hitWallFaces
// triangle. Assuming that the wallImpactDistance
// does not change as the particle or the mesh moves
// forward in time.
scalar r = wallImpactDistance(nHat);
scalar r = p.wallImpactDistance(nHat);
vector toPlusRNHat = to + r*nHat;

View File

@ -52,8 +52,9 @@ class parcel
{
// Private member data
// Reference to the names of the liquid components
List<word> liquidComponents_;
//- Reference to the names of the liquid components
List<word> liquidComponents_;
// Defining data (read and written to field files)
@ -384,11 +385,11 @@ public:
//- Transform the position and physical properties of the particle
// according to the given transformation tensor
void transformProperties(const tensor& T);
virtual void transformProperties(const tensor& T);
//- Transform the position and physical properties of the particle
// according to the given separation vector
void transformProperties(const vector& separation);
virtual void transformProperties(const vector& separation);
//- fix the 2D plane normal,
// when particle hits a face it is slightly perturbed

View File

@ -293,11 +293,11 @@ public:
//- Transform the physical properties of the particle
// according to the given transformation tensor
void transformProperties(const tensor& T);
virtual void transformProperties(const tensor& T);
//- Transform the physical properties of the particle
// according to the given separation vector
void transformProperties(const vector& separation);
virtual void transformProperties(const vector& separation);
// I-O

View File

@ -157,6 +157,13 @@ Foam::CollidingCloud<CloudType>::~CollidingCloud()
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template<class CloudType>
bool Foam::CollidingCloud<CloudType>::hasWallImpactDistance() const
{
return !collision().controlsWallInteraction();
}
template<class CloudType>
void Foam::CollidingCloud<CloudType>::storeState()
{

View File

@ -180,7 +180,7 @@ public:
// then the wall impact distance should be zero.
// Otherwise, it should be allowed to be the value from
// the Parcel.
inline bool hasWallImpactDistance() const;
virtual bool hasWallImpactDistance() const;
// Sub-models

View File

@ -33,13 +33,6 @@ Foam::CollidingCloud<CloudType>::cloudCopy() const
}
template<class CloudType>
inline bool Foam::CollidingCloud<CloudType>::hasWallImpactDistance() const
{
return !collision().controlsWallInteraction();
}
template<class CloudType>
inline const Foam::CollisionModel<Foam::CollidingCloud<CloudType> >&
Foam::CollidingCloud<CloudType>::collision() const

View File

@ -218,10 +218,10 @@ void Foam::KinematicCloud<CloudType>::evolveCloud(TrackData& td)
{
// this->surfaceFilm().injectSteadyState(td);
this->injection().injectSteadyState(td, solution_.deltaTValue());
this->injection().injectSteadyState(td, solution_.trackTime());
td.part() = TrackData::tpLinearTrack;
CloudType::move(td, solution_.deltaTValue());
CloudType::move(td, solution_.trackTime());
}
}
@ -491,6 +491,13 @@ Foam::KinematicCloud<CloudType>::~KinematicCloud()
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template<class CloudType>
bool Foam::KinematicCloud<CloudType>::hasWallImpactDistance() const
{
return true;
}
template<class CloudType>
void Foam::KinematicCloud<CloudType>::checkParcelProperties
(
@ -504,7 +511,7 @@ void Foam::KinematicCloud<CloudType>::checkParcelProperties
parcel.rho() = constProps_.rho0();
}
const scalar carrierDt = solution_.deltaTValue();
const scalar carrierDt = mesh_.time().deltaTValue();
parcel.stepFraction() = (carrierDt - lagrangianDt)/carrierDt;
parcel.typeId() = constProps_.parcelTypeId();
}
@ -582,7 +589,7 @@ template<class TrackData>
void Foam::KinematicCloud<CloudType>::motion(TrackData& td)
{
td.part() = TrackData::tpLinearTrack;
CloudType::move(td, solution_.deltaTValue());
CloudType::move(td, solution_.trackTime());
updateCellOccupancy();
}

View File

@ -304,7 +304,9 @@ public:
//- Return a reference to the cloud copy
inline const KinematicCloud& cloudCopy() const;
inline bool hasWallImpactDistance() const;
//- Switch to specify if particles of the cloud can return
// non-zero wall distance values - true for kinematic parcels
virtual bool hasWallImpactDistance() const;
// References to the mesh and databases

View File

@ -35,13 +35,6 @@ Foam::KinematicCloud<CloudType>::cloudCopy() const
}
template<class CloudType>
inline bool Foam::KinematicCloud<CloudType>::hasWallImpactDistance() const
{
return true;
}
template<class CloudType>
inline const Foam::fvMesh& Foam::KinematicCloud<CloudType>::mesh() const
{

View File

@ -41,7 +41,7 @@ Foam::cloudSolution::cloudSolution
calcFrequency_(1),
maxCo_(0.3),
iter_(1),
deltaT_(0.0),
trackTime_(0.0),
coupled_(false),
cellValueSourceCorrection_(false),
maxTrackTime_(0.0),
@ -67,7 +67,7 @@ Foam::cloudSolution::cloudSolution
calcFrequency_(cs.calcFrequency_),
maxCo_(cs.maxCo_),
iter_(cs.iter_),
deltaT_(cs.deltaT_),
trackTime_(cs.trackTime_),
coupled_(cs.coupled_),
cellValueSourceCorrection_(cs.cellValueSourceCorrection_),
maxTrackTime_(cs.maxTrackTime_),
@ -88,7 +88,7 @@ Foam::cloudSolution::cloudSolution
calcFrequency_(0),
maxCo_(GREAT),
iter_(0),
deltaT_(0.0),
trackTime_(0.0),
coupled_(false),
cellValueSourceCorrection_(false),
maxTrackTime_(0.0),
@ -159,10 +159,8 @@ Foam::scalar Foam::cloudSolution::relaxCoeff(const word& fieldName) const
}
}
FatalErrorIn
(
"scalar cloudSolution::relaxCoeff(const word& fieldName) const"
) << "Field name " << fieldName << " not found in schemes"
FatalErrorIn("scalar cloudSolution::relaxCoeff(const word&) const")
<< "Field name " << fieldName << " not found in schemes"
<< abort(FatalError);
return 1.0;
@ -179,10 +177,8 @@ bool Foam::cloudSolution::semiImplicit(const word& fieldName) const
}
}
FatalErrorIn
(
"bool cloudSolution::semiImplicit(const word& fieldName) const"
) << "Field name " << fieldName << " not found in schemes"
FatalErrorIn("bool cloudSolution::semiImplicit(const word&) const")
<< "Field name " << fieldName << " not found in schemes"
<< abort(FatalError);
return false;
@ -202,14 +198,13 @@ bool Foam::cloudSolution::solveThisStep() const
bool Foam::cloudSolution::canEvolve()
{
// Set the calculation time step
if (transient_)
{
deltaT_ = mesh_.time().deltaTValue();
trackTime_ = mesh_.time().deltaTValue();
}
else
{
deltaT_ = maxTrackTime_;
trackTime_ = maxTrackTime_;
}
return solveThisStep();

View File

@ -77,8 +77,8 @@ class cloudSolution
//- Current cloud iteration
label iter_;
//- Cloud solution time step
scalar deltaT_;
//- Particle track time
scalar trackTime_;
// Run-time options
@ -168,11 +168,8 @@ public:
//- Increment and return iter counter
inline label nextIter();
//- Return the time step
inline scalar deltaTValue() const;
//- Return the time step
inline const dimensionedScalar deltaT() const;
//- Return the particle track time
inline scalar trackTime() const;
//- Return const access to the coupled flag
inline const Switch coupled() const;

View File

@ -95,15 +95,9 @@ inline Foam::label Foam::cloudSolution::nextIter()
}
inline Foam::scalar Foam::cloudSolution::deltaTValue() const
inline Foam::scalar Foam::cloudSolution::trackTime() const
{
return deltaT_;
}
inline const Foam::dimensionedScalar Foam::cloudSolution::deltaT() const
{
return dimensionedScalar("cloudSolution::deltaT", dimTime, deltaT_);
return trackTime_;
}

View File

@ -470,6 +470,16 @@ void Foam::KinematicParcel<ParcelType>::transformProperties
}
template<class ParcelType>
Foam::scalar Foam::KinematicParcel<ParcelType>::wallImpactDistance
(
const vector&
) const
{
return 0.5*d_;
}
// * * * * * * * * * * * * * * IOStream operators * * * * * * * * * * * * * //
#include "KinematicParcelIO.C"

View File

@ -496,10 +496,6 @@ public:
// Helper functions
//- The nearest distance to a wall that
// the particle can be in the n direction
inline scalar wallImpactDistance(const vector& n) const;
//- Return the index of the face to be used in the interpolation
// routine
inline label faceInterpolation() const;
@ -631,11 +627,15 @@ public:
//- Transform the physical properties of the particle
// according to the given transformation tensor
void transformProperties(const tensor& T);
virtual void transformProperties(const tensor& T);
//- Transform the physical properties of the particle
// according to the given separation vector
void transformProperties(const vector& separation);
virtual void transformProperties(const vector& separation);
//- The nearest distance to a wall that the particle can be
// in the n direction
virtual scalar wallImpactDistance(const vector& n) const;
// I-O

View File

@ -421,16 +421,6 @@ inline Foam::vector& Foam::KinematicParcel<ParcelType>::UTurb()
}
template<class ParcelType>
inline Foam::scalar Foam::KinematicParcel<ParcelType>::wallImpactDistance
(
const vector&
) const
{
return 0.5*d_;
}
template<class ParcelType>
inline Foam::label Foam::KinematicParcel<ParcelType>::faceInterpolation() const
{

View File

@ -520,7 +520,7 @@ void Foam::InjectionModel<CloudType>::inject(TrackData& td)
}
const scalar time = this->owner().db().time().value();
const scalar carrierDt = this->owner().solution().deltaTValue();
const scalar trackTime = this->owner().solution().trackTime();
const polyMesh& mesh = this->owner().mesh();
// Prepare for next time step
@ -533,7 +533,7 @@ void Foam::InjectionModel<CloudType>::inject(TrackData& td)
// Duration of injection period during this timestep
const scalar deltaT =
max(0.0, min(carrierDt, min(time - SOI_, timeEnd() - time0_)));
max(0.0, min(trackTime, min(time - SOI_, timeEnd() - time0_)));
// Pad injection time if injection starts during this timestep
const scalar padTime = max(0.0, SOI_ - time0_);

View File

@ -281,9 +281,9 @@ public:
bool move(trackingData&, const scalar trackTime);
void transformProperties(const tensor& T);
virtual void transformProperties(const tensor& T);
void transformProperties(const vector& separation);
virtual void transformProperties(const vector& separation);
void setSitePositions(const constantProperties& constProps);

View File

@ -171,4 +171,10 @@ void Foam::solidParticle::transformProperties(const vector& separation)
}
Foam::scalar Foam::solidParticle::wallImpactDistance(const vector&) const
{
return 0.5*d_;
}
// ************************************************************************* //

View File

@ -174,10 +174,6 @@ public:
//- Return velocity
inline const vector& U() const;
//- The nearest distance to a wall that
// the particle can be in the n direction
inline scalar wallImpactDistance(const vector& n) const;
// Tracking
@ -223,17 +219,15 @@ public:
//- Transform the physical properties of the particle
// according to the given transformation tensor
void transformProperties
(
const tensor& T
);
virtual void transformProperties(const tensor& T);
//- Transform the physical properties of the particle
// according to the given separation vector
void transformProperties
(
const vector& separation
);
virtual void transformProperties(const vector& separation);
//- The nearest distance to a wall that
// the particle can be in the n direction
virtual scalar wallImpactDistance(const vector& n) const;
// I-O

View File

@ -28,14 +28,6 @@ License
#include "volFields.H"
#include "interpolationCellPoint.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
// defineParticleTypeNameAndDebug(solidParticle, 0);
// defineTemplateTypeNameAndDebug(Cloud<solidParticle>, 0);
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::solidParticleCloud::solidParticleCloud
@ -71,6 +63,12 @@ Foam::solidParticleCloud::solidParticleCloud
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
bool Foam::solidParticleCloud::hasWallImpactDistance() const
{
return true;
}
void Foam::solidParticleCloud::move(const dimensionedVector& g)
{
const volScalarField& rho = mesh_.lookupObject<const volScalarField>("rho");

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd.
\\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -94,7 +94,7 @@ public:
// Access
inline bool hasWallImpactDistance() const;
virtual bool hasWallImpactDistance() const;
inline const fvMesh& mesh() const;

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd.
\\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -25,12 +25,6 @@ License
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
inline bool Foam::solidParticleCloud::hasWallImpactDistance() const
{
return true;
}
inline const Foam::fvMesh& Foam::solidParticleCloud::mesh() const
{
return mesh_;

View File

@ -93,12 +93,6 @@ inline Foam::scalar Foam::solidParticle::d() const
}
inline Foam::scalar Foam::solidParticle::wallImpactDistance(const vector&) const
{
return 0.5*d_;
}
inline const Foam::vector& Foam::solidParticle::U() const
{
return U_;

View File

@ -0,0 +1,80 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: dev |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
location "system";
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
{
systemCall1
{
type systemCall;
functionObjectLibs ("libsystemCall.so");
enabled true;
outputControl outputTime;
// called every time step
executeCalls
(
"echo execute"
);
// called at the end of the run
endCalls
(
"echo \*\*\* writing .bashrc \*\*\*"
"cat ~/.bashrc"
"echo \*\*\* done \*\*\*"
);
// called every ouput time
writeCalls
(
"echo \*\*\* writing data \*\*\*"
);
}
}
// ************************************************************************* //

View File

@ -327,7 +327,7 @@ void Foam::triSurface::checkEdges(const bool verbose)
<< " has no edgeFaces"
<< exit(FatalError);
}
else if (myFaces.size() > 2)
else if (myFaces.size() > 2 && verbose)
{
WarningIn
(