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

This commit is contained in:
mattijs
2011-02-16 11:53:29 +00:00
242 changed files with 5170 additions and 1862 deletions

View File

@ -39,6 +39,7 @@ parallel/decompose/AllwmakeLnInclude
dummyThirdParty/Allwmake $*
wmake $makeOption lagrangian/basic
wmake $makeOption lagrangian/distributionModels
wmake $makeOption finiteVolume
wmake $makeOption genericPatchFields

View File

@ -29,7 +29,7 @@ Description
SeeAlso
The manpage regex(7) for more information about POSIX regular expressions.
These differ somewhat from \c Perl and @c sed regular expressions.
These differ somewhat from \c Perl and \c sed regular expressions.
SourceFiles
regExp.C

View File

@ -66,6 +66,7 @@ primitives/functions/DataEntry/makeDataEntries.C
primitives/functions/DataEntry/polynomial/polynomial.C
primitives/functions/DataEntry/polynomial/polynomialIO.C
primitives/functions/Polynomial/polynomialFunction.C
strings = primitives/strings
$(strings)/string/string.C
@ -164,11 +165,16 @@ $(functionEntries)/includeIfPresentEntry/includeIfPresentEntry.C
$(functionEntries)/inputModeEntry/inputModeEntry.C
$(functionEntries)/removeEntry/removeEntry.C
calcEntry = $(functionEntries)/calcEntry
$(calcEntry)/calcEntryParser.atg
$(calcEntry)/calcEntryInternal.C
$(calcEntry)/calcEntry.C
/*
* Requires customized coco-cpp
* could be dropped or activated in the future
*/
/*
calcEntry = $(functionEntries)/calcEntry
$(calcEntry)/calcEntryParser.atg
$(calcEntry)/calcEntryInternal.C
$(calcEntry)/calcEntry.C
*/
IOdictionary = db/IOobjects/IOdictionary
$(IOdictionary)/IOdictionary.C

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
@ -137,7 +137,7 @@ Foam::IOdictionary::IOdictionary(const IOobject& io)
}
// Everyone check or just master
bool masterOnly =
bool masterOnly =
regIOobject::fileModificationChecking == timeStampMaster
|| regIOobject::fileModificationChecking == inotifyMaster;
@ -195,7 +195,7 @@ Foam::IOdictionary::IOdictionary(const IOobject& io, const dictionary& dict)
}
// Everyone check or just master
bool masterOnly =
bool masterOnly =
regIOobject::fileModificationChecking == timeStampMaster
|| regIOobject::fileModificationChecking == inotifyMaster;
@ -239,6 +239,15 @@ Foam::IOdictionary::IOdictionary(const IOobject& io, const dictionary& dict)
}
Foam::IOdictionary::IOdictionary(const IOobject& io, Istream& is)
:
regIOobject(io),
dictionary(is)
{
dictionary::name() = IOobject::objectPath();
}
// * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * * //
Foam::IOdictionary::~IOdictionary()

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
@ -75,6 +75,9 @@ public:
//- Construct given an IOobject and dictionary
IOdictionary(const IOobject&, const dictionary&);
//- Construct given an IOobject and Istream
IOdictionary(const IOobject&, Istream&);
//- Destructor
virtual ~IOdictionary();

View File

@ -486,14 +486,29 @@ Foam::dictionary& Foam::dictionary::subDict(const word& keyword)
Foam::dictionary Foam::dictionary::subOrEmptyDict
(
const word& keyword
const word& keyword,
const bool mustRead
) const
{
const entry* entryPtr = lookupEntryPtr(keyword, false, true);
if (entryPtr == NULL)
{
return dictionary(*this, dictionary(name() + "::" + keyword));
if (mustRead)
{
FatalIOErrorIn
(
"dictionary::subOrEmptyDict(const word& keyword, const bool)",
*this
) << "keyword " << keyword << " is undefined in dictionary "
<< name()
<< exit(FatalIOError);
return entryPtr->dict();
}
else
{
return dictionary(*this, dictionary(name() + "::" + keyword));
}
}
else
{

View File

@ -368,7 +368,11 @@ public:
//- Find and return a sub-dictionary as a copy, or
// return an empty dictionary if the sub-dictionary does not exist
dictionary subOrEmptyDict(const word&) const;
dictionary subOrEmptyDict
(
const word&,
const bool mustRead = false
) const;
//- Return the table of contents
wordList toc() const;

View File

@ -27,7 +27,7 @@ Class
Description
Specify a file to include if it exists. Expects a single string to follow.
The \c \#includeIfPresent directive is similar to the @c \#include
The \c \#includeIfPresent directive is similar to the \c \#include
directive, but does not generate an error if the file does not exist.
See Also

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
@ -95,17 +95,22 @@ Foam::tmp
>
Foam::GeometricField<Type, PatchField, GeoMesh>::readField(Istream& is)
{
if (is.version() < 2.0)
{
FatalIOErrorIn
return readField
(
IOdictionary
(
"GeometricField<Type, PatchField, GeoMesh>::readField(Istream&)",
IOobject
(
this->name(),
this->time().timeName(),
this->db(),
IOobject::NO_READ,
IOobject::NO_WRITE,
false
),
is
) << "IO versions < 2.0 are not supported."
<< exit(FatalIOError);
}
return readField(dictionary(is));
)
);
}
@ -384,45 +389,6 @@ Foam::GeometricField<Type, PatchField, GeoMesh>::GeometricField
}
template<class Type, template<class> class PatchField, class GeoMesh>
Foam::GeometricField<Type, PatchField, GeoMesh>::GeometricField
(
const IOobject& io,
const Mesh& mesh,
Istream& is
)
:
DimensionedField<Type, GeoMesh>(io, mesh, dimless, false),
timeIndex_(this->time().timeIndex()),
field0Ptr_(NULL),
fieldPrevIterPtr_(NULL),
boundaryField_(*this, readField(is))
{
// Check compatibility between field and mesh
if (this->size() != GeoMesh::size(this->mesh()))
{
FatalIOErrorIn
(
"GeometricField<Type, PatchField, GeoMesh>::GeometricField"
"(const IOobject&, const Mesh&, Istream&)",
is
) << " number of field elements = " << this->size()
<< " number of mesh elements = " << GeoMesh::size(this->mesh())
<< exit(FatalIOError);
}
readOldTimeIfPresent();
if (debug)
{
Info<< "Finishing read-construct of "
"GeometricField<Type, PatchField, GeoMesh>"
<< endl << this->info() << endl;
}
}
template<class Type, template<class> class PatchField, class GeoMesh>
Foam::GeometricField<Type, PatchField, GeoMesh>::GeometricField
(

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
@ -325,14 +325,6 @@ public:
const Mesh&
);
//- Construct and read from given stream
GeometricField
(
const IOobject&,
const Mesh&,
Istream&
);
//- Construct from dictionary
GeometricField
(

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2010-2010 OpenCFD Ltd.
\\ / A nd | Copyright (C) 2010-2011 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -21,9 +21,9 @@ License
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
@mainpage OpenFOAM&reg;: open source CFD
\mainpage OpenFOAM&reg;: open source CFD
@section about About OpenFOAM
\section about About OpenFOAM
OpenFOAM is a free, open source CFD software package produced by
a commercial company,
@ -35,7 +35,7 @@ License
heat transfer, to solid dynamics and electromagnetics.
<a href="http://www.openfoam.com/features">More ...</a>
@section users Our commitment to the users
\section users Our commitment to the users
OpenFOAM comes with full commercial support from OpenCFD, including
<a href="http://www.openfoam.com/support/software.php">
@ -48,7 +48,7 @@ License
These activities fund the development, maintenance and release of
OpenFOAM to make it an extremely viable commercial open source product.
@section opensource Our commitment to open source
\section opensource Our commitment to open source
OpenCFD is committed to open source software, continually developing and
maintaining OpenFOAM under the

View File

@ -550,11 +550,12 @@ Foam::label Foam::polyBoundaryMesh::whichPatch(const label faceIndex) const
Foam::labelHashSet Foam::polyBoundaryMesh::patchSet
(
const wordList& patchNames
const wordReList& patchNames,
const bool warnNotFound
) const
{
wordList allPatchNames = names();
labelHashSet ps(size());
const wordList allPatchNames(this->names());
labelHashSet ids(size());
forAll(patchNames, i)
{
@ -562,20 +563,23 @@ Foam::labelHashSet Foam::polyBoundaryMesh::patchSet
// of all patch names for matches
labelList patchIDs = findStrings(patchNames[i], allPatchNames);
if (patchIDs.empty())
if (patchIDs.empty() && warnNotFound)
{
WarningIn("polyBoundaryMesh::patchSet(const wordList&)")
<< "Cannot find any patch names matching " << patchNames[i]
WarningIn
(
"polyBoundaryMesh::patchSet"
"(const wordReList&, const bool) const"
) << "Cannot find any patch names matching " << patchNames[i]
<< endl;
}
forAll(patchIDs, j)
{
ps.insert(patchIDs[j]);
ids.insert(patchIDs[j]);
}
}
return ps;
return ids;
}

View File

@ -38,6 +38,7 @@ SourceFiles
#include "polyPatchList.H"
#include "regIOobject.H"
#include "labelPair.H"
#include "wordReList.H"
#include "HashSet.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -166,9 +167,13 @@ public:
//- Per boundary face label the patch index
const labelList& patchID() const;
//- Return the set of patch IDs corresponding to the given list of names
// Wild cards are expanded.
labelHashSet patchSet(const wordList&) const;
//- Return the set of patch IDs corresponding to the given names
// By default warns if given names are not found.
labelHashSet patchSet
(
const wordReList& patchNames,
const bool warnNotFound = true
) const;
//- Check whether all procs have all patches and in same order. Return
// true if in error.

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
\\ / A nd | Copyright (C) 2008-2011 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
\\ / A nd | Copyright (C) 2008-2011 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
\\ / A nd | Copyright (C) 2008-2011 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
\\ / A nd | Copyright (C) 2008-2011 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
\\ / A nd | Copyright (C) 2008-2011 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
\\ / A nd | Copyright (C) 2008-2011 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
\\ / A nd | Copyright (C) 2008-2011 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
\\ / A nd | Copyright (C) 2008-2011 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
\\ / A nd | Copyright (C) 2008-2011 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
\\ / A nd | Copyright (C) 2008-2011 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
\\ / A nd | Copyright (C) 2008-2011 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License

View File

@ -41,6 +41,18 @@ Foam::Polynomial<PolySize>::Polynomial()
}
template<int PolySize>
Foam::Polynomial<PolySize>::Polynomial
(
const Polynomial<PolySize>& poly
)
:
VectorSpace<Polynomial<PolySize>, scalar, PolySize>(poly),
logActive_(poly.logActive_),
logCoeff_(poly.logCoeff_)
{}
template<int PolySize>
Foam::Polynomial<PolySize>::Polynomial(const scalar coeffs[PolySize])
:
@ -68,7 +80,7 @@ Foam::Polynomial<PolySize>::Polynomial(const UList<scalar>& coeffs)
(
"Polynomial<PolySize>::Polynomial(const UList<scalar>&)"
) << "Size mismatch: Needed " << PolySize
<< " but got " << coeffs.size()
<< " but given " << coeffs.size()
<< nl << exit(FatalError);
}
@ -79,6 +91,39 @@ Foam::Polynomial<PolySize>::Polynomial(const UList<scalar>& coeffs)
}
// template<int PolySize>
// Foam::Polynomial<PolySize>::Polynomial(const polynomialFunction& poly)
// :
// VectorSpace<Polynomial<PolySize>, scalar, PolySize>(),
// logActive_(poly.logActive()),
// logCoeff_(poly.logCoeff())
// {
// if (poly.size() != PolySize)
// {
// FatalErrorIn
// (
// "Polynomial<PolySize>::Polynomial(const polynomialFunction&)"
// ) << "Size mismatch: Needed " << PolySize
// << " but given " << poly.size()
// << nl << exit(FatalError);
// }
//
// for (int i = 0; i < PolySize; ++i)
// {
// this->v_[i] = poly[i];
// }
// }
template<int PolySize>
Foam::Polynomial<PolySize>::Polynomial(Istream& is)
:
VectorSpace<Polynomial<PolySize>, scalar, PolySize>(is),
logActive_(false),
logCoeff_(0.0)
{}
template<int PolySize>
Foam::Polynomial<PolySize>::Polynomial(const word& name, Istream& is)
:
@ -111,38 +156,17 @@ Foam::Polynomial<PolySize>::Polynomial(const word& name, Istream& is)
}
template<int PolySize>
Foam::Polynomial<PolySize>::Polynomial(Istream& is)
:
VectorSpace<Polynomial<PolySize>, scalar, PolySize>(is),
logActive_(false),
logCoeff_(0.0)
{}
template<int PolySize>
Foam::Polynomial<PolySize>::Polynomial
(
const Polynomial<PolySize>& poly
)
:
VectorSpace<Polynomial<PolySize>, scalar, PolySize>(poly),
logActive_(poly.logActive_),
logCoeff_(poly.logCoeff_)
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template<int PolySize>
bool& Foam::Polynomial<PolySize>::logActive()
bool Foam::Polynomial<PolySize>::logActive() const
{
return logActive_;
}
template<int PolySize>
Foam::scalar& Foam::Polynomial<PolySize>::logCoeff()
Foam::scalar Foam::Polynomial<PolySize>::logCoeff() const
{
return logCoeff_;
}
@ -151,27 +175,27 @@ Foam::scalar& Foam::Polynomial<PolySize>::logCoeff()
template<int PolySize>
Foam::scalar Foam::Polynomial<PolySize>::value(const scalar x) const
{
scalar y = this->v_[0];
scalar val = this->v_[0];
// avoid costly pow() in calculation
scalar powX = x;
for (label i=1; i<PolySize; ++i)
{
y += this->v_[i]*powX;
val += this->v_[i]*powX;
powX *= x;
}
if (logActive_)
{
y += logCoeff_*log(x);
val += logCoeff_*log(x);
}
return y;
return val;
}
template<int PolySize>
Foam::scalar Foam::Polynomial<PolySize>::integrateLimits
Foam::scalar Foam::Polynomial<PolySize>::integrate
(
const scalar x1,
const scalar x2
@ -181,7 +205,7 @@ Foam::scalar Foam::Polynomial<PolySize>::integrateLimits
{
FatalErrorIn
(
"scalar Polynomial<PolySize>::integrateLimits"
"scalar Polynomial<PolySize>::integrate"
"("
"const scalar, "
"const scalar"
@ -190,22 +214,33 @@ Foam::scalar Foam::Polynomial<PolySize>::integrateLimits
<< nl << abort(FatalError);
}
intPolyType poly = this->integrate();
return poly.value(x2) - poly.value(x1);
// avoid costly pow() in calculation
scalar powX1 = x1;
scalar powX2 = x2;
scalar val = this->v_[0]*(powX2 - powX1);
for (label i=1; i<PolySize; ++i)
{
val += this->v_[i]/(i + 1) * (powX2 - powX1);
powX1 *= x1;
powX2 *= x2;
}
return val;
}
template<int PolySize>
typename Foam::Polynomial<PolySize>::intPolyType
Foam::Polynomial<PolySize>::integrate(const scalar intConstant)
Foam::Polynomial<PolySize>::integral(const scalar intConstant) const
{
intPolyType newCoeffs;
newCoeffs[0] = intConstant;
forAll(*this, i)
{
newCoeffs[i + 1] = this->v_[i]/(i + 1);
newCoeffs[i+1] = this->v_[i]/(i + 1);
}
return newCoeffs;
@ -214,14 +249,14 @@ Foam::Polynomial<PolySize>::integrate(const scalar intConstant)
template<int PolySize>
typename Foam::Polynomial<PolySize>::polyType
Foam::Polynomial<PolySize>::integrateMinus1(const scalar intConstant)
Foam::Polynomial<PolySize>::integralMinus1(const scalar intConstant) const
{
polyType newCoeffs;
if (this->v_[0] > VSMALL)
{
newCoeffs.logActive() = true;
newCoeffs.logCoeff() = this->v_[0];
newCoeffs.logActive_ = true;
newCoeffs.logCoeff_ = this->v_[0];
}
newCoeffs[0] = intConstant;

View File

@ -29,14 +29,14 @@ Description
poly = logCoeff*log(x) + sum(coeff_[i]*x^i)
where 0 \<= i \<= n
where 0 \<= i \<= N
- integer powers, starting at zero
- value(x) to evaluate the poly for a given value
- integrate(x1, x2) between two scalar values
- integrate() to return a new, intergated coeff polynomial
- integral() to return a new, integral coeff polynomial
- increases the size (order)
- integrateMinus1() to return a new, integrated coeff polynomial where
- integralMinus1() to return a new, integral coeff polynomial where
the base poly starts at order -1
SourceFiles
@ -85,10 +85,10 @@ class Polynomial
// Private data
//- Include the log term? - only activated using integrateMinus1()
//- Include the log term? - only activated using integralMinus1()
bool logActive_;
//- Log coefficient - only activated using integrateMinus1()
//- Log coefficient - only activated using integralMinus1()
scalar logCoeff_;
@ -104,6 +104,9 @@ public:
//- Construct null, with all coefficients = 0.0
Polynomial();
//- Copy constructor
Polynomial(const Polynomial&);
//- Construct from C-array of coefficients
explicit Polynomial(const scalar coeffs[PolySize]);
@ -111,24 +114,21 @@ public:
explicit Polynomial(const UList<scalar>& coeffs);
//- Construct from Istream
Polynomial(Istream& is);
Polynomial(Istream&);
//- Construct from name and Istream
Polynomial(const word& name, Istream& is);
//- Copy constructor
Polynomial(const Polynomial& poly);
Polynomial(const word& name, Istream&);
// Member Functions
// Access
//- Return access to the log term active flag
bool& logActive();
//- Return true if the log term is active
bool logActive() const;
//- Return access to the log coefficient
scalar& logCoeff();
//- Return the log coefficient
scalar logCoeff() const;
// Evaluation
@ -136,16 +136,17 @@ public:
//- Return polynomial value
scalar value(const scalar x) const;
//- Return integrated polynomial coefficients
// argument becomes zeroth element (constant of integration)
intPolyType integrate(const scalar intConstant = 0.0);
//- Return integrated polynomial coefficients when lowest order
// is -1. Argument added to zeroth element
polyType integrateMinus1(const scalar intConstant = 0.0);
//- Integrate between two values
scalar integrateLimits(const scalar x1, const scalar x2) const;
scalar integrate(const scalar x1, const scalar x2) const;
//- Return integral coefficients.
// Argument becomes zeroth element (constant of integration)
intPolyType integral(const scalar intConstant = 0.0) const;
//- Return integral coefficients when lowest order is -1.
// Argument becomes zeroth element (constant of integration)
polyType integralMinus1(const scalar intConstant = 0.0) const;
//- Ostream Operator

View File

@ -0,0 +1,415 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / 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 "polynomialFunction.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
defineTypeNameAndDebug(polynomialFunction, 0);
}
// * * * * * * * * * * * * * Static Member Functions * * * * * * * * * * * * //
Foam::polynomialFunction Foam::polynomialFunction::cloneIntegral
(
const polynomialFunction& poly,
const scalar intConstant
)
{
polynomialFunction newPoly(poly.size()+1);
newPoly[0] = intConstant;
forAll(poly, i)
{
newPoly[i+1] = poly[i]/(i + 1);
}
return newPoly;
}
Foam::polynomialFunction Foam::polynomialFunction::cloneIntegralMinus1
(
const polynomialFunction& poly,
const scalar intConstant
)
{
polynomialFunction newPoly(poly.size()+1);
if (poly[0] > VSMALL)
{
newPoly.logActive_ = true;
newPoly.logCoeff_ = poly[0];
}
newPoly[0] = intConstant;
for (label i=1; i < poly.size(); ++i)
{
newPoly[i] = poly[i]/i;
}
return newPoly;
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::polynomialFunction::polynomialFunction(const label order)
:
scalarList(order, 0.0),
logActive_(false),
logCoeff_(0.0)
{
if (this->empty())
{
FatalErrorIn
(
"polynomialFunction::polynomialFunction(const label order)"
) << "polynomialFunction coefficients are invalid (empty)"
<< nl << exit(FatalError);
}
}
Foam::polynomialFunction::polynomialFunction(const polynomialFunction& poly)
:
scalarList(poly),
logActive_(poly.logActive_),
logCoeff_(poly.logCoeff_)
{}
Foam::polynomialFunction::polynomialFunction(const UList<scalar>& coeffs)
:
scalarList(coeffs),
logActive_(false),
logCoeff_(0.0)
{
if (this->empty())
{
FatalErrorIn
(
"polynomialFunction::polynomialFunction(const UList<scalar>&)"
) << "polynomialFunction coefficients are invalid (empty)"
<< nl << exit(FatalError);
}
}
Foam::polynomialFunction::polynomialFunction(Istream& is)
:
scalarList(is),
logActive_(false),
logCoeff_(0.0)
{
if (this->empty())
{
FatalErrorIn
(
"polynomialFunction::polynomialFunction(Istream&)"
) << "polynomialFunction coefficients are invalid (empty)"
<< nl << exit(FatalError);
}
}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::polynomialFunction::~polynomialFunction()
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
bool Foam::polynomialFunction::logActive() const
{
return logActive_;
}
Foam::scalar Foam::polynomialFunction::logCoeff() const
{
return logCoeff_;
}
Foam::scalar Foam::polynomialFunction::value(const scalar x) const
{
const scalarList& coeffs = *this;
scalar val = coeffs[0];
// avoid costly pow() in calculation
scalar powX = x;
for (label i=1; i<coeffs.size(); ++i)
{
val += coeffs[i]*powX;
powX *= x;
}
if (logActive_)
{
val += this->logCoeff_*log(x);
}
return val;
}
Foam::scalar Foam::polynomialFunction::integrate
(
const scalar x1,
const scalar x2
) const
{
const scalarList& coeffs = *this;
if (logActive_)
{
FatalErrorIn
(
"scalar polynomialFunction::integrate"
"("
"const scalar, "
"const scalar"
") const"
) << "Cannot integrate polynomial with logarithmic coefficients"
<< nl << abort(FatalError);
}
// avoid costly pow() in calculation
scalar powX1 = x1;
scalar powX2 = x2;
scalar val = coeffs[0]*(powX2 - powX1);
for (label i=1; i<coeffs.size(); ++i)
{
val += coeffs[i]/(i + 1)*(powX2 - powX1);
powX1 *= x1;
powX2 *= x2;
}
return val;
}
Foam::polynomialFunction
Foam::polynomialFunction::integral(const scalar intConstant) const
{
return cloneIntegral(*this, intConstant);
}
Foam::polynomialFunction
Foam::polynomialFunction::integralMinus1(const scalar intConstant) const
{
return cloneIntegralMinus1(*this, intConstant);
}
// * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * * //
Foam::polynomialFunction&
Foam::polynomialFunction::operator+=(const polynomialFunction& poly)
{
scalarList& coeffs = *this;
if (coeffs.size() > poly.size())
{
forAll(poly, i)
{
coeffs[i] += poly[i];
}
}
else
{
coeffs.setSize(poly.size(), 0.0);
forAll(coeffs, i)
{
coeffs[i] += poly[i];
}
}
return *this;
}
Foam::polynomialFunction&
Foam::polynomialFunction::operator-=(const polynomialFunction& poly)
{
scalarList& coeffs = *this;
if (coeffs.size() > poly.size())
{
forAll(poly, i)
{
coeffs[i] -= poly[i];
}
}
else
{
coeffs.setSize(poly.size(), 0.0);
forAll(coeffs, i)
{
coeffs[i] -= poly[i];
}
}
return *this;
}
Foam::polynomialFunction&
Foam::polynomialFunction::operator*=(const scalar s)
{
scalarList& coeffs = *this;
forAll(coeffs, i)
{
coeffs[i] *= s;
}
return *this;
}
Foam::polynomialFunction&
Foam::polynomialFunction::operator/=(const scalar s)
{
scalarList& coeffs = *this;
forAll(coeffs, i)
{
coeffs[i] /= s;
}
return *this;
}
// * * * * * * * * * * * * * * * IOstream Operators * * * * * * * * * * * * //
Foam::Ostream& Foam::operator<<(Ostream& os, const polynomialFunction& poly)
{
// output like VectorSpace
os << token::BEGIN_LIST;
if (!poly.empty())
{
for (int i=0; i<poly.size()-1; i++)
{
os << poly[i] << token::SPACE;
}
os << poly.last();
}
os << token::END_LIST;
// Check state of Ostream
os.check("operator<<(Ostream&, const polynomialFunction&)");
return os;
}
// * * * * * * * * * * * * * * * Global Operators * * * * * * * * * * * * * //
Foam::polynomialFunction
Foam::operator+
(
const polynomialFunction& p1,
const polynomialFunction& p2
)
{
polynomialFunction poly(p1);
return poly += p2;
}
Foam::polynomialFunction
Foam::operator-
(
const polynomialFunction& p1,
const polynomialFunction& p2
)
{
polynomialFunction poly(p1);
return poly -= p2;
}
Foam::polynomialFunction
Foam::operator*
(
const scalar s,
const polynomialFunction& p
)
{
polynomialFunction poly(p);
return poly *= s;
}
Foam::polynomialFunction
Foam::operator/
(
const scalar s,
const polynomialFunction& p
)
{
polynomialFunction poly(p);
return poly /= s;
}
Foam::polynomialFunction
Foam::operator*
(
const polynomialFunction& p,
const scalar s
)
{
polynomialFunction poly(p);
return poly *= s;
}
Foam::polynomialFunction
Foam::operator/
(
const polynomialFunction& p,
const scalar s
)
{
polynomialFunction poly(p);
return poly /= s;
}
// ************************************************************************* //

View File

@ -0,0 +1,246 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / 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::polynomialFunction
Description
Polynomial function representation
poly = logCoeff*log(x) + sum(coeff_[i]*x^i)
where 0 \<= i \<= N
- integer powers, starting at zero
- value(x) to evaluate the poly for a given value
- integrate(x1, x2) between two scalar values
- integral() to return a new, integral coeff polynomial
- increases the size (order)
- integralMinus1() to return a new, integral coeff polynomial where
the base poly starts at order -1
SeeAlso
Foam::Polynomial for a templated implementation
SourceFiles
polynomialFunction.C
\*---------------------------------------------------------------------------*/
#ifndef polynomialFunction_H
#define polynomialFunction_H
#include "scalarList.H"
#include "Ostream.H"
#include "runTimeSelectionTables.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// Forward declaration of classes
class polynomialFunction;
// Forward declaration of friend functions
Ostream& operator<<(Ostream&, const polynomialFunction&);
/*---------------------------------------------------------------------------*\
Class polynomialFunction Declaration
\*---------------------------------------------------------------------------*/
class polynomialFunction
:
private scalarList
{
// Private data
//- Include the log term? - only activated using integralMinus1()
bool logActive_;
//- Log coefficient - only activated using integralMinus1()
scalar logCoeff_;
// Private Member Functions
//- Return integral coefficients.
// Argument becomes zeroth element (constant of integration)
static polynomialFunction cloneIntegral
(
const polynomialFunction&,
const scalar intConstant = 0.0
);
//- Return integral coefficients when lowest order is -1.
// Argument becomes zeroth element (constant of integration)
static polynomialFunction cloneIntegralMinus1
(
const polynomialFunction&,
const scalar intConstant = 0.0
);
//- Disallow default bitwise assignment
void operator=(const polynomialFunction&);
public:
//- Runtime type information
TypeName("polynomialFunction");
// Constructors
//- Construct a particular size, with all coefficients = 0.0
explicit polynomialFunction(const label);
//- Copy constructor
polynomialFunction(const polynomialFunction&);
//- Construct from a list of coefficients
explicit polynomialFunction(const UList<scalar>& coeffs);
//- Construct from Istream
polynomialFunction(Istream&);
//- Destructor
virtual ~polynomialFunction();
// Member Functions
//- Return the number of coefficients
using scalarList::size;
//- Return coefficient
using scalarList::operator[];
// Access
//- Return true if the log term is active
bool logActive() const;
//- Return the log coefficient
scalar logCoeff() const;
// Evaluation
//- Return polynomial value
scalar value(const scalar x) const;
//- Integrate between two values
scalar integrate(const scalar x1, const scalar x2) const;
//- Return integral coefficients.
// Argument becomes zeroth element (constant of integration)
polynomialFunction integral
(
const scalar intConstant = 0.0
) const;
//- Return integral coefficients when lowest order is -1.
// Argument becomes zeroth element (constant of integration)
polynomialFunction integralMinus1
(
const scalar intConstant = 0.0
) const;
// Member Operators
polynomialFunction& operator+=(const polynomialFunction&);
polynomialFunction& operator-=(const polynomialFunction&);
polynomialFunction& operator*=(const scalar);
polynomialFunction& operator/=(const scalar);
//- Ostream Operator
friend Ostream& operator<<(Ostream&, const polynomialFunction&);
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// * * * * * * * * * * * * * * * Global Operators * * * * * * * * * * * * * //
polynomialFunction operator+
(
const polynomialFunction&,
const polynomialFunction&
);
polynomialFunction operator-
(
const polynomialFunction&,
const polynomialFunction&
);
polynomialFunction operator*
(
const scalar,
const polynomialFunction&
);
polynomialFunction operator/
(
const scalar,
const polynomialFunction&
);
polynomialFunction operator*
(
const polynomialFunction&,
const scalar
);
polynomialFunction operator/
(
const polynomialFunction&,
const scalar
);
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -35,7 +35,7 @@ Description
write OpenFOAM meshes and/or results to another CFD format
- currently just STAR-CD
@par Files
\par Files
"constant/boundaryRegion" is an IOMap<dictionary> that contains
the boundary type and names. eg,

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

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

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
@ -36,6 +36,7 @@ SourceFiles
#define inverseDistanceDiffusivity_H
#include "uniformDiffusivity.H"
#include "wordReList.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -43,7 +44,7 @@ namespace Foam
{
/*---------------------------------------------------------------------------*\
Class inverseDistanceDiffusivity Declaration
Class inverseDistanceDiffusivity Declaration
\*---------------------------------------------------------------------------*/
class inverseDistanceDiffusivity
@ -53,9 +54,8 @@ class inverseDistanceDiffusivity
// Private data
//- Patches selected to base the distance on
// These can contain regular expressions and the actual patch names
// will be searched for.
wordList patchNames_;
// These can contain patch names or regular expressions to search for.
wordReList patchNames_;
// Private Member Functions

View File

@ -0,0 +1,40 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / 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 "coalParcel.H"
// Using thermodynamic variant
#include "makeThermoParcelForces.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// Kinematic sub-models
makeThermoParcelForces(coalParcel);
};
// ************************************************************************* //

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2008-2010 OpenCFD Ltd.
\\ / A nd | Copyright (C) 2008-2011 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -26,8 +26,8 @@ License
#include "coalParcel.H"
// Kinematic
#include "makeThermoParcelForces.H" // thermo variant
#include "makeParcelDispersionModels.H"
#include "makeParcelDragModels.H"
#include "makeReactingMultiphaseParcelInjectionModels.H" // MP variant
#include "makeParcelCollisionModels.H"
#include "makeParcelPatchInteractionModels.H"
@ -52,8 +52,8 @@ License
namespace Foam
{
// Kinematic sub-models
makeThermoParcelForces(coalParcel);
makeParcelDispersionModels(coalParcel);
makeParcelDragModels(coalParcel);
makeReactingMultiphaseParcelInjectionModels(coalParcel);
makeParcelCollisionModels(coalParcel);
makeParcelPatchInteractionModels(coalParcel);

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) 2008-2011 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License

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) 2008-2011 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License

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) 2008-2011 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License

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) 2008-2011 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License

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) 2008-2011 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License

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) 2008-2011 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License

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) 2008-2011 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License

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) 2008-2011 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License

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) 2008-2011 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License

View File

@ -78,10 +78,6 @@ $(REACTINGMPINJECTION)/ReactingMultiphaseLookupTableInjection/reactingMultiphase
IntegrationScheme/makeIntegrationSchemes.C
/* particle forces */
particleForces/particleForces.C
/* phase properties */
phaseProperties/phaseProperties/phaseProperties.C
phaseProperties/phaseProperties/phasePropertiesIO.C

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
\\ / A nd | Copyright (C) 2008-2011 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -30,7 +30,6 @@ License
#include "CollisionModel.H"
#include "DispersionModel.H"
#include "DragModel.H"
#include "InjectionModel.H"
#include "PatchInteractionModel.H"
#include "PostProcessingModel.H"
@ -209,15 +208,6 @@ void Foam::KinematicCloud<ParcelType>::setModels()
).ptr()
);
dragModel_.reset
(
DragModel<KinematicCloud<ParcelType> >::New
(
subModelProperties_,
*this
).ptr()
);
injectionModel_.reset
(
InjectionModel<KinematicCloud<ParcelType> >::New
@ -306,7 +296,7 @@ void Foam::KinematicCloud<ParcelType>::preEvolve()
Info<< "\nSolving cloud " << this->name() << endl;
this->dispersion().cacheFields(true);
forces_.cacheFields(true, solution_.interpolationSchemes());
forces_.cacheFields(true);
updateCellOccupancy();
}
@ -390,7 +380,7 @@ void Foam::KinematicCloud<ParcelType>::evolveCloud
}
else
{
// this->surfaceFilm().injectStreadyState(td);
// this->surfaceFilm().injectSteadyState(td);
this->injection().injectSteadyState(td, solution_.deltaT());
@ -473,7 +463,7 @@ void Foam::KinematicCloud<ParcelType>::postEvolve()
}
this->dispersion().cacheFields(false);
forces_.cacheFields(false, solution_.interpolationSchemes());
forces_.cacheFields(false);
this->postProcessing().post();
@ -488,14 +478,15 @@ void Foam::KinematicCloud<ParcelType>::cloudReset(KinematicCloud<ParcelType>& c)
rndGen_ = c.rndGen_;
collisionModel_ = c.collisionModel_->clone();
dispersionModel_= c.dispersionModel_->clone();
dragModel_ = c.dragModel_->clone();
injectionModel_ = c.injectionModel_->clone();
patchInteractionModel_ = c.patchInteractionModel_->clone();
postProcessingModel_ = c.postProcessingModel_->clone();
forces_.transfer(c.forces_);
UIntegrator_ = c.UIntegrator_->clone();
collisionModel_.reset(c.collisionModel_.ptr());
dispersionModel_.reset(c.dispersionModel_.ptr());
injectionModel_.reset(c.injectionModel_.ptr());
patchInteractionModel_.reset(c.patchInteractionModel_.ptr());
postProcessingModel_.reset(c.postProcessingModel_.ptr());
UIntegrator_.reset(c.UIntegrator_.ptr());
}
@ -529,7 +520,10 @@ Foam::KinematicCloud<ParcelType>::KinematicCloud
),
solution_(mesh_, particleProperties_.subDict("solution")),
constProps_(particleProperties_, solution_.active()),
subModelProperties_(particleProperties_.subOrEmptyDict("subModels")),
subModelProperties_
(
particleProperties_.subOrEmptyDict("subModels", solution_.active())
),
rndGen_
(
label(0),
@ -540,10 +534,19 @@ Foam::KinematicCloud<ParcelType>::KinematicCloud
U_(U),
mu_(mu),
g_(g),
forces_(mesh_, particleProperties_, g_.value(), solution_.active()),
forces_
(
*this,
mesh_,
subModelProperties_.subOrEmptyDict
(
"particleForces",
solution_.active()
),
solution_.active()
),
collisionModel_(NULL),
dispersionModel_(NULL),
dragModel_(NULL),
injectionModel_(NULL),
patchInteractionModel_(NULL),
postProcessingModel_(NULL),
@ -606,7 +609,7 @@ Foam::KinematicCloud<ParcelType>::KinematicCloud
const word& name
)
:
Cloud<ParcelType>(c.mesh(), name, c),
Cloud<ParcelType>(c.mesh_, name, c),
kinematicCloud(),
cloudCopyPtr_(NULL),
mesh_(c.mesh_),
@ -623,7 +626,6 @@ Foam::KinematicCloud<ParcelType>::KinematicCloud
forces_(c.forces_),
collisionModel_(c.collisionModel_->clone()),
dispersionModel_(c.dispersionModel_->clone()),
dragModel_(c.dragModel_->clone()),
injectionModel_(c.injectionModel_->clone()),
patchInteractionModel_(c.patchInteractionModel_->clone()),
postProcessingModel_(c.postProcessingModel_->clone()),
@ -661,7 +663,6 @@ Foam::KinematicCloud<ParcelType>::KinematicCloud
c.UCoeff_()
)
)
{}
@ -698,10 +699,9 @@ Foam::KinematicCloud<ParcelType>::KinematicCloud
U_(c.U_),
mu_(c.mu_),
g_(c.g_),
forces_(mesh),
forces_(*this, mesh),
collisionModel_(NULL),
dispersionModel_(NULL),
dragModel_(NULL),
injectionModel_(NULL),
patchInteractionModel_(NULL),
postProcessingModel_(NULL),
@ -830,8 +830,10 @@ void Foam::KinematicCloud<ParcelType>::info() const
<< linearKineticEnergy << nl
<< " Rotational kinetic energy = "
<< rotationalKineticEnergy << nl;
this->injection().info(Info);
this->surfaceFilm().info(Info);
this->patchInteraction().info(Info);
}

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
\\ / A nd | Copyright (C) 2008-2011 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -29,10 +29,14 @@ Description
- holds a 'cloudSolution' class that stores all relevant solution info
- particle forces
- buoyancy
- drag
- pressure gradient
- sub-models:
- Collision model
- Dispersion model
- Drag model
- Injection model
- Patch interaction model
- Post-processing model
@ -55,7 +59,6 @@ SourceFiles
#include "fvMesh.H"
#include "volFields.H"
#include "fvMatrices.H"
#include "particleForces.H"
#include "IntegrationSchemesFwd.H"
@ -72,9 +75,6 @@ class CollisionModel;
template<class CloudType>
class DispersionModel;
template<class CloudType>
class DragModel;
template<class CloudType>
class InjectionModel;
@ -98,6 +98,14 @@ class KinematicCloud
public Cloud<ParcelType>,
public kinematicCloud
{
public:
//- Type of parcel the cloud was instantiated for
typedef ParcelType parcelType;
private:
// Private data
//- Cloud copy pointer
@ -316,7 +324,7 @@ protected:
//- Optional particle forces
particleForces forces_;
typename ParcelType::forceType forces_;
// References to the cloud sub-models
@ -329,9 +337,6 @@ protected:
autoPtr<DispersionModel<KinematicCloud<ParcelType> > >
dispersionModel_;
//- Drag transfer model
autoPtr<DragModel<KinematicCloud<ParcelType> > > dragModel_;
//- Injector model
autoPtr<InjectionModel<KinematicCloud<ParcelType> > >
injectionModel_;
@ -450,10 +455,6 @@ public:
virtual ~KinematicCloud();
//- Type of parcel the cloud was instantiated for
typedef ParcelType parcelType;
// Member Functions
// Access
@ -521,7 +522,7 @@ public:
//- Optional particle forces
inline const particleForces& forces() const;
inline const typename ParcelType::forceType& forces() const;
// Sub-models
@ -542,10 +543,6 @@ public:
inline DispersionModel<KinematicCloud<ParcelType> >&
dispersion();
//- Return const-access to the drag model
inline const DragModel<KinematicCloud<ParcelType> >&
drag() const;
//- Return const access to the injection model
inline const InjectionModel<KinematicCloud<ParcelType> >&
injection() const;
@ -558,6 +555,10 @@ public:
inline const PatchInteractionModel<KinematicCloud<ParcelType> >&
patchInteraction() const;
//- Return reference to the patch interaction model
inline PatchInteractionModel<KinematicCloud<ParcelType> >&
patchInteraction();
//- Return reference to post-processing model
inline PostProcessingModel<KinematicCloud<ParcelType> >&
postProcessing();

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
\\ / A nd | Copyright (C) 2008-2011 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -257,7 +257,7 @@ Foam::KinematicCloud<ParcelType>::g() const
template<class ParcelType>
inline const Foam::particleForces&
inline const typename ParcelType::forceType&
Foam::KinematicCloud<ParcelType>::forces() const
{
return forces_;
@ -296,14 +296,6 @@ Foam::KinematicCloud<ParcelType>::dispersion()
}
template<class ParcelType>
inline const Foam::DragModel<Foam::KinematicCloud<ParcelType> >&
Foam::KinematicCloud<ParcelType>::drag() const
{
return dragModel_;
}
template<class ParcelType>
inline const Foam::InjectionModel<Foam::KinematicCloud<ParcelType> >&
Foam::KinematicCloud<ParcelType>::injection() const
@ -320,6 +312,14 @@ Foam::KinematicCloud<ParcelType>::patchInteraction() const
}
template<class ParcelType>
inline Foam::PatchInteractionModel<Foam::KinematicCloud<ParcelType> >&
Foam::KinematicCloud<ParcelType>::patchInteraction()
{
return patchInteractionModel_();
}
template<class ParcelType>
inline Foam::InjectionModel<Foam::KinematicCloud<ParcelType> >&
Foam::KinematicCloud<ParcelType>::injection()

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
\\ / A nd | Copyright (C) 2008-2011 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -85,8 +85,8 @@ void Foam::ReactingCloud<ParcelType>::cloudReset(ReactingCloud<ParcelType>& c)
{
ThermoCloud<ParcelType>::cloudReset(c);
compositionModel_ = c.compositionModel_->clone();
phaseChangeModel_ = c.phaseChangeModel_->clone();
compositionModel_.reset(c.compositionModel_.ptr());
phaseChangeModel_.reset(c.phaseChangeModel_.ptr());
dMassPhaseChange_ = c.dMassPhaseChange_;
}

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
\\ / A nd | Copyright (C) 2008-2011 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License

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) 2008-2011 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License

View File

@ -61,8 +61,8 @@ void Foam::ReactingMultiphaseCloud<ParcelType>::cloudReset
{
ReactingCloud<ParcelType>::cloudReset(c);
devolatilisationModel_ = c.devolatilisationModel_->clone();
surfaceReactionModel_ = c.surfaceReactionModel_->clone();
devolatilisationModel_.reset(c.devolatilisationModel_.ptr());
surfaceReactionModel_.reset(c.surfaceReactionModel_.ptr());
dMassDevolatilisation_ = c.dMassDevolatilisation_;
dMassSurfaceReaction_ = c.dMassSurfaceReaction_;

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
\\ / A nd | Copyright (C) 2008-2011 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -60,8 +60,8 @@ void Foam::ThermoCloud<ParcelType>::cloudReset(ThermoCloud<ParcelType>& c)
{
KinematicCloud<ParcelType>::cloudReset(c);
heatTransferModel_ = c.heatTransferModel_->clone();
TIntegrator_ = c.TIntegrator_->clone();
heatTransferModel_.reset(c.heatTransferModel_.ptr());
TIntegrator_.reset(c.TIntegrator_.ptr());
radiation_ = c.radiation_;
}

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
\\ / A nd | Copyright (C) 2008-2011 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License

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) 2008-2011 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License

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) 2008-2011 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License

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) 2008-2011 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License

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) 2008-2011 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License

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) 2008-2011 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License

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) 2008-2011 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License

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) 2008-2011 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License

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) 2008-2011 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License

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) 2008-2011 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License

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) 2008-2011 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
\\ / A nd | Copyright (C) 2008-2011 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -42,16 +42,19 @@ void Foam::KinematicParcel<ParcelType>::setCellValues
if (rhoc_ < td.cloud().constProps().rhoMin())
{
WarningIn
(
"void Foam::KinematicParcel<ParcelType>::setCellValues"
"("
"TrackData&, "
"const scalar, "
"const label"
")"
) << "Limiting observed density in cell " << cellI << " to "
<< td.cloud().constProps().rhoMin() << nl << endl;
if (debug)
{
WarningIn
(
"void Foam::KinematicParcel<ParcelType>::setCellValues"
"("
"TrackData&, "
"const scalar, "
"const label"
")"
) << "Limiting observed density in cell " << cellI << " to "
<< td.cloud().constProps().rhoMin() << nl << endl;
}
rhoc_ = td.cloud().constProps().rhoMin();
}
@ -176,46 +179,21 @@ const Foam::vector Foam::KinematicParcel<ParcelType>::calcVelocity
scalar& Cud
) const
{
const polyMesh& mesh = this->cloud().pMesh();
// Momentum transfer coefficient
const scalar utc = td.cloud().drag().utc(Re, d, mu) + ROOTVSMALL;
tetIndices tetIs = this->currentTetIndices();
const typename ParcelType::forceType& forces = td.cloud().forces();
// Momentum source due to particle forces
const vector Fcp = mass*td.cloud().forces().calcCoupled
(
this->position(),
tetIs,
dt,
rhoc_,
rho,
Uc_,
U,
d
);
const vector Fncp = mass*td.cloud().forces().calcNonCoupled
(
this->position(),
tetIs,
dt,
rhoc_,
rho,
Uc_,
U,
d
);
const ParcelType& p = static_cast<const ParcelType&>(*this);
const forceSuSp Fcp = forces.calcCoupled(p, dt, mass, Re, mu);
const forceSuSp Fncp = forces.calcNonCoupled(p, dt, mass, Re, mu);
const forceSuSp Feff = Fcp + Fncp;
// New particle velocity
//~~~~~~~~~~~~~~~~~~~~~~
// Update velocity - treat as 3-D
const scalar As = this->areaS(d);
const vector ap = Uc_ + (Fcp + Fncp + Su)/(utc*As);
const scalar bp = 6.0*utc/(rho*d);
const vector ap = Uc_ + (Feff.Su() + Su)/(Feff.Sp() + ROOTVSMALL);
const scalar bp = Feff.Sp()/mass;
Cud = bp;
@ -224,9 +202,10 @@ const Foam::vector Foam::KinematicParcel<ParcelType>::calcVelocity
vector Unew = Ures.value();
dUTrans += dt*(utc*As*(Ures.average() - Uc_) - Fcp);
dUTrans += dt*(Feff.Sp()*(Ures.average() - Uc_) - Fcp.Su());
// Apply correction to velocity and dUTrans for reduced-D cases
const polyMesh& mesh = this->cloud().pMesh();
meshTools::constrainDirection(mesh, mesh.solutionD(), Unew);
meshTools::constrainDirection(mesh, mesh.solutionD(), dUTrans);

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
\\ / A nd | Copyright (C) 2008-2011 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -56,6 +56,8 @@ SourceFiles
#include "labelFieldIOField.H"
#include "vectorFieldIOField.H"
#include "ParticleForceList.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
@ -88,6 +90,10 @@ class KinematicParcel
{
public:
//- Type of force to be used by this parcel type
typedef ParticleForceList<KinematicCloud<ParcelType> > forceType;
//- Class to hold kinematic particle constant properties
class constantProperties
{
@ -456,6 +462,15 @@ public:
//- Return const access to turbulent velocity fluctuation
inline const vector& UTurb() const;
//- Return const access to carrier density [kg/m3]
inline scalar rhoc() const;
//- Return const access to carrier velocity [m/s]
inline const vector& Uc() const;
//- Return const access to carrier viscosity [Pa.s]
inline scalar muc() const;
//- Return const access to the collision records
inline const collisionRecordList& collisionRecords() const;

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
\\ / A nd | Copyright (C) 2008-2011 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -409,6 +409,27 @@ inline const Foam::vector& Foam::KinematicParcel<ParcelType>::UTurb() const
}
template <class ParcelType>
inline Foam::scalar Foam::KinematicParcel<ParcelType>::rhoc() const
{
return rhoc_;
}
template <class ParcelType>
inline const Foam::vector& Foam::KinematicParcel<ParcelType>::Uc() const
{
return Uc_;
}
template <class ParcelType>
inline Foam::scalar Foam::KinematicParcel<ParcelType>::muc() const
{
return muc_;
}
template<class ParcelType>
inline bool& Foam::KinematicParcel<ParcelType>::active()
{

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) 2008-2011 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
\\ / A nd | Copyright (C) 2008-2011 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
\\ / A nd | Copyright (C) 2008-2011 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
\\ / A nd | Copyright (C) 2008-2011 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License

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) 2008-2011 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
\\ / A nd | Copyright (C) 2008-2011 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
\\ / A nd | Copyright (C) 2008-2011 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -344,6 +344,12 @@ public:
//- Return the parcel sensible enthalpy
inline scalar hs() const;
//- Return const access to carrier temperature
inline scalar Tc() const;
//- Return const access to carrier specific heat capacity
inline scalar Cpc() const;
// Edit

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
\\ / A nd | Copyright (C) 2008-2011 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -321,6 +321,20 @@ inline Foam::scalar Foam::ThermoParcel<ParcelType>::hs() const
}
template<class ParcelType>
inline Foam::scalar Foam::ThermoParcel<ParcelType>::Tc() const
{
return Tc_;
}
template<class ParcelType>
inline Foam::scalar Foam::ThermoParcel<ParcelType>::Cpc() const
{
return Cpc_;
}
template<class ParcelType>
inline Foam::scalar& Foam::ThermoParcel<ParcelType>::T()
{

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) 2008-2011 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License

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) 2008-2011 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License

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) 2008-2011 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License

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) 2008-2011 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2008-2010 OpenCFD Ltd.
\\ / A nd | Copyright (C) 2008-2011 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -26,8 +26,8 @@ License
#include "basicKinematicParcel.H"
// Kinematic
#include "makeParcelForces.H"
#include "makeParcelDispersionModels.H"
#include "makeParcelDragModels.H"
#include "makeParcelInjectionModels.H"
#include "makeParcelCollisionModels.H"
#include "makeParcelPatchInteractionModels.H"
@ -39,8 +39,8 @@ License
namespace Foam
{
// Kinematic sub-models
makeParcelForces(basicKinematicParcel);
makeParcelDispersionModels(basicKinematicParcel);
makeParcelDragModels(basicKinematicParcel);
makeParcelInjectionModels(basicKinematicParcel);
makeParcelCollisionModels(basicKinematicParcel);
makeParcelPatchInteractionModels(basicKinematicParcel);

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2008-2010 OpenCFD Ltd.
\\ / A nd | Copyright (C) 2008-2011 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -26,8 +26,8 @@ License
#include "basicReactingMultiphaseParcel.H"
// Kinematic
#include "makeThermoParcelForces.H" // thermo variant
#include "makeParcelDispersionModels.H"
#include "makeParcelDragModels.H"
#include "makeReactingMultiphaseParcelInjectionModels.H" // MP variant
#include "makeParcelCollisionModels.H"
#include "makeParcelPatchInteractionModels.H"
@ -50,8 +50,8 @@ License
namespace Foam
{
// Kinematic sub-models
makeThermoParcelForces(basicReactingMultiphaseParcel);
makeParcelDispersionModels(basicReactingMultiphaseParcel);
makeParcelDragModels(basicReactingMultiphaseParcel);
makeReactingMultiphaseParcelInjectionModels(basicReactingMultiphaseParcel);
makeParcelCollisionModels(basicReactingMultiphaseParcel);
makeParcelPatchInteractionModels(basicReactingMultiphaseParcel);

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) 2008-2011 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License

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) 2008-2011 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License

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) 2008-2011 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2008-2010 OpenCFD Ltd.
\\ / A nd | Copyright (C) 2008-2011 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -26,8 +26,8 @@ License
#include "basicReactingParcel.H"
// Kinematic
#include "makeThermoParcelForces.H" // thermo variant
#include "makeParcelDispersionModels.H"
#include "makeParcelDragModels.H"
#include "makeReactingParcelInjectionModels.H" // Reacting variant
#include "makeParcelCollisionModels.H"
#include "makeParcelPatchInteractionModels.H"
@ -46,8 +46,8 @@ License
namespace Foam
{
// Kinematic sub-models
makeThermoParcelForces(basicReactingParcel);
makeParcelDispersionModels(basicReactingParcel);
makeParcelDragModels(basicReactingParcel);
makeReactingParcelInjectionModels(basicReactingParcel);
makeParcelCollisionModels(basicReactingParcel);
makeParcelPatchInteractionModels(basicReactingParcel);

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) 2008-2011 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License

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) 2008-2011 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2008-2010 OpenCFD Ltd.
\\ / A nd | Copyright (C) 2008-2011 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -26,8 +26,8 @@ License
#include "basicThermoParcel.H"
// Kinematic
#include "makeThermoParcelForces.H" // thermo variant
#include "makeParcelDispersionModels.H"
#include "makeParcelDragModels.H"
#include "makeParcelInjectionModels.H"
#include "makeParcelCollisionModels.H"
#include "makeParcelPatchInteractionModels.H"
@ -42,8 +42,8 @@ License
namespace Foam
{
// Kinematic sub-models
makeThermoParcelForces(basicThermoParcel);
makeParcelDispersionModels(basicThermoParcel);
makeParcelDragModels(basicThermoParcel);
makeParcelInjectionModels(basicThermoParcel);
makeParcelCollisionModels(basicThermoParcel);
makeParcelPatchInteractionModels(basicThermoParcel);

View File

@ -0,0 +1,89 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / 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/>.
\*---------------------------------------------------------------------------*/
#ifndef makeParcelForces_H
#define makeParcelForces_H
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#include "KinematicCloud.H"
#include "SphereDragForce.H"
#include "NonSphereDragForce.H"
#include "GravityForce.H"
#include "ParamagneticForce.H"
#include "PressureGradientForce.H"
#include "SRFForce.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#define makeParcelForces(ParcelType) \
\
makeParticleForceModel(KinematicCloud<ParcelType>); \
\
makeParticleForceModelType \
( \
SphereDragForce, \
KinematicCloud, \
ParcelType \
); \
makeParticleForceModelType \
( \
NonSphereDragForce, \
KinematicCloud, \
ParcelType \
); \
makeParticleForceModelType \
( \
GravityForce, \
KinematicCloud, \
ParcelType \
); \
makeParticleForceModelType \
( \
ParamagneticForce, \
KinematicCloud, \
ParcelType \
); \
makeParticleForceModelType \
( \
PressureGradientForce, \
KinematicCloud, \
ParcelType \
); \
makeParticleForceModelType \
( \
SRFForce, \
KinematicCloud, \
ParcelType \
);
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -0,0 +1,96 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / 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/>.
\*---------------------------------------------------------------------------*/
#ifndef makeThermoParcelForces_H
#define makeThermoParcelForces_H
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#include "KinematicCloud.H"
#include "SphereDragForce.H"
#include "NonSphereDragForce.H"
#include "BrownianMotionForce.H"
#include "GravityForce.H"
#include "ParamagneticForce.H"
#include "PressureGradientForce.H"
#include "SRFForce.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#define makeThermoParcelForces(ParcelType) \
\
makeParticleForceModel(KinematicCloud<ParcelType>); \
\
makeParticleForceModelType \
( \
SphereDragForce, \
KinematicCloud, \
ParcelType \
); \
makeParticleForceModelType \
( \
NonSphereDragForce, \
KinematicCloud, \
ParcelType \
); \
makeParticleForceModelType \
( \
BrownianMotionForce, \
KinematicCloud, \
ParcelType \
); \
makeParticleForceModelType \
( \
GravityForce, \
KinematicCloud, \
ParcelType \
); \
makeParticleForceModelType \
( \
ParamagneticForce, \
KinematicCloud, \
ParcelType \
); \
makeParticleForceModelType \
( \
PressureGradientForce, \
KinematicCloud, \
ParcelType \
); \
makeParticleForceModelType \
( \
SRFForce, \
KinematicCloud, \
ParcelType \
);
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -1,362 +0,0 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2008-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 "particleForces.H"
#include "fvMesh.H"
#include "volFields.H"
#include "fvcGrad.H"
#include "mathematicalConstants.H"
#include "electromagneticConstants.H"
#include "SRFModel.H"
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
void Foam::particleForces::deleteFields()
{
if (gradUPtr_)
{
delete gradUPtr_;
gradUPtr_ = NULL;
}
if (HdotGradHInterPtr_)
{
delete HdotGradHInterPtr_;
HdotGradHInterPtr_ = NULL;
}
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::particleForces::particleForces(const fvMesh& mesh)
:
mesh_(mesh),
dict_(dictionary::null),
g_(vector::zero),
gradUPtr_(NULL),
HdotGradHInterPtr_(NULL),
gravity_(false),
virtualMass_(false),
Cvm_(0.0),
pressureGradient_(false),
paramagnetic_(false),
magneticSusceptibility_(0.0),
refFrame_(rfInertial),
UName_("undefined_UName"),
HdotGradHName_("undefined_HdotGradHName")
{}
Foam::particleForces::particleForces
(
const fvMesh& mesh,
const dictionary& dict,
const vector& g,
const bool readFields
)
:
mesh_(mesh),
dict_(dict.subOrEmptyDict("particleForces")),
g_(g),
gradUPtr_(NULL),
HdotGradHInterPtr_(NULL),
gravity_(false),
virtualMass_(false),
Cvm_(0.0),
pressureGradient_(false),
paramagnetic_(false),
magneticSusceptibility_(0.0),
refFrame_(rfInertial),
UName_(dict_.lookupOrDefault<word>("UName", "U")),
HdotGradHName_(dict_.lookupOrDefault<word>("HdotGradHName", "HdotGradH"))
{
if (readFields)
{
dict_.lookup("gravity") >> gravity_;
dict_.lookup("virtualMass") >> virtualMass_;
dict_.lookup("pressureGradient") >> pressureGradient_;
dict_.lookup("paramagnetic") >> paramagnetic_;
if (virtualMass_)
{
dict_.lookup("Cvm") >> Cvm_;
}
if (paramagnetic_)
{
dict_.lookup("magneticSusceptibility") >> magneticSusceptibility_;
}
}
if (dict_.found("referenceFrame"))
{
word rf(dict_.lookup("referenceFrame"));
if (rf == "SRF")
{
refFrame_ = rfSRF;
}
else if (rf != "inertial")
{
FatalErrorIn
(
"Foam::particleForces::particleForces"
"("
"const fvMesh&, "
"const dictionary&, "
"const vector&, "
"const bool"
")"
)
<< "Unknown referenceFrame, options are inertial and SRF."
<< abort(FatalError);
}
}
}
Foam::particleForces::particleForces(const particleForces& f)
:
mesh_(f.mesh_),
dict_(f.dict_),
g_(f.g_),
gradUPtr_(f.gradUPtr_),
HdotGradHInterPtr_(f.HdotGradHInterPtr_),
gravity_(f.gravity_),
virtualMass_(f.virtualMass_),
Cvm_(f.Cvm_),
pressureGradient_(f.pressureGradient_),
paramagnetic_(f.paramagnetic_),
magneticSusceptibility_(f.magneticSusceptibility_),
refFrame_(f.refFrame_),
UName_(f.UName_),
HdotGradHName_(f.HdotGradHName_)
{}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::particleForces::~particleForces()
{
deleteFields();
}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
const Foam::dictionary& Foam::particleForces::dict() const
{
return dict_;
}
const Foam::vector& Foam::particleForces::g() const
{
return g_;
}
Foam::Switch Foam::particleForces::gravity() const
{
return gravity_;
}
Foam::Switch Foam::particleForces::virtualMass() const
{
return virtualMass_;
}
Foam::scalar Foam::particleForces::Cvm() const
{
return Cvm_;
}
Foam::Switch Foam::particleForces::pressureGradient() const
{
return pressureGradient_;
}
Foam::Switch Foam::particleForces::paramagnetic() const
{
return paramagnetic_;
}
Foam::scalar Foam::particleForces::magneticSusceptibility() const
{
return magneticSusceptibility_;
}
const Foam::word& Foam::particleForces::UName() const
{
return UName_;
}
const Foam::word& Foam::particleForces::HdotGradHName() const
{
return HdotGradHName_;
}
void Foam::particleForces::cacheFields
(
const bool store,
const dictionary& interpolationSchemes
)
{
if (store)
{
if (pressureGradient_)
{
const volVectorField& U =
mesh_.lookupObject<volVectorField>(UName_);
gradUPtr_ = fvc::grad(U).ptr();
}
if (paramagnetic_)
{
const volVectorField& HdotGradH =
mesh_.lookupObject<volVectorField>(HdotGradHName_);
HdotGradHInterPtr_ = interpolation<vector>::New
(
interpolationSchemes,
HdotGradH
).ptr();
}
}
else
{
deleteFields();
}
}
Foam::vector Foam::particleForces::calcCoupled
(
const vector& position,
const tetIndices& tetIs,
const scalar dt,
const scalar rhoc,
const scalar rho,
const vector& Uc,
const vector& U,
const scalar d
) const
{
vector accelTot = vector::zero;
// Virtual mass force
if (virtualMass_)
{
notImplemented
(
"Foam::particleForces::calcCoupled(...) - virtual mass force"
);
// accelTot += Cvm_*rhoc/rho*d(Uc - U)/dt;
}
// Pressure gradient force
if (pressureGradient_)
{
const volTensorField& gradU = *gradUPtr_;
accelTot += rhoc/rho*(U & gradU[tetIs.cell()]);
}
return accelTot;
}
Foam::vector Foam::particleForces::calcNonCoupled
(
const vector& position,
const tetIndices& tetIs,
const scalar dt,
const scalar rhoc,
const scalar rho,
const vector& Uc,
const vector& U,
const scalar d
) const
{
vector accelTot = vector::zero;
// Gravity force
if (gravity_)
{
accelTot += g_*(1.0 - rhoc/rho);
}
// Magnetic field force
if (paramagnetic_)
{
const interpolation<vector>& HdotGradHInter = *HdotGradHInterPtr_;
accelTot +=
3.0*constant::electromagnetic::mu0.value()/rho
*magneticSusceptibility_/(magneticSusceptibility_ + 3)
*HdotGradHInter.interpolate(position, tetIs);
// force is:
// 4.0
// *constant::mathematical::pi
// *constant::electromagnetic::mu0.value()
// *pow3(d/2)
// *magneticSusceptibility_/(magneticSusceptibility_ + 3)
// *HdotGradH[cellI];
// which is divided by mass (pi*d^3*rho/6) to produce
// acceleration
}
if (refFrame_ == rfSRF)
{
const SRF::SRFModel& srf =
mesh_.lookupObject<SRF::SRFModel>("SRFProperties");
const vector& omega = srf.omega().value();
const vector& axis = srf.axis();
vector r = position - axis*(axis & position);
// Coriolis and centrifugal acceleration terms
accelTot += 2*(U ^ omega) + (omega ^ (r ^ omega));
}
return accelTot;
}
// ************************************************************************* //

View File

@ -1,229 +0,0 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2008-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::particleForces
Description
Provides a mechanism to calculate particle forces
Note: forces are force per unit mass (accelerations)
SourceFiles
particleForces.C
\*---------------------------------------------------------------------------*/
#ifndef particleForces_H
#define particleForces_H
#include "dictionary.H"
#include "Switch.H"
#include "vector.H"
#include "volFieldsFwd.H"
#include "interpolation.H"
#include "tetIndices.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// Forward class declarations
class fvMesh;
/*---------------------------------------------------------------------------*\
Class particleForces Declaration
\*---------------------------------------------------------------------------*/
class particleForces
{
// Private data
//- Reference frame type
enum refFrame
{
rfInertial,
rfSRF
};
//- Reference to the mesh database
const fvMesh& mesh_;
//- The particleForces dictionary
const dictionary dict_;
//- Gravity
const vector g_;
//- Velocity gradient field
const volTensorField* gradUPtr_;
//- HdotGradH interpolator
const interpolation<vector>* HdotGradHInterPtr_;
// Forces to include in particle motion evaluation
//- Gravity
Switch gravity_;
//- Virtual mass
Switch virtualMass_;
//- Virtual mass force coefficient
scalar Cvm_;
//- Pressure gradient
Switch pressureGradient_;
//- Paramagnetic force
Switch paramagnetic_;
//- Magnetic susceptibility of particle
scalar magneticSusceptibility_;
//- Reference frame accelerations
refFrame refFrame_;
// Additional info
//- Name of velocity field - default = "U"
const word UName_;
//- Name of paramagnetic field strength field - default =
// "HdotGradH"
const word HdotGradHName_;
// Private Member Functions
//- Delete cached carrier fields
void deleteFields();
public:
// Constructors
//- Construct null from mesh reference
particleForces(const fvMesh& mesh);
//- Construct from mesh, dictionary and gravity
particleForces
(
const fvMesh& mesh,
const dictionary& dict,
const vector& g,
const bool readFields = true
);
//- Construct copy
particleForces(const particleForces& f);
//- Destructor
~particleForces();
// Member Functions
// Access
//- Return the particleForces dictionary
const dictionary& dict() const;
//- Return the gravity vector
const vector& g() const;
//- Return gravity force activate switch
Switch gravity() const;
//- Return virtual mass force activate switch
Switch virtualMass() const;
//- Return virtual mass force coefficient
scalar Cvm() const;
//- Return pressure gradient force activate switch
Switch pressureGradient() const;
//- Return name of velocity field
const word& UName() const;
//- Return paramagnetic force activate switch
Switch paramagnetic() const;
//- Return magnetic susceptibility
scalar magneticSusceptibility() const;
//- Return name of paramagnetic field strength field
const word& HdotGradHName() const;
// Evaluation
//- Cache carrier fields
void cacheFields
(
const bool store,
const dictionary& interpolationSchemes
);
//- Calculate action/reaction forces between carrier and particles
vector calcCoupled
(
const vector& position,
const tetIndices& tetIs,
const scalar dt,
const scalar rhoc,
const scalar rho,
const vector& Uc,
const vector& U,
const scalar d
) const;
//- Calculate external forces applied to the particles
vector calcNonCoupled
(
const vector& position,
const tetIndices& tetIs,
const scalar dt,
const scalar rhoc,
const scalar rho,
const vector& Uc,
const vector& U,
const scalar d
) const;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -0,0 +1,158 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / 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 "ParticleForceList.H"
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
template<class CloudType>
Foam::ParticleForceList<CloudType>::ParticleForceList
(
CloudType& owner,
const fvMesh& mesh
)
:
PtrList<ParticleForce<CloudType> >(),
owner_(owner),
mesh_(mesh),
dict_(dictionary::null)
{}
template<class CloudType>
Foam::ParticleForceList<CloudType>::ParticleForceList
(
CloudType& owner,
const fvMesh& mesh,
const dictionary& dict,
const bool readFields
)
:
PtrList<ParticleForce<CloudType> >(),
owner_(owner),
mesh_(mesh),
dict_(dict)
{
if (readFields)
{
const wordList activeForces(dict.lookup("activeForces"));
wordHashSet models;
models.insert(activeForces);
Info<< "Constructing particle forces" << endl;
if (models.size() > 0)
{
this->setSize(models.size());
label i = 0;
forAllConstIter(wordHashSet, models, iter)
{
const word& model = iter.key();
set(i, ParticleForce<CloudType>::New(owner, mesh, dict, model));
i++;
}
}
else
{
Info<< " none" << endl;
}
}
}
template<class CloudType>
Foam::ParticleForceList<CloudType>::ParticleForceList
(
const ParticleForceList& pf
)
:
PtrList<ParticleForce<CloudType> >(pf),
owner_(pf.owner_),
mesh_(pf.mesh_),
dict_(pf.dict_)
{}
// * * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * //
template<class CloudType>
Foam::ParticleForceList<CloudType>::~ParticleForceList()
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template<class CloudType>
void Foam::ParticleForceList<CloudType>::cacheFields(const bool store)
{
forAll(*this, i)
{
this->operator[](i).cacheFields(store);
}
}
template<class CloudType>
Foam::forceSuSp Foam::ParticleForceList<CloudType>::calcCoupled
(
const typename CloudType::parcelType& p,
const scalar dt,
const scalar mass,
const scalar Re,
const scalar muc
) const
{
forceSuSp value(vector::zero, 0.0);
forAll(*this, i)
{
value += this->operator[](i).calcCoupled(p, dt, mass, Re, muc);
}
return value;
}
template<class CloudType>
Foam::forceSuSp Foam::ParticleForceList<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);
forAll(*this, i)
{
value += this->operator[](i).calcNonCoupled(p, dt, mass, Re, muc);
}
return value;
}
// ************************************************************************* //

View File

@ -0,0 +1,152 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / 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::ParticleForceList
Description
List of particle forces
SourceFiles
ParticleForceListI.H
ParticleForceList.C
\*---------------------------------------------------------------------------*/
#ifndef ParticleForceList_H
#define ParticleForceList_H
#include "ParticleForce.H"
#include "forceSuSp.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
/*---------------------------------------------------------------------------*\
Class ParticleForceList Declaration
\*---------------------------------------------------------------------------*/
template<class CloudType>
class ParticleForceList
:
public PtrList<ParticleForce<CloudType> >
{
// Private data
//- Reference to the owner cloud
CloudType& owner_;
//- Reference to the mesh database
const fvMesh& mesh_;
//- Forces dictionary
const dictionary dict_;
public:
// Constructors
//- Null constructor
ParticleForceList(CloudType& owner, const fvMesh& mesh);
//- Construct from mesh
ParticleForceList
(
CloudType& owner,
const fvMesh& mesh,
const dictionary& dict,
const bool readFields
);
//- Construct copy
ParticleForceList(const ParticleForceList& pfl);
//- Destructor
virtual ~ParticleForceList();
// Member Functions
// Access
//- Return const access to the cloud owner
inline const CloudType& owner() const;
//- Return refernce to the cloud owner
inline CloudType& owner();
//- Return the mesh database
inline const fvMesh& mesh() const;
//- Return the forces dictionary
inline const dictionary& dict() const;
// Evaluation
//- Cache fields
virtual void cacheFields(const bool store);
//- Calculate the coupled force
virtual forceSuSp calcCoupled
(
const typename CloudType::parcelType& p,
const scalar dt,
const scalar mass,
const scalar Re,
const scalar muc
) const;
//- 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 "ParticleForceListI.H"
#ifdef NoRepository
#include "ParticleForceList.C"
#endif
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2008-2010 OpenCFD Ltd.
\\ / A nd | Copyright (C) 2011-2011 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -23,30 +23,34 @@ License
\*---------------------------------------------------------------------------*/
#ifndef makeParcelDragModels_H
#define makeParcelDragModels_H
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#include "KinematicCloud.H"
#include "NoDrag.H"
#include "NonSphereDrag.H"
#include "SphereDrag.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#define makeParcelDragModels(ParcelType) \
\
makeDragModel(KinematicCloud<ParcelType>); \
\
makeDragModelType(NoDrag, KinematicCloud, ParcelType); \
makeDragModelType(NonSphereDrag, KinematicCloud, ParcelType); \
makeDragModelType(SphereDrag, KinematicCloud, ParcelType);
template<class CloudType>
inline const CloudType& Foam::ParticleForceList<CloudType>::owner() const
{
return owner_;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
template<class CloudType>
inline CloudType& Foam::ParticleForceList<CloudType>::owner()
{
return owner_;
}
template<class CloudType>
inline const Foam::fvMesh& Foam::ParticleForceList<CloudType>::mesh() const
{
return mesh_;
}
template<class CloudType>
inline const Foam::dictionary& Foam::ParticleForceList<CloudType>::dict() const
{
return dict_;
}
#endif
// ************************************************************************* //

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) 2008-2011 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License

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) 2008-2011 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License

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) 2008-2011 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License

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) 2008-2011 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License

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) 2008-2011 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License

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) 2008-2011 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License

Some files were not shown because too many files have changed in this diff Show More