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

This commit is contained in:
Henry
2011-03-07 12:59:14 +00:00
200 changed files with 1273 additions and 40668 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) 2009-2010 OpenCFD Ltd.
\\ / A nd | Copyright (C) 2009-2011 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -61,7 +61,7 @@ Foam::UniformDimensionedField<Type>::UniformDimensionedField
{
dictionary dict(readStream(typeName));
this->dimensions().reset(dict.lookup("dimensions"));
this->value() = dict.lookup("value");
dict.lookup("value") >> this->value();
}

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

@ -334,11 +334,14 @@ void Foam::Cloud<ParticleType>::move(TrackData& td, const scalar trackTime)
}
}
reduce(nTrackingRescues_, sumOp<label>());
if (nTrackingRescues_ > 0)
if (cloud::debug)
{
Info<< nTrackingRescues_ << " tracking rescue corrections" << endl;
reduce(nTrackingRescues_, sumOp<label>());
if (nTrackingRescues_ > 0)
{
Info<< nTrackingRescues_ << " tracking rescue corrections" << endl;
}
}
}

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

@ -784,23 +784,26 @@ inline void Foam::particle::initCellFacePt()
<< position_ << abort(FatalError);
}
WarningIn("void Foam::particle::initCellFacePt()")
<< "Particle moved from " << position_
<< " to " << newPosition
<< " in cell " << cellI_
<< " tetFace " << tetFaceI_
<< " tetPt " << tetPtI_ << nl
<< " (A fraction of "
<< 1.0 - mag(cC - newPosition)/mag(cC - position_)
<< " of the distance to the cell centre)"
<< " because a decomposition tetFace and tetPt "
<< "could not be found."
<< endl;
if (debug)
{
WarningIn("void Foam::particle::initCellFacePt()")
<< "Particle moved from " << position_
<< " to " << newPosition
<< " in cell " << cellI_
<< " tetFace " << tetFaceI_
<< " tetPt " << tetPtI_ << nl
<< " (A fraction of "
<< 1.0 - mag(cC - newPosition)/mag(cC - position_)
<< " of the distance to the cell centre)"
<< " because a decomposition tetFace and tetPt "
<< "could not be found."
<< endl;
}
position_ = newPosition;
}
if (cellI_ != oldCellI)
if (debug && cellI_ != oldCellI)
{
WarningIn("void Foam::particle::initCellFacePt()")
<< "Particle at position " << position_
@ -888,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);
}
@ -899,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,6 +304,10 @@ public:
//- Return a reference to the cloud copy
inline const KinematicCloud& cloudCopy() 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

@ -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

@ -32,6 +32,7 @@ License
#include "NonSphereDragForce.H"
#include "GravityForce.H"
#include "NonInertialFrameForce.H"
#include "ParamagneticForce.H"
#include "PressureGradientForce.H"
#include "SRFForce.H"
@ -44,6 +45,7 @@ License
makeParticleForceModelType(SphereDragForce, CloudType); \
makeParticleForceModelType(NonSphereDragForce, CloudType); \
makeParticleForceModelType(GravityForce, CloudType); \
makeParticleForceModelType(NonInertialFrameForce, CloudType); \
makeParticleForceModelType(ParamagneticForce, CloudType); \
makeParticleForceModelType(PressureGradientForce, CloudType); \
makeParticleForceModelType(SRFForce, CloudType);

View File

@ -33,6 +33,7 @@ License
#include "BrownianMotionForce.H"
#include "GravityForce.H"
#include "NonInertialFrameForce.H"
#include "ParamagneticForce.H"
#include "PressureGradientForce.H"
#include "SRFForce.H"
@ -46,6 +47,7 @@ License
makeParticleForceModelType(NonSphereDragForce, CloudType); \
makeParticleForceModelType(BrownianMotionForce, CloudType); \
makeParticleForceModelType(GravityForce, CloudType); \
makeParticleForceModelType(NonInertialFrameForce, CloudType); \
makeParticleForceModelType(ParamagneticForce, CloudType); \
makeParticleForceModelType(PressureGradientForce, CloudType); \
makeParticleForceModelType(SRFForce, CloudType);

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

@ -98,7 +98,7 @@ public:
// Access
//- Return the the acceleration due to gravity
//- Return the acceleration due to gravity
inline const vector& g() const;

View File

@ -0,0 +1,206 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2011 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#include "NonInertialFrameForce.H"
#include "uniformDimensionedFields.H"
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
template<class CloudType>
Foam::NonInertialFrameForce<CloudType>::NonInertialFrameForce
(
CloudType& owner,
const fvMesh& mesh,
const dictionary& dict,
const word& forceType
)
:
ParticleForce<CloudType>(owner, mesh, dict),
WName_
(
this->coeffs().template lookupOrDefault<word>
(
"linearAccelerationName",
"linearAcceleration"
)
),
W_(vector::zero),
omegaName_
(
this->coeffs().template lookupOrDefault<word>
(
"angularVelocityName",
"angularVelocity"
)
),
omega_(vector::zero),
omegaDotName_
(
this->coeffs().template lookupOrDefault<word>
(
"angularAccelerationName",
"angularAcceleration"
)
),
omegaDot_(vector::zero),
centreOfRotationName_
(
this->coeffs().template lookupOrDefault<word>
(
"centreOfRotationName",
"centreOfRotation"
)
),
centreOfRotation_(vector::zero)
{}
template<class CloudType>
Foam::NonInertialFrameForce<CloudType>::NonInertialFrameForce
(
const NonInertialFrameForce& niff
)
:
ParticleForce<CloudType>(niff),
WName_(niff.WName_),
W_(niff.W_),
omegaName_(niff.omegaName_),
omega_(niff.omega_),
omegaDotName_(niff.omegaDotName_),
omegaDot_(niff.omegaDot_),
centreOfRotationName_(niff.centreOfRotationName_),
centreOfRotation_(niff.centreOfRotation_)
{}
// * * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * //
template<class CloudType>
Foam::NonInertialFrameForce<CloudType>::~NonInertialFrameForce()
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template<class CloudType>
void Foam::NonInertialFrameForce<CloudType>::cacheFields(const bool store)
{
W_ = vector::zero;
omega_ = vector::zero;
omegaDot_ = vector::zero;
centreOfRotation_ = vector::zero;
if (store)
{
if
(
this->mesh().template foundObject<uniformDimensionedVectorField>
(
WName_
)
)
{
uniformDimensionedVectorField W = this->mesh().template
lookupObject<uniformDimensionedVectorField>(WName_);
W_ = W.value();
}
if
(
this->mesh().template foundObject<uniformDimensionedVectorField>
(
omegaName_
)
)
{
uniformDimensionedVectorField omega = this->mesh().template
lookupObject<uniformDimensionedVectorField>(omegaName_);
omega_ = omega.value();
}
if
(
this->mesh().template foundObject<uniformDimensionedVectorField>
(
omegaDotName_
)
)
{
uniformDimensionedVectorField omegaDot = this->mesh().template
lookupObject<uniformDimensionedVectorField>(omegaDotName_);
omegaDot_ = omegaDot.value();
}
if
(
this->mesh().template foundObject<uniformDimensionedVectorField>
(
centreOfRotationName_
)
)
{
uniformDimensionedVectorField omegaDot = this->mesh().template
lookupObject<uniformDimensionedVectorField>
(
centreOfRotationName_
);
centreOfRotation_ = omegaDot.value();
}
}
}
template<class CloudType>
Foam::forceSuSp Foam::NonInertialFrameForce<CloudType>::calcNonCoupled
(
const typename CloudType::parcelType& p,
const scalar dt,
const scalar mass,
const scalar Re,
const scalar muc
) const
{
forceSuSp value(vector::zero, 0.0);
const vector& r = p.position() - centreOfRotation_;
value.Su() =
mass
*(
-W_
+ (r ^ omegaDot_)
+ 2.0*(p.U() ^ omega_)
+ (omega_ ^ (r ^ omega_))
);
return value;
}
// ************************************************************************* //

View File

@ -0,0 +1,168 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2011 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Class
Foam::NonInertialFrameForce
Description
Calculates particle non-inertial reference frame force. Variable names as
from Landau and Lifshitz, Mechanics, 3rd Ed, p126-129.
SourceFiles
NonInertialFrameForce.C
\*---------------------------------------------------------------------------*/
#ifndef NonInertialFrameForce_H
#define NonInertialFrameForce_H
#include "ParticleForce.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
class fvMesh;
/*---------------------------------------------------------------------------*\
Class NonInertialFrameForce Declaration
\*---------------------------------------------------------------------------*/
template<class CloudType>
class NonInertialFrameForce
:
public ParticleForce<CloudType>
{
// Private data
//- Name of the linear acceleration field
word WName_;
//- The linear acceleration of the reference frame
vector W_;
//- Name of the angular velocity field
word omegaName_;
//- The angular velocity of the reference frame
vector omega_;
//- Name of the angular acceleration field
word omegaDotName_;
//- The angular acceleration of the reference frame
vector omegaDot_;
//- Name of the centre of rotation field
word centreOfRotationName_;
//- The centre of rotation of the reference frame
vector centreOfRotation_;
public:
//- Runtime type information
TypeName("nonInertialFrame");
// Constructors
//- Construct from mesh
NonInertialFrameForce
(
CloudType& owner,
const fvMesh& mesh,
const dictionary& dict,
const word& forceType
);
//- Construct copy
NonInertialFrameForce(const NonInertialFrameForce& niff);
//- Construct and return a clone
virtual autoPtr<ParticleForce<CloudType> > clone() const
{
return autoPtr<ParticleForce<CloudType> >
(
new ParticleForce<CloudType>(*this)
);
}
//- Destructor
virtual ~NonInertialFrameForce();
// Member Functions
// Access
//- Return the linear acceleration of the reference frame
inline const vector& W() const;
//- Return the angular velocity of the reference frame
inline const vector& omega() const;
//- Return the angular acceleration of the reference frame
inline const vector& omegaDot() const;
//- Return the centre of rotation of the reference frame
inline const vector& centreOfRotation() const;
// Evaluation
//- Cache fields
virtual void cacheFields(const bool store);
//- Calculate the non-coupled force
virtual forceSuSp calcNonCoupled
(
const typename CloudType::parcelType& p,
const scalar dt,
const scalar mass,
const scalar Re,
const scalar muc
) const;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#include "NonInertialFrameForceI.H"
#ifdef NoRepository
#include "NonInertialFrameForce.C"
#endif
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -0,0 +1,58 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2011 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
template<class CloudType>
inline const Foam::vector& Foam::NonInertialFrameForce<CloudType>::W() const
{
return W_;
}
template<class CloudType>
inline const Foam::vector& Foam::NonInertialFrameForce<CloudType>::omega() const
{
return omega_;
}
template<class CloudType>
inline const Foam::vector&
Foam::NonInertialFrameForce<CloudType>::omegaDot() const
{
return omegaDot_;
}
template<class CloudType>
inline const Foam::vector&
Foam::NonInertialFrameForce<CloudType>::centreOfRotation() const
{
return centreOfRotation_;
}
// ************************************************************************* //

View File

@ -92,12 +92,11 @@ Foam::forceSuSp Foam::SRFForce<CloudType>::calcNonCoupled
const typename SRF::SRFModel& srf = *srfPtr_;
const vector& omega = srf.omega().value();
const vector& axis = srf.axis();
const vector r = p.position() - axis*(axis & p.position());
const vector& r = p.position();
// Coriolis and centrifugal acceleration terms
value.Su() = mass*2.0*(p.U() ^ omega) + (omega ^ (r ^ omega));
value.Su() = mass*(2.0*(p.U() ^ omega) + (omega ^ (r ^ omega)));
return value;
}

View File

@ -28,7 +28,6 @@ Description
Calculates particle SRF reference frame force
SourceFiles
SRFForceI.H
SRFForce.C
\*---------------------------------------------------------------------------*/

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
(