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

This commit is contained in:
andy
2009-07-07 16:36:36 +01:00
55 changed files with 484 additions and 359 deletions

View File

View File

View File

View File

View File

@ -78,6 +78,7 @@ int main(int argc, char *argv[])
if (sourceType == "patch") if (sourceType == "patch")
{ {
fileName sourceCasePath(dict.lookup("sourceCase")); fileName sourceCasePath(dict.lookup("sourceCase"));
sourceCasePath.expand();
fileName sourceRootDir = sourceCasePath.path(); fileName sourceRootDir = sourceCasePath.path();
fileName sourceCaseDir = sourceCasePath.name(); fileName sourceCaseDir = sourceCasePath.name();
word patchName(dict.lookup("sourcePatch")); word patchName(dict.lookup("sourcePatch"));

View File

@ -1,16 +0,0 @@
argList::validArgs.clear();
argList::noParallel();
argList::validOptions.insert("sourceCase", "source case");
argList::validOptions.insert("sourcePatch", "source patch");
argList::validOptions.insert("surface", "surface file");
argList::validOptions.insert("mergeFaces", "");
argList args(argc, argv);
if (!args.check())
{
FatalError.exit();
}

View File

View File

View File

View File

View File

@ -113,7 +113,7 @@ Foam::label Foam::meshRefinement::createBaffle
true, // face flip true, // face flip
neiPatch, // patch for face neiPatch, // patch for face
zoneID, // zone for face zoneID, // zone for face
zoneFlip // face flip in zone !zoneFlip // face flip in zone
) )
); );
} }

View File

@ -56,7 +56,7 @@ Foam::trackedParticle::trackedParticle
bool readFields bool readFields
) )
: :
ExactParticle<trackedParticle>(c, is) ExactParticle<trackedParticle>(c, is, readFields)
{ {
if (readFields) if (readFields)
{ {

View File

@ -42,15 +42,12 @@ Foam::Cloud<ParticleType>::Cloud
) )
: :
cloud(pMesh), cloud(pMesh),
IDLList<ParticleType>(particles), IDLList<ParticleType>(),
polyMesh_(pMesh), polyMesh_(pMesh),
allFaces_(pMesh.faces()), particleCount_(0)
points_(pMesh.points()), {
cellFaces_(pMesh.cells()), IDLList<ParticleType>::operator=(particles);
allFaceCentres_(pMesh.faceCentres()), }
owner_(pMesh.faceOwner()),
neighbour_(pMesh.faceNeighbour())
{}
template<class ParticleType> template<class ParticleType>
@ -62,19 +59,31 @@ Foam::Cloud<ParticleType>::Cloud
) )
: :
cloud(pMesh, cloudName), cloud(pMesh, cloudName),
IDLList<ParticleType>(particles), IDLList<ParticleType>(),
polyMesh_(pMesh), polyMesh_(pMesh),
allFaces_(pMesh.faces()), particleCount_(0)
points_(pMesh.points()), {
cellFaces_(pMesh.cells()), IDLList<ParticleType>::operator=(particles);
allFaceCentres_(pMesh.faceCentres()), }
owner_(pMesh.faceOwner()),
neighbour_(pMesh.faceNeighbour())
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template<class ParticleType>
Foam::label Foam::Cloud<ParticleType>::getNewParticleID() const
{
label id = particleCount_++;
if (id == labelMax)
{
WarningIn("Cloud<ParticleType>::getNewParticleID() const")
<< "Particle counter has overflowed. This might cause problems"
<< " when reconstructing particle tracks." << endl;
}
return id;
}
template<class ParticleType> template<class ParticleType>
void Foam::Cloud<ParticleType>::addParticle(ParticleType* pPtr) void Foam::Cloud<ParticleType>::addParticle(ParticleType* pPtr)
{ {

View File

@ -50,6 +50,9 @@ namespace Foam
template<class ParticleType> template<class ParticleType>
class Cloud; class Cloud;
template<class ParticleType>
class IOPosition;
template<class ParticleType> template<class ParticleType>
Ostream& operator<< Ostream& operator<<
( (
@ -71,12 +74,9 @@ class Cloud
// Private data // Private data
const polyMesh& polyMesh_; const polyMesh& polyMesh_;
const faceList& allFaces_;
const vectorField& points_; //- Overall count of particles ever created. Never decreases.
const cellList& cellFaces_; mutable label particleCount_;
const vectorField& allFaceCentres_;
const unallocLabelList& owner_;
const unallocLabelList& neighbour_;
//- Temporary storage for addressing. Used in findFaces. //- Temporary storage for addressing. Used in findFaces.
mutable DynamicList<label> labels_; mutable DynamicList<label> labels_;
@ -92,6 +92,8 @@ public:
template<class ParticleT> template<class ParticleT>
friend class Particle; friend class Particle;
template<class ParticleT>
friend class IOPosition;
typedef ParticleType particleType; typedef ParticleType particleType;
@ -218,6 +220,9 @@ public:
return IDLList<ParticleType>::clear(); return IDLList<ParticleType>::clear();
}; };
//- Get unique particle creation id
label getNewParticleID() const;
//- Transfer particle to cloud //- Transfer particle to cloud
void addParticle(ParticleType* pPtr); void addParticle(ParticleType* pPtr);
@ -251,13 +256,15 @@ public:
const IOField<DataType>& data const IOField<DataType>& data
) const; ) const;
//- Read the field data for the cloud of particles //- Read the field data for the cloud of particles. Dummy at
void readFields(); // this level.
virtual void readFields();
// Write // Write
//- Write the field data for the cloud of particles //- Write the field data for the cloud of particles Dummy at
// this level.
virtual void writeFields() const; virtual void writeFields() const;
//- Write using given format, version and compression. //- Write using given format, version and compression.

View File

@ -67,12 +67,7 @@ Foam::Cloud<ParticleType>::Cloud
: :
cloud(pMesh), cloud(pMesh),
polyMesh_(pMesh), polyMesh_(pMesh),
allFaces_(pMesh.faces()), particleCount_(0)
points_(pMesh.points()),
cellFaces_(pMesh.cells()),
allFaceCentres_(pMesh.faceCentres()),
owner_(pMesh.faceOwner()),
neighbour_(pMesh.faceNeighbour())
{ {
initCloud(checkClass); initCloud(checkClass);
} }
@ -88,12 +83,7 @@ Foam::Cloud<ParticleType>::Cloud
: :
cloud(pMesh, cloudName), cloud(pMesh, cloudName),
polyMesh_(pMesh), polyMesh_(pMesh),
allFaces_(pMesh.faces()), particleCount_(0)
points_(pMesh.points()),
cellFaces_(pMesh.cells()),
allFaceCentres_(pMesh.faceCentres()),
owner_(pMesh.faceOwner()),
neighbour_(pMesh.faceNeighbour())
{ {
initCloud(checkClass); initCloud(checkClass);
} }

View File

@ -34,6 +34,7 @@ Foam::word Foam::IOPosition<ParticleType>::particlePropertiesName
"particleProperties" "particleProperties"
); );
// * * * * * * * * * * * Private Member Functions * * * * * * * * * * * * * // // * * * * * * * * * * * Private Member Functions * * * * * * * * * * * * * //
template<class ParticleType> template<class ParticleType>
@ -58,7 +59,7 @@ void Foam::IOPosition<ParticleType>::readParticleProperties()
if (propsDict.found(procName)) if (propsDict.found(procName))
{ {
propsDict.subDict(procName).lookup("particleCount") propsDict.subDict(procName).lookup("particleCount")
>> Particle<ParticleType>::particleCount; >> cloud_.particleCount_;
} }
} }
} }
@ -83,11 +84,7 @@ void Foam::IOPosition<ParticleType>::writeParticleProperties() const
word procName("processor" + Foam::name(Pstream::myProcNo())); word procName("processor" + Foam::name(Pstream::myProcNo()));
propsDict.add(procName, dictionary()); propsDict.add(procName, dictionary());
propsDict.subDict(procName).add propsDict.subDict(procName).add("particleCount", cloud_.particleCount_);
(
"particleCount",
Particle<ParticleType>::particleCount
);
propsDict.regIOobject::write(); propsDict.regIOobject::write();
} }
@ -135,13 +132,20 @@ bool Foam::IOPosition<ParticleType>::write() const
template<class ParticleType> template<class ParticleType>
bool Foam::IOPosition<ParticleType>::writeData(Ostream& os) const bool Foam::IOPosition<ParticleType>::writeData(Ostream& os) const
{ {
// Write global cloud data
writeParticleProperties(); writeParticleProperties();
os<< cloud_.size() << nl << token::BEGIN_LIST << nl; os<< cloud_.size() << nl << token::BEGIN_LIST << nl;
forAllConstIter(typename Cloud<ParticleType>, cloud_, iter) forAllConstIter(typename Cloud<ParticleType>, cloud_, iter)
{ {
os<< static_cast<const Particle<ParticleType>&>(iter()) << nl; // Prevent writing additional fields
static_cast<const Particle<ParticleType>&>(iter()).write
(
os,
false
);
os << nl;
} }
os<< token::END_LIST << endl; os<< token::END_LIST << endl;
@ -157,6 +161,7 @@ void Foam::IOPosition<ParticleType>::readData
bool checkClass bool checkClass
) )
{ {
// Read global cloud data. Resets count on cloud.
readParticleProperties(); readParticleProperties();
Istream& is = readStream(checkClass ? typeName : ""); Istream& is = readStream(checkClass ? typeName : "");
@ -172,6 +177,7 @@ void Foam::IOPosition<ParticleType>::readData
for (label i=0; i<s; i++) for (label i=0; i<s; i++)
{ {
// Do not read any fields, position only
c.append(new ParticleType(c, is, false)); c.append(new ParticleType(c, is, false));
} }
@ -202,6 +208,7 @@ void Foam::IOPosition<ParticleType>::readData
) )
{ {
is.putBack(lastToken); is.putBack(lastToken);
// Do not read any fields, position only
c.append(new ParticleType(c, is, false)); c.append(new ParticleType(c, is, false));
is >> lastToken; is >> lastToken;
} }

View File

@ -26,7 +26,7 @@ Class
Foam::IOPosition Foam::IOPosition
Description Description
Helper IO class to write particle positions Helper IO class to read and write particle positions
SourceFiles SourceFiles
IOPosition.C IOPosition.C
@ -72,7 +72,7 @@ public:
// Static data // Static data
//- Runtime type name information //- Runtime type name information. Use cloud type.
virtual const word& type() const virtual const word& type() const
{ {
return cloud_.type(); return cloud_.type();
@ -90,11 +90,11 @@ public:
// Member functions // Member functions
void readData(Cloud<ParticleType>& c, bool checkClass); virtual void readData(Cloud<ParticleType>& c, bool checkClass);
bool write() const; virtual bool write() const;
bool writeData(Ostream& os) const; virtual bool writeData(Ostream& os) const;
}; };

View File

@ -33,12 +33,6 @@ License
#include "wallPolyPatch.H" #include "wallPolyPatch.H"
#include "transform.H" #include "transform.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
template<class ParticleType>
Foam::label Foam::Particle<ParticleType>::particleCount = 0;
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
template<class ParticleType> template<class ParticleType>
@ -75,7 +69,7 @@ void Foam::Particle<ParticleType>::findFaces
DynamicList<label>& faceList DynamicList<label>& faceList
) const ) const
{ {
const polyMesh& mesh = cloud_.mesh(); const polyMesh& mesh = cloud_.pMesh();
const labelList& faces = mesh.cells()[celli]; const labelList& faces = mesh.cells()[celli];
const vector& C = mesh.cellCentres()[celli]; const vector& C = mesh.cellCentres()[celli];
@ -184,7 +178,7 @@ Foam::Particle<ParticleType>::Particle
facei_(-1), facei_(-1),
stepFraction_(0.0), stepFraction_(0.0),
origProc_(Pstream::myProcNo()), origProc_(Pstream::myProcNo()),
origId_(particleCount++) origId_(cloud_.getNewParticleID())
{} {}
@ -313,13 +307,13 @@ Foam::scalar Foam::Particle<ParticleType>::trackToFace
// change cell // change cell
if (internalFace) // Internal face if (internalFace) // Internal face
{ {
if (celli_ == cloud_.owner_[facei_]) if (celli_ == mesh.faceOwner()[facei_])
{ {
celli_ = cloud_.neighbour_[facei_]; celli_ = mesh.faceNeighbour()[facei_];
} }
else if (celli_ == cloud_.neighbour_[facei_]) else if (celli_ == mesh.faceNeighbour()[facei_])
{ {
celli_ = cloud_.owner_[facei_]; celli_ = mesh.faceOwner()[facei_];
} }
else else
{ {

View File

@ -279,9 +279,6 @@ public:
//- String representation of properties //- String representation of properties
static string propHeader; static string propHeader;
//- Cumulative particle count used for particle id
static label particleCount;
// Constructors // Constructors
@ -330,7 +327,15 @@ public:
autoPtr<ParticleType> operator()(Istream& is) const autoPtr<ParticleType> operator()(Istream& is) const
{ {
return autoPtr<ParticleType>(new ParticleType(cloud_, is)); return autoPtr<ParticleType>
(
new ParticleType
(
cloud_,
is,
true
)
);
} }
}; };
@ -454,9 +459,14 @@ public:
// I-O // I-O
//- Read the fields associated with the owner cloud
static void readFields(Cloud<ParticleType>& c);
//- Write the fields associated with the owner cloud //- Write the fields associated with the owner cloud
static void writeFields(const Cloud<ParticleType>& c); static void writeFields(const Cloud<ParticleType>& c);
//- Write the particle data
void write(Ostream& os, bool writeFields) const;
// Ostream Operator // Ostream Operator

View File

@ -50,13 +50,26 @@ Foam::Particle<ParticleType>::Particle
origProc_(Pstream::myProcNo()), origProc_(Pstream::myProcNo()),
origId_(-1) origId_(-1)
{ {
// readFields : read additional data. Should be consistent with writeFields.
if (is.format() == IOstream::ASCII) if (is.format() == IOstream::ASCII)
{ {
is >> position_ >> celli_ >> origProc_ >> origId_; is >> position_ >> celli_;
if (readFields)
{
is >> origProc_ >> origId_;
}
else
{
origId_ = cloud_.getNewParticleID();
}
} }
else else
{ {
// In binary read all particle data - needed for parallel transfer // In binary read all particle data - needed for parallel transfer
if (readFields)
{
is.read is.read
( (
reinterpret_cast<char*>(&position_), reinterpret_cast<char*>(&position_),
@ -68,6 +81,19 @@ Foam::Particle<ParticleType>::Particle
+ sizeof(origId_) + sizeof(origId_)
); );
} }
else
{
is.read
(
reinterpret_cast<char*>(&position_),
sizeof(position_)
+ sizeof(celli_)
+ sizeof(facei_)
+ sizeof(stepFraction_)
);
origId_ = cloud_.getNewParticleID();
}
}
if (celli_ == -1) if (celli_ == -1)
{ {
@ -79,6 +105,38 @@ Foam::Particle<ParticleType>::Particle
} }
template<class ParticleType>
void Foam::Particle<ParticleType>::readFields
(
Cloud<ParticleType>& c
)
{
if (!c.size())
{
return;
}
IOobject procIO(c.fieldIOobject("origProcId", IOobject::MUST_READ));
if (procIO.headerOk())
{
IOField<label> origProcId(procIO);
c.checkFieldIOobject(c, origProcId);
IOField<label> origId(c.fieldIOobject("origId", IOobject::MUST_READ));
c.checkFieldIOobject(c, origId);
label i = 0;
forAllIter(typename Cloud<ParticleType>, c, iter)
{
ParticleType& p = iter();
p.origProc_ = origProcId[i];
p.origId_ = origId[i];
i++;
}
}
}
template<class ParticleType> template<class ParticleType>
void Foam::Particle<ParticleType>::writeFields void Foam::Particle<ParticleType>::writeFields
( (
@ -88,36 +146,91 @@ void Foam::Particle<ParticleType>::writeFields
// Write the cloud position file // Write the cloud position file
IOPosition<ParticleType> ioP(c); IOPosition<ParticleType> ioP(c);
ioP.write(); ioP.write();
label np = c.size();
IOField<label> origProc
(
c.fieldIOobject
(
"origProcId",
IOobject::NO_READ
),
np
);
IOField<label> origId(c.fieldIOobject("origId", IOobject::NO_READ), np);
label i = 0;
forAllConstIter(typename Cloud<ParticleType>, c, iter)
{
origProc[i] = iter().origProc_;
origId[i] = iter().origId_;
i++;
}
origProc.write();
origId.write();
}
template<class ParticleType>
void Foam::Particle<ParticleType>::write(Ostream& os, bool writeFields) const
{
if (os.format() == IOstream::ASCII)
{
if (writeFields)
{
// Write the additional entries
os << position_
<< token::SPACE << celli_
<< token::SPACE << origProc_
<< token::SPACE << origId_;
}
else
{
os << position_
<< token::SPACE << celli_;
}
}
else
{
// In binary write both celli_ and facei_, needed for parallel transfer
if (writeFields)
{
os.write
(
reinterpret_cast<const char*>(&position_),
sizeof(position_)
+ sizeof(celli_)
+ sizeof(facei_)
+ sizeof(stepFraction_)
+ sizeof(origProc_)
+ sizeof(origId_)
);
}
else
{
os.write
(
reinterpret_cast<const char*>(&position_),
sizeof(position_)
+ sizeof(celli_)
+ sizeof(facei_)
+ sizeof(stepFraction_)
);
}
}
// Check state of Ostream
os.check("Particle<ParticleType>::write(Ostream& os, bool) const");
} }
template<class ParticleType> template<class ParticleType>
Foam::Ostream& Foam::operator<<(Ostream& os, const Particle<ParticleType>& p) Foam::Ostream& Foam::operator<<(Ostream& os, const Particle<ParticleType>& p)
{ {
if (os.format() == IOstream::ASCII) // Write all data
{ p.write(os, true);
os << p.position_
<< token::SPACE << p.celli_
<< token::SPACE << p.origProc_
<< token::SPACE << p.origId_;
}
else
{
// In binary write both celli_ and facei_, needed for parallel transfer
os.write
(
reinterpret_cast<const char*>(&p.position_),
sizeof(p.position_)
+ sizeof(p.celli_)
+ sizeof(p.facei_)
+ sizeof(p.stepFraction_)
+ sizeof(p.origProc_)
+ sizeof(p.origId_)
);
}
// Check state of Ostream
os.check("Ostream& operator<<(Ostream&, const Particle<ParticleType>&)");
return os; return os;
} }

View File

@ -84,7 +84,7 @@ public:
bool readFields = true bool readFields = true
) )
: :
Particle<indexedParticle>(c, is) Particle<indexedParticle>(c, is, readFields)
{} {}
//- Construct as a copy //- Construct as a copy

View File

@ -22,12 +22,9 @@ License
along with OpenFOAM; if not, write to the Free Software Foundation, along with OpenFOAM; if not, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Description
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
#include "indexedParticle.H" #include "indexedParticleCloud.H"
#include "Cloud.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -43,4 +40,23 @@ defineTemplateTypeNameAndDebug(Cloud<indexedParticle>, 0);
} // End namespace Foam } // End namespace Foam
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::indexedParticleCloud::indexedParticleCloud
(
const polyMesh& mesh,
const word& cloudName
)
:
Cloud<indexedParticle>(mesh, cloudName, false)
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
void Foam::indexedParticleCloud::writeFields() const
{
indexedParticle::writeFields(*this);
}
// ************************************************************************* // // ************************************************************************* //

View File

@ -0,0 +1,91 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2009 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 2 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, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Class
Foam::indexedParticleCloud
Description
A Cloud of particles carrying an additional index.
SourceFiles
indexedParticleCloud.C
\*---------------------------------------------------------------------------*/
#ifndef indexedParticleCloud_H
#define indexedParticleCloud_H
#include "Cloud.H"
#include "indexedParticle.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
/*---------------------------------------------------------------------------*\
Class indexedParticleCloud Declaration
\*---------------------------------------------------------------------------*/
class indexedParticleCloud
:
public Cloud<indexedParticle>
{
// Private Member Functions
//- Disallow default bitwise copy construct
indexedParticleCloud(const indexedParticleCloud&);
//- Disallow default bitwise assignment
void operator=(const indexedParticleCloud&);
public:
// Constructors
//- Construct given mesh
indexedParticleCloud
(
const polyMesh&,
const word& cloudName = "defaultCloud"
);
// Member Functions
//- Write fields
virtual void writeFields() const;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -28,9 +28,6 @@ Class
Description Description
SourceFiles SourceFiles
passiveParticleI.H
passiveParticle.C
passiveParticleIO.C
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
@ -78,7 +75,7 @@ public:
bool readFields = true bool readFields = true
) )
: :
Particle<passiveParticle>(c, is) Particle<passiveParticle>(c, is, readFields)
{} {}
//- Construct as copy //- Construct as copy

View File

@ -22,12 +22,9 @@ License
along with OpenFOAM; if not, write to the Free Software Foundation, along with OpenFOAM; if not, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Description
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
#include "passiveParticle.H" #include "passiveParticleCloud.H"
#include "Cloud.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -39,8 +36,32 @@ namespace Foam
defineParticleTypeNameAndDebug(passiveParticle, 0); defineParticleTypeNameAndDebug(passiveParticle, 0);
defineTemplateTypeNameAndDebug(Cloud<passiveParticle>, 0); defineTemplateTypeNameAndDebug(Cloud<passiveParticle>, 0);
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // };
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::passiveParticleCloud::passiveParticleCloud
(
const polyMesh& mesh,
const word& cloudName
)
:
Cloud<passiveParticle>(mesh, cloudName, false)
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
void Foam::passiveParticleCloud::readFields()
{
passiveParticle::readFields(*this);
}
void Foam::passiveParticleCloud::writeFields() const
{
passiveParticle::writeFields(*this);
}
} // End namespace Foam
// ************************************************************************* // // ************************************************************************* //

View File

@ -0,0 +1,94 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2009 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 2 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, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Class
Foam::passiveParticleCloud
Description
A Cloud of passive particles
SourceFiles
passiveParticleCloud.C
\*---------------------------------------------------------------------------*/
#ifndef passiveParticleCloud_H
#define passiveParticleCloud_H
#include "Cloud.H"
#include "passiveParticle.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
/*---------------------------------------------------------------------------*\
Class passiveParticleCloud Declaration
\*---------------------------------------------------------------------------*/
class passiveParticleCloud
:
public Cloud<passiveParticle>
{
// Private Member Functions
//- Disallow default bitwise copy construct
passiveParticleCloud(const passiveParticleCloud&);
//- Disallow default bitwise assignment
void operator=(const passiveParticleCloud&);
public:
// Constructors
//- Construct given mesh
passiveParticleCloud
(
const polyMesh&,
const word& cloudName = "defaultCloud"
);
// Member Functions
//- Read fields
virtual void readFields();
//- Write fields
virtual void writeFields() const;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -87,7 +87,7 @@ public:
// Member Functions // Member Functions
//- Write fields //- Write fields
void writeFields() const; virtual void writeFields() const;
}; };

0
src/lagrangian/coalCombustion/Make/files Executable file → Normal file
View File

0
src/lagrangian/coalCombustion/Make/options Executable file → Normal file
View File

View File

@ -36,7 +36,7 @@ Foam::parcel::parcel
bool readFields bool readFields
) )
: :
Particle<parcel>(cloud, is), Particle<parcel>(cloud, is, readFields),
liquidComponents_ liquidComponents_
( (

View File

@ -345,7 +345,7 @@ public:
// I/O // I/O
//- Write fields //- Write fields
void writeFields() const; virtual void writeFields() const;
}; };

View File

@ -1,211 +0,0 @@
// The FOAM Project // File: reflectParcel.C
/*
-------------------------------------------------------------------------------
========= | Class Implementation
\\ / |
\\ / | Name: reflectParcel
\\ / | Family: wallModel
\\/ |
F ield | FOAM version: 2.3
O peration |
A and | Copyright (C) 1991-2009 OpenCFD Ltd.
M anipulation | All Rights Reserved.
-------------------------------------------------------------------------------
DESCRIPTION
AUTHOR
Henry G Weller.
-------------------------------------------------------------------------------
*/
#include "reflectParcel.H"
#include "addToRunTimeSelectionTable.H"
#include "wallPolyPatch.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
defineTypeNameAndDebug(reflectParcel, 0);
addToRunTimeSelectionTable
(
wallModel,
reflectParcel,
dictionary
);
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
// Construct from components
reflectParcel::reflectParcel
(
const dictionary& dict,
const fvMesh& mesh,
spray& sm
)
:
wallModel(dict, mesh, sm),
coeffsDict_(dict.subDict(typeName + "Coeffs")),
elasticity_(readScalar(coeffsDict_.lookup("elasticity")))
{}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
reflectParcel::~reflectParcel()
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
// Return 'keepParcel'
bool reflectParcel::wallTreatment
(
parcel& p
) const
{
label patchi = p.patch();
label facei = p.patchFace(patchi);
const polyMesh& mesh = spray_.mesh();
if (typeid(mesh_.boundaryMesh()[patchi]) == typeid(wallPolyPatch))
{
// wallNormal defined to point outwards of domain
vector Sf = mesh_.Sf().boundaryField()[patchi][facei];
Sf /= mag(Sf);
// adjust velocity when wall is moving
if (!mesh.moving())
{
scalar Un = p.U() & Sf;
if (Un > 0)
{
p.U() -= (1.0 + elasticity_)*Un*Sf;
}
}
else
{
label facep = p.face();
scalar dt = spray_.runTime().deltaT().value();
scalar fraction = p.t0()/dt;
const vectorField& oldPoints = mesh.oldPoints();
const vector& Cf1 = mesh.faceCentres()[facep];
vector Cf0 = mesh.faces()[facep].centre(oldPoints);
vector Cf = Cf0 + fraction*(Cf1 - Cf0);
vector Sf0 = mesh.faces()[facep].normal(oldPoints);
Sf0 /= mag(Sf0);
scalar magSfDiff = mag(Sf - Sf0);
if (magSfDiff > SMALL)
{
bool pureRotation = false;
if (pureRotation)
{
// rotation
// find center of rotation
vector omega = Sf0 ^ Sf;
scalar magOmega = mag(omega);
omega /= magOmega+SMALL;
vector n0 = omega ^ Sf0;
scalar lam = ((Cf1 - Cf0) & Sf)/(n0 & Sf);
vector r0 = Cf0 + lam*n0;
scalar phiVel = ::asin(magOmega)/dt;
vector pos = p.position() - r0;
vector v = phiVel*(omega ^ pos);
vector Sfp = Sf0 + fraction*(Sf - Sf0);
//vector Sfp = Sf;
vector Ur = p.U() - v;
scalar Urn = Ur & Sfp;
/*
scalar dd = (p.position() - r0) & Sfp;
Info << "Urn = " << Urn
<< ", dd = " << dd
<< ", pos = " << p.position()
<< ", Sfp = " << Sfp
<< ", omega = " << omega
<< ", r0 = " << r0
<< endl;
*/
if (Urn > 0.0)
{
p.U() -= (1.0 + elasticity_)*Urn*Sfp;
}
}
else
{
vector Sfp = Sf0 + fraction*(Sf - Sf0);
//vector Sfp = Sf;
vector omega = Sf0 ^ Sf;
scalar magOmega = mag(omega);
omega /= magOmega+SMALL;
scalar phiVel = ::asin(magOmega)/dt;
scalar dist = (p.position() - Cf) & Sfp;
vector pos = p.position() - dist*Sfp;
vector vrot = phiVel*(omega ^ (pos - Cf));
vector vtrans = (Cf1 - Cf0)/dt;
vector v = vtrans + vrot;
scalar Un = ((p.U() - v) & Sfp);
if (Un > 0.0)
{
p.U() -= (1.0 + elasticity_)*Un*Sfp;
}
}
}
else
{
// translation
vector v = (Cf1 - Cf0)/dt;
vector Ur = p.U() - v;
scalar Urn = Ur & Sf;
if (Urn > 0.0)
{
Ur -= (1.0 + elasticity_)*Urn*Sf;
p.U() = Ur + v;
}
}
}
}
else
{
FatalError
<< "bool reflectParcel::wallTreatment(parcel& parcel) const "
<< " parcel has hit a boundary "
<< mesh_.boundary()[patchi].type()
<< " which not yet has been implemented."
<< abort(FatalError);
}
return true;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// ************************************************************************* //

View File

@ -91,7 +91,7 @@ public:
// Member functions // Member functions
//- Write fields //- Write fields
void writeFields() const; virtual void writeFields() const;
}; };
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -59,6 +59,7 @@ submodels/addOns/radiation/scatter/cloudScatter/cloudScatter.C
/* data entries */ /* data entries */
submodels/IO/DataEntry/makeDataEntries.C submodels/IO/DataEntry/makeDataEntries.C
submodels/IO/DataEntry/polynomial/polynomial.C submodels/IO/DataEntry/polynomial/polynomial.C
submodels/IO/DataEntry/polynomial/polynomialIO.C
/* integration schemes */ /* integration schemes */

View File

@ -92,7 +92,7 @@ public:
// Member Functions // Member Functions
//- Write fields //- Write fields
void writeFields() const; virtual void writeFields() const;
}; };

View File

@ -92,7 +92,7 @@ public:
// Member Functions // Member Functions
//- Write fields //- Write fields
void writeFields() const; virtual void writeFields() const;
}; };

View File

@ -87,7 +87,7 @@ public:
// Member functions // Member functions
//- Write fields //- Write fields
void writeFields() const; virtual void writeFields() const;
}; };
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -90,7 +90,7 @@ public:
// Member Functions // Member Functions
//- Write fields //- Write fields
void writeFields() const; virtual void writeFields() const;
}; };

View File

@ -233,7 +233,8 @@ void Foam::InjectionModel<CloudType>::postInjectCheck(const label parcelsAdded)
{ {
if (parcelsAdded > 0) if (parcelsAdded > 0)
{ {
Pout<< "\n--> Cloud: " << owner_.name() << nl Pout<< nl
<< "--> Cloud: " << owner_.name() << nl
<< " Added " << parcelsAdded << " Added " << parcelsAdded
<< " new parcels" << nl << endl; << " new parcels" << nl << endl;
} }

0
src/lagrangian/molecularDynamics/molecule/Make/files Executable file → Normal file
View File

0
src/lagrangian/molecularDynamics/molecule/Make/options Executable file → Normal file
View File

View File

@ -108,10 +108,10 @@ public:
void move(const dimensionedVector& g); void move(const dimensionedVector& g);
// I-O // Write
//- Write fields //- Write fields
void writeFields() const; virtual void writeFields() const;
}; };

View File

@ -3,6 +3,7 @@ set -x
# remove old cell sets # remove old cell sets
rm -rf constant/polyMesh/sets rm -rf constant/polyMesh/sets
foamClearPolyMesh
# remove old time folders # remove old time folders
rm -rf 0 *[1-9]* rm -rf 0 *[1-9]*

View File

@ -15,6 +15,7 @@ setSet -batch system/sets.setSet >& log.setSet1
setsToZones -noFlipMap >& log.setsToZones setsToZones -noFlipMap >& log.setsToZones
# create the first cyclic - lhs of porous zone # create the first cyclic - lhs of porous zone
unset FOAM_SETNAN
createBaffles cycLeft cycLeft -overwrite >& log.createBaffles1 createBaffles cycLeft cycLeft -overwrite >& log.createBaffles1
# create the second cyclic - rhs of porous zone # create the second cyclic - rhs of porous zone

View File

@ -19,7 +19,7 @@ numberOfSubdomains 4;
method metis; method metis;
preservePatches preserveFaceZones
( (
cycLeft cycLeft
cycRight cycRight
@ -39,9 +39,7 @@ hierarchicalCoeffs
} }
metisCoeffs metisCoeffs
{ {}
processorWeights ( 1 1 1 1 );
}
manualCoeffs manualCoeffs
{ {