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

This commit is contained in:
mattijs
2009-06-12 16:41:28 +01:00
464 changed files with 17423 additions and 3843 deletions

View File

@ -72,6 +72,7 @@ primitiveLists = primitives/Lists
$(primitiveLists)/boolList.C
$(primitiveLists)/labelIOList.C
$(primitiveLists)/scalarList.C
$(primitiveLists)/scalarIOList.C
$(primitiveLists)/vectorList.C
$(primitiveLists)/sphericalTensorList.C
$(primitiveLists)/symmTensorList.C

View File

@ -63,6 +63,21 @@ Foam::IOPtrList<T>::IOPtrList(const IOobject& io)
}
template<class T>
Foam::IOPtrList<T>::IOPtrList(const IOobject& io, const label s)
:
regIOobject(io),
PtrList<T>(s)
{
if (io.readOpt() != IOobject::NO_READ)
{
FatalErrorIn("IOPtrList<T>::IOPtrList(const IOobject&, const label)")
<< "NO_READ must be set if specifying size" << nl
<< exit(FatalError);
}
}
template<class T>
Foam::IOPtrList<T>::IOPtrList(const IOobject& io, const PtrList<T>& list)
:

View File

@ -70,6 +70,9 @@ public:
//- Construct from IOobject
IOPtrList(const IOobject&);
//- Construct from IOobject with given size
IOPtrList(const IOobject&, const label);
//- Construct from IOobject and a PtrList
IOPtrList(const IOobject&, const PtrList<T>&);

View File

@ -22,27 +22,25 @@ License
along with OpenFOAM; if not, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Description
Declaration of scalar IOList containers
\*---------------------------------------------------------------------------*/
#include "basicReactingParcel.H"
#include "ReactingCloud.H"
#include "SinglePhaseMixture.H"
#include "scalarIOList.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
makeCompositionModel(ReactingCloud<basicReactingParcel>);
// Add instances of composition model to the table
makeCompositionModelType
defineTemplateTypeNameAndDebugWithName(scalarIOList, "scalarList", 0);
defineTemplateTypeNameAndDebugWithName
(
SinglePhaseMixture,
ReactingCloud,
basicReactingParcel
scalarListIOList,
"scalarListList",
0
);
};
}
// ************************************************************************* //

View File

@ -22,24 +22,30 @@ License
along with OpenFOAM; if not, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Typedef
Foam::scalarIOList
Description
Scalar container classes
\*---------------------------------------------------------------------------*/
#include "basicKinematicParcel.H"
#include "KinematicCloud.H"
#ifndef scalarIOList_H
#define scalarIOList_H
#include "NoDrag.H"
#include "SphereDrag.H"
#include "scalarList.H"
#include "IOList.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
makeDragModel(KinematicCloud<basicKinematicParcel>);
typedef IOList<scalar> scalarIOList;
typedef IOList<scalarList> scalarListIOList;
}
// Add instances of drag model to the table
makeDragModelType(NoDrag, KinematicCloud, basicKinematicParcel);
makeDragModelType(SphereDrag, KinematicCloud, basicKinematicParcel);
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -115,6 +115,28 @@ bool Foam::trackedParticle::move(trackedParticle::trackData& td)
}
bool Foam::trackedParticle::hitPatch
(
const polyPatch&,
trackedParticle::trackData& td,
const label patchI
)
{
return false;
}
bool Foam::trackedParticle::hitPatch
(
const polyPatch&,
int&,
const label
)
{
return false;
}
void Foam::trackedParticle::hitWedgePatch
(
const wedgePolyPatch&,

View File

@ -169,6 +169,21 @@ public:
bool move(trackData&);
//- Overridable function to handle the particle hitting a patch
// Executed before other patch-hitting functions
bool hitPatch
(
const polyPatch&,
trackedParticle::trackData& td,
const label patchI
);
bool hitPatch
(
const polyPatch&,
int&,
const label patchI
);
//- Overridable function to handle the particle hitting a wedge
void hitWedgePatch
(

View File

@ -316,18 +316,32 @@ $(laplacianSchemes)/gaussLaplacianScheme/gaussLaplacianSchemes.C
finiteVolume/fvc/fvcMeshPhi.C
cfdTools/general/findRefCell/findRefCell.C
cfdTools/general/adjustPhi/adjustPhi.C
cfdTools/general/bound/bound.C
cfdTools/general/porousMedia/porousZone.C
cfdTools/general/porousMedia/porousZones.C
cfdTools/general/MRF/MRFZone.C
cfdTools/general/MRF/MRFZones.C
cfdTools/general/fieldSources/pressureGradientExplicitSource/pressureGradientExplicitSource.C
cfdTools/general/fieldSources/timeActivatedExplicitSource/timeActivatedExplicitSource.C
cfdTools/general/SRF/SRFModel/SRFModel/SRFModel.C
cfdTools/general/SRF/SRFModel/SRFModel/newSRFModel.C
cfdTools/general/SRF/SRFModel/rpm/rpm.C
cfdTools/general/SRF/derivedFvPatchFields/SRFVelocityFvPatchVectorField/SRFVelocityFvPatchVectorField.C
general = cfdTools/general
$(general)/findRefCell/findRefCell.C
$(general)/adjustPhi/adjustPhi.C
$(general)/bound/bound.C
porousMedia = $(general)/porousMedia
$(porousMedia)/porousZone.C
$(porousMedia)/porousZones.C
MRF = $(general)/MRF
$(MRF)/MRFZone.C
$(MRF)/MRFZones.C
SRF = $(general)/SRF
$(SRF)/SRFModel/SRFModel/SRFModel.C
$(SRF)/SRFModel/SRFModel/newSRFModel.C
$(SRF)/SRFModel/rpm/rpm.C
$(SRF)/derivedFvPatchFields/SRFVelocityFvPatchVectorField/SRFVelocityFvPatchVectorField.C
fieldSources = $(general)/fieldSources
$(fieldSources)/pressureGradientExplicitSource/pressureGradientExplicitSource.C
$(fieldSources)/timeActivatedExplicitSource/timeActivatedExplicitSource.C
$(fieldSources)/timeActivatedExplicitCellSource/timeActivatedExplicitCellSource.C
$(fieldSources)/timeActivatedExplicitMulticomponentPointSource/timeActivatedExplicitMulticomponentPointSource.C
$(fieldSources)/timeActivatedExplicitMulticomponentPointSource/pointSourceProperties/pointSourceProperties.C
$(fieldSources)/timeActivatedExplicitMulticomponentPointSource/pointSourceProperties/pointSourcePropertiesIO.C
LIB = $(FOAM_LIBBIN)/libfiniteVolume

View File

@ -0,0 +1,175 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / 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
\*---------------------------------------------------------------------------*/
#include "timeActivatedExplicitCellSource.H"
#include "volFields.H"
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
void Foam::timeActivatedExplicitCellSource::updateCellSet()
{
cellSelector_->applyToSet(topoSetSource::NEW, selectedCellSet_);
Info<< " " << name_ << ": selected "
<< returnReduce(selectedCellSet_.size(), sumOp<label>())
<< " cells" << nl << endl;
V_ = scalarField(selectedCellSet_.size(), 1.0);
if (volumeType_ == vtAbsolute)
{
label i = 0;
forAllConstIter(cellSet, selectedCellSet_, iter)
{
V_[i++] = mesh_.V()[iter.key()];
}
}
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::timeActivatedExplicitCellSource::timeActivatedExplicitCellSource
(
const word& name,
const fvMesh& mesh,
const dimensionSet& dims
)
:
timeActivatedExplicitSource(name, mesh, dims),
onValue_(readScalar(lookup("onValue"))),
offValue_(readScalar(lookup("offValue"))),
V_(0),
cellSource_(lookup("cellSource")),
cellSelector_
(
topoSetSource::New
(
cellSource_,
mesh,
subDict(cellSource_ + "Coeffs")
)
),
selectedCellSet_
(
mesh,
name + "SourceCellSet",
mesh.nCells()/10 + 1 // Reasonable size estimate.
)
{
// Create the cell set
updateCellSet();
}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
Foam::scalar Foam::timeActivatedExplicitCellSource::onValue() const
{
return onValue_;
}
Foam::scalar Foam::timeActivatedExplicitCellSource::offValue() const
{
return offValue_;
}
Foam::tmp<Foam::DimensionedField<Foam::scalar, Foam::volMesh> >
Foam::timeActivatedExplicitCellSource::Su()
{
tmp<DimensionedField<scalar, volMesh> > tSource
(
new DimensionedField<scalar, volMesh>
(
IOobject
(
name_ + "Su",
runTime_.timeName(),
mesh_,
IOobject::NO_READ,
IOobject::NO_WRITE
),
mesh_,
dimensionedScalar("zero", dimensions_, 0.0)
)
);
scalar value = offValue_;
if
(
active_
&& (runTime_.time().value() >= timeStart_)
&& (runTime_.time().value() <= timeStart_ + duration_)
)
{
// Update the cell set if the mesh is changing
if (mesh_.changing())
{
updateCellSet();
}
value = onValue_;
}
DimensionedField<scalar, volMesh>& sourceField = tSource();
label i = 0;
forAllConstIter(cellSet, selectedCellSet_, iter)
{
sourceField[iter.key()] = value/V_[i++];
}
return tSource;
}
bool Foam::timeActivatedExplicitCellSource::read()
{
if (timeActivatedExplicitSource::read())
{
lookup("onValue") >> onValue_;
lookup("offValue") >> offValue_;
lookup("cellSource") >> cellSource_;
cellSelector_ =
topoSetSource::New
(
cellSource_,
mesh_,
subDict(cellSource_ + "Coeffs")
);
updateCellSet();
return true;
}
else
{
return false;
}
}
// ************************************************************************* //

View File

@ -0,0 +1,143 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / 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::timeActivatedExplicitSourceNew
Description
Creates a cell set source that is activated at a given time, and remains
active for a specified duration. The source value is either in specific
(XX/m3) or absolute (XX) units.
SourceFiles
timeActivatedExplicitCellSource.C
\*---------------------------------------------------------------------------*/
#ifndef timeActivatedExplicitCellSource_H
#define timeActivatedExplicitCellSource_H
#include "timeActivatedExplicitSource.H"
#include "topoSetSource.H"
#include "cellSet.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
/*---------------------------------------------------------------------------*\
Class timeActivatedExplicitCellSource Declaration
\*---------------------------------------------------------------------------*/
class timeActivatedExplicitCellSource
:
public timeActivatedExplicitSource
{
private:
// Private member functions
//- Update the cell set that the source is acting on
void updateCellSet();
// Private Member Functions
//- Disallow default bitwise copy construct
timeActivatedExplicitCellSource(const timeActivatedExplicitCellSource&);
//- Disallow default bitwise assignment
void operator=(const timeActivatedExplicitCellSource&);
protected:
// Protected data
// Source properties
//- Value when "on"
scalar onValue_;
//- Value when "off"
scalar offValue_;
// Cell set
//- Cell volumes
scalarList V_;
//- Name of cell source (XXXToCell)
word cellSource_;
//- Method by which the cells will be selected
autoPtr<topoSetSource> cellSelector_;
//- Set of selected cells
cellSet selectedCellSet_;
public:
// Constructors
//- Construct from explicit source name and mesh
timeActivatedExplicitCellSource
(
const word&,
const fvMesh&,
const dimensionSet&
);
// Member Functions
// Access
//- Return the "on" value
virtual scalar onValue() const;
//- Return the "off" value
virtual scalar offValue() const;
//- Return a tmp field of the source
virtual tmp<DimensionedField<scalar, volMesh> > Su();
//- Read properties dictionary
virtual bool read();
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -0,0 +1,87 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / 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
\*---------------------------------------------------------------------------*/
#include "pointSourceProperties.H"
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::pointSourceProperties::pointSourceProperties()
:
name_("unknownPointSourceName"),
timeStart_(0.0),
duration_(0.0),
location_(point::zero),
fieldData_()
{}
Foam::pointSourceProperties::pointSourceProperties(const dictionary& dict)
:
name_(dict.name().name()),
timeStart_(readScalar(dict.lookup("timeStart"))),
duration_(readScalar(dict.lookup("duration"))),
location_(dict.lookup("location")),
fieldData_(dict.lookup("fieldData"))
{}
Foam::pointSourceProperties::pointSourceProperties
(
const pointSourceProperties& psp
)
:
name_(psp.name_),
timeStart_(psp.timeStart_),
duration_(psp.duration_),
location_(psp.location_),
fieldData_(psp.fieldData_)
{}
// * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * //
void Foam::pointSourceProperties::operator=(const pointSourceProperties& rhs)
{
// Check for assignment to self
if (this == &rhs)
{
FatalErrorIn
(
"pointSourceProperties::operator=(const pointSourceProperties&)"
) << "Attempted assignment to self" << nl
<< abort(FatalError);
}
// Set updated values
name_ = rhs.name_;
timeStart_ = rhs.timeStart_;
duration_ = rhs.duration_;
location_ = rhs.location_;
fieldData_ = rhs.fieldData_;}
// ************************************************************************* //

View File

@ -0,0 +1,158 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / 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::pointSourceProperties
Description
Helper class to describe point source properties
SourceFiles
pointSourceProperties.C
\*---------------------------------------------------------------------------*/
#ifndef pointSourceProperties_H
#define pointSourceProperties_H
#include "IOdictionary.H"
#include "fvMesh.H"
#include "Time.H"
#include "Tuple2.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
/*---------------------------------------------------------------------------*\
Class pointSourceProperties Declaration
\*---------------------------------------------------------------------------*/
class pointSourceProperties
{
protected:
// Protected data
typedef Tuple2<word, scalar> fieldNameValuePair;
//- Source name
word name_;
//- Time start
scalar timeStart_;
//- Duration
scalar duration_;
//- Point location
point location_;
//- List of source field name vs value pairs
List<fieldNameValuePair> fieldData_;
public:
// Constructors
//- Construct null
pointSourceProperties();
//- Construct from dictionary
pointSourceProperties(const dictionary& dict);
//- Construct from Istream
pointSourceProperties(Istream& is);
//- Copy constructor
pointSourceProperties(const pointSourceProperties&);
// Member Functions
// Access
//- Return const access to the source name
inline const word& name() const;
//- Return const access to the time start
inline scalar timeStart() const;
//- Return const access to the time end
inline scalar timeEnd() const;
//- Return const access to the duration
inline scalar duration() const;
//- Return const access to the point location
inline const point& location() const;
//- Return const access to the source field name vs value pairs
inline const List<fieldNameValuePair>& fieldData() const;
// Edit
//- Return access to the source name
inline word& name();
//- Return access to the time start
inline scalar& timeStart();
//- Return access to the duration
inline scalar& duration();
//- Return access to the point location
inline point& location();
//- Return access to the source field name vs value pairs
inline List<fieldNameValuePair>& fieldData();
// Member Operators
void operator=(const pointSourceProperties&);
// IOstream operators
friend Istream& operator>>(Istream&, pointSourceProperties&);
friend Ostream& operator<<(Ostream&, const pointSourceProperties&);
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#include "pointSourcePropertiesI.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -0,0 +1,99 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / 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
\*---------------------------------------------------------------------------*/
#include "pointSourceProperties.H"
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
inline const Foam::word& Foam::pointSourceProperties::name() const
{
return name_;
}
inline Foam::scalar Foam::pointSourceProperties::timeStart() const
{
return timeStart_;
}
inline Foam::scalar Foam::pointSourceProperties::timeEnd() const
{
return timeStart_ + duration_;
}
inline Foam::scalar Foam::pointSourceProperties::duration() const
{
return duration_;
}
inline const Foam::point& Foam::pointSourceProperties::location() const
{
return location_;
}
inline const Foam::List<Foam::pointSourceProperties::fieldNameValuePair>&
Foam::pointSourceProperties::fieldData() const
{
return fieldData_;
}
inline Foam::word& Foam::pointSourceProperties::name()
{
return name_;
}
inline Foam::scalar& Foam::pointSourceProperties::timeStart()
{
return timeStart_;
}
inline Foam::scalar& Foam::pointSourceProperties::duration()
{
return duration_;
}
inline Foam::point& Foam::pointSourceProperties::location()
{
return location_;
}
inline Foam::List<Foam::pointSourceProperties::fieldNameValuePair>&
Foam::pointSourceProperties::fieldData()
{
return fieldData_;
}
// ************************************************************************* //

View File

@ -0,0 +1,88 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / 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
\*---------------------------------------------------------------------------*/
#include "pointSourceProperties.H"
#include "dictionaryEntry.H"
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::pointSourceProperties::pointSourceProperties(Istream& is)
:
name_("unknownPointSourceName"),
timeStart_(0.0),
duration_(0.0),
location_(point::zero),
fieldData_()
{
is.check("pointSourceProperties(Istream&)");
const dictionaryEntry entry(dictionary::null, is);
name_ = entry.keyword();
entry.lookup("timeStart") >> timeStart_;
entry.lookup("duration") >> duration_;
entry.lookup("location") >> location_;
entry.lookup("fieldData") >> fieldData_;
}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
Foam::Istream& Foam::operator>>(Istream& is, pointSourceProperties& psp)
{
is.check("Istream& operator>>(Istream&, pointSourceProperties&)");
const dictionaryEntry entry(dictionary::null, is);
psp.name_ = entry.keyword();
entry.lookup("timeStart") >> psp.timeStart_;
entry.lookup("duration") >> psp.duration_;
entry.lookup("location") >> psp.location_;
entry.lookup("fieldData") >> psp.fieldData_;
return is;
}
Foam::Ostream& Foam::operator<<(Ostream& os, const pointSourceProperties& psp)
{
os.check("Ostream& operator<<(Ostream&, const pointSourceProperties&)");
os << psp.name_ << nl << token::BEGIN_BLOCK << nl;
os.writeKeyword("timeStart") << psp.timeStart_ << token::END_STATEMENT << nl;
os.writeKeyword("duration") << psp.duration_ << token::END_STATEMENT << nl;
os.writeKeyword("location") << psp.location_ << token::END_STATEMENT << nl;
os.writeKeyword("fieldData") << psp.fieldData_ << token::END_STATEMENT << nl;
os << token::END_BLOCK << nl;
os.check("Ostream& operator<<(Ostream&, const pointSourceProperties&)");
return os;
}
// ************************************************************************* //

View File

@ -0,0 +1,292 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / 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
\*---------------------------------------------------------------------------*/
#include "timeActivatedExplicitMulticomponentPointSource.H"
#include "volFields.H"
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
Foam::label
Foam::timeActivatedExplicitMulticomponentPointSource::carrierFieldId
(
const word& fieldName
)
{
forAll(carrierFields_, fieldI)
{
if (carrierFields_[fieldI].name() == fieldName)
{
return fieldI;
}
}
return -1;
}
void Foam::timeActivatedExplicitMulticomponentPointSource::updateAddressing()
{
forAll(pointSources_, sourceI)
{
const pointSourceProperties& psp = pointSources_[sourceI];
bool foundCell = false;
label cid = mesh_.findCell(psp.location());
if (cid >= 0)
{
foundCell = mesh_.pointInCell(psp.location(), cid);
}
reduce(foundCell, orOp<bool>());
if (!foundCell)
{
label cid = mesh_.findNearestCell(psp.location());
if (cid >= 0)
{
foundCell = mesh_.pointInCell(psp.location(), cid);
}
}
reduce(foundCell, orOp<bool>());
if (!foundCell)
{
FatalErrorIn
(
"timeActivatedExplicitMulticomponentPointSource::"
"updateAddressing()"
) << "Unable to find location " << psp.location() << " in mesh "
<< "for source " << psp.name() << nl
<< exit(FatalError);
}
else
{
cellOwners_[sourceI] = cid;
}
fieldIds_[sourceI].setSize(psp.fieldData().size());
forAll(psp.fieldData(), fieldI)
{
const word& fieldName = psp.fieldData()[fieldI].first();
label cfid = carrierFieldId(fieldName);
if (cfid < 0)
{
FatalErrorIn
(
"timeActivatedExplicitMulticomponentPointSource::"
"updateAddressing()"
) << "Unable to find field " << fieldName << " in carrier "
<< "fields for source " << psp.name() << nl
<< exit(FatalError);
}
else
{
fieldIds_[sourceI][fieldI] = cfid;
}
}
}
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::timeActivatedExplicitMulticomponentPointSource::
timeActivatedExplicitMulticomponentPointSource
(
const word& name,
const fvMesh& mesh,
const PtrList<volScalarField>& carrierFields,
const dimensionSet& dims
)
:
IOdictionary
(
IOobject
(
name + "Properties",
mesh.time().constant(),
mesh,
IOobject::MUST_READ,
IOobject::NO_WRITE
)
),
name_(name),
mesh_(mesh),
runTime_(mesh.time()),
dimensions_(dims),
carrierFields_(carrierFields),
active_(lookup("active")),
pointSources_(lookup("pointSources")),
cellOwners_(pointSources_.size()),
fieldIds_(pointSources_.size())
{
// Initialise the field addressing
updateAddressing();
}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
Foam::tmp<Foam::DimensionedField<Foam::scalar, Foam::volMesh> >
Foam::timeActivatedExplicitMulticomponentPointSource::Su
(
const label fieldI
)
{
if (mesh_.changing())
{
updateAddressing();
}
tmp<DimensionedField<scalar, volMesh> > tSource
(
new DimensionedField<scalar, volMesh>
(
IOobject
(
name_ + carrierFields_[fieldI].name() + "Su",
runTime_.timeName(),
mesh_,
IOobject::NO_READ,
IOobject::NO_WRITE
),
mesh_,
dimensionedScalar("zero", dimensions_, 0.0)
)
);
if (active_)
{
DimensionedField<scalar, volMesh>& sourceField = tSource();
const scalarField& V = mesh_.V();
const scalar dt = runTime_.deltaT().value();
forAll(pointSources_, sourceI)
{
const pointSourceProperties& psp = pointSources_[sourceI];
forAll(fieldIds_[sourceI], i)
{
if
(
fieldIds_[sourceI][i] == fieldI
&& (runTime_.time().value() >= psp.timeStart())
&& (runTime_.time().value() <= psp.timeEnd())
)
{
const label cid = cellOwners_[sourceI];
if (cid >= 0)
{
sourceField[cid] +=
dt*psp.fieldData()[i].second()/V[cid];
}
}
}
}
}
return tSource;
}
Foam::tmp<Foam::DimensionedField<Foam::scalar, Foam::volMesh> >
Foam::timeActivatedExplicitMulticomponentPointSource::Su()
{
if (mesh_.changing())
{
updateAddressing();
}
tmp<DimensionedField<scalar, volMesh> > tSource
(
new DimensionedField<scalar, volMesh>
(
IOobject
(
name_ + "TotalSu",
runTime_.timeName(),
mesh_,
IOobject::NO_READ,
IOobject::NO_WRITE
),
mesh_,
dimensionedScalar("zero", dimensions_, 0.0)
)
);
if (active_)
{
DimensionedField<scalar, volMesh>& sourceField = tSource();
const scalarField& V = mesh_.V();
const scalar dt = runTime_.deltaT().value();
forAll(pointSources_, sourceI)
{
const pointSourceProperties& psp = pointSources_[sourceI];
forAll(fieldIds_[sourceI], i)
{
if
(
(runTime_.time().value() >= psp.timeStart())
&& (runTime_.time().value() <= psp.timeEnd())
)
{
const label cid = cellOwners_[sourceI];
if (cid >= 0)
{
sourceField[cid] +=
dt*psp.fieldData()[i].second()/V[cid];
}
}
}
}
}
return tSource;
}
bool Foam::timeActivatedExplicitMulticomponentPointSource::read()
{
if (regIOobject::read())
{
lookup("active") >> active_;
lookup("pointSources") >> pointSources_;
cellOwners_.setSize(pointSources_.size());
updateAddressing();
return true;
}
else
{
return false;
}
}
// ************************************************************************* //

View File

@ -0,0 +1,185 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / 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::timeActivatedExplicitMulticomponentPointSourceNew
Description
Provides a mechanism to introduce point sources to a set of carrier fields.
Carrier fields are supplied on consruction, and interrogated to provide the
field indices of the sources.
Source values are assumed to be in <quantity>/s, and divided through by the
cell volumes before being returned, e.g. for a kg/s source
Properties are described in a <name>Properties dictionary
active true; // are sources active (true/false)
pointSources
(
source1 // source name
{
timeStart 0.0;
duration 1.0;
location (0 0 0);
fieldData
(
(H2O 0.1) // kg/s
(O2 0.05) // kg/s
);
}
source2 // source name
{
timeStart 0.5;
duration 2.0;
location (1 1 1);
fieldData
(
(NO 0.1) // kg/s
(CO2 0.05) // kg/s
(H2 0.001) // kg/s
);
}
);
SourceFiles
timeActivatedExplicitMulticomponentPointSourceNew.C
\*---------------------------------------------------------------------------*/
#ifndef timeActivatedExplicitMulticomponentPointSource_H
#define timeActivatedExplicitMulticomponentPointSource_H
#include "IOdictionary.H"
#include "fvMesh.H"
#include "Time.H"
#include "pointSourceProperties.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
/*---------------------------------------------------------------------------*\
Class timeActivatedExplicitMulitcomponentPointSource Declaration
\*---------------------------------------------------------------------------*/
class timeActivatedExplicitMulticomponentPointSource
:
public IOdictionary
{
protected:
// Protected data
//- Name of the source
word name_;
//- Reference to the mesh
const fvMesh& mesh_;
//- Reference to time database
const Time& runTime_;
//- Source dimensions
const dimensionSet& dimensions_;
//- Reference to the multicomponent carrier fields
const PtrList<volScalarField>& carrierFields_;
//- Active flag
bool active_;
//- List of point source properties
List<pointSourceProperties> pointSources_;
//- List of cell owners for point source locations
List<label> cellOwners_;
//- List of field ids for each source
List<labelList> fieldIds_;
// Protected Member Functions
//- Return the id of field given its name
label carrierFieldId(const word& fieldName);
//- Update the addressing between source and carrier fields
void updateAddressing();
//- Disallow default bitwise copy construct
timeActivatedExplicitMulticomponentPointSource
(
const timeActivatedExplicitMulticomponentPointSource&
);
//- Disallow default bitwise assignment
void operator=(const timeActivatedExplicitMulticomponentPointSource&);
public:
// Constructors
//- Construct from components
timeActivatedExplicitMulticomponentPointSource
(
const word&,
const fvMesh&,
const PtrList<volScalarField>&,
const dimensionSet&
);
// Member Functions
// Access
//- Return a tmp field of the source for field fieldI
virtual tmp<DimensionedField<scalar, volMesh> > Su
(
const label fieldI
);
//- Return a tmp field of the total source
virtual tmp<DimensionedField<scalar, volMesh> > Su();
//- Read properties dictionary
virtual bool read();
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -44,33 +44,11 @@ const Foam::NamedEnum<Foam::timeActivatedExplicitSource::volumeType, 2>
Foam::timeActivatedExplicitSource::volumeTypeNames_;
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
void Foam::timeActivatedExplicitSource::updateCellSet()
{
cellSelector_->applyToSet(topoSetSource::NEW, selectedCellSet_);
Info<< " " << sourceName_ << ": selected "
<< returnReduce(selectedCellSet_.size(), sumOp<label>())
<< " cells" << nl << endl;
V_ = scalarField(selectedCellSet_.size(), 1.0);
if (volumeType_ == vtAbsolute)
{
label i = 0;
forAllConstIter(cellSet, selectedCellSet_, iter)
{
V_[i++] = mesh_.V()[iter.key()];
}
}
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::timeActivatedExplicitSource::timeActivatedExplicitSource
(
const word& sourceName,
const word& name,
const fvMesh& mesh,
const dimensionSet& dims
)
@ -79,51 +57,63 @@ Foam::timeActivatedExplicitSource::timeActivatedExplicitSource
(
IOobject
(
sourceName + "Properties",
name + "Properties",
mesh.time().constant(),
mesh,
IOobject::MUST_READ,
IOobject::NO_WRITE
)
),
sourceName_(sourceName),
mesh_(mesh),
runTime_(mesh.time()),
name_(name),
active_(lookup("active")),
dimensions_(dims),
volumeType_(volumeTypeNames_.read(lookup("volumeType"))),
timeStart_(readScalar(lookup("timeStart"))),
duration_(readScalar(lookup("duration"))),
onValue_(readScalar(lookup("onValue"))),
offValue_(readScalar(lookup("offValue"))),
currentValue_(0.0),
V_(0),
cellSource_(lookup("cellSource")),
cellSelector_
(
topoSetSource::New
(
cellSource_,
mesh,
subDict(cellSource_ + "Coeffs")
)
),
selectedCellSet_
(
mesh,
sourceName + "SourceCellSet",
mesh.nCells()/10 + 1 // Reasonable size estimate.
)
{
// Create the cell set
updateCellSet();
// Initialise the value
update();
}
duration_(readScalar(lookup("duration")))
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
const Foam::fvMesh& Foam::timeActivatedExplicitSource::mesh() const
{
return mesh_;
}
const Foam::Time& Foam::timeActivatedExplicitSource::runTime() const
{
return runTime_;
}
const Foam::word& Foam::timeActivatedExplicitSource::name() const
{
return name_;
}
const Foam::Switch& Foam::timeActivatedExplicitSource::active() const
{
return active_;
}
const Foam::dimensionSet& Foam::timeActivatedExplicitSource::dimensions() const
{
return dimensions_;
}
const Foam::timeActivatedExplicitSource::volumeType&
Foam::timeActivatedExplicitSource::volume() const
{
return volumeType_;
}
Foam::scalar Foam::timeActivatedExplicitSource::timeStart() const
{
return timeStart_;
@ -136,70 +126,22 @@ Foam::scalar Foam::timeActivatedExplicitSource::duration() const
}
const Foam::dimensionedScalar
Foam::timeActivatedExplicitSource::currentValue() const
{
return dimensionedScalar
(
sourceName_,
dimensions_,
currentValue_
);
}
Foam::tmp<Foam::DimensionedField<Foam::scalar, Foam::volMesh> >
Foam::timeActivatedExplicitSource::Su() const
{
tmp<DimensionedField<scalar, volMesh> > tSource
(
new DimensionedField<scalar, volMesh>
(
IOobject
(
sourceName_ + "Su",
runTime_.timeName(),
mesh_,
IOobject::NO_READ,
IOobject::NO_WRITE
),
mesh_,
dimensionedScalar("zero", dimensions_, 0.0)
)
);
DimensionedField<scalar, volMesh>& sourceField = tSource();
label i = 0;
forAllConstIter(cellSet, selectedCellSet_, iter)
{
sourceField[iter.key()] = currentValue_/V_[i++];
}
return tSource;
}
bool Foam::timeActivatedExplicitSource::read()
{
if (regIOobject::read())
{
volumeType_ = volumeTypeNames_.read(lookup("volumeType"));
lookup("timeStart") >> duration_;
lookup("duration") >> duration_;
lookup("onValue") >> onValue_;
lookup("offValue") >> offValue_;
lookup("cellSource") >> cellSource_;
cellSelector_ =
topoSetSource::New
(
cellSource_,
mesh_,
subDict(cellSource_ + "Coeffs")
);
updateCellSet();
return true;
lookup("active") >> active_;
if (active_)
{
volumeType_ = volumeTypeNames_.read(lookup("volumeType"));
lookup("timeStart") >> duration_;
lookup("duration") >> duration_;
return true;
}
else
{
return false;
}
}
else
{
@ -208,28 +150,6 @@ bool Foam::timeActivatedExplicitSource::read()
}
void Foam::timeActivatedExplicitSource::update()
{
// Set the source value
if
(
(runTime_.time().value() >= timeStart_)
&& (runTime_.time().value() <= timeStart_ + duration_)
)
{
currentValue_ = onValue_;
}
else
{
currentValue_ = offValue_;
}
// Update the cell set if the mesh is changing
if (mesh_.changing())
{
updateCellSet();
}
}
// ************************************************************************* //

View File

@ -23,15 +23,20 @@ License
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Class
Foam::timeActivatedExplicitSourceNew
Foam::timeActivatedExplicitSource
Description
Creates a cell set source that is activated at a given time, and remains
active for a specified duration. The source value is either in specific
(XX/m3) or absolute (XX) units.
Base class for field sources. Provides:
- name
- references to mesh and time
- dimensions
- volume type
- startTime
- duration
- read (from <sourceName>Properties dictionary)
SourceFiles
timeActivatedExplicitSourceNew.C
timeActivatedExplicitSource.C
\*---------------------------------------------------------------------------*/
@ -40,8 +45,6 @@ SourceFiles
#include "IOdictionary.H"
#include "autoPtr.H"
#include "topoSetSource.H"
#include "cellSet.H"
#include "fvMesh.H"
#include "Time.H"
#include "NamedEnum.H"
@ -72,19 +75,19 @@ public:
private:
// Private member functions
// Private Member Functions
//- Update the cell set that the source is acting on
void updateCellSet();
//- Disallow default bitwise copy construct
timeActivatedExplicitSource(const timeActivatedExplicitSource&);
//- Disallow default bitwise assignment
void operator=(const timeActivatedExplicitSource&);
protected:
// Protected data
//- Name of the source
word sourceName_;
//- Reference to the mesh
const fvMesh& mesh_;
@ -94,6 +97,12 @@ protected:
// Source properties
//- Name of the source
word name_;
//- Active flag
Switch active_;
//- Dimensions
const dimensionSet dimensions_;
@ -106,39 +115,6 @@ protected:
//- Duration [s]
scalar duration_;
//- Value when "on"
scalar onValue_;
//- Value when "off"
scalar offValue_;
//- Current source value
scalar currentValue_;
// Cell set
//- Cell volumes
scalarList V_;
//- Name of cell source (XXXToCell)
word cellSource_;
//- Method by which the cells will be selected
autoPtr<topoSetSource> cellSelector_;
//- Set of selected cells
cellSet selectedCellSet_;
// Protected Member Functions
//- Disallow default bitwise copy construct
timeActivatedExplicitSource(const timeActivatedExplicitSource&);
//- Disallow default bitwise assignment
void operator=(const timeActivatedExplicitSource&);
public:
@ -157,24 +133,33 @@ public:
// Access
//- Return the reference to the mesh
virtual const fvMesh& mesh() const;
//- Return the reference to the time database
virtual const Time& runTime() const;
//- Return the source name
virtual const word& name() const;
//- Return the active flag
virtual const Switch& active() const;
//- Return the dimensions
virtual const dimensionSet& dimensions() const;
//- Return the volume type
virtual const volumeType& volume() const;
//- Return the start time
scalar timeStart() const;
virtual scalar timeStart() const;
//- Return the duration
scalar duration() const;
//- Return the current value of the source
const dimensionedScalar currentValue() const;
//- Return a tmp field of the source
virtual tmp<DimensionedField<scalar, volMesh> > Su() const;
virtual scalar duration() const;
//- Read properties dictionary
virtual bool read();
//- Update
virtual void update();
};

View File

@ -79,6 +79,8 @@ Foam::porousZone::porousZone
D_("D", dimensionSet(0, -2, 0, 0, 0), tensor::zero),
F_("F", dimensionSet(0, -1, 0, 0, 0), tensor::zero)
{
Info<< "Creating porous zone: " << name_ << endl;
if (cellZoneID_ == -1 && !Pstream::parRun())
{
FatalErrorIn

View File

@ -21,7 +21,7 @@ License
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
\*---------------------------------------------------------------------------*/
#include "gaussLaplacianScheme.H"

View File

@ -45,7 +45,7 @@ Foam::labelList Foam::Particle<ParticleType>::findFaces
const labelList& faces = mesh.cells()[celli_];
const vector& C = mesh.cellCentres()[celli_];
labelList faceList(0);
DynamicList<label> faceList(10);
forAll(faces, i)
{
label facei = faces[i];
@ -53,12 +53,12 @@ Foam::labelList Foam::Particle<ParticleType>::findFaces
if ((lam > 0) && (lam < 1.0))
{
label n = faceList.size();
faceList.setSize(n+1);
faceList[n] = facei;
faceList.append(facei);
}
}
faceList.shrink();
return faceList;
}
@ -75,7 +75,7 @@ Foam::labelList Foam::Particle<ParticleType>::findFaces
const labelList& faces = mesh.cells()[celli];
const vector& C = mesh.cellCentres()[celli];
labelList faceList(0);
DynamicList<label> faceList(10);
forAll(faces, i)
{
label facei = faces[i];
@ -83,12 +83,12 @@ Foam::labelList Foam::Particle<ParticleType>::findFaces
if ((lam > 0) && (lam < 1.0))
{
label n = faceList.size();
faceList.setSize(n+1);
faceList[n] = facei;
faceList.append(facei);
}
}
faceList.shrink();
return faceList;
}
@ -186,6 +186,17 @@ Foam::Particle<ParticleType>::Particle
{}
template<class ParticleType>
Foam::Particle<ParticleType>::Particle(const Particle<ParticleType>& p)
:
cloud_(p.cloud_),
position_(p.position_),
celli_(p.celli_),
facei_(p.facei_),
stepFraction_(p.stepFraction_)
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template<class ParticleType>
@ -328,56 +339,47 @@ Foam::scalar Foam::Particle<ParticleType>::trackToFace
label patchi = patch(facei_);
const polyPatch& patch = mesh.boundaryMesh()[patchi];
if (isA<wedgePolyPatch>(patch))
if (!p.hitPatch(patch, td, patchi))
{
p.hitWedgePatch
(
static_cast<const wedgePolyPatch&>(patch), td
);
}
else if (isA<symmetryPolyPatch>(patch))
{
p.hitSymmetryPatch
(
static_cast<const symmetryPolyPatch&>(patch), td
);
}
else if (isA<cyclicPolyPatch>(patch))
{
p.hitCyclicPatch
(
static_cast<const cyclicPolyPatch&>(patch), td
);
}
else if (isA<processorPolyPatch>(patch))
{
p.hitProcessorPatch
(
static_cast<const processorPolyPatch&>(patch), td
);
}
else if (isA<wallPolyPatch>(patch))
{
p.hitWallPatch
(
static_cast<const wallPolyPatch&>(patch), td
);
}
else if (isA<polyPatch>(patch))
{
p.hitPatch
(
static_cast<const polyPatch&>(patch), td
);
}
else
{
FatalErrorIn
(
"Particle::trackToFace"
"(const vector& endPosition, scalar& trackFraction)"
)<< "patch type " << patch.type() << " not suported" << nl
<< abort(FatalError);
if (isA<wedgePolyPatch>(patch))
{
p.hitWedgePatch
(
static_cast<const wedgePolyPatch&>(patch), td
);
}
else if (isA<symmetryPolyPatch>(patch))
{
p.hitSymmetryPatch
(
static_cast<const symmetryPolyPatch&>(patch), td
);
}
else if (isA<cyclicPolyPatch>(patch))
{
p.hitCyclicPatch
(
static_cast<const cyclicPolyPatch&>(patch), td
);
}
else if (isA<processorPolyPatch>(patch))
{
p.hitProcessorPatch
(
static_cast<const processorPolyPatch&>(patch), td
);
}
else if (isA<wallPolyPatch>(patch))
{
p.hitWallPatch
(
static_cast<const wallPolyPatch&>(patch), td
);
}
else
{
p.hitPatch(patch, td);
}
}
}
}
@ -423,6 +425,19 @@ void Foam::Particle<ParticleType>::transformProperties(const vector&)
{}
template<class ParticleType>
template<class TrackData>
bool Foam::Particle<ParticleType>::hitPatch
(
const polyPatch&,
TrackData&,
const label
)
{
return false;
}
template<class ParticleType>
template<class TrackData>
void Foam::Particle<ParticleType>::hitWedgePatch

View File

@ -98,10 +98,7 @@ public:
// Constructors
inline trackData
(
Cloud<ParticleType>& cloud
);
inline trackData(Cloud<ParticleType>& cloud);
// Member functions
@ -171,6 +168,16 @@ protected:
// Patch interactions
//- Overridable function to handle the particle hitting a patch
// Executed before other patch-hitting functions
template<class TrackData>
bool hitPatch
(
const polyPatch&,
TrackData& td,
const label patchI
);
//- Overridable function to handle the particle hitting a wedgePatch
template<class TrackData>
void hitWedgePatch
@ -256,8 +263,13 @@ public:
friend class Cloud<ParticleType>;
//- Runtime type information
TypeName("Particle");
// Static data members
//- String representation of properties
static string propHeader;
//- Runtime type information
TypeName("Particle");
// Constructors
@ -278,14 +290,24 @@ public:
bool readFields = true
);
//- Construct as a copy
Particle(const Particle& p);
//- Construct a clone
autoPtr<ParticleType> clone() const
{
return autoPtr<Particle>(new Particle(*this));
}
//- Factory class to read-construct particles used for
// parallel transfer
class iNew
{
// Private data
const Cloud<ParticleType>& cloud_;
//- Reference to the cloud
const Cloud<ParticleType>& cloud_;
public:
@ -303,9 +325,8 @@ public:
//- Destructor
virtual ~Particle()
{}
virtual ~Particle()
{}
// Member Functions
@ -344,6 +365,9 @@ public:
//- Return the impact model to be used, soft or hard (default).
inline bool softImpact() const;
//- Return the particle current time
inline scalar currentTime() const;
// Check
@ -414,10 +438,7 @@ public:
// I-O
//- Write the fields associated with the owner cloud
static void writeFields
(
const Cloud<ParticleType>& c
);
static void writeFields(const Cloud<ParticleType>& c);
// Ostream Operator

View File

@ -345,6 +345,15 @@ inline bool Particle<ParticleType>::softImpact() const
}
template<class ParticleType>
inline scalar Particle<ParticleType>::currentTime() const
{
return
cloud_.pMesh().time().value()
+ stepFraction_*cloud_.pMesh().time().deltaT().value();
}
template<class ParticleType>
inline label Particle<ParticleType>::patch(const label facei) const
{

View File

@ -28,6 +28,12 @@ License
#include "IOstreams.H"
#include "IOPosition.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
template<class ParticleType>
Foam::string Foam::Particle<ParticleType>::propHeader = "(Px Py Pz) cellI";
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
// Construct from Istream

View File

@ -0,0 +1,72 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / 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
\*---------------------------------------------------------------------------*/
#include "ParticleTrackingData.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
template<class ParcelType>
Foam::label Foam::ParticleTrackingData<ParcelType>::PARTICLE_COUNT = 0;
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
template<class ParcelType>
Foam::ParticleTrackingData<ParcelType>::ParticleTrackingData
(
const Cloud<ParcelType>& cloud
)
:
cloud_(cloud),
origProc_(Pstream::myProcNo()),
id_(PARTICLE_COUNT++)
{}
template<class ParcelType>
Foam::ParticleTrackingData<ParcelType>::ParticleTrackingData
(
const ParticleTrackingData& ptd
)
:
cloud_(ptd.cloud_),
origProc_(ptd.origProc_),
id_(ptd.id_)
{}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
template<class ParcelType>
Foam::ParticleTrackingData<ParcelType>::~ParticleTrackingData()
{}
// * * * * * * * * * * * * * * IOStream operators * * * * * * * * * * * * * //
#include "ParticleTrackingDataIO.C"
// ************************************************************************* //

View File

@ -0,0 +1,166 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / 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::ParticleTrackingData
Description
Class to provide additional properties to allow construction of
particle tracks
SourceFiles
ParticleTrackingData.C
ParticleTrackingDataIO.C
\*---------------------------------------------------------------------------*/
#ifndef ParticleTrackingData_H
#define ParticleTrackingData_H
#include "Cloud.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// Forward declaration of classes and friend functions
template<class ParcelType>
class ParticleTrackingData;
template<class ParcelType>
Ostream& operator<<
(
Ostream&,
const ParticleTrackingData<ParcelType>&
);
/*---------------------------------------------------------------------------*\
Class ParticleTrackingData Declaration
\*---------------------------------------------------------------------------*/
template<class ParcelType>
class ParticleTrackingData
{
// Private data
//- Reference to the cloud
const Cloud<ParcelType>& cloud_;
//- Originating processor id
label origProc_;
//- Local particle id
label id_;
//- Cumulative particle count used for particle id
static label PARTICLE_COUNT;
// Private member functions
//- Write properties - particle count
static void writeProperties(const Cloud<ParcelType>& cloud);
//- Read properties - particle count
static void readProperties(const Cloud<ParcelType>& cloud);
public:
// Constructors
//- Construct from cloud
ParticleTrackingData(const Cloud<ParcelType>& cloud);
//- Construct copy
ParticleTrackingData(const ParticleTrackingData& ptd);
//- Construct from Istream and mesh
ParticleTrackingData
(
const Cloud<ParcelType>& cloud,
Istream& is,
bool readFields
);
//- Destructor
~ParticleTrackingData();
// Member functions
// Access
//- Return const access to the cloud
inline const Cloud<ParcelType>& cloud() const;
//- Return const access to the originating processor id
inline label origProc() const;
//- Return const access to the local particle id
inline label id() const;
// I-O
//- Read fields
static void readFields(Cloud<ParcelType>& c);
//- Write fields
static void writeFields(const Cloud<ParcelType>& c);
// Ostream Operator
friend Ostream& operator<< <ParcelType>
(
Ostream&,
const ParticleTrackingData<ParcelType>&
);
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#include "ParticleTrackingDataI.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#ifdef NoRepository
# include "ParticleTrackingData.C"
#endif
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -0,0 +1,49 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / 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
\*---------------------------------------------------------------------------*/
template<class ParcelType>
inline const Foam::Cloud<ParcelType>&
Foam::ParticleTrackingData<ParcelType>::cloud() const
{
return cloud_;
}
template<class ParcelType>
inline Foam::label Foam::ParticleTrackingData<ParcelType>::origProc() const
{
return origProc_;
}
template<class ParcelType>
inline Foam::label Foam::ParticleTrackingData<ParcelType>::id() const
{
return id_;
}
// ************************************************************************* //

View File

@ -0,0 +1,233 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / 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
\*---------------------------------------------------------------------------*/
#include "ParticleTrackingData.H"
// * * * * * * * * * * * Private Member Functions * * * * * * * * * * * * * //
template<class ParcelType>
void Foam::ParticleTrackingData<ParcelType>::readProperties
(
const Cloud<ParcelType>& cloud
)
{
IOobject propsDictHeader
(
"particleTrackingProperties",
cloud.db().time().timeName(),
"uniform/Lagrangian"/cloud.name(),
cloud.db(),
IOobject::MUST_READ,
IOobject::NO_WRITE,
false
);
if (propsDictHeader.headerOk())
{
const IOdictionary propsDict(propsDictHeader);
word procName("processor" + name(Pstream::myProcNo()));
if (propsDict.found(procName))
{
propsDict.subDict(procName).lookup("particleCount") >>
PARTICLE_COUNT;
}
}
}
template<class ParcelType>
void Foam::ParticleTrackingData<ParcelType>::writeProperties
(
const Cloud<ParcelType>& cloud
)
{
if (cloud.db().time().outputTime())
{
IOdictionary propsDict
(
IOobject
(
"particleTrackingProperties",
cloud.db().time().timeName(),
"uniform/Lagrangian"/cloud.name(),
cloud.db(),
IOobject::NO_READ,
IOobject::NO_WRITE,
false
)
);
word procName("processor" + name(Pstream::myProcNo()));
propsDict.add(procName, dictionary());
propsDict.subDict(procName).add("particleCount", PARTICLE_COUNT);
propsDict.regIOobject::write();
}
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
template<class ParcelType>
Foam::ParticleTrackingData<ParcelType>::ParticleTrackingData
(
const Cloud<ParcelType>& cloud,
Istream& is,
bool readFields
)
:
cloud_(cloud),
origProc_(-1),
id_(-1)
{
if (readFields)
{
if (is.format() == IOstream::ASCII)
{
is >> origProc_ >> id_;
}
else
{
is.read
(
reinterpret_cast<char*>(&origProc_),
sizeof(origProc_) + sizeof(id_)
);
}
}
// Check state of Istream
is.check
(
"ParticleTrackingData<ParcelType>::ParticleTrackingData"
"("
"Istream&, "
"bool"
")"
);
}
template<class ParcelType>
void Foam::ParticleTrackingData<ParcelType>::readFields
(
Cloud<ParcelType>& c
)
{
if (!c.size())
{
return;
}
readProperties(c);
IOField<label> origProc(c.fieldIOobject("origProc", IOobject::MUST_READ));
c.checkFieldIOobject(c, origProc);
IOField<label> id(c.fieldIOobject("id", IOobject::MUST_READ));
c.checkFieldIOobject(c, id);
label i = 0;
forAllIter(typename Cloud<ParcelType>, c, iter)
{
ParcelType& p = iter();
p.origProc_ = origProc[i];
p.id_ = id[i];
i++;
}
}
template<class ParcelType>
void Foam::ParticleTrackingData<ParcelType>::writeFields
(
const Cloud<ParcelType>& c
)
{
writeProperties(c);
const label np = c.size();
IOField<label> origProc
(
c.fieldIOobject("origProc", IOobject::NO_READ),
np
);
IOField<label> id(c.fieldIOobject("id", IOobject::NO_READ), np);
label i = 0;
forAllConstIter(typename Cloud<ParcelType>, c, iter)
{
const ParcelType& p = iter();
origProc[i] = p.origProc();
id[i] = p.id();
i++;
}
origProc.write();
id.write();
}
// * * * * * * * * * * * * * * * IOstream Operators * * * * * * * * * * * * //
template<class ParcelType>
Foam::Ostream& Foam::operator<<
(
Ostream& os,
const ParticleTrackingData<ParcelType>& p
)
{
if (os.format() == IOstream::ASCII)
{
os << p.origProc_ << token::SPACE << p.id_ << token::SPACE;
}
else
{
os.write
(
reinterpret_cast<const char*>(&p.origProc_),
sizeof(p.origProc_) + sizeof(p.id_)
);
}
// Check state of Ostream
os.check
(
"Ostream& operator<<"
"("
"Ostream&, "
"const ParticleTrackingData<ParcelType>&"
")"
);
return os;
}
// ************************************************************************* //

View File

@ -87,6 +87,12 @@ public:
Particle<indexedParticle>(c, is)
{}
//- Construct as a copy
indexedParticle(const indexedParticle& p)
:
Particle<indexedParticle>(p)
{}
//- Construct and return a clone
autoPtr<indexedParticle> clone() const
{

View File

@ -47,7 +47,7 @@ namespace Foam
{
/*---------------------------------------------------------------------------*\
Class passiveParticle Declaration
Class passiveParticle Declaration
\*---------------------------------------------------------------------------*/
class passiveParticle
@ -81,6 +81,12 @@ public:
Particle<passiveParticle>(c, is)
{}
//- Construct as copy
passiveParticle(const passiveParticle& p)
:
Particle<passiveParticle>(p)
{}
//- Construct and return a clone
autoPtr<passiveParticle> clone() const
{

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2007 OpenCFD Ltd.
\\ / A nd | Copyright (C) 2008-2007 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -24,53 +24,46 @@ License
\*---------------------------------------------------------------------------*/
#include "coalCloud.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
defineTypeNameAndDebug(coalCloud, 0);
};
#include "CoalCloud.H"
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::coalCloud::coalCloud
template<class ThermoType>
Foam::CoalCloud<ThermoType>::CoalCloud
(
const word& cloudType,
const word& cloudName,
const volScalarField& rho,
const volVectorField& U,
const dimensionedVector& g,
hCombustionThermo& thermo,
PtrList<specieReactingProperties>& gases
hCombustionThermo& thermo
)
:
ReactingMultiphaseCloud<coalParcel>
ReactingMultiphaseCloud<CoalParcel<ThermoType> >
(
cloudType,
cloudName,
rho,
U,
g,
thermo,
gases
thermo
)
{
coalParcel::readFields(*this);
CoalParcel<ThermoType>::readFields(*this);
}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::coalCloud::~coalCloud()
template<class ThermoType>
Foam::CoalCloud<ThermoType>::~CoalCloud()
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
void Foam::coalCloud::writeFields() const
template<class ThermoType>
void Foam::CoalCloud<ThermoType>::writeFields() const
{
coalParcel::writeFields(*this);
CoalParcel<ThermoType>::writeFields(*this);
}

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2007 OpenCFD Ltd.
\\ / A nd | Copyright (C) 2008-2007 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -23,20 +23,20 @@ License
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Class
coalCloud
CoalCloud
Description
SourceFiles
coalCloud.C
CoalCloud.C
\*---------------------------------------------------------------------------*/
#ifndef coalCloud_H
#define coalCloud_H
#ifndef CoalCloud_H
#define CoalCloud_H
#include "ReactingMultiphaseCloud.H"
#include "coalParcel.H"
#include "CoalParcel.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -44,44 +44,44 @@ namespace Foam
{
/*---------------------------------------------------------------------------*\
Class coalCloud Declaration
Class CoalCloud Declaration
\*---------------------------------------------------------------------------*/
class coalCloud
template<class ThermoType>
class CoalCloud
:
public ReactingMultiphaseCloud<coalParcel>
public ReactingMultiphaseCloud<CoalParcel<ThermoType> >
{
// Private Member Functions
//- Disallow default bitwise copy construct
coalCloud(const coalCloud&);
CoalCloud(const CoalCloud&);
//- Disallow default bitwise assignment
void operator=(const coalCloud&);
void operator=(const CoalCloud&);
public:
//-Runtime type information
TypeName("coalCloud");
TypeName("CoalCloud");
// Constructors
//- Construct given carrier gas fields
coalCloud
CoalCloud
(
const word& cloudType,
const word& cloudName,
const volScalarField& rho,
const volVectorField& U,
const dimensionedVector& g,
hCombustionThermo& thermo,
PtrList<specieReactingProperties>& gases
hCombustionThermo& thermo
);
//- Destructor
~coalCloud();
~CoalCloud();
// Member Functions
@ -97,6 +97,12 @@ public:
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#ifdef NoRepository
#include "CoalCloud.C"
#endif
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2007 OpenCFD Ltd.
\\ / A nd | Copyright (C) 2008-2009 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -24,24 +24,14 @@ License
\*---------------------------------------------------------------------------*/
#include "coalParcel.H"
#include "ReactingCloud.H"
#include "SingleMixtureFraction.H"
#include "createReactingCloudTypes.H"
#include "CoalCloud.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
makeCompositionModel(ReactingCloud<coalParcel>);
// Add instances of composition model to the table
makeCompositionModelType
(
SingleMixtureFraction,
ReactingCloud,
coalParcel
);
createReactingCloudType(CoalCloud);
};

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2007 OpenCFD Ltd.
\\ / A nd | Copyright (C) 2008-2007 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -24,25 +24,28 @@ License
\*---------------------------------------------------------------------------*/
#include "coalParcel.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
defineTypeNameAndDebug(coalParcel, 0);
defineParticleTypeNameAndDebug(coalParcel, 0);
defineParcelTypeNameAndDebug(coalParcel, 0);
};
#include "CoalParcel.H"
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::coalParcel::coalParcel
template<class ThermoType>
Foam::CoalParcel<ThermoType>::CoalParcel
(
ReactingMultiphaseCloud<coalParcel>& owner,
ReactingMultiphaseCloud<CoalParcel<ThermoType> >& owner,
const vector& position,
const label celli,
const label cellI
)
:
ReactingMultiphaseParcel<CoalParcel<ThermoType> >(owner, position, cellI)
{}
template<class ThermoType>
Foam::CoalParcel<ThermoType>::CoalParcel
(
ReactingMultiphaseCloud<CoalParcel<ThermoType> >& owner,
const vector& position,
const label cellI,
const label typeId,
const scalar nParticle0,
const scalar d0,
@ -51,14 +54,16 @@ Foam::coalParcel::coalParcel
const scalarField& YGas0,
const scalarField& YLiquid0,
const scalarField& YSolid0,
const constantProperties& constProps
const typename
ReactingMultiphaseParcel<CoalParcel<ThermoType> >::
constantProperties& constProps
)
:
ReactingMultiphaseParcel<coalParcel>
ReactingMultiphaseParcel<CoalParcel<ThermoType> >
(
owner,
position,
celli,
cellI,
typeId,
nParticle0,
d0,
@ -72,20 +77,22 @@ Foam::coalParcel::coalParcel
{}
Foam::coalParcel::coalParcel
template<class ThermoType>
Foam::CoalParcel<ThermoType>::CoalParcel
(
const Cloud<coalParcel>& cloud,
const Cloud<CoalParcel<ThermoType> >& cloud,
Istream& is,
bool readFields
)
:
ReactingMultiphaseParcel<coalParcel>(cloud, is, readFields)
ReactingMultiphaseParcel<CoalParcel<ThermoType> >(cloud, is, readFields)
{}
// * * * * * * * * * * * * * * * * Destructors * * * * * * * * * * * * * * //
Foam::coalParcel::~coalParcel()
template<class ThermoType>
Foam::CoalParcel<ThermoType>::~CoalParcel()
{}

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2007 OpenCFD Ltd.
\\ / A nd | Copyright (C) 2008-2007 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -23,19 +23,19 @@ License
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Class
coalParcel
CoalParcel
Description
SourceFiles
coalParcel.C
coalParcelIO.C
CoalParcel.C
CoalParcelIO.C
\*---------------------------------------------------------------------------*/
#ifndef coalParcel_H
#define coalParcel_H
#ifndef CoalParcel_H
#define CoalParcel_H
#include "ReactingMultiphaseParcel.H"
@ -44,27 +44,44 @@ SourceFiles
namespace Foam
{
// Forward declaration of classes
template<class ThermoType>
class CoalParcel;
/*---------------------------------------------------------------------------*\
Class coalParcel Declaration
Class CoalParcel Declaration
\*---------------------------------------------------------------------------*/
class coalParcel
template<class ThermoType>
class CoalParcel
:
public ReactingMultiphaseParcel<coalParcel>
public ReactingMultiphaseParcel<CoalParcel<ThermoType> >
{
public:
//- The type of thermodynamics this parcel was instantiated for
typedef ThermoType thermoType;
// Run-time type information
TypeName("coalParcel");
TypeName("CoalParcel");
// Constructors
//- Construct from components
coalParcel
//- Construct from owner, position, and cloud owner
// Other properties initialised as null
CoalParcel
(
ReactingMultiphaseCloud<coalParcel>& owner,
ReactingMultiphaseCloud<CoalParcel>& owner,
const vector& position,
const label celli,
const label cellI
);
//- Construct from components
CoalParcel
(
ReactingMultiphaseCloud<CoalParcel>& owner,
const vector& position,
const label cellI,
const label typeId,
const scalar nParticle0,
const scalar d0,
@ -73,42 +90,43 @@ public:
const scalarField& YGas0,
const scalarField& YLiquid0,
const scalarField& YSolid0,
const constantProperties& constProps
const typename
ReactingMultiphaseParcel<CoalParcel>::
constantProperties& constProps
);
//- Construct from Istream
coalParcel
CoalParcel
(
const Cloud<coalParcel>& c,
const Cloud<CoalParcel>& c,
Istream& is,
bool readFields = true
);
//- Construct and return a clone
autoPtr<coalParcel> clone() const
autoPtr<CoalParcel> clone() const
{
return autoPtr<coalParcel>(new coalParcel(*this));
return autoPtr<CoalParcel>(new CoalParcel(*this));
}
//- Destructor
virtual ~coalParcel();
virtual ~CoalParcel();
};
template<>
inline bool contiguous<coalParcel>()
{
return false; // Now have scalar lists/fields (mass fractions)
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#ifdef NoRepository
#include "CoalParcel.C"
#endif
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2007 OpenCFD Ltd.
\\ / A nd | Copyright (C) 2008-2007 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -24,21 +24,14 @@ License
\*---------------------------------------------------------------------------*/
#include "coalParcel.H"
#include "KinematicCloud.H"
#include "NoDrag.H"
#include "SphereDrag.H"
#include "createCoalParcelTypes.H"
#include "CoalParcel.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
makeDragModel(KinematicCloud<coalParcel>);
// Add instances of drag model to the table
makeDragModelType(NoDrag, KinematicCloud, coalParcel);
makeDragModelType(SphereDrag, KinematicCloud, coalParcel);
createCoalParcelType(CoalParcel);
};

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
\\ / A nd | Copyright (C) 2008-2009 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -24,44 +24,47 @@ License
\*---------------------------------------------------------------------------*/
#include "basicKinematicParcel.H"
#include "KinematicCloud.H"
#include "CoalParcel.H"
#include "NoDispersion.H"
#include "GradientDispersionRAS.H"
#include "StochasticDispersionRAS.H"
// Kinematic
#include "makeReactingParcelDispersionModels.H"
#include "makeReactingParcelDragModels.H"
#include "makeReactingMultiphaseParcelInjectionModels.H" // MP variant
#include "makeReactingParcelPatchInteractionModels.H"
#include "makeReactingParcelPostProcessingModels.H"
// Thermodynamic
#include "makeReactingParcelHeatTransferModels.H"
// Reacting
#include "makeReactingMultiphaseParcelCompositionModels.H" // MP variant
#include "makeReactingParcelPhaseChangeModels.H"
// Reacting multiphase
#include "makeReactingMultiphaseParcelDevolatilisationModels.H"
#include "makeCoalParcelSurfaceReactionModels.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
makeDispersionModel(KinematicCloud<basicKinematicParcel>);
// Kinematic sub-models
makeReactingDispersionModels(CoalParcel);
makeReactingDragModels(CoalParcel);
makeReactingMultiphaseInjectionModels(CoalParcel);
makeReactingPatchInteractionModels(CoalParcel);
makeReactingPostProcessingModels(CoalParcel);
defineNamedTemplateTypeNameAndDebug
(
DispersionRASModel<KinematicCloud<basicKinematicParcel> >,
0
);
// Thermo sub-models
makeReactingHeatTransferModels(CoalParcel);
// Add instances of dispersion model to the table
makeDispersionModelType
(
NoDispersion,
KinematicCloud,
basicKinematicParcel
);
makeDispersionModelType
(
GradientDispersionRAS,
KinematicCloud,
basicKinematicParcel
);
makeDispersionModelType
(
StochasticDispersionRAS,
KinematicCloud,
basicKinematicParcel
);
// Reacting sub-models
makeReactingMultiphaseCompositionModels(CoalParcel);
makeReactingPhaseChangeModels(CoalParcel);
// Reacting multiphase sub-models
makeReactingMultiphaseDevolatilisationModels(CoalParcel);
makeCoalSurfaceReactionModels(CoalParcel);
};

View File

@ -1,22 +1,8 @@
/* coal cloud */
coalCloud/coalCloud.C
/* coal parcel and sub-models */
coalParcel/coalParcel.C
coalParcel/defineCoalParcel.C
coalParcel/submodels/makeCoalParcelCompositionModels.C
coalParcel/submodels/makeCoalParcelDevolatilisationModels.C
coalParcel/submodels/makeCoalParcelDragModels.C
coalParcel/submodels/makeCoalParcelDispersionModels.C
coalParcel/submodels/makeCoalParcelInjectionModels.C
coalParcel/submodels/makeCoalParcelHeatTransferModels.C
coalParcel/submodels/makeCoalParcelPhaseChangeModels.C
coalParcel/submodels/makeCoalParcelSurfaceReactionModels.C
coalParcel/submodels/makeCoalParcelWallInteractionModels.C
submodels/surfaceReactionModel/COxidationDiffusionLimitedRate/COxidationDiffusionLimitedRate.C
submodels/surfaceReactionModel/COxidationKineticDiffusionLimitedRate/COxidationKineticDiffusionLimitedRate.C
submodels/surfaceReactionModel/COxidationMurphyShaddix/COxidationMurphyShaddix.C
/* Coal cloud */
CoalCloud/defineCoalCloud.C
/* Coal parcel and sub-models */
CoalParcel/defineCoalParcel.C
CoalParcel/makeCoalParcelSubmodels.C
LIB = $(FOAM_LIBBIN)/libcoalCombustion

View File

@ -1,50 +0,0 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2007 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
\*---------------------------------------------------------------------------*/
#include "coalParcel.H"
#include "ReactingMultiphaseCloud.H"
namespace Foam
{
defineTemplateTypeNameAndDebug(Cloud<coalParcel>, 0);
defineParcelTypeNameAndDebug(KinematicParcel<coalParcel>, 0);
// defineTemplateTypeNameAndDebug(KinematicParcel<coalParcel>, 0);
defineParcelTypeNameAndDebug(ThermoParcel<coalParcel>, 0);
defineTemplateTypeNameAndDebug(ThermoParcel<coalParcel>, 0);
defineParcelTypeNameAndDebug(ReactingParcel<coalParcel>, 0);
defineTemplateTypeNameAndDebug(ReactingParcel<coalParcel>, 0);
defineParcelTypeNameAndDebug(ReactingMultiphaseParcel<coalParcel>, 0);
defineTemplateTypeNameAndDebug(ReactingMultiphaseParcel<coalParcel>, 0);
defineParcelTypeNameAndDebug(KinematicCloud<coalParcel>, 0);
defineParcelTypeNameAndDebug(ThermoCloud<coalParcel>, 0);
defineParcelTypeNameAndDebug(ReactingCloud<coalParcel>, 0);
defineParcelTypeNameAndDebug(ReactingMultiphaseCloud<coalParcel>, 0);
};
// ************************************************************************* //

View File

@ -1,65 +0,0 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / 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
\*---------------------------------------------------------------------------*/
#include "coalParcel.H"
#include "ReactingMultiphaseCloud.H"
#include "NoDevolatilisation.H"
#include "ConstantRateDevolatilisation.H"
#include "SingleKineticRateDevolatilisation.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
makeDevolatilisationModel
(
ReactingMultiphaseCloud<coalParcel>
);
// Add instances of devolatilisation model to the table
makeDevolatilisationModelType
(
NoDevolatilisation,
ReactingMultiphaseCloud,
coalParcel
);
makeDevolatilisationModelType
(
ConstantRateDevolatilisation,
ReactingMultiphaseCloud,
coalParcel
);
makeDevolatilisationModelType
(
SingleKineticRateDevolatilisation,
ReactingMultiphaseCloud,
coalParcel
);
};
// ************************************************************************* //

View File

@ -1,58 +0,0 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / 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
\*---------------------------------------------------------------------------*/
#include "coalParcel.H"
#include "ReactingCloud.H"
#include "NoPhaseChange.H"
#include "LiquidEvaporation.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
makePhaseChangeModel
(
ReactingCloud<coalParcel>
);
// Add instances of phase change model to the table
makePhaseChangeModelType
(
NoPhaseChange,
ReactingCloud,
coalParcel
);
makePhaseChangeModelType
(
LiquidEvaporation,
ReactingCloud,
coalParcel
);
};
// ************************************************************************* //

View File

@ -1,69 +0,0 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2007 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
\*---------------------------------------------------------------------------*/
#include "coalParcel.H"
#include "ReactingMultiphaseCloud.H"
#include "NoSurfaceReaction.H"
#include "COxidationDiffusionLimitedRate.H"
#include "COxidationKineticDiffusionLimitedRate.H"
#include "COxidationMurphyShaddix.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
makeSurfaceReactionModel(ReactingMultiphaseCloud<coalParcel>);
// Add instances of surface reaction model to the table
makeSurfaceReactionModelType
(
NoSurfaceReaction,
ReactingMultiphaseCloud,
coalParcel
);
makeSurfaceReactionModelTypeInstance
(
COxidationDiffusionLimitedRate,
ReactingMultiphaseCloud,
coalParcel
);
makeSurfaceReactionModelTypeInstance
(
COxidationKineticDiffusionLimitedRate,
ReactingMultiphaseCloud,
coalParcel
);
makeSurfaceReactionModelTypeInstance
(
COxidationMurphyShaddix,
ReactingMultiphaseCloud,
coalParcel
);
};
// ************************************************************************* //

View File

@ -1,55 +0,0 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2007 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
\*---------------------------------------------------------------------------*/
#include "coalParcel.H"
#include "ReactingCloud.H"
#include "Rebound.H"
#include "StandardWallInteraction.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
makeWallInteractionModel(KinematicCloud<coalParcel>);
// Add instances of wall interaction model to the table
makeWallInteractionModelType
(
Rebound,
KinematicCloud,
coalParcel
);
makeWallInteractionModelType
(
StandardWallInteraction,
KinematicCloud,
coalParcel
);
};
// ************************************************************************* //

View File

@ -0,0 +1,98 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2008-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
\*---------------------------------------------------------------------------*/
#ifndef createCoalParcelTypes_H
#define createCoalParcelTypes_H
#include "makeParcelIOList.H"
#include "reactingThermoTypes.H"
#include "CoalCloud.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#define createCoalParcelType(ParcelType) \
\
createCoalParcelThermoType \
( \
ParcelType, \
specieConstProperties \
); \
createCoalParcelThermoType \
( \
ParcelType, \
specieReactingProperties \
);
#define createCoalParcelThermoType(ParcelType, ThermoType) \
\
typedef ParcelType<ThermoType> ParcelType##ThermoType; \
\
makeParcelIOList(ParcelType##ThermoType); \
\
defineTemplateTypeNameAndDebug(ParcelType##ThermoType, 0); \
defineTemplateTypeNameAndDebug(Particle<ParcelType##ThermoType>, 0); \
defineTemplateTypeNameAndDebug(Cloud<ParcelType##ThermoType>, 0); \
\
defineParcelTypeNameAndDebug(KinematicParcel<ParcelType##ThermoType>, 0); \
defineTemplateTypeNameAndDebug \
( \
KinematicParcel<ParcelType##ThermoType>, \
0 \
); \
defineParcelTypeNameAndDebug(ThermoParcel<ParcelType##ThermoType>, 0); \
defineTemplateTypeNameAndDebug(ThermoParcel<ParcelType##ThermoType>, 0); \
defineParcelTypeNameAndDebug(ReactingParcel<ParcelType##ThermoType>, 0); \
defineTemplateTypeNameAndDebug(ReactingParcel<ParcelType##ThermoType>, 0);\
defineParcelTypeNameAndDebug \
( \
ReactingMultiphaseParcel<ParcelType##ThermoType>, \
0 \
); \
defineTemplateTypeNameAndDebug \
( \
ReactingMultiphaseParcel<ParcelType##ThermoType>, \
0 \
); \
defineParcelTypeNameAndDebug(CoalParcel<ParcelType##ThermoType>, 0); \
defineTemplateTypeNameAndDebug(CoalParcel<ParcelType##ThermoType>, 0); \
\
defineParcelTypeNameAndDebug(KinematicCloud<ParcelType##ThermoType>, 0); \
defineParcelTypeNameAndDebug(ThermoCloud<ParcelType##ThermoType>, 0); \
defineParcelTypeNameAndDebug(ReactingCloud<ParcelType##ThermoType>, 0); \
defineParcelTypeNameAndDebug \
( \
ReactingMultiphaseCloud<ParcelType##ThermoType>, \
0 \
); \
defineParcelTypeNameAndDebug(CoalCloud<ParcelType##ThermoType>, 0);
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -0,0 +1,97 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2008-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
\*---------------------------------------------------------------------------*/
#ifndef makeCoalParcelSurfaceReactionModels_H
#define makeCoalParcelSurfaceReactionModels_H
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#include "reactingThermoTypes.H"
#include "ReactingMultiphaseCloud.H"
#include "NoSurfaceReaction.H"
#include "COxidationDiffusionLimitedRate.H"
#include "COxidationKineticDiffusionLimitedRate.H"
#include "COxidationMurphyShaddix.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#define makeCoalSurfaceReactionModels(ParcelType) \
\
makeCoalSurfaceReactionModelThermoType \
( \
ParcelType, \
specieConstProperties \
); \
makeCoalSurfaceReactionModelThermoType \
( \
ParcelType, \
specieReactingProperties \
);
#define makeCoalSurfaceReactionModelThermoType(ParcelType, ThermoType) \
\
makeSurfaceReactionModel \
( \
ReactingMultiphaseCloud<ParcelType<ThermoType> > \
); \
\
makeSurfaceReactionModelThermoType \
( \
NoSurfaceReaction, \
ReactingMultiphaseCloud, \
ParcelType, \
ThermoType \
); \
makeSurfaceReactionModelThermoType \
( \
COxidationDiffusionLimitedRate, \
ReactingMultiphaseCloud, \
ParcelType, \
ThermoType \
); \
makeSurfaceReactionModelThermoType \
( \
COxidationKineticDiffusionLimitedRate, \
ReactingMultiphaseCloud, \
ParcelType, \
ThermoType \
); \
makeSurfaceReactionModelThermoType \
( \
COxidationMurphyShaddix, \
ReactingMultiphaseCloud, \
ParcelType, \
ThermoType \
);
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
\\ / A nd | Copyright (C) 2008-2009 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -28,18 +28,14 @@ License
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::COxidationDiffusionLimitedRate::COxidationDiffusionLimitedRate
template<class CloudType>
Foam::COxidationDiffusionLimitedRate<CloudType>::COxidationDiffusionLimitedRate
(
const dictionary& dict,
ReactingMultiphaseCloud<coalParcel>& owner
CloudType& owner
)
:
SurfaceReactionModel<ReactingMultiphaseCloud<coalParcel> >
(
dict,
owner,
typeName
),
SurfaceReactionModel<CloudType>(dict, owner, typeName),
Sb_(dimensionedScalar(this->coeffDict().lookup("Sb")).value()),
D_(dimensionedScalar(this->coeffDict().lookup("D")).value()),
CsLocalId_(-1),
@ -63,10 +59,10 @@ Foam::COxidationDiffusionLimitedRate::COxidationDiffusionLimitedRate
{
FatalErrorIn
(
"COxidationDiffusionLimitedRate"
"COxidationDiffusionLimitedRate<CloudType>"
"("
"const dictionary&, "
"ReactingMultiphaseCloud<coalParcel>&"
"CloudType&"
")"
) << "Stoichiometry of reaction, Sb, must be greater than zero" << nl
<< exit(FatalError);
@ -76,19 +72,23 @@ Foam::COxidationDiffusionLimitedRate::COxidationDiffusionLimitedRate
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::COxidationDiffusionLimitedRate::~COxidationDiffusionLimitedRate()
template<class CloudType>
Foam::COxidationDiffusionLimitedRate<CloudType>::
~COxidationDiffusionLimitedRate()
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
bool Foam::COxidationDiffusionLimitedRate::active() const
template<class CloudType>
bool Foam::COxidationDiffusionLimitedRate<CloudType>::active() const
{
return true;
}
Foam::scalar Foam::COxidationDiffusionLimitedRate::calculate
template<class CloudType>
Foam::scalar Foam::COxidationDiffusionLimitedRate<CloudType>::calculate
(
const scalar dt,
const label cellI,
@ -110,7 +110,8 @@ Foam::scalar Foam::COxidationDiffusionLimitedRate::calculate
) const
{
// Fraction of remaining combustible material
const scalar fComb = YMixture[coalParcel::SLD]*YSolid[CsLocalId_];
const label idSolid = CloudType::parcelType::SLD;
const scalar fComb = YMixture[idSolid]*YSolid[CsLocalId_];
// Surface combustion active combustible fraction is consumed
if (fComb < SMALL)
@ -120,7 +121,7 @@ Foam::scalar Foam::COxidationDiffusionLimitedRate::calculate
// Local mass fraction of O2 in the carrier phase
const scalar YO2 =
owner().carrierThermo().composition().Y(O2GlobalId_)[cellI];
this->owner().carrierThermo().composition().Y(O2GlobalId_)[cellI];
// Change in C mass [kg]
scalar dmC =

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
\\ / A nd | Copyright (C) 2008-2009 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -38,19 +38,23 @@ Description
#define COxidationDiffusionLimitedRate_H
#include "SurfaceReactionModel.H"
#include "coalParcel.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// Forward class declarations
template<class CloudType>
class COxidationDiffusionLimitedRate;
namespace Foam
{
/*---------------------------------------------------------------------------*\
Class COxidationDiffusionLimitedRate Declaration
Class COxidationDiffusionLimitedRate Declaration
\*---------------------------------------------------------------------------*/
template<class CloudType>
class COxidationDiffusionLimitedRate
:
public SurfaceReactionModel<ReactingMultiphaseCloud<coalParcel> >
public SurfaceReactionModel<CloudType>
{
// Private data
@ -99,7 +103,7 @@ public:
COxidationDiffusionLimitedRate
(
const dictionary& dict,
ReactingMultiphaseCloud<coalParcel>& owner
CloudType& owner
);
@ -142,6 +146,12 @@ public:
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#ifdef NoRepository
#include "COxidationDiffusionLimitedRate.C"
#endif
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
\\ / A nd | Copyright (C) 2008-2009 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -28,14 +28,15 @@ License
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::COxidationKineticDiffusionLimitedRate::
template<class CloudType>
Foam::COxidationKineticDiffusionLimitedRate<CloudType>::
COxidationKineticDiffusionLimitedRate
(
const dictionary& dict,
ReactingMultiphaseCloud<coalParcel>& owner
CloudType& owner
)
:
SurfaceReactionModel<ReactingMultiphaseCloud<coalParcel> >
SurfaceReactionModel<CloudType>
(
dict,
owner,
@ -69,7 +70,7 @@ COxidationKineticDiffusionLimitedRate
"COxidationKineticDiffusionLimitedRate"
"("
"const dictionary&, "
"ReactingMultiphaseCloud<coalParcel>&"
"CloudType&"
")"
) << "Stoichiometry of reaction, Sb, must be greater than zero" << nl
<< exit(FatalError);
@ -79,20 +80,23 @@ COxidationKineticDiffusionLimitedRate
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::COxidationKineticDiffusionLimitedRate::
template<class CloudType>
Foam::COxidationKineticDiffusionLimitedRate<CloudType>::
~COxidationKineticDiffusionLimitedRate()
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
bool Foam::COxidationKineticDiffusionLimitedRate::active() const
template<class CloudType>
bool Foam::COxidationKineticDiffusionLimitedRate<CloudType>::active() const
{
return true;
}
Foam::scalar Foam::COxidationKineticDiffusionLimitedRate::calculate
template<class CloudType>
Foam::scalar Foam::COxidationKineticDiffusionLimitedRate<CloudType>::calculate
(
const scalar dt,
const label cellI,
@ -114,7 +118,8 @@ Foam::scalar Foam::COxidationKineticDiffusionLimitedRate::calculate
) const
{
// Fraction of remaining combustible material
const scalar fComb = YMixture[coalParcel::SLD]*YSolid[CsLocalId_];
const label idSolid = CloudType::parcelType::SLD;
const scalar fComb = YMixture[idSolid]*YSolid[CsLocalId_];
// Surface combustion active combustible fraction is consumed
if (fComb < SMALL)
@ -124,7 +129,7 @@ Foam::scalar Foam::COxidationKineticDiffusionLimitedRate::calculate
// Local mass fraction of O2 in the carrier phase
const scalar YO2 =
owner().carrierThermo().composition().Y(O2GlobalId_)[cellI];
this->owner().carrierThermo().composition().Y(O2GlobalId_)[cellI];
// Diffusion rate coefficient
const scalar D0 = C1_/d*pow(0.5*(T + Tc), 0.75);

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
\\ / A nd | Copyright (C) 2008-2009 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -39,19 +39,24 @@ Description
#define COxidationKineticDiffusionLimitedRate_H
#include "SurfaceReactionModel.H"
#include "coalParcel.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// Forward class declarations
template<class CloudType>
class COxidationKineticDiffusionLimitedRate;
/*---------------------------------------------------------------------------*\
Class COxidationKineticDiffusionLimitedRate Declaration
\*---------------------------------------------------------------------------*/
template<class CloudType>
class COxidationKineticDiffusionLimitedRate
:
public SurfaceReactionModel<ReactingMultiphaseCloud<coalParcel> >
public SurfaceReactionModel<CloudType>
{
// Private data
@ -106,7 +111,7 @@ public:
COxidationKineticDiffusionLimitedRate
(
const dictionary& dict,
ReactingMultiphaseCloud<coalParcel>& owner
CloudType& owner
);
@ -149,6 +154,12 @@ public:
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#ifdef NoRepository
#include "COxidationKineticDiffusionLimitedRate.C"
#endif
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
\\ / A nd | Copyright (C) 2008-2009 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -28,20 +28,23 @@ License
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
Foam::label Foam::COxidationMurphyShaddix::maxIters_ = 1000;
template<class CloudType>
Foam::label Foam::COxidationMurphyShaddix<CloudType>::maxIters_ = 1000;
Foam::scalar Foam::COxidationMurphyShaddix::tolerance_ = 1e-06;
template<class CloudType>
Foam::scalar Foam::COxidationMurphyShaddix<CloudType>::tolerance_ = 1e-06;
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::COxidationMurphyShaddix::COxidationMurphyShaddix
template<class CloudType>
Foam::COxidationMurphyShaddix<CloudType>::COxidationMurphyShaddix
(
const dictionary& dict,
ReactingMultiphaseCloud<coalParcel>& owner
CloudType& owner
)
:
SurfaceReactionModel<ReactingMultiphaseCloud<coalParcel> >
SurfaceReactionModel<CloudType>
(
dict,
owner,
@ -59,36 +62,37 @@ Foam::COxidationMurphyShaddix::COxidationMurphyShaddix
O2GlobalId_(owner.composition().globalCarrierId("O2")),
CO2GlobalId_(owner.composition().globalCarrierId("CO2")),
WC_(0.0),
WO2_(0.0),
HcCO2_(0.0)
WO2_(0.0)
{
// Determine Cs ids
label idSolid = owner.composition().idSolid();
CsLocalId_ = owner.composition().localId(idSolid, "Cs");
CsLocalId_ = owner.composition().localId(idSolid, "C");
// Set local copies of thermo properties
WO2_ = owner.composition().carrierSpecies()[O2GlobalId_].W();
scalar WCO2 = owner.composition().carrierSpecies()[CO2GlobalId_].W();
WC_ = WCO2 - WO2_;
HcCO2_ = owner.composition().carrierSpecies()[CO2GlobalId_].Hc();
}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::COxidationMurphyShaddix::~COxidationMurphyShaddix()
template<class CloudType>
Foam::COxidationMurphyShaddix<CloudType>::~COxidationMurphyShaddix()
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
bool Foam::COxidationMurphyShaddix::active() const
template<class CloudType>
bool Foam::COxidationMurphyShaddix<CloudType>::active() const
{
return true;
}
Foam::scalar Foam::COxidationMurphyShaddix::calculate
template<class CloudType>
Foam::scalar Foam::COxidationMurphyShaddix<CloudType>::calculate
(
const scalar dt,
const label cellI,
@ -110,7 +114,8 @@ Foam::scalar Foam::COxidationMurphyShaddix::calculate
) const
{
// Fraction of remaining combustible material
const scalar fComb = YMixture[coalParcel::SLD]*YSolid[CsLocalId_];
const label idSolid = CloudType::parcelType::SLD;
const scalar fComb = YMixture[idSolid]*YSolid[CsLocalId_];
// Surface combustion until combustible fraction is consumed
if (fComb < SMALL)
@ -120,7 +125,7 @@ Foam::scalar Foam::COxidationMurphyShaddix::calculate
// Cell carrier phase O2 species density [kg/m^3]
const scalar rhoO2 =
rhoc*owner().carrierThermo().composition().Y(O2GlobalId_)[cellI];
rhoc*this->owner().carrierThermo().composition().Y(O2GlobalId_)[cellI];
if (rhoO2 < SMALL)
{
@ -186,8 +191,10 @@ Foam::scalar Foam::COxidationMurphyShaddix::calculate
if (iter > maxIters_)
{
WarningIn("scalar Foam::COxidationMurphyShaddix::calculate(...)")
<< "iter limit reached (" << maxIters_ << ")" << nl << endl;
WarningIn
(
"scalar Foam::COxidationMurphyShaddix<CloudType>::calculate(...)"
) << "iter limit reached (" << maxIters_ << ")" << nl << endl;
}
// Calculate the number of molar units reacted
@ -200,8 +207,16 @@ Foam::scalar Foam::COxidationMurphyShaddix::calculate
// Add to particle mass transfer
dMassSolid[CsLocalId_] += dOmega*WC_;
const scalar HC =
this->owner().composition().solids().properties()[CsLocalId_].Hf()
+ this->owner().composition().solids().properties()[CsLocalId_].cp()*T;
const scalar HCO2 =
this->owner().composition().carrierSpecies()[CO2GlobalId_].H(T);
const scalar HO2 =
this->owner().composition().carrierSpecies()[O2GlobalId_].H(T);
// Heat of reaction
return -HcCO2_*dOmega*WC_;
return dOmega*(WC_*HC + WO2_*HO2 - (WC_ + WO2_)*HCO2);
}

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
\\ / A nd | Copyright (C) 2008-2009 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -34,19 +34,24 @@ Description
#define COxidationMurphyShaddix_H
#include "SurfaceReactionModel.H"
#include "coalParcel.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// Forward class declarations
template<class CloudType>
class COxidationMurphyShaddix;
/*---------------------------------------------------------------------------*\
Class COxidationMurphyShaddix Declaration
\*---------------------------------------------------------------------------*/
template<class CloudType>
class COxidationMurphyShaddix
:
public SurfaceReactionModel<ReactingMultiphaseCloud<coalParcel> >
public SurfaceReactionModel<CloudType>
{
// Private data
@ -106,9 +111,6 @@ class COxidationMurphyShaddix
//- Molecular weight of O2 [kg/kmol]
scalar WO2_;
//- Chemical enthalpy of CO2 [J/kg]
scalar HcCO2_;
public:
@ -122,7 +124,7 @@ public:
COxidationMurphyShaddix
(
const dictionary& dict,
ReactingMultiphaseCloud<coalParcel>& owner
CloudType& owner
);
@ -165,6 +167,12 @@ public:
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#ifdef NoRepository
#include "COxidationMurphyShaddix.C"
#endif
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -696,6 +696,4 @@ void Foam::parcel::transformProperties(const vector&)
{}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// ************************************************************************* //

View File

@ -527,20 +527,20 @@ void Foam::DsmcCloud<ParcelType>::addNewParcel
template<class ParcelType>
Foam::DsmcCloud<ParcelType>::DsmcCloud
(
const word& cloudType,
const word& cloudName,
const volScalarField& T,
const volVectorField& U
)
:
Cloud<ParcelType>(T.mesh(), cloudType, false),
Cloud<ParcelType>(T.mesh(), cloudName, false),
DsmcBaseCloud(),
cloudType_(cloudType),
cloudName_(cloudName),
mesh_(T.mesh()),
particleProperties_
(
IOobject
(
cloudType + "Properties",
cloudName + "Properties",
mesh_.time().constant(),
mesh_,
IOobject::MUST_READ,
@ -639,19 +639,19 @@ Foam::DsmcCloud<ParcelType>::DsmcCloud
template<class ParcelType>
Foam::DsmcCloud<ParcelType>::DsmcCloud
(
const word& cloudType,
const word& cloudName,
const fvMesh& mesh
)
:
Cloud<ParcelType>(mesh, cloudType, false),
Cloud<ParcelType>(mesh, cloudName, false),
DsmcBaseCloud(),
cloudType_(cloudType),
cloudName_(cloudName),
mesh_(mesh),
particleProperties_
(
IOobject
(
cloudType + "Properties",
cloudName + "Properties",
mesh_.time().constant(),
mesh_,
IOobject::MUST_READ,

View File

@ -76,7 +76,7 @@ class DsmcCloud
//- Cloud type - used to set the name of the parcel properties
// dictionary by appending "Properties"
const word cloudType_;
const word cloudName_;
//- References to the mesh and time databases
const fvMesh& mesh_;
@ -181,7 +181,7 @@ public:
//- Construct given name and mesh, will read Parcels from file
DsmcCloud
(
const word& cloudType,
const word& cloudName,
const volScalarField& T,
const volVectorField& U
);
@ -189,7 +189,7 @@ public:
//- Construct given name and mesh. Used to initialise.
DsmcCloud
(
const word& cloudType,
const word& cloudName,
const fvMesh& mesh
);
@ -205,7 +205,7 @@ public:
// References to the mesh and databases
//- Return the cloud type
inline const word& cloudType() const;
inline const word& cloudName() const;
//- Return refernce to the mesh
inline const fvMesh& mesh() const;

View File

@ -27,9 +27,9 @@ License
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template<class ParcelType>
inline const Foam::word& Foam::DsmcCloud<ParcelType>::cloudType() const
inline const Foam::word& Foam::DsmcCloud<ParcelType>::cloudName() const
{
return cloudType_;
return cloudName_;
}

View File

@ -38,12 +38,12 @@ namespace Foam
Foam::dsmcCloud::dsmcCloud
(
const word& cloudType,
const word& cloudName,
const volScalarField& T,
const volVectorField& U
)
:
DsmcCloud<dsmcParcel>(cloudType, T, U)
DsmcCloud<dsmcParcel>(cloudName, T, U)
{
dsmcParcel::readFields(*this);
}
@ -51,11 +51,11 @@ Foam::dsmcCloud::dsmcCloud
Foam::dsmcCloud::dsmcCloud
(
const word& cloudType,
const word& cloudName,
const fvMesh& mesh
)
:
DsmcCloud<dsmcParcel>(cloudType, mesh)
DsmcCloud<dsmcParcel>(cloudName, mesh)
{}

View File

@ -72,7 +72,7 @@ public:
//- Construct from components
dsmcCloud
(
const word& cloudType,
const word& cloudName,
const volScalarField& T,
const volVectorField& U
);
@ -80,7 +80,7 @@ public:
//- Construct from name and mesh, used to initialise.
dsmcCloud
(
const word& cloudType,
const word& cloudName,
const fvMesh& mesh
);

View File

@ -61,15 +61,9 @@ bool Foam::DsmcParcel<ParcelType>::move
if (p.onBoundary() && td.keepParticle)
{
if (p.face() > -1)
if (isType<processorPolyPatch>(pbMesh[p.patch(p.face())]))
{
if
(
isType<processorPolyPatch>(pbMesh[p.patch(p.face())])
)
{
td.switchProcessor = true;
}
td.switchProcessor = true;
}
}
}
@ -78,6 +72,19 @@ bool Foam::DsmcParcel<ParcelType>::move
}
template<class ParcelType>
template<class TrackData>
bool Foam::DsmcParcel<ParcelType>::hitPatch
(
const polyPatch&,
TrackData& td,
const label patchI
)
{
return false;
}
template<class ParcelType>
template<class TrackData>
void Foam::DsmcParcel<ParcelType>::hitProcessorPatch

View File

@ -239,6 +239,16 @@ public:
// Patch interactions
//- Overridable function to handle the particle hitting a patch
// Executed before other patch-hitting functions
template<class TrackData>
bool hitPatch
(
const polyPatch&,
TrackData& td,
const label patchI
);
//- Overridable function to handle the particle hitting a
// processorPatch
template<class TrackData>

View File

@ -1,70 +1,61 @@
PARCELS=parcels
BASEPARCELS=$(PARCELS)/baseClasses
DERIVEDPARCELS=$(PARCELS)/derived
CLOUDS=clouds
BASECLOUDS=$(CLOUDS)/baseClasses
DERIVEDCLOUDS=$(CLOUDS)/derived
/* Parcels */
$(DERIVEDPARCELS)/basicKinematicParcel/basicKinematicParcel.C
$(DERIVEDPARCELS)/basicThermoParcel/basicThermoParcel.C
$(DERIVEDPARCELS)/basicReactingParcel/basicReactingParcel.C
$(DERIVEDPARCELS)/basicReactingMultiphaseParcel/basicReactingMultiphaseParcel.C
$(BASEPARCELS)/reactingParcel/reactingParcel.C
/* Cloud base classes */
clouds/baseClasses/kinematicCloud/kinematicCloud.C
clouds/baseClasses/thermoCloud/thermoCloud.C
clouds/baseClasses/reactingCloud/reactingCloud.C
clouds/baseClasses/reactingMultiphaseCloud/reactingMultiphaseCloud.C
$(BASECLOUDS)/kinematicCloud/kinematicCloud.C
$(BASECLOUDS)/thermoCloud/thermoCloud.C
$(BASECLOUDS)/reactingCloud/reactingCloud.C
$(BASECLOUDS)/reactingMultiphaseCloud/reactingMultiphaseCloud.C
/* Cloud container/injection mechanisms */
clouds/derived/basicKinematicCloud/basicKinematicCloud.C
clouds/derived/basicThermoCloud/basicThermoCloud.C
clouds/derived/basicReactingCloud/basicReactingCloud.C
clouds/derived/basicReactingMultiphaseCloud/basicReactingMultiphaseCloud.C
$(DERIVEDCLOUDS)/basicKinematicCloud/basicKinematicCloud.C
$(DERIVEDCLOUDS)/basicThermoCloud/basicThermoCloud.C
$(DERIVEDCLOUDS)/BasicReactingCloud/defineBasicReactingCloud.C
$(DERIVEDCLOUDS)/BasicReactingMultiphaseCloud/defineBasicReactingMultiphaseCloud.C
$(DERIVEDCLOUDS)/BasicTrackedReactingCloud/defineBasicTrackedReactingCloud.C
/* kinematic parcel sub-models */
KINEMATICPARCEL=$(DERIVEDPARCELS)/basicKinematicParcel
$(KINEMATICPARCEL)/basicKinematicParcel.C
$(KINEMATICPARCEL)/defineBasicKinematicParcel.C
$(KINEMATICPARCEL)/submodels/makeBasicKinematicParcelDispersionModels.C
$(KINEMATICPARCEL)/submodels/makeBasicKinematicParcelDragModels.C
$(KINEMATICPARCEL)/submodels/makeBasicKinematicParcelInjectionModels.C
$(KINEMATICPARCEL)/submodels/makeBasicKinematicParcelWallInteractionModels.C
$(KINEMATICPARCEL)/makeBasicKinematicParcelSubmodels.C
/* thermo parcel sub-models */
THERMOPARCEL=$(DERIVEDPARCELS)/basicThermoParcel
$(THERMOPARCEL)/basicThermoParcel.C
$(THERMOPARCEL)/defineBasicThermoParcel.C
$(THERMOPARCEL)/submodels/makeBasicThermoParcelDispersionModels.C
$(THERMOPARCEL)/submodels/makeBasicThermoParcelDragModels.C
$(THERMOPARCEL)/submodels/makeBasicThermoParcelHeatTransferModels.C
$(THERMOPARCEL)/submodels/makeBasicThermoParcelInjectionModels.C
$(THERMOPARCEL)/submodels/makeBasicThermoParcelWallInteractionModels.C
$(THERMOPARCEL)/makeBasicThermoParcelSubmodels.C
/* reacting parcel sub-models */
REACTINGPARCEL=$(DERIVEDPARCELS)/basicReactingParcel
REACTINGPARCEL=$(DERIVEDPARCELS)/BasicReactingParcel
$(REACTINGPARCEL)/defineBasicReactingParcel.C
$(REACTINGPARCEL)/submodels/makeBasicReactingParcelCompositionModels.C
$(REACTINGPARCEL)/submodels/makeBasicReactingParcelDispersionModels.C
$(REACTINGPARCEL)/submodels/makeBasicReactingParcelDragModels.C
$(REACTINGPARCEL)/submodels/makeBasicReactingParcelHeatTransferModels.C
$(REACTINGPARCEL)/submodels/makeBasicReactingParcelInjectionModels.C
$(REACTINGPARCEL)/submodels/makeBasicReactingParcelPhaseChangeModels.C
$(REACTINGPARCEL)/submodels/makeBasicReactingParcelWallInteractionModels.C
$(REACTINGPARCEL)/makeBasicReactingParcelSubmodels.C
/* tracked reacting parcel sub-models */
TRACKEDREACTINGPARCEL=$(DERIVEDPARCELS)/BasicTrackedReactingParcel
$(TRACKEDREACTINGPARCEL)/defineTrackedReactingParcel.C
$(TRACKEDREACTINGPARCEL)/makeBasicTrackedReactingParcelSubmodels.C
/* reacting multiphase parcel sub-models */
REACTINGMPPARCEL=$(DERIVEDPARCELS)/basicReactingMultiphaseParcel
REACTINGMPPARCEL=$(DERIVEDPARCELS)/BasicReactingMultiphaseParcel
$(REACTINGMPPARCEL)/defineBasicReactingMultiphaseParcel.C
$(REACTINGMPPARCEL)/submodels/makeBasicReactingMultiphaseParcelCompositionModels.C
$(REACTINGMPPARCEL)/submodels/makeBasicReactingMultiphaseParcelDevolatilisationModels.C
$(REACTINGMPPARCEL)/submodels/makeBasicReactingMultiphaseParcelDispersionModels.C
$(REACTINGMPPARCEL)/submodels/makeBasicReactingMultiphaseParcelDragModels.C
$(REACTINGMPPARCEL)/submodels/makeBasicReactingMultiphaseParcelHeatTransferModels.C
$(REACTINGMPPARCEL)/submodels/makeBasicReactingMultiphaseParcelInjectionModels.C
$(REACTINGMPPARCEL)/submodels/makeBasicReactingMultiphaseParcelPhaseChangeModels.C
$(REACTINGMPPARCEL)/submodels/makeBasicReactingMultiphaseParcelSurfaceReactionModels.C
$(REACTINGMPPARCEL)/submodels/makeBasicReactingMultiphaseParcelWallInteractionModels.C
$(REACTINGMPPARCEL)/makeBasicReactingMultiphaseParcelSubmodels.C
/* bolt-on models */
@ -72,6 +63,11 @@ submodels/addOns/radiation/absorptionEmission/cloudAbsorptionEmission/cloudAbsor
submodels/addOns/radiation/scatter/cloudScatter/cloudScatter.C
/* data entries */
submodels/IO/DataEntry/makeDataEntries.C
submodels/IO/DataEntry/polynomial/polynomial.C
/* integration schemes */
IntegrationScheme/makeIntegrationSchemes.C
@ -86,9 +82,4 @@ phaseProperties/phaseProperties/phasePropertiesIO.C
phaseProperties/phasePropertiesList/phasePropertiesList.C
/* data entries */
submodels/IO/DataEntry/makeDataEntries.C
submodels/IO/DataEntry/polynomial/polynomial.C
LIB = $(FOAM_LIBBIN)/liblagrangianIntermediate

View File

@ -31,62 +31,29 @@ License
#include "DispersionModel.H"
#include "DragModel.H"
#include "InjectionModel.H"
#include "WallInteractionModel.H"
// * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * * //
template<class ParcelType>
void Foam::KinematicCloud<ParcelType>::addNewParcel
(
const vector& position,
const label cellId,
const scalar d,
const vector& U,
const scalar nParticles,
const scalar lagrangianDt
)
{
ParcelType* pPtr = new ParcelType
(
*this,
position,
cellId,
parcelTypeId_,
nParticles,
d,
U,
constProps_
);
scalar continuousDt = this->db().time().deltaT().value();
pPtr->stepFraction() = (continuousDt - lagrangianDt)/continuousDt;
addParticle(pPtr);
}
#include "PatchInteractionModel.H"
#include "PostProcessingModel.H"
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
template<class ParcelType>
Foam::KinematicCloud<ParcelType>::KinematicCloud
(
const word& cloudType,
const word& cloudName,
const volScalarField& rho,
const volVectorField& U,
const volScalarField& mu,
const dimensionedVector& g
)
:
Cloud<ParcelType>(rho.mesh(), cloudType, false),
Cloud<ParcelType>(rho.mesh(), cloudName, false),
kinematicCloud(),
cloudType_(cloudType),
mesh_(rho.mesh()),
particleProperties_
(
IOobject
(
cloudType + "Properties",
cloudName + "Properties",
rho.mesh().time().constant(),
rho.mesh(),
IOobject::MUST_READ,
@ -131,14 +98,22 @@ Foam::KinematicCloud<ParcelType>::KinematicCloud
*this
)
),
wallInteractionModel_
patchInteractionModel_
(
WallInteractionModel<KinematicCloud<ParcelType> >::New
PatchInteractionModel<KinematicCloud<ParcelType> >::New
(
particleProperties_,
*this
)
),
postProcessingModel_
(
PostProcessingModel<KinematicCloud<ParcelType> >::New
(
this->particleProperties_,
*this
)
),
UIntegrator_
(
vectorIntegrationScheme::New
@ -173,6 +148,24 @@ Foam::KinematicCloud<ParcelType>::~KinematicCloud()
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template<class ParcelType>
void Foam::KinematicCloud<ParcelType>::checkParcelProperties
(
ParcelType* pPtr,
const scalar lagrangianDt,
const bool fullyDescribed
)
{
if (!fullyDescribed)
{
pPtr->rho() = constProps_.rho0();
}
scalar carrierDt = this->db().time().deltaT().value();
pPtr->stepFraction() = (carrierDt - lagrangianDt)/carrierDt;
}
template<class ParcelType>
void Foam::KinematicCloud<ParcelType>::resetSourceTerms()
{
@ -227,6 +220,8 @@ void Foam::KinematicCloud<ParcelType>::evolve()
}
Cloud<ParcelType>::move(td);
this->postProcessing().post();
}

View File

@ -72,7 +72,10 @@ template<class CloudType>
class InjectionModel;
template<class CloudType>
class WallInteractionModel;
class PostProcessingModel;
template<class CloudType>
class PatchInteractionModel;
/*---------------------------------------------------------------------------*\
Class KinematicCloud Declaration
@ -84,11 +87,18 @@ class KinematicCloud
public Cloud<ParcelType>,
public kinematicCloud
{
// Private data
// Private Member Functions
//- Cloud type - used to set the name of the parcel properties
// dictionary by appending "Properties"
const word cloudType_;
//- Disallow default bitwise copy construct
KinematicCloud(const KinematicCloud&);
//- Disallow default bitwise assignment
void operator=(const KinematicCloud&);
protected:
// Protected data
//- References to the mesh and time databases
const fvMesh& mesh_;
@ -153,9 +163,13 @@ class KinematicCloud
autoPtr<InjectionModel<KinematicCloud<ParcelType> > >
injectionModel_;
//- Wall interaction model
autoPtr<WallInteractionModel<KinematicCloud<ParcelType> > >
wallInteractionModel_;
//- Patch interaction model
autoPtr<PatchInteractionModel<KinematicCloud<ParcelType> > >
patchInteractionModel_;
//- Post-processing model
autoPtr<PostProcessingModel<KinematicCloud<ParcelType> > >
postProcessingModel_;
// Reference to the particle integration schemes
@ -170,15 +184,6 @@ class KinematicCloud
DimensionedField<vector, volMesh> UTrans_;
// Private Member Functions
//- Disallow default bitwise copy construct
KinematicCloud(const KinematicCloud&);
//- Disallow default bitwise assignment
void operator=(const KinematicCloud&);
public:
// Constructors
@ -186,7 +191,7 @@ public:
//- Construct given carrier gas fields
KinematicCloud
(
const word& cloudType,
const word& cloudName,
const volScalarField& rho,
const volVectorField& U,
const volScalarField& mu,
@ -208,9 +213,6 @@ public:
// References to the mesh and databases
//- Return the cloud type
inline const word& cloudType() const;
//- Return the parcel type id
inline label parcelTypeId() const;
@ -277,27 +279,33 @@ public:
// Sub-models
//- Return reference to dispersion model
//- Return const-access to the dispersion model
inline const DispersionModel<KinematicCloud<ParcelType> >&
dispersion() const;
//- Return reference to the dispersion model
inline DispersionModel<KinematicCloud<ParcelType> >&
dispersion();
//- Return reference to drag model
//- Return const-access to the drag model
inline const DragModel<KinematicCloud<ParcelType> >&
drag() const;
//- Return reference to injection model
//- Return const access to the injection model
inline const InjectionModel<KinematicCloud<ParcelType> >&
injection() const;
//- Return reference to the injection model
inline InjectionModel<KinematicCloud<ParcelType> >&
injection();
//- Return reference to wall interaction model
inline const WallInteractionModel<KinematicCloud<ParcelType> >&
wallInteraction() const;
//- Return const-access to the patch interaction model
inline const PatchInteractionModel<KinematicCloud<ParcelType> >&
patchInteraction() const;
//- Return reference to post-processing model
inline PostProcessingModel<KinematicCloud<ParcelType> >&
postProcessing();
// Integration schemes
@ -346,15 +354,12 @@ public:
// Cloud evolution functions
//- Add new parcel
void addNewParcel
//- Check parcel properties
void checkParcelProperties
(
const vector& position,
const label cellId,
const scalar d,
const vector& U,
const scalar nParticles,
const scalar lagrangianDt
ParcelType* pPtr,
const scalar lagrangianDt,
const bool fullyDescribed
);
//- Reset the spray source terms

View File

@ -28,13 +28,6 @@ License
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template<class ParcelType>
inline const Foam::word& Foam::KinematicCloud<ParcelType>::cloudType() const
{
return cloudType_;
}
template<class ParcelType>
inline Foam::label Foam::KinematicCloud<ParcelType>::parcelTypeId() const
{
@ -158,6 +151,14 @@ Foam::KinematicCloud<ParcelType>::injection() const
}
template<class ParcelType>
inline const Foam::PatchInteractionModel<Foam::KinematicCloud<ParcelType> >&
Foam::KinematicCloud<ParcelType>::patchInteraction() const
{
return patchInteractionModel_;
}
template<class ParcelType>
inline Foam::InjectionModel<Foam::KinematicCloud<ParcelType> >&
Foam::KinematicCloud<ParcelType>::injection()
@ -167,10 +168,10 @@ Foam::KinematicCloud<ParcelType>::injection()
template<class ParcelType>
inline const Foam::WallInteractionModel<Foam::KinematicCloud<ParcelType> >&
Foam::KinematicCloud<ParcelType>::wallInteraction() const
inline Foam::PostProcessingModel<Foam::KinematicCloud<ParcelType> >&
Foam::KinematicCloud<ParcelType>::postProcessing()
{
return wallInteractionModel_;
return postProcessingModel_();
}

View File

@ -28,37 +28,34 @@ License
#include "CompositionModel.H"
#include "PhaseChangeModel.H"
#include "multiComponentMixture.H"
// * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * * //
template<class ParcelType>
void Foam::ReactingCloud<ParcelType>::addNewParcel
void Foam::ReactingCloud<ParcelType>::checkSuppliedComposition
(
const vector& position,
const label cellId,
const scalar d,
const vector& U,
const scalar nParticles,
const scalar lagrangianDt
const scalarField& YSupplied,
const scalarField& Y,
const word& YName
)
{
ParcelType* pPtr = new ParcelType
(
*this,
position,
cellId,
this->parcelTypeId(),
nParticles,
d,
U,
composition().YMixture0(),
constProps_
);
scalar continuousDt = this->db().time().deltaT().value();
pPtr->stepFraction() = (continuousDt - lagrangianDt)/continuousDt;
addParticle(pPtr);
if (YSupplied.size() != Y.size())
{
FatalErrorIn
(
"ReactingCloud<ParcelType>::checkSuppliedComposition"
"("
"const scalarField&, "
"const scalarField&, "
"const word&"
")"
) << YName << " supplied, but size is not compatible with "
<< "parcel composition: " << nl << " "
<< YName << "(" << YSupplied.size() << ") vs required composition "
<< YName << "(" << Y.size() << ")" << nl
<< abort(FatalError);
}
}
@ -67,19 +64,18 @@ void Foam::ReactingCloud<ParcelType>::addNewParcel
template<class ParcelType>
Foam::ReactingCloud<ParcelType>::ReactingCloud
(
const word& cloudType,
const word& cloudName,
const volScalarField& rho,
const volVectorField& U,
const dimensionedVector& g,
hCombustionThermo& thermo,
PtrList<specieReactingProperties>& carrierSpecies
hCombustionThermo& thermo
)
:
ThermoCloud<ParcelType>(cloudType, rho, U, g, thermo),
ThermoCloud<ParcelType>(cloudName, rho, U, g, thermo),
reactingCloud(),
constProps_(this->particleProperties()),
carrierThermo_(thermo),
carrierSpecies_(carrierSpecies),
carrierSpecies_(thermo.composition().Y().size()),
compositionModel_
(
CompositionModel<ReactingCloud<ParcelType> >::New
@ -99,6 +95,20 @@ Foam::ReactingCloud<ParcelType>::ReactingCloud
rhoTrans_(thermo.composition().Y().size()),
dMassPhaseChange_(0.0)
{
// Create the carrier species
forAll(carrierSpecies_, specieI)
{
carrierSpecies_.set
(
specieI,
new thermoType
(
dynamic_cast<const multiComponentMixture<thermoType>&>
(thermo).speciesData()[specieI]
)
);
}
// Set storage for mass source fields and initialise to zero
forAll(rhoTrans_, i)
{
@ -135,6 +145,40 @@ Foam::ReactingCloud<ParcelType>::~ReactingCloud()
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template<class ParcelType>
void Foam::ReactingCloud<ParcelType>::checkParcelProperties
(
ParcelType* pPtr,
const scalar lagrangianDt,
const bool fullyDescribed
)
{
ThermoCloud<ParcelType>::checkParcelProperties
(
pPtr,
lagrangianDt,
fullyDescribed
);
if (!fullyDescribed)
{
pPtr->Y() = composition().YMixture0();
}
else
{
checkSuppliedComposition
(
pPtr->Y(),
composition().YMixture0(),
"YMixture"
);
}
// derived information - store initial mass
pPtr->mass0() = pPtr->mass();
}
template<class ParcelType>
void Foam::ReactingCloud<ParcelType>::resetSourceTerms()
{
@ -215,6 +259,8 @@ void Foam::ReactingCloud<ParcelType>::evolve()
}
Cloud<ParcelType>::move(td);
this->postProcessing().post();
}

View File

@ -27,6 +27,7 @@ Class
Description
Templated base class for reacting cloud
- Adds to thermodynamic cloud
- Variable composition (single phase)
- Phase change
@ -46,8 +47,6 @@ SourceFiles
#include "ThermoCloud.H"
#include "reactingCloud.H"
#include "ReactingCloudThermoTypes.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
@ -71,7 +70,26 @@ class ReactingCloud
public ThermoCloud<ParcelType>,
public reactingCloud
{
// Private data
public:
//- Type of thermodynamics the cloud was instantiated for
typedef typename ParcelType::thermoType thermoType;
private:
// Private Member Functions
//- Disallow default bitwise copy construct
ReactingCloud(const ReactingCloud&);
//- Disallow default bitwise assignment
void operator=(const ReactingCloud&);
protected:
// Protected data
//- Parcel constant properties
typename ParcelType::constantProperties constProps_;
@ -80,7 +98,7 @@ class ReactingCloud
hCombustionThermo& carrierThermo_;
//- Gas phase properties
PtrList<specieReactingProperties>& carrierSpecies_;
PtrList<thermoType> carrierSpecies_;
// References to the cloud sub-models
@ -106,13 +124,17 @@ class ReactingCloud
scalar dMassPhaseChange_;
// Private Member Functions
// Protected Member Functions
//- Disallow default bitwise copy construct
ReactingCloud(const ReactingCloud&);
// New parcel helper functions
//- Disallow default bitwise assignment
void operator=(const ReactingCloud&);
//- Check that size of a composition field is valid
void checkSuppliedComposition
(
const scalarField& YSupplied,
const scalarField& Y,
const word& YName
);
public:
@ -122,12 +144,11 @@ public:
//- Construct given carrier gas fields
ReactingCloud
(
const word& cloudType,
const word& cloudName,
const volScalarField& rho,
const volVectorField& U,
const dimensionedVector& g,
hCombustionThermo& thermo,
PtrList<specieReactingProperties>& carrierSpecies
hCombustionThermo& thermo
);
@ -154,7 +175,7 @@ public:
inline hCombustionThermo& carrierThermo();
//- Gas phase properties
inline const PtrList<specieReactingProperties>& carrierSpecies() const;
inline const PtrList<thermoType>& carrierSpecies() const;
// Sub-models
@ -200,15 +221,12 @@ public:
// Cloud evolution functions
//- Add new parcel
void addNewParcel
//- Check parcel properties
void checkParcelProperties
(
const vector& position,
const label cellId,
const scalar d,
const vector& U,
const scalar nParticles,
const scalar lagrangianDt
ParcelType* pPtr,
const scalar lagrangianDt,
const bool fullyDescribed
);
//- Reset the spray source terms

View File

@ -51,7 +51,7 @@ Foam::ReactingCloud<ParcelType>::carrierThermo()
template<class ParcelType>
inline const Foam::PtrList<Foam::specieReactingProperties>&
inline const Foam::PtrList<typename ParcelType::thermoType>&
Foam::ReactingCloud<ParcelType>::carrierSpecies() const
{
return carrierSpecies_;

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
\\ / A nd | Copyright (C) 2008-2009 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -29,60 +29,19 @@ License
#include "DevolatilisationModel.H"
#include "SurfaceReactionModel.H"
// * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * * //
template<class ParcelType>
void Foam::ReactingMultiphaseCloud<ParcelType>::addNewParcel
(
const vector& position,
const label cellId,
const scalar d,
const vector& U,
const scalar nParticles,
const scalar lagrangianDt
)
{
label idGas = this->composition().idGas();
label idLiquid = this->composition().idLiquid();
label idSolid = this->composition().idSolid();
ParcelType* pPtr = new ParcelType
(
*this,
position,
cellId,
this->parcelTypeId(),
nParticles,
d,
U,
this->composition().YMixture0(),
this->composition().Y0(idGas),
this->composition().Y0(idLiquid),
this->composition().Y0(idSolid),
constProps_
);
scalar continuousDt = this->db().time().deltaT().value();
pPtr->stepFraction() = (continuousDt - lagrangianDt)/continuousDt;
addParticle(pPtr);
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
template<class ParcelType>
Foam::ReactingMultiphaseCloud<ParcelType>::ReactingMultiphaseCloud
(
const word& cloudType,
const word& cloudName,
const volScalarField& rho,
const volVectorField& U,
const dimensionedVector& g,
hCombustionThermo& thermo,
PtrList<specieReactingProperties>& carrierSpecies
hCombustionThermo& thermo
)
:
ReactingCloud<ParcelType>(cloudType, rho, U, g, thermo, carrierSpecies),
ReactingCloud<ParcelType>(cloudName, rho, U, g, thermo),
reactingMultiphaseCloud(),
constProps_(this->particleProperties()),
devolatilisationModel_
@ -114,6 +73,55 @@ Foam::ReactingMultiphaseCloud<ParcelType>::~ReactingMultiphaseCloud()
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template<class ParcelType>
void Foam::ReactingMultiphaseCloud<ParcelType>::checkParcelProperties
(
ParcelType* pPtr,
const scalar lagrangianDt,
const bool fullyDescribed
)
{
ReactingCloud<ParcelType>::checkParcelProperties
(
pPtr,
lagrangianDt,
fullyDescribed
);
label idGas = this->composition().idGas();
label idLiquid = this->composition().idLiquid();
label idSolid = this->composition().idSolid();
if (!fullyDescribed)
{
pPtr->YGas() = this->composition().Y0(idGas);
pPtr->YLiquid() = this->composition().Y0(idLiquid);
pPtr->YSolid() = this->composition().Y0(idSolid);
}
else
{
this->checkSuppliedComposition
(
pPtr->YGas(),
this->composition().Y0(idGas),
"YGas"
);
this->checkSuppliedComposition
(
pPtr->YLiquid(),
this->composition().Y0(idLiquid),
"YLiquid"
);
this->checkSuppliedComposition
(
pPtr->YSolid(),
this->composition().Y0(idSolid),
"YSolid"
);
}
}
template<class ParcelType>
void Foam::ReactingMultiphaseCloud<ParcelType>::resetSourceTerms()
{
@ -190,6 +198,8 @@ void Foam::ReactingMultiphaseCloud<ParcelType>::evolve()
}
Cloud<ParcelType>::move(td);
this->postProcessing().post();
}

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
\\ / A nd | Copyright (C) 2008-2009 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -27,6 +27,7 @@ Class
Description
Templated base class for multiphase reacting cloud
- Adds to reacting cloud
- multiphase composition
- devolatilisatsion
@ -67,7 +68,18 @@ class ReactingMultiphaseCloud
public ReactingCloud<ParcelType>,
public reactingMultiphaseCloud
{
// Private data
// Private Member Functions
//- Disallow default bitwise copy construct
ReactingMultiphaseCloud(const ReactingMultiphaseCloud&);
//- Disallow default bitwise assignment
void operator=(const ReactingMultiphaseCloud&);
protected:
// Protected data
//- Parcel constant properties
typename ParcelType::constantProperties constProps_;
@ -100,15 +112,6 @@ class ReactingMultiphaseCloud
scalar dMassSurfaceReaction_;
// Private Member Functions
//- Disallow default bitwise copy construct
ReactingMultiphaseCloud(const ReactingMultiphaseCloud&);
//- Disallow default bitwise assignment
void operator=(const ReactingMultiphaseCloud&);
public:
// Constructors
@ -116,12 +119,11 @@ public:
//- Construct given carrier gas fields
ReactingMultiphaseCloud
(
const word& cloudType,
const word& cloudName,
const volScalarField& rho,
const volVectorField& U,
const dimensionedVector& g,
hCombustionThermo& thermo,
PtrList<specieReactingProperties>& carrierSpecies
hCombustionThermo& thermo
);
@ -173,15 +175,12 @@ public:
// Cloud evolution functions
//- Add new parcel
void addNewParcel
//- Check parcel properties
void checkParcelProperties
(
const vector& position,
const label cellId,
const scalar d,
const vector& U,
const scalar nParticles,
const scalar lagrangianDt
ParcelType* pPtr,
const scalar lagrangianDt,
const bool fullyDescribed
);
//- Reset the spray source terms

View File

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

View File

@ -30,44 +30,12 @@ License
#include "HeatTransferModel.H"
// * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * * //
template<class ParcelType>
void Foam::ThermoCloud<ParcelType>::addNewParcel
(
const vector& position,
const label cellId,
const scalar d,
const vector& U,
const scalar nParticles,
const scalar lagrangianDt
)
{
ParcelType* pPtr = new ParcelType
(
*this,
position,
cellId,
this->parcelTypeId(),
nParticles,
d,
U,
constProps_
);
scalar continuousDt = this->db().time().deltaT().value();
pPtr->stepFraction() = (continuousDt - lagrangianDt)/continuousDt;
addParticle(pPtr);
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
template<class ParcelType>
Foam::ThermoCloud<ParcelType>::ThermoCloud
(
const word& cloudType,
const word& cloudName,
const volScalarField& rho,
const volVectorField& U,
const dimensionedVector& g,
@ -76,7 +44,7 @@ Foam::ThermoCloud<ParcelType>::ThermoCloud
:
KinematicCloud<ParcelType>
(
cloudType,
cloudName,
rho,
U,
thermo.mu(),
@ -142,6 +110,29 @@ Foam::ThermoCloud<ParcelType>::~ThermoCloud()
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template<class ParcelType>
void Foam::ThermoCloud<ParcelType>::checkParcelProperties
(
ParcelType* pPtr,
const scalar lagrangianDt,
const bool fullyDescribed
)
{
KinematicCloud<ParcelType>::checkParcelProperties
(
pPtr,
lagrangianDt,
fullyDescribed
);
if (!fullyDescribed)
{
pPtr->T() = constProps_.T0();
pPtr->cp() = constProps_.cp0();
}
}
template<class ParcelType>
void Foam::ThermoCloud<ParcelType>::resetSourceTerms()
{
@ -212,6 +203,8 @@ void Foam::ThermoCloud<ParcelType>::evolve()
}
Cloud<ParcelType>::move(td);
this->postProcessing().post();
}

View File

@ -27,6 +27,7 @@ Class
Description
Templated base class for thermodynamic cloud
- Adds to kinematic cloud
- Heat transfer
@ -45,7 +46,6 @@ SourceFiles
#include "KinematicCloud.H"
#include "thermoCloud.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
@ -66,7 +66,18 @@ class ThermoCloud
public KinematicCloud<ParcelType>,
public thermoCloud
{
// Private data
// Private Member Functions
//- Disallow default bitwise copy construct
ThermoCloud(const ThermoCloud&);
//- Disallow default bitwise assignment
void operator=(const ThermoCloud&);
protected:
// Protected data
//- Thermo parcel constant properties
typename ParcelType::constantProperties constProps_;
@ -109,15 +120,6 @@ class ThermoCloud
DimensionedField<scalar, volMesh> hcTrans_;
// Private Member Functions
//- Disallow default bitwise copy construct
ThermoCloud(const ThermoCloud&);
//- Disallow default bitwise assignment
void operator=(const ThermoCloud&);
public:
// Constructors
@ -125,7 +127,7 @@ public:
//- Construct given carrier gas fields
ThermoCloud
(
const word& cloudType,
const word& cloudName,
const volScalarField& rho,
const volVectorField& U,
const dimensionedVector& g,
@ -215,15 +217,12 @@ public:
// Cloud evolution functions
//- Add new parcel
void addNewParcel
//- Check parcel properties
void checkParcelProperties
(
const vector& position,
const label cellId,
const scalar d,
const vector& U,
const scalar nParticles,
const scalar lagrangianDt
ParcelType* pPtr,
const scalar lagrangianDt,
const bool fullyDescribed
);
//- Reset the spray source terms

View File

@ -29,13 +29,14 @@ Description
Virtual abstract base class for templated KinematicCloud
SourceFiles
kinematicCloud.H
\*---------------------------------------------------------------------------*/
#ifndef kinematicCloud_H
#define kinematicCloud_H
#include "volFields.H"
#include "typeInfo.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -29,13 +29,14 @@ Description
Virtual abstract base class for templated ReactingCloud
SourceFiles
reactingCloud.C
\*---------------------------------------------------------------------------*/
#ifndef reactingCloud_H
#define reactingCloud_H
#include "volFields.H"
#include "typeInfo.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -29,13 +29,14 @@ Description
Virtual abstract base class for templated reactingMultiphaseCloud
SourceFiles
reactingMultiphaseCloud.C
\*---------------------------------------------------------------------------*/
#ifndef reactingMultiphaseCloud_H
#define reactingMultiphaseCloud_H
#include "volFields.H"
#include "typeInfo.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -29,6 +29,7 @@ Description
Virtual abstract base class for templated ThermoCloud
SourceFiles
thermoCloud.C
\*---------------------------------------------------------------------------*/

View File

@ -24,53 +24,46 @@ License
\*---------------------------------------------------------------------------*/
#include "basicReactingCloud.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
defineTypeNameAndDebug(basicReactingCloud, 0);
};
#include "BasicReactingCloud.H"
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::basicReactingCloud::basicReactingCloud
template<class ThermoType>
Foam::BasicReactingCloud<ThermoType>::BasicReactingCloud
(
const word& cloudType,
const word& cloudName,
const volScalarField& rho,
const volVectorField& U,
const dimensionedVector& g,
hCombustionThermo& thermo,
PtrList<specieReactingProperties>& carrierSpecies
hCombustionThermo& thermo
)
:
ReactingCloud<basicReactingParcel>
ReactingCloud<BasicReactingParcel<ThermoType> >
(
cloudType,
cloudName,
rho,
U,
g,
thermo,
carrierSpecies
thermo
)
{
basicReactingParcel::readFields(*this);
BasicReactingParcel<ThermoType>::readFields(*this);
}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::basicReactingCloud::~basicReactingCloud()
template<class ThermoType>
Foam::BasicReactingCloud<ThermoType>::~BasicReactingCloud()
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
void Foam::basicReactingCloud::writeFields() const
template<class ThermoType>
void Foam::BasicReactingCloud<ThermoType>::writeFields() const
{
basicReactingParcel::writeFields(*this);
BasicReactingParcel<ThermoType>::writeFields(*this);
}

View File

@ -23,66 +23,70 @@ License
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Class
Foam::basicReactingCloud
Foam::BasicReactingCloud
Description
Reacting cloud templated on the reacting parcel
Reacting cloud templated on the type of carrier phase thermodynamics
SourceFiles
basicReactingCloud.C
BasicReactingCloud.C
\*---------------------------------------------------------------------------*/
#ifndef basicReactingCloud_H
#define basicReactingCloud_H
#ifndef BasicReactingCloud_H
#define BasicReactingCloud_H
#include "ReactingCloud.H"
#include "basicReactingParcel.H"
#include "BasicReactingParcel.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// Forward declaration of classes
template<class ThermoType>
class BasicReactingCloud;
/*---------------------------------------------------------------------------*\
Class basicReactingCloud Declaration
Class BasicReactingCloud Declaration
\*---------------------------------------------------------------------------*/
class basicReactingCloud
template<class ThermoType>
class BasicReactingCloud
:
public ReactingCloud<basicReactingParcel>
public ReactingCloud<BasicReactingParcel<ThermoType> >
{
// Private Member Functions
//- Disallow default bitwise copy construct
basicReactingCloud(const basicReactingCloud&);
BasicReactingCloud(const BasicReactingCloud&);
//- Disallow default bitwise assignment
void operator=(const basicReactingCloud&);
void operator=(const BasicReactingCloud&);
public:
//- Runtime type information
TypeName("basicReactingCloud");
TypeName("BasicReactingCloud");
// Constructors
//- Construct given carrier gas fields
basicReactingCloud
BasicReactingCloud
(
const word& cloudType,
const word& cloudName,
const volScalarField& rho,
const volVectorField& U,
const dimensionedVector& g,
hCombustionThermo& thermo,
PtrList<specieReactingProperties>& carrierSpecies
hCombustionThermo& thermo
);
//- Destructor
~basicReactingCloud();
~BasicReactingCloud();
// Member Functions
@ -98,6 +102,12 @@ public:
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#ifdef NoRepository
#include "BasicReactingCloud.C"
#endif
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -24,20 +24,14 @@ License
\*---------------------------------------------------------------------------*/
#include "basicThermoParcel.H"
#include "KinematicCloud.H"
#include "NoDrag.H"
#include "SphereDrag.H"
#include "createReactingCloudTypes.H"
#include "BasicReactingCloud.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
makeDragModel(KinematicCloud<basicThermoParcel>);
// Add instances of drag model to the table
makeDragModelType(NoDrag, KinematicCloud, basicThermoParcel);
makeDragModelType(SphereDrag, KinematicCloud, basicThermoParcel);
createReactingCloudType(BasicReactingCloud);
};

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
\\ / A nd | Copyright (C) 2008-2009 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -24,31 +24,24 @@ License
\*---------------------------------------------------------------------------*/
#include "basicReactingMultiphaseCloud.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
defineTypeNameAndDebug(basicReactingMultiphaseCloud, 0);
};
#include "BasicReactingMultiphaseCloud.H"
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::basicReactingMultiphaseCloud::basicReactingMultiphaseCloud
template<class ThermoType>
Foam::BasicReactingMultiphaseCloud<ThermoType>::BasicReactingMultiphaseCloud
(
const word& cloudType,
const word& cloudName,
const volScalarField& rho,
const volVectorField& U,
const dimensionedVector& g,
hCombustionThermo& thermo,
PtrList<specieReactingProperties>& carrierSpecies
PtrList<ThermoType>& carrierSpecies
)
:
ReactingMultiphaseCloud<basicReactingMultiphaseParcel>
ReactingMultiphaseCloud<BasicReactingMultiphaseParcel<ThermoType> >
(
cloudType,
cloudName,
rho,
U,
g,
@ -56,21 +49,23 @@ Foam::basicReactingMultiphaseCloud::basicReactingMultiphaseCloud
carrierSpecies
)
{
basicReactingMultiphaseParcel::readFields(*this);
BasicReactingMultiphaseParcel<ThermoType>::readFields(*this);
}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::basicReactingMultiphaseCloud::~basicReactingMultiphaseCloud()
template<class ThermoType>
Foam::BasicReactingMultiphaseCloud<ThermoType>::~BasicReactingMultiphaseCloud()
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
void Foam::basicReactingMultiphaseCloud::writeFields() const
template<class ThermoType>
void Foam::BasicReactingMultiphaseCloud<ThermoType>::writeFields() const
{
basicReactingMultiphaseParcel::writeFields(*this);
BasicReactingMultiphaseParcel<ThermoType>::writeFields(*this);
}

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
\\ / A nd | Copyright (C) 2008-2009 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -23,66 +23,71 @@ License
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Class
Foam::basicReactingMultiphaseCloud
Foam::BasicReactingMultiphaseCloud
Description
Reacting cloud templated on the reacting multiphase parcel
Reacting multiphase cloud templated on the type of carrier phase thermodynamics
SourceFiles
basicReactingMultiphaseCloud.C
BasicReactingMultiphaseCloud.C
\*---------------------------------------------------------------------------*/
#ifndef basicReactingMultiphaseCloud_H
#define basicReactingMultiphaseCloud_H
#ifndef BasicReactingMultiphaseCloud_H
#define BasicReactingMultiphaseCloud_H
#include "ReactingMultiphaseCloud.H"
#include "basicReactingMultiphaseParcel.H"
#include "BasicReactingMultiphaseParcel.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// Forward declaration of classes
template<class ThermoType>
class BasicReactingMultiphaseCloud;
/*---------------------------------------------------------------------------*\
Class basicReactingMultiphaseCloud Declaration
Class BasicReactingMultiphaseCloud Declaration
\*---------------------------------------------------------------------------*/
class basicReactingMultiphaseCloud
template<class ThermoType>
class BasicReactingMultiphaseCloud
:
public ReactingMultiphaseCloud<basicReactingMultiphaseParcel>
public ReactingMultiphaseCloud<BasicReactingMultiphaseParcel<ThermoType> >
{
// Private Member Functions
//- Disallow default bitwise copy construct
basicReactingMultiphaseCloud(const basicReactingMultiphaseCloud&);
BasicReactingMultiphaseCloud(const BasicReactingMultiphaseCloud&);
//- Disallow default bitwise assignment
void operator=(const basicReactingMultiphaseCloud&);
void operator=(const BasicReactingMultiphaseCloud&);
public:
//- Runtime type information
TypeName("basicReactingMultiphaseCloud");
TypeName("BasicReactingMultiphaseCloud");
// Constructors
//- Construct given carrier gas fields
basicReactingMultiphaseCloud
BasicReactingMultiphaseCloud
(
const word& cloudType,
const word& cloudName,
const volScalarField& rho,
const volVectorField& U,
const dimensionedVector& g,
hCombustionThermo& thermo,
PtrList<specieReactingProperties>& carrierSpecies
PtrList<ThermoType>& carrierSpecies
);
//- Destructor
~basicReactingMultiphaseCloud();
~BasicReactingMultiphaseCloud();
// Member Functions
@ -98,6 +103,12 @@ public:
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#ifdef NoRepository
#include "BasicReactingMultiphaseCloud.C"
#endif
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -0,0 +1,38 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2008-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
\*---------------------------------------------------------------------------*/
#include "createReactingCloudTypes.H"
#include "BasicReactingMultiphaseCloud.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
createReactingCloudType(BasicReactingMultiphaseCloud);
};
// ************************************************************************* //

View File

@ -0,0 +1,70 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2008-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
\*---------------------------------------------------------------------------*/
#include "BasicTrackedReactingCloud.H"
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
template<class ThermoType>
Foam::BasicTrackedReactingCloud<ThermoType>::BasicTrackedReactingCloud
(
const word& cloudName,
const volScalarField& rho,
const volVectorField& U,
const dimensionedVector& g,
hCombustionThermo& thermo
)
:
ReactingCloud<BasicTrackedReactingParcel<ThermoType> >
(
cloudName,
rho,
U,
g,
thermo
)
{
BasicTrackedReactingParcel<ThermoType>::readFields(*this);
}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
template<class ThermoType>
Foam::BasicTrackedReactingCloud<ThermoType>::~BasicTrackedReactingCloud()
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template<class ThermoType>
void Foam::BasicTrackedReactingCloud<ThermoType>::writeFields() const
{
BasicTrackedReactingParcel<ThermoType>::writeFields(*this);
}
// ************************************************************************* //

View File

@ -0,0 +1,113 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2008-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::BasicTrackedReactingCloud
Description
Tracked racting cloud templated on the type of carrier phase thermodynamics
SourceFiles
BasicTrackedReactingCloud.C
\*---------------------------------------------------------------------------*/
#ifndef BasicTrackedReactingCloud_H
#define BasicTrackedReactingCloud_H
#include "ReactingCloud.H"
#include "BasicTrackedReactingParcel.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// Forward declaration of classes
template<class ThermoType>
class BasicTrackedReactingCloud;
/*---------------------------------------------------------------------------*\
Class BasicTrackedReactingCloud Declaration
\*---------------------------------------------------------------------------*/
template<class ThermoType>
class BasicTrackedReactingCloud
:
public ReactingCloud<BasicTrackedReactingParcel<ThermoType> >
{
// Private Member Functions
//- Disallow default bitwise copy construct
BasicTrackedReactingCloud(const BasicTrackedReactingCloud&);
//- Disallow default bitwise assignment
void operator=(const BasicTrackedReactingCloud&);
public:
//- Runtime type information
TypeName("BasicTrackedReactingCloud");
// Constructors
//- Construct given carrier gas fields
BasicTrackedReactingCloud
(
const word& cloudName,
const volScalarField& rho,
const volVectorField& U,
const dimensionedVector& g,
hCombustionThermo& thermo
);
//- Destructor
~BasicTrackedReactingCloud();
// Member Functions
//- Write fields
void writeFields() const;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#ifdef NoRepository
#include "BasicTrackedReactingCloud.C"
#endif
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -0,0 +1,38 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2008-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
\*---------------------------------------------------------------------------*/
#include "createReactingCloudTypes.H"
#include "BasicTrackedReactingCloud.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
createReactingCloudType(BasicTrackedReactingCloud);
};
// ************************************************************************* //

View File

@ -38,14 +38,14 @@ namespace Foam
Foam::basicKinematicCloud::basicKinematicCloud
(
const word& cloudType,
const word& cloudName,
const volScalarField& rho,
const volVectorField& U,
const volScalarField& mu,
const dimensionedVector& g
)
:
KinematicCloud<basicKinematicParcel>(cloudType, rho, U, mu, g)
KinematicCloud<basicKinematicParcel>(cloudName, rho, U, mu, g)
{
basicKinematicParcel::readFields(*this);
}
@ -64,4 +64,5 @@ void Foam::basicKinematicCloud::writeFields() const
basicKinematicParcel::writeFields(*this);
}
// ************************************************************************* //

View File

@ -72,7 +72,7 @@ public:
//- Construct from components
basicKinematicCloud
(
const word& cloudType,
const word& cloudName,
const volScalarField& rho,
const volVectorField& U,
const volScalarField& mu,

View File

@ -38,14 +38,14 @@ namespace Foam
Foam::basicThermoCloud::basicThermoCloud
(
const word& cloudType,
const word& cloudName,
const volScalarField& rho,
const volVectorField& U,
const dimensionedVector& g,
basicThermo& thermo
)
:
ThermoCloud<basicThermoParcel>(cloudType, rho, U, g, thermo)
ThermoCloud<basicThermoParcel>(cloudName, rho, U, g, thermo)
{
basicThermoParcel::readFields(*this);
}

View File

@ -26,6 +26,7 @@ Class
Foam::basicThermoCloud
Description
Cloud class to introduce thermodynamic parcels
SourceFiles
basicThermoCloud.C
@ -74,7 +75,7 @@ public:
//- Construct given carrier gas fields
basicThermoCloud
(
const word& cloudType,
const word& cloudName,
const volScalarField& rho,
const volVectorField& U,
const dimensionedVector& g,

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2007 OpenCFD Ltd.
\\ / A nd | Copyright (C) 2008-2009 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -24,26 +24,26 @@ License
\*---------------------------------------------------------------------------*/
#include "coalParcel.H"
#include "ReactingCloud.H"
#ifndef createReactingCloudTypes_H
#define createReactingCloudTypes_H
#include "ConeInjection.H"
#include "FieldActivatedInjection.H"
#include "ManualInjection.H"
#include "NoInjection.H"
#include "reactingThermoTypes.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
makeInjectionModel(KinematicCloud<coalParcel>);
#define createReactingCloudType(CloudType) \
\
createReactingCloudThermoType(CloudType, specieConstProperties); \
createReactingCloudThermoType(CloudType, specieReactingProperties);
// Add instances of injection model to the table
makeInjectionModelType(ConeInjection, KinematicCloud, coalParcel);
makeInjectionModelType(FieldActivatedInjection, KinematicCloud, coalParcel);
makeInjectionModelType(ManualInjection, KinematicCloud, coalParcel);
makeInjectionModelType(NoInjection, KinematicCloud, coalParcel);
};
#define createReactingCloudThermoType(CloudType, ThermoType) \
\
defineTemplateTypeNameAndDebug(CloudType<ThermoType>, 0);
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -103,6 +103,13 @@ void Foam::KinematicParcel<ParcelType>::calc
const scalar mass0 = mass();
// Explicit momentum source for particle
vector Su = vector::zero;
// Momentum transfer from the particle to the carrier phase
vector dUTrans = vector::zero;
// Motion
// ~~~~~~
@ -110,7 +117,7 @@ void Foam::KinematicParcel<ParcelType>::calc
vector Fx = vector::zero;
// Calculate new particle velocity
vector U1 = calcVelocity(td, dt, cellI, d0, U0, rho0, mass0, Fx);
vector U1 = calcVelocity(td, dt, cellI, d0, U0, rho0, mass0, Su, dUTrans);
// Accumulate carrier phase source terms
@ -118,7 +125,7 @@ void Foam::KinematicParcel<ParcelType>::calc
if (td.cloud().coupled())
{
// Update momentum transfer
td.cloud().UTrans()[cellI] += np0*mass0*(U0 - U1);
td.cloud().UTrans()[cellI] += np0*dUTrans;
}
@ -139,34 +146,68 @@ const Foam::vector Foam::KinematicParcel<ParcelType>::calcVelocity
const vector& U,
const scalar rho,
const scalar mass,
const vector& Fx
const vector& Su,
vector& dUTrans
) const
{
const polyMesh& mesh = this->cloud().pMesh();
// Return linearised term from drag model
scalar Cud = td.cloud().drag().Cu(U - Uc_, d, rhoc_, rho, muc_);
// Momentum transfer coefficient
const scalar ptc =
td.cloud().drag().ptc(U - Uc_, d, rhoc_, muc_) + ROOTVSMALL;
// Calculate particle forces
vector Ftot = td.cloud().forces().calc(cellI, dt, rhoc_, rho, Uc_, U);
// Momentum source due to particle forces
const vector PFCoupled =
mass*td.cloud().forces().calcCoupled(cellI, dt, rhoc_, rho, Uc_, U);
const vector PFNonCoupled =
mass*td.cloud().forces().calcNonCoupled(cellI, dt, rhoc_, rho, Uc_, U);
// New particle velocity
//~~~~~~~~~~~~~~~~~~~~~~
// Update velocity - treat as 3-D
const vector ap = Uc_ + (Ftot + Fx)/(Cud + VSMALL);
const scalar bp = Cud;
const scalar As = this->areaS(d);
const vector ap = Uc_ + (PFCoupled + PFNonCoupled + Su)/(ptc*As);
const scalar bp = 6.0*ptc/(rho*d);
vector Unew = td.cloud().UIntegrator().integrate(U, dt, ap, bp).value();
IntegrationScheme<vector>::integrationResult Ures =
td.cloud().UIntegrator().integrate(U, dt, ap, bp);
// Apply correction to velocity for reduced-D cases
vector Unew = Ures.value();
dUTrans += dt*(ptc*As*(Ures.average() - Uc_) - PFCoupled);
// Apply correction to velocity and dUTrans for reduced-D cases
meshTools::constrainDirection(mesh, mesh.solutionD(), Unew);
meshTools::constrainDirection(mesh, mesh.solutionD(), dUTrans);
return Unew;
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
template <class ParcelType>
Foam::KinematicParcel<ParcelType>::KinematicParcel
(
const KinematicParcel<ParcelType>& p
)
:
Particle<ParcelType>(p),
typeId_(p.typeId_),
nParticle_(p.nParticle_),
d_(p.d_),
U_(p.U_),
rho_(p.rho_),
tTurb_(p.tTurb_),
UTurb_(p.UTurb_),
rhoc_(p.rhoc_),
Uc_(p.Uc_),
muc_(p.muc_)
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template<class ParcelType>
@ -218,12 +259,9 @@ bool Foam::KinematicParcel<ParcelType>::move(TrackData& td)
if (p.onBoundary() && td.keepParticle)
{
if (p.face() > -1)
if (isType<processorPolyPatch>(pbMesh[p.patch(p.face())]))
{
if (isType<processorPolyPatch>(pbMesh[p.patch(p.face())]))
{
td.switchProcessor = true;
}
td.switchProcessor = true;
}
}
}
@ -232,6 +270,34 @@ bool Foam::KinematicParcel<ParcelType>::move(TrackData& td)
}
template<class ParcelType>
template<class TrackData>
bool Foam::KinematicParcel<ParcelType>::hitPatch
(
const polyPatch& pp,
TrackData& td,
const label patchI
)
{
ParcelType& p = static_cast<ParcelType&>(*this);
td.cloud().postProcessing().postPatch(p, patchI);
return td.cloud().patchInteraction().correct(pp, this->face(), U_);
}
template<class ParcelType>
bool Foam::KinematicParcel<ParcelType>::hitPatch
(
const polyPatch& pp,
int& td,
const label patchI
)
{
return false;
}
template<class ParcelType>
template<class TrackData>
void Foam::KinematicParcel<ParcelType>::hitProcessorPatch
@ -261,7 +327,7 @@ void Foam::KinematicParcel<ParcelType>::hitWallPatch
TrackData& td
)
{
td.cloud().wallInteraction().correct(wpp, this->face(), U_);
// Wall interactions handled by generic hitPatch function
}

View File

@ -243,20 +243,36 @@ protected:
const vector& U, // velocity
const scalar rho, // density
const scalar mass, // mass
const vector& Fx // additional forces
const vector& Su, // explicit particle momentum source
vector& dUTrans // momentum transfer to carrier
) const;
public:
//- Runtime type information
TypeName("KinematicParcel");
// Static data members
//- String representation of properties
static string propHeader;
//- Runtime type information
TypeName("KinematicParcel");
friend class Cloud<ParcelType>;
// Constructors
//- Construct from owner, position, and cloud owner
// Other properties initialised as null
inline KinematicParcel
(
KinematicCloud<ParcelType>& owner,
const vector& position,
const label cellI
);
//- Construct from components
inline KinematicParcel
(
@ -278,10 +294,13 @@ public:
bool readFields = true
);
//- Construct as a copy
KinematicParcel(const KinematicParcel& p);
//- Construct and return a clone
autoPtr<ParcelType> clone() const
autoPtr<KinematicParcel> clone() const
{
return autoPtr<ParcelType>(new KinematicParcel<ParcelType>(*this));
return autoPtr<KinematicParcel>(new KinematicParcel(*this));
}
@ -409,6 +428,27 @@ public:
// Patch interactions
//- Overridable function to handle the particle hitting a patch
// Executed before other patch-hitting functions
template<class TrackData>
bool hitPatch
(
const polyPatch& p,
TrackData& td,
const label patchI
);
//- Overridable function to handle the particle hitting a patch
// Executed before other patch-hitting functions without trackData
bool hitPatch
(
const polyPatch& p,
int& td,
const label patchI
);
//- Overridable function to handle the particle hitting a
// processorPatch
template<class TrackData>
@ -472,7 +512,7 @@ public:
//- Read
static void readFields(KinematicCloud<ParcelType>& c);
//- write
//- Write
static void writeFields(const KinematicCloud<ParcelType>& c);

View File

@ -63,6 +63,28 @@ inline Foam::KinematicParcel<ParcelType>::trackData::trackData
{}
template <class ParcelType>
inline Foam::KinematicParcel<ParcelType>::KinematicParcel
(
KinematicCloud<ParcelType>& owner,
const vector& position,
const label cellI
)
:
Particle<ParcelType>(owner, position, cellI),
typeId_(owner.parcelTypeId()),
nParticle_(0),
d_(0.0),
U_(vector::zero),
rho_(0.0),
tTurb_(0.0),
UTurb_(vector::zero),
rhoc_(0.0),
Uc_(vector::zero),
muc_(0.0)
{}
template <class ParcelType>
inline Foam::KinematicParcel<ParcelType>::KinematicParcel
(

View File

@ -29,6 +29,20 @@ License
#include "IOField.H"
#include "Cloud.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
template <class ParcelType>
Foam::string Foam::KinematicParcel<ParcelType>::propHeader =
Particle<ParcelType>::propHeader
+ " typeId"
+ " nParticle"
+ " d"
+ " (Ux Uy Uz)"
+ " rho"
+ " tTurb"
+ " UTurb";
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
template <class ParcelType>
@ -102,16 +116,16 @@ void Foam::KinematicParcel<ParcelType>::readFields
IOField<label> typeId(c.fieldIOobject("typeId", IOobject::MUST_READ));
c.checkFieldIOobject(c, typeId);
IOField<scalar>
nParticle(c.fieldIOobject("nParticle", IOobject::MUST_READ));
c.checkFieldIOobject(c, nParticle);
IOField<scalar> d(c.fieldIOobject("d", IOobject::MUST_READ));
c.checkFieldIOobject(c, d);
IOField<vector> U(c.fieldIOobject("U", IOobject::MUST_READ));
c.checkFieldIOobject(c, U);
IOField<scalar>
nParticle(c.fieldIOobject("nParticle", IOobject::MUST_READ));
c.checkFieldIOobject(c, nParticle);
IOField<scalar> rho(c.fieldIOobject("rho", IOobject::MUST_READ));
c.checkFieldIOobject(c, rho);

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
\\ / A nd | Copyright (C) 2008-2009 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -174,14 +174,7 @@ void Foam::ReactingMultiphaseParcel<ParcelType>::cellValueSourceCorrection
const scalar cpc = td.cpInterp().psi()[cellI];
this->cpc_ = (massCell*cpc + addedMass*cpEff)/massCellNew;
const scalar fCarrier =
(1.0 - td.cloud().constProps().hRetentionCoeff())
/td.cloud().constProps().hRetentionCoeff();
const scalar dh =
td.cloud().hsTrans()[cellI] - fCarrier*td.cloud().hcTrans()[cellI];
this->Tc_ += dh/(this->cpc_*massCellNew);
this->Tc_ += td.cloud().hsTrans()[cellI]/(this->cpc_*massCellNew);
}
@ -211,34 +204,17 @@ void Foam::ReactingMultiphaseParcel<ParcelType>::calc
const label idL = td.cloud().composition().idLiquid();
const label idS = td.cloud().composition().idSolid();
// Intial ethalpy state
scalar H0H = HEff(td, pc, T0, idG, idL, idS);
scalar H0L = LEff(td, pc, T0, idG, idL, idS);
scalar H0 = H0H - H0L;
// Explicit momentum source for particle
vector Su = vector::zero;
// Momentum transfer from the particle to the carrier phase
vector dUTrans = vector::zero;
// Phase change in liquid phase
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// Explicit enthalpy source for particle
scalar Sh = 0.0;
// Mass transfer due to phase change
scalarField dMassPC(YLiquid_.size(), 0.0);
// Return enthalpy source and calc mass transfer due to phase change
scalar ShPC =
calcPhaseChange
(
td,
dt,
cellI,
d0,
T0,
U0,
mass0,
idL,
YMix[LIQ],
YLiquid_,
dMassPC
);
// Sensible enthalpy transfer from the particle to the carrier phase
scalar dhsTrans = 0.0;
// Devolatilisation
@ -247,21 +223,22 @@ void Foam::ReactingMultiphaseParcel<ParcelType>::calc
// Mass transfer due to devolatilisation
scalarField dMassDV(YGas_.size(), 0.0);
// Return enthalpy source and calc mass transfer due to devolatilisation
scalar ShDV =
calcDevolatilisation
(
td,
dt,
T0,
mass0,
this->mass0_,
idG,
YMix[GAS],
YGas_,
canCombust_,
dMassDV
);
// Calc mass and enthalpy transfer due to devolatilisation
calcDevolatilisation
(
td,
dt,
T0,
mass0,
this->mass0_,
idG,
YMix[GAS],
YGas_,
canCombust_,
dMassDV,
Sh,
dhsTrans
);
// Surface reactions
@ -273,30 +250,53 @@ void Foam::ReactingMultiphaseParcel<ParcelType>::calc
scalarField dMassSRSolid(YSolid_.size(), 0.0);
scalarField dMassSRCarrier(td.cloud().carrierSpecies().size(), 0.0);
// Return enthalpy source and calc mass transfer(s) due to surface reaction
scalar hReaction =
calcSurfaceReactions
(
td,
dt,
cellI,
d0,
T0,
mass0,
canCombust_,
dMassDV, // assuming d(mass) due to phase change is non-volatile
YMix,
YGas_,
YLiquid_,
YSolid_,
dMassSRGas,
dMassSRLiquid,
dMassSRSolid,
dMassSRCarrier
);
// Clac mass and enthalpy transfer due to surface reactions
calcSurfaceReactions
(
td,
dt,
cellI,
d0,
T0,
mass0,
canCombust_,
dMassDV, // assuming d(mass) due to phase change is non-volatile
YMix,
YGas_,
YLiquid_,
YSolid_,
dMassSRGas,
dMassSRLiquid,
dMassSRSolid,
dMassSRCarrier,
Sh,
dhsTrans
);
// Heat of reaction retained by particle
const scalar ShSR = td.constProps().hRetentionCoeff()*hReaction;
// Phase change in liquid phase
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// Mass transfer due to phase change
scalarField dMassPC(YLiquid_.size(), 0.0);
// Calc mass and enthalpy transfer due to phase change
calcPhaseChange
(
td,
dt,
cellI,
d0,
T0,
U0,
mass0,
idL,
YMix[LIQ],
YLiquid_,
dMassPC,
Sh,
dhsTrans
);
// Update component mass fractions
@ -313,27 +313,18 @@ void Foam::ReactingMultiphaseParcel<ParcelType>::calc
// Heat transfer
// ~~~~~~~~~~~~~
// Total enthalpy source
scalar Sh = ShPC + ShDV + ShSR;
// Calculate new particle temperature
scalar T1 = calcHeatTransfer(td, dt, cellI, d0, U0, rho0, T0, cp0, Sh);
// Calculate new enthalpy state based on updated composition at new
// temperature
scalar H1H = HEff(td, pc, T1, idG, idL, idS);
scalar H1L = LEff(td, pc, T1, idG, idL, idS);
scalar H1 = H1H - H1L;
scalar T1 =
calcHeatTransfer(td, dt, cellI, d0, U0, rho0, T0, cp0, Sh, dhsTrans);
// Motion
// ~~~~~~
// No additional forces
vector Fx = vector::zero;
// Calculate new particle velocity
vector U1 = calcVelocity(td, dt, cellI, d0, U0, rho0, mass0, Fx);
vector U1 = calcVelocity(td, dt, cellI, d0, U0, rho0, mass0, Su, dUTrans);
dUTrans += 0.5*(mass0 - mass1)*(U0 + U1);
// Accumulate carrier phase source terms
@ -344,35 +335,48 @@ void Foam::ReactingMultiphaseParcel<ParcelType>::calc
// Transfer mass lost from particle to carrier mass source
forAll(YGas_, i)
{
label id = td.cloud().composition().localToGlobalCarrierId(GAS, i);
td.cloud().rhoTrans(id)[cellI] += np0*dMassGas[i];
label gid = td.cloud().composition().localToGlobalCarrierId(GAS, i);
td.cloud().rhoTrans(gid)[cellI] += np0*dMassGas[i];
td.cloud().hcTrans()[cellI] +=
np0
*dMassGas[i]
*td.cloud().composition().carrierSpecies()[gid].H(T0);
}
forAll(YLiquid_, i)
{
label id = td.cloud().composition().localToGlobalCarrierId(LIQ, i);
td.cloud().rhoTrans(id)[cellI] += np0*dMassLiquid[i];
label gid = td.cloud().composition().localToGlobalCarrierId(LIQ, i);
td.cloud().rhoTrans(gid)[cellI] += np0*dMassLiquid[i];
td.cloud().hcTrans()[cellI] +=
np0
*dMassLiquid[i]
*td.cloud().composition().carrierSpecies()[gid].H(T0);
}
/*
// No mapping between solid components and carrier phase
forAll(YSolid_, i)
{
label id = td.cloud().composition().localToGlobalCarrierId(SLD, i);
td.cloud().rhoTrans(id)[cellI] += np0*dMassSolid[i];
label gid = td.cloud().composition().localToGlobalCarrierId(SLD, i);
td.cloud().rhoTrans(gid)[cellI] += np0*dMassSolid[i];
td.cloud().hcTrans()[cellI] +=
np0
*dMassSolid[i]
*td.cloud().composition().carrierSpecies()[gid].H(T0);
}
*/
forAll(dMassSRCarrier, i)
{
td.cloud().rhoTrans(i)[cellI] += np0*dMassSRCarrier[i];
td.cloud().hcTrans()[cellI] +=
np0
*dMassSRCarrier[i]
*td.cloud().composition().carrierSpecies()[i].H(T0);
}
// Update momentum transfer
td.cloud().UTrans()[cellI] += np0*(mass0*U0 - mass1*U1);
td.cloud().UTrans()[cellI] += np0*dUTrans;
// Update sensible enthalpy transfer
td.cloud().hsTrans()[cellI] += np0*(mass0*H0 - mass1*H1);
// Update chemical enthalpy transfer
td.cloud().hcTrans()[cellI] -= np0*ShSR;
td.cloud().hsTrans()[cellI] += np0*dhsTrans;
}
@ -388,29 +392,30 @@ void Foam::ReactingMultiphaseParcel<ParcelType>::calc
// Absorb parcel into carrier phase
forAll(YGas_, i)
{
label id =
label gid =
td.cloud().composition().localToGlobalCarrierId(GAS, i);
td.cloud().rhoTrans(id)[cellI] += np0*mass1*YMix[GAS]*YGas_[i];
td.cloud().rhoTrans(gid)[cellI] += np0*mass1*YMix[GAS]*YGas_[i];
}
forAll(YLiquid_, i)
{
label id =
label gid =
td.cloud().composition().localToGlobalCarrierId(LIQ, i);
td.cloud().rhoTrans(id)[cellI] +=
td.cloud().rhoTrans(gid)[cellI] +=
np0*mass1*YMix[LIQ]*YLiquid_[i];
}
/*
// No mapping between solid components and carrier phase
forAll(YSolid_, i)
{
label id =
label gid =
td.cloud().composition().localToGlobalCarrierId(SLD, i);
td.cloud().rhoTrans(id)[cellI] +=
td.cloud().rhoTrans(gid)[cellI] +=
np0*mass1*YMix[SLD]*YSolid_[i];
}
*/
td.cloud().UTrans()[cellI] += np0*mass1*U1;
td.cloud().hsTrans()[cellI] += np0*mass1*H1;
td.cloud().hsTrans()[cellI] +=
np0*mass1*HEff(td, pc, T1, idG, idL, idS);
}
}
@ -420,9 +425,9 @@ void Foam::ReactingMultiphaseParcel<ParcelType>::calc
else
{
this->U_ = U1;
this->T_ = T1;
this->cp_ = cpEff(td, pc, T1, idG, idL, idS);
this->T_ = T1;
this->U_ = U1;
// Update particle density or diameter
if (td.constProps().constantVolume())
@ -439,7 +444,7 @@ void Foam::ReactingMultiphaseParcel<ParcelType>::calc
template<class ParcelType>
template<class TrackData>
Foam::scalar Foam::ReactingMultiphaseParcel<ParcelType>::calcDevolatilisation
void Foam::ReactingMultiphaseParcel<ParcelType>::calcDevolatilisation
(
TrackData& td,
const scalar dt,
@ -450,7 +455,9 @@ Foam::scalar Foam::ReactingMultiphaseParcel<ParcelType>::calcDevolatilisation
const scalar YVolatileTot,
const scalarField& YVolatile,
bool& canCombust,
scalarField& dMassDV
scalarField& dMassDV,
scalar& Sh,
scalar& dhsTrans
) const
{
// Check that model is active, and that the parcel temperature is
@ -459,10 +466,9 @@ Foam::scalar Foam::ReactingMultiphaseParcel<ParcelType>::calcDevolatilisation
(
!td.cloud().devolatilisation().active()
|| T < td.constProps().Tvap()
|| T < td.constProps().Tbp()
)
{
return 0.0;
return;
}
// Total mass of volatiles evolved
@ -482,13 +488,13 @@ Foam::scalar Foam::ReactingMultiphaseParcel<ParcelType>::calcDevolatilisation
td.cloud().addToMassDevolatilisation(this->nParticle_*dMassTot);
return -dMassTot*td.constProps().LDevol();
Sh -= dMassTot*td.constProps().LDevol()/dt;
}
template<class ParcelType>
template<class TrackData>
Foam::scalar Foam::ReactingMultiphaseParcel<ParcelType>::calcSurfaceReactions
void Foam::ReactingMultiphaseParcel<ParcelType>::calcSurfaceReactions
(
TrackData& td,
const scalar dt,
@ -505,13 +511,15 @@ Foam::scalar Foam::ReactingMultiphaseParcel<ParcelType>::calcSurfaceReactions
scalarField& dMassSRGas,
scalarField& dMassSRLiquid,
scalarField& dMassSRSolid,
scalarField& dMassSRCarrier
scalarField& dMassSRCarrier,
scalar& Sh,
scalar& dhsTrans
) const
{
// Check that model is active
if (!td.cloud().surfaceReaction().active() || !canCombust)
{
return 0.0;
return;
}
// Update surface reactions
@ -542,10 +550,31 @@ Foam::scalar Foam::ReactingMultiphaseParcel<ParcelType>::calcSurfaceReactions
*(sum(dMassSRGas) + sum(dMassSRLiquid) + sum(dMassSRSolid))
);
return hReaction;
const scalar xsi = min(T/5000.0, 1.0);
const scalar hRetentionCoeffMod =
(1.0 - xsi*xsi)*td.constProps().hRetentionCoeff();
Sh += hRetentionCoeffMod *hReaction/dt;
dhsTrans += (1.0 - hRetentionCoeffMod)*hReaction;
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
template <class ParcelType>
Foam::ReactingMultiphaseParcel<ParcelType>::ReactingMultiphaseParcel
(
const ReactingMultiphaseParcel<ParcelType>& p
)
:
ReactingParcel<ParcelType>(p),
YGas_(p.YGas_),
YLiquid_(p.YLiquid_),
YSolid_(p.YSolid_)
{}
// * * * * * * * * * * * * * * IOStream operators * * * * * * * * * * * * * //
#include "ReactingMultiphaseParcelIO.C"

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
\\ / A nd | Copyright (C) 2008-2009 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -223,7 +223,7 @@ protected:
//- Calculate Devolatilisation
template<class TrackData>
scalar calcDevolatilisation
void calcDevolatilisation
(
TrackData& td,
const scalar dt, // timestep
@ -234,12 +234,14 @@ protected:
const scalar YVolatileTot, // total volatile mass fraction
const scalarField& YVolatile, // volatile component mass fractions
bool& canCombust, // 'can combust' flag
scalarField& dMassDV // mass transfer - local to particle
scalarField& dMassDV, // mass transfer - local to particle
scalar& Sh, // explicit particle enthalpy source
scalar& dhsTrans // sensible enthalpy transfer to carrier
) const;
//- Calculate surface reactions
template<class TrackData>
scalar calcSurfaceReactions
void calcSurfaceReactions
(
TrackData& td,
const scalar dt, // timestep
@ -256,20 +258,38 @@ protected:
scalarField& dMassSRGas, // gas-phase mass transfer - local
scalarField& dMassSRLiquid,// liquid-phase mass transfer - local
scalarField& dMassSRSolid, // solid-phase mass transfer - local
scalarField& dMassSRCarrier// carrier phase mass transfer
scalarField& dMassSRCarrier, // carrier phase mass transfer
scalar& Sh, // explicit particle enthalpy source
scalar& dhsTrans // sensible enthalpy transfer to carrier
) const;
public:
//- Runtime type information
TypeName("ReactingMultiphaseParcel");
// Static data members
//- String representation of properties
static string propHeader;
//- Runtime type information
TypeName("ReactingMultiphaseParcel");
friend class Cloud<ParcelType>;
// Constructors
//- Construct from owner, position, and cloud owner
// Other properties initialised as null
inline ReactingMultiphaseParcel
(
ReactingMultiphaseCloud<ParcelType>& owner,
const vector& position,
const label cellI
);
//- Construct from components
inline ReactingMultiphaseParcel
(
@ -295,13 +315,17 @@ public:
bool readFields = true
);
//- Construct as a copy
ReactingMultiphaseParcel(const ReactingMultiphaseParcel& p);
//- Construct and return a clone
autoPtr<ParcelType> clone() const
autoPtr<ReactingMultiphaseParcel> clone() const
{
return autoPtr<ParcelType>
(
new ReactingMultiphaseParcel<ParcelType>(*this)
);
return
autoPtr<ReactingMultiphaseParcel>
(
new ReactingMultiphaseParcel(*this)
);
}
@ -318,6 +342,9 @@ public:
//- Return const access to mass fractions of solids
inline const scalarField& YSolid() const;
//- Return const access to the canCombust flag
inline bool canCombust() const;
// Edit
@ -330,6 +357,9 @@ public:
//- Return access to mass fractions of solids
inline scalarField& YSolid();
//- Return access to the canCombust flag
inline bool& canCombust();
// Main calculation loop

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
\\ / A nd | Copyright (C) 2008-2009 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -85,6 +85,22 @@ inline Foam::ReactingMultiphaseParcel<ParcelType>::trackData::trackData
{}
template <class ParcelType>
inline Foam::ReactingMultiphaseParcel<ParcelType>::ReactingMultiphaseParcel
(
ReactingMultiphaseCloud<ParcelType>& owner,
const vector& position,
const label cellI
)
:
ReactingParcel<ParcelType>(owner, position, cellI),
YGas_(0),
YLiquid_(0),
YSolid_(0),
canCombust_(false)
{}
template<class ParcelType>
inline Foam::ReactingMultiphaseParcel<ParcelType>::ReactingMultiphaseParcel
(
@ -185,6 +201,13 @@ YSolid() const
}
template<class ParcelType>
inline bool Foam::ReactingMultiphaseParcel<ParcelType>::canCombust() const
{
return canCombust_;
}
template<class ParcelType>
inline Foam::scalarField& Foam::ReactingMultiphaseParcel<ParcelType>::YGas()
{
@ -206,4 +229,10 @@ inline Foam::scalarField& Foam::ReactingMultiphaseParcel<ParcelType>::YSolid()
}
template<class ParcelType>
inline bool& Foam::ReactingMultiphaseParcel<ParcelType>::canCombust()
{
return canCombust_;
}
// ************************************************************************* //

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
\\ / A nd | Copyright (C) 2008-2009 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -27,6 +27,16 @@ License
#include "ReactingMultiphaseParcel.H"
#include "IOstreams.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
template <class ParcelType>
Foam::string Foam::ReactingMultiphaseParcel<ParcelType>::propHeader =
ReactingParcel<ParcelType>::propHeader
+ " nGas(Y1..YN)"
+ " nLiquid(Y1..YN)"
+ " nSolid(Y1..YN)";
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
template<class ParcelType>

View File

@ -138,10 +138,17 @@ void Foam::ReactingParcel<ParcelType>::calc
const scalar cp0 = this->cp_;
const scalar mass0 = this->mass();
// Intial ethalpy state
scalar H0H = td.cloud().composition().H(0, Y_, pc_, T0);
scalar H0L = td.cloud().composition().L(0, Y_, pc_, T0);
scalar H0 = H0H - H0L;
// Explicit momentum source for particle
vector Su = vector::zero;
// Momentum transfer from the particle to the carrier phase
vector dUTrans = vector::zero;
// Explicit enthalpy source for particle
scalar Sh = 0.0;
// Sensible enthalpy transfer from the particle to the carrier phase
scalar dhsTrans = 0.0;
// Phase change
@ -150,9 +157,23 @@ void Foam::ReactingParcel<ParcelType>::calc
// Mass transfer due to phase change
scalarField dMassPC(Y_.size(), 0.0);
// Return enthalpy source and calc mass transfer due to phase change
scalar ShPC =
calcPhaseChange(td, dt, cellI, d0, T0, U0, mass0, 0, 1.0, Y_, dMassPC);
// Calc mass and enthalpy transfer due to phase change
calcPhaseChange
(
td,
dt,
cellI,
d0,
T0,
U0,
mass0,
0,
1.0,
Y_,
dMassPC,
Sh,
dhsTrans
);
// Update particle component mass and mass fractions
scalar mass1 = updateMassFraction(mass0, dMassPC, Y_);
@ -162,12 +183,8 @@ void Foam::ReactingParcel<ParcelType>::calc
// ~~~~~~~~~~~~~
// Calculate new particle temperature
scalar T1 = calcHeatTransfer(td, dt, cellI, d0, U0, rho0, T0, cp0, ShPC);
// Calculate new enthalpy state
scalar H1H = td.cloud().composition().H(0, Y_, pc_, T1);
scalar H1L = td.cloud().composition().L(0, Y_, pc_, T1);
scalar H1 = H1H - H1L;
scalar T1 =
calcHeatTransfer(td, dt, cellI, d0, U0, rho0, T0, cp0, Sh, dhsTrans);
// Motion
@ -177,8 +194,9 @@ void Foam::ReactingParcel<ParcelType>::calc
vector Fx = vector::zero;
// Calculate new particle velocity
vector U1 = calcVelocity(td, dt, cellI, d0, U0, rho0, mass0, Fx);
vector U1 = calcVelocity(td, dt, cellI, d0, U0, rho0, mass0, Su, dUTrans);
dUTrans += 0.5*(mass0 - mass1)*(U0 + U1);
// Accumulate carrier phase source terms
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@ -187,15 +205,19 @@ void Foam::ReactingParcel<ParcelType>::calc
// Transfer mass lost from particle to carrier mass source
forAll(dMassPC, i)
{
label id = td.cloud().composition().localToGlobalCarrierId(0, i);
td.cloud().rhoTrans(id)[cellI] += np0*dMassPC[i];
label gid = td.cloud().composition().localToGlobalCarrierId(0, i);
td.cloud().rhoTrans(gid)[cellI] += np0*dMassPC[i];
td.cloud().hcTrans()[cellI] +=
np0
*dMassPC[i]
*td.cloud().composition().carrierSpecies()[gid].H(T0);
}
// Update momentum transfer
td.cloud().UTrans()[cellI] += np0*(mass0*U0 - mass1*U1);
td.cloud().UTrans()[cellI] += np0*dUTrans;
// Update sensible enthalpy transfer
td.cloud().hsTrans()[cellI] += np0*(mass0*H0 - mass1*H1);
td.cloud().hsTrans()[cellI] += np0*dhsTrans;
}
@ -210,12 +232,13 @@ void Foam::ReactingParcel<ParcelType>::calc
// Absorb parcel into carrier phase
forAll(Y_, i)
{
label id =
label gid =
td.cloud().composition().localToGlobalCarrierId(0, i);
td.cloud().rhoTrans(id)[cellI] += np0*mass1*Y_[i];
td.cloud().rhoTrans(gid)[cellI] += np0*mass1*Y_[i];
}
td.cloud().UTrans()[cellI] += np0*mass1*U1;
td.cloud().hsTrans()[cellI] += np0*mass1*H1;
td.cloud().hcTrans()[cellI] +=
np0*mass1*td.cloud().composition().H(0, Y_, pc_, T1);
}
}
@ -225,9 +248,9 @@ void Foam::ReactingParcel<ParcelType>::calc
else
{
this->U_ = U1;
this->T_ = T1;
this->cp_ = td.cloud().composition().cp(0, Y_, pc_, T1);
this->T_ = T1;
this->U_ = U1;
// Update particle density or diameter
if (td.constProps().constantVolume())
@ -244,7 +267,7 @@ void Foam::ReactingParcel<ParcelType>::calc
template<class ParcelType>
template<class TrackData>
Foam::scalar Foam::ReactingParcel<ParcelType>::calcPhaseChange
void Foam::ReactingParcel<ParcelType>::calcPhaseChange
(
TrackData& td,
const scalar dt,
@ -256,7 +279,9 @@ Foam::scalar Foam::ReactingParcel<ParcelType>::calcPhaseChange
const label idPhase,
const scalar YPhase,
const scalarField& YComponents,
scalarField& dMassPC
scalarField& dMassPC,
scalar& Sh,
scalar& dhsTrans
)
{
if
@ -266,7 +291,7 @@ Foam::scalar Foam::ReactingParcel<ParcelType>::calcPhaseChange
|| YPhase < SMALL
)
{
return 0.0;
return;
}
// Calculate mass transfer due to phase change
@ -275,7 +300,7 @@ Foam::scalar Foam::ReactingParcel<ParcelType>::calcPhaseChange
dt,
cellI,
d,
min(T, td.constProps().Tbp()), // Limit to boiling temperature
T,
pc_,
this->Tc_,
this->muc_/(this->rhoc_ + ROOTVSMALL),
@ -291,13 +316,38 @@ Foam::scalar Foam::ReactingParcel<ParcelType>::calcPhaseChange
// Add to cumulative phase change mass
td.cloud().addToMassPhaseChange(this->nParticle_*dMassTot);
// Effective latent heat of vaporisation
scalar LEff = td.cloud().composition().L(idPhase, YComponents, pc_, T);
// Enthalphy transfer to carrier phase
forAll(YComponents, i)
{
label gid;
return -dMassTot*LEff;
gid = td.cloud().composition().localToGlobalCarrierId(idPhase, i);
const scalar hv = td.cloud().composition().carrierSpecies()[gid].H(T);
gid = td.cloud().composition().globalIds(idPhase)[i];
const scalar hl =
td.cloud().composition().liquids().properties()[gid].h(pc_, T);
Sh += dMassPC[i]*(hl - hv)/dt;
}
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
template <class ParcelType>
Foam::ReactingParcel<ParcelType>::ReactingParcel
(
const ReactingParcel<ParcelType>& p
)
:
ThermoParcel<ParcelType>(p),
mass0_(p.mass0_),
Y_(p.Y_),
pc_(p.pc_)
{}
// * * * * * * * * * * * * * * IOStream operators * * * * * * * * * * * * * //
#include "ReactingParcelIO.C"

View File

@ -46,6 +46,7 @@ SourceFiles
#include "ThermoParcel.H"
#include "ReactingCloud.H"
#include "reactingParcel.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -69,6 +70,7 @@ Ostream& operator<<
template<class ParcelType>
class ReactingParcel
:
public reactingParcel,
public ThermoParcel<ParcelType>
{
public:
@ -86,10 +88,7 @@ public:
//- Constant volume flag - e.g. during mass transfer
Switch constantVolume_;
//- Boiling point [K]
const scalar Tbp_;
//- Vapourisation temperature [K]
//- Vaporisation temperature [K]
const scalar Tvap_;
@ -106,10 +105,7 @@ public:
//- Return const access to the constant volume flag
inline Switch constantVolume() const;
//- Return const access to the boiling point
inline scalar Tbp() const;
//- Return const access to the vapourisation temperature
//- Return const access to the vaporisation temperature
inline scalar Tvap() const;
};
@ -159,7 +155,7 @@ public:
//- Return const access to the constant properties
inline const constantProperties& constProps() const;
//- Return conat access to the interpolator for continuous
//- Return const access to the interpolator for continuous
// phase pressure field
inline const interpolation<scalar>& pInterp() const;
};
@ -188,7 +184,7 @@ protected:
//- Calculate Phase change
template<class TrackData>
scalar calcPhaseChange
void calcPhaseChange
(
TrackData& td,
const scalar dt, // timestep
@ -200,7 +196,9 @@ protected:
const label idPhase, // id of phase involved in phase change
const scalar YPhase, // total mass fraction
const scalarField& YComponents, // component mass fractions
scalarField& dMassPC // mass transfer - local to particle
scalarField& dMassPC, // mass transfer - local to particle
scalar& Sh, // explicit particle enthalpy source
scalar& dhsTrans // sensible enthalpy transfer to carrier
);
//- Update mass fraction
@ -214,14 +212,29 @@ protected:
public:
//- Runtime type information
TypeName("ReactingParcel");
// Static data members
//- String representation of properties
static string propHeader;
//- Runtime type information
TypeName("ReactingParcel");
friend class Cloud<ParcelType>;
// Constructors
//- Construct from owner, position, and cloud owner
// Other properties initialised as null
inline ReactingParcel
(
ReactingCloud<ParcelType>& owner,
const vector& position,
const label cellI
);
//- Construct from components
inline ReactingParcel
(
@ -244,10 +257,13 @@ public:
bool readFields = true
);
//- Construct as a copy
ReactingParcel(const ReactingParcel& p);
//- Construct and return a clone
autoPtr<ParcelType> clone() const
autoPtr<ReactingParcel> clone() const
{
return autoPtr<ParcelType>(new ReactingParcel<ParcelType>(*this));
return autoPtr<ReactingParcel>(new ReactingParcel(*this));
}

View File

@ -35,7 +35,6 @@ inline Foam::ReactingParcel<ParcelType>::constantProperties::constantProperties
ThermoParcel<ParcelType>::constantProperties(parentDict),
pMin_(dimensionedScalar(this->dict().lookup("pMin")).value()),
constantVolume_(this->dict().lookup("constantVolume")),
Tbp_(dimensionedScalar(this->dict().lookup("Tbp")).value()),
Tvap_(dimensionedScalar(this->dict().lookup("Tvap")).value())
{}
@ -71,6 +70,21 @@ inline Foam::ReactingParcel<ParcelType>::trackData::trackData
{}
template<class ParcelType>
inline Foam::ReactingParcel<ParcelType>::ReactingParcel
(
ReactingCloud<ParcelType>& owner,
const vector& position,
const label cellI
)
:
ThermoParcel<ParcelType>(owner, position, cellI),
mass0_(0.0),
Y_(0),
pc_(0.0)
{}
template<class ParcelType>
inline Foam::ReactingParcel<ParcelType>::ReactingParcel
(
@ -123,14 +137,6 @@ Foam::ReactingParcel<ParcelType>::constantProperties::constantVolume() const
}
template<class ParcelType>
inline Foam::scalar
Foam::ReactingParcel<ParcelType>::constantProperties::Tbp() const
{
return Tbp_;
}
template<class ParcelType>
inline Foam::scalar
Foam::ReactingParcel<ParcelType>::constantProperties::Tvap() const

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