mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
Merge branch 'master' of /home/dm4/OpenFOAM/OpenFOAM-dev
This commit is contained in:
@ -237,8 +237,6 @@ public:
|
||||
Ostream& os,
|
||||
const cv2DControls& s
|
||||
);
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
@ -23,7 +23,6 @@ License
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
|
||||
inline Foam::scalar Foam::cv2DControls::minCellSize() const
|
||||
{
|
||||
return minCellSize_;
|
||||
|
||||
@ -106,3 +106,5 @@ inline int CGAL::indexedFace<Gt, Fb>::faceIndex() const
|
||||
return index_;
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
@ -228,3 +228,6 @@ bool CGAL::outsideTriangle
|
||||
|| (v1.farPoint() || v1.ppSlave())
|
||||
|| (v2.farPoint() || v2.ppSlave());
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
@ -46,6 +46,8 @@ wmake $makeType genericPatchFields
|
||||
# Build the proper scotchDecomp, metisDecomp etc.
|
||||
parallel/Allwmake $*
|
||||
|
||||
wmake $makeType renumberMethods
|
||||
|
||||
wmake $makeType conversion
|
||||
|
||||
wmake $makeType sampling
|
||||
|
||||
@ -0,0 +1,86 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "CompatibilityConstant.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
template<class Type>
|
||||
Foam::CompatibilityConstant<Type>::CompatibilityConstant
|
||||
(
|
||||
const word& entryName, const dictionary& dict
|
||||
)
|
||||
:
|
||||
DataEntry<Type>(entryName),
|
||||
value_(pTraits<Type>::zero)
|
||||
{
|
||||
dict.lookup(entryName) >> value_;
|
||||
}
|
||||
|
||||
|
||||
template<class Type>
|
||||
Foam::CompatibilityConstant<Type>::CompatibilityConstant
|
||||
(
|
||||
const CompatibilityConstant<Type>& cnst
|
||||
)
|
||||
:
|
||||
DataEntry<Type>(cnst),
|
||||
value_(cnst.value_)
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
||||
|
||||
template<class Type>
|
||||
Foam::CompatibilityConstant<Type>::~CompatibilityConstant()
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
template<class Type>
|
||||
Type Foam::CompatibilityConstant<Type>::value(const scalar x) const
|
||||
{
|
||||
return value_;
|
||||
}
|
||||
|
||||
|
||||
template<class Type>
|
||||
Type Foam::CompatibilityConstant<Type>::integrate
|
||||
(
|
||||
const scalar x1,
|
||||
const scalar x2
|
||||
) const
|
||||
{
|
||||
return (x2 - x1)*value_;
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * IOStream operators * * * * * * * * * * * * * //
|
||||
|
||||
#include "CompatibilityConstantIO.C"
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,143 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Class
|
||||
Foam::CompatibilityConstant
|
||||
|
||||
Description
|
||||
Templated basic entry that holds a constant value for backwards
|
||||
compatibility (when DataEntry type is not present)
|
||||
|
||||
Usage - for entry \<entryName\> having the value <value>:
|
||||
\verbatim
|
||||
<entryName> <value>
|
||||
\endverbatim
|
||||
|
||||
SourceFiles
|
||||
CompatibilityConstant.C
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef CompatibilityConstant_H
|
||||
#define CompatibilityConstant_H
|
||||
|
||||
#include "DataEntry.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
|
||||
template<class Type>
|
||||
class CompatibilityConstant;
|
||||
|
||||
template<class Type>
|
||||
Ostream& operator<<(Ostream&, const CompatibilityConstant<Type>&);
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class CompatibilityConstant Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
template<class Type>
|
||||
class CompatibilityConstant
|
||||
:
|
||||
public DataEntry<Type>
|
||||
{
|
||||
// Private data
|
||||
|
||||
//- Constant value
|
||||
Type value_;
|
||||
|
||||
|
||||
// Private Member Functions
|
||||
|
||||
//- Disallow default bitwise assignment
|
||||
void operator=(const CompatibilityConstant<Type>&);
|
||||
|
||||
|
||||
public:
|
||||
|
||||
// Runtime type information
|
||||
TypeName("CompatibilityConstant");
|
||||
|
||||
|
||||
// Constructors
|
||||
|
||||
//- Construct from entry name and Istream
|
||||
CompatibilityConstant(const word& entryName, const dictionary& dict);
|
||||
|
||||
//- Copy constructor
|
||||
CompatibilityConstant(const CompatibilityConstant<Type>& cnst);
|
||||
|
||||
//- Construct and return a clone
|
||||
virtual tmp<DataEntry<Type> > clone() const
|
||||
{
|
||||
return tmp<DataEntry<Type> >
|
||||
(
|
||||
new CompatibilityConstant<Type>(*this)
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
//- Destructor
|
||||
virtual ~CompatibilityConstant();
|
||||
|
||||
|
||||
// Member Functions
|
||||
|
||||
//- Return constant value
|
||||
Type value(const scalar) const;
|
||||
|
||||
//- Integrate between two values
|
||||
Type integrate(const scalar x1, const scalar x2) const;
|
||||
|
||||
|
||||
// I/O
|
||||
|
||||
//- Ostream Operator
|
||||
friend Ostream& operator<< <Type>
|
||||
(
|
||||
Ostream& os,
|
||||
const CompatibilityConstant<Type>& cnst
|
||||
);
|
||||
|
||||
//- Write in dictionary format
|
||||
virtual void writeData(Ostream& os) const;
|
||||
};
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#ifdef NoRepository
|
||||
# include "CompatibilityConstant.C"
|
||||
#endif
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,69 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "DataEntry.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * IOstream Operators * * * * * * * * * * * * //
|
||||
|
||||
template<class Type>
|
||||
Foam::Ostream& Foam::operator<<
|
||||
(
|
||||
Ostream& os,
|
||||
const CompatibilityConstant<Type>& cnst
|
||||
)
|
||||
{
|
||||
if (os.format() == IOstream::ASCII)
|
||||
{
|
||||
os << static_cast<const DataEntry<Type>& >(cnst)
|
||||
<< token::SPACE << cnst.value_;
|
||||
}
|
||||
else
|
||||
{
|
||||
os << static_cast<const DataEntry<Type>& >(cnst);
|
||||
os.write
|
||||
(
|
||||
reinterpret_cast<const char*>(&cnst.value_),
|
||||
sizeof(cnst.value_)
|
||||
);
|
||||
}
|
||||
|
||||
// Check state of Ostream
|
||||
os.check
|
||||
(
|
||||
"Ostream& operator<<(Ostream&, const CompatibilityConstant<Type>&)"
|
||||
);
|
||||
|
||||
return os;
|
||||
}
|
||||
|
||||
|
||||
template<class Type>
|
||||
void Foam::CompatibilityConstant<Type>::writeData(Ostream& os) const
|
||||
{
|
||||
os.writeKeyword(this->name_) << value_ << token::END_STATEMENT << nl;
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -35,17 +35,28 @@ Foam::autoPtr<Foam::DataEntry<Type> > Foam::DataEntry<Type>::New
|
||||
)
|
||||
{
|
||||
Istream& is(dict.lookup(entryName));
|
||||
word DataEntryType(is);
|
||||
|
||||
token firstToken(is);
|
||||
|
||||
word DataEntryType;
|
||||
if (firstToken.isWord())
|
||||
{
|
||||
DataEntryType = firstToken.wordToken();
|
||||
}
|
||||
else
|
||||
{
|
||||
is.putBack(firstToken);
|
||||
// DataEntryType = CompatibilityConstant<Type>::typeName;
|
||||
DataEntryType = "CompatibilityConstant";
|
||||
}
|
||||
|
||||
typename dictionaryConstructorTable::iterator cstrIter =
|
||||
dictionaryConstructorTablePtr_->find(DataEntryType);
|
||||
|
||||
if (cstrIter == dictionaryConstructorTablePtr_->end())
|
||||
{
|
||||
FatalErrorIn
|
||||
(
|
||||
"DataEntry<Type>::New(Istream&)"
|
||||
) << "Unknown DataEntry type "
|
||||
FatalErrorIn("DataEntry<Type>::New(const word&, const dictionary&)")
|
||||
<< "Unknown DataEntry type "
|
||||
<< DataEntryType << " for DataEntry "
|
||||
<< entryName << nl << nl
|
||||
<< "Valid DataEntry types are:" << nl
|
||||
|
||||
@ -23,6 +23,7 @@ License
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "CompatibilityConstant.H"
|
||||
#include "Constant.H"
|
||||
#include "CSV.H"
|
||||
#include "DataEntry.H"
|
||||
@ -39,36 +40,42 @@ License
|
||||
namespace Foam
|
||||
{
|
||||
makeDataEntry(label);
|
||||
makeDataEntryType(CompatibilityConstant, label);
|
||||
makeDataEntryType(Constant, label);
|
||||
// makeDataEntryType(CSV, label);
|
||||
makeDataEntryType(Table, label);
|
||||
makeDataEntryType(TableFile, label);
|
||||
|
||||
makeDataEntry(scalar);
|
||||
makeDataEntryType(CompatibilityConstant, scalar);
|
||||
makeDataEntryType(Constant, scalar);
|
||||
makeDataEntryType(CSV, scalar);
|
||||
makeDataEntryType(Table, scalar);
|
||||
makeDataEntryType(TableFile, scalar);
|
||||
|
||||
makeDataEntry(vector);
|
||||
makeDataEntryType(CompatibilityConstant, vector);
|
||||
makeDataEntryType(Constant, vector);
|
||||
makeDataEntryType(CSV, vector);
|
||||
makeDataEntryType(Table, vector);
|
||||
makeDataEntryType(TableFile, vector);
|
||||
|
||||
makeDataEntry(sphericalTensor);
|
||||
makeDataEntryType(CompatibilityConstant, sphericalTensor);
|
||||
makeDataEntryType(Constant, sphericalTensor);
|
||||
makeDataEntryType(CSV, sphericalTensor);
|
||||
makeDataEntryType(Table, sphericalTensor);
|
||||
makeDataEntryType(TableFile, sphericalTensor);
|
||||
|
||||
makeDataEntry(symmTensor);
|
||||
makeDataEntryType(CompatibilityConstant, symmTensor);
|
||||
makeDataEntryType(Constant, symmTensor);
|
||||
makeDataEntryType(CSV, symmTensor);
|
||||
makeDataEntryType(Table, symmTensor);
|
||||
makeDataEntryType(TableFile, symmTensor);
|
||||
|
||||
makeDataEntry(tensor);
|
||||
makeDataEntryType(CompatibilityConstant, tensor);
|
||||
makeDataEntryType(Constant, tensor);
|
||||
makeDataEntryType(CSV, tensor);
|
||||
makeDataEntryType(Table, tensor);
|
||||
|
||||
@ -65,7 +65,7 @@ class orthogonalSnGrad
|
||||
public:
|
||||
|
||||
//- Runtime type information
|
||||
TypeName("uncorrected");
|
||||
TypeName("orthogonal");
|
||||
|
||||
|
||||
// Constructors
|
||||
|
||||
@ -90,7 +90,8 @@ Foam::COxidationDiffusionLimitedRate<CloudType>::COxidationDiffusionLimitedRate
|
||||
O2GlobalId_(srm.O2GlobalId_),
|
||||
CO2GlobalId_(srm.CO2GlobalId_),
|
||||
WC_(srm.WC_),
|
||||
WO2_(srm.WO2_)
|
||||
WO2_(srm.WO2_),
|
||||
HcCO2_(srm.HcCO2_)
|
||||
{}
|
||||
|
||||
|
||||
|
||||
@ -81,7 +81,8 @@ COxidationKineticDiffusionLimitedRate
|
||||
O2GlobalId_(srm.O2GlobalId_),
|
||||
CO2GlobalId_(srm.CO2GlobalId_),
|
||||
WC_(srm.WC_),
|
||||
WO2_(srm.WO2_)
|
||||
WO2_(srm.WO2_),
|
||||
HcCO2_(srm.HcCO2_)
|
||||
{}
|
||||
|
||||
|
||||
|
||||
@ -96,7 +96,8 @@ Foam::COxidationMurphyShaddix<CloudType>::COxidationMurphyShaddix
|
||||
O2GlobalId_(srm.O2GlobalId_),
|
||||
CO2GlobalId_(srm.CO2GlobalId_),
|
||||
WC_(srm.WC_),
|
||||
WO2_(srm.WO2_)
|
||||
WO2_(srm.WO2_),
|
||||
HcCO2_(srm.HcCO2_)
|
||||
{}
|
||||
|
||||
|
||||
|
||||
@ -230,6 +230,16 @@ void Foam::KinematicCloud<CloudType>::postEvolve()
|
||||
functions_.postEvolve();
|
||||
|
||||
solution_.nextIter();
|
||||
|
||||
if (this->db().time().outputTime())
|
||||
{
|
||||
outputProperties_.writeObject
|
||||
(
|
||||
IOstream::ASCII,
|
||||
IOstream::currentVersion,
|
||||
this->db().time().writeCompression()
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -281,6 +291,18 @@ Foam::KinematicCloud<CloudType>::KinematicCloud
|
||||
IOobject::NO_WRITE
|
||||
)
|
||||
),
|
||||
outputProperties_
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
cloudName + "OutputProperties",
|
||||
mesh_.time().timeName(),
|
||||
"uniform"/cloud::prefix/cloudName,
|
||||
mesh_,
|
||||
IOobject::READ_IF_PRESENT,
|
||||
IOobject::NO_WRITE
|
||||
)
|
||||
),
|
||||
solution_(mesh_, particleProperties_.subDict("solution")),
|
||||
constProps_(particleProperties_, solution_.active()),
|
||||
subModelProperties_
|
||||
@ -384,6 +406,7 @@ Foam::KinematicCloud<CloudType>::KinematicCloud
|
||||
cloudCopyPtr_(NULL),
|
||||
mesh_(c.mesh_),
|
||||
particleProperties_(c.particleProperties_),
|
||||
outputProperties_(c.outputProperties_),
|
||||
solution_(c.solution_),
|
||||
constProps_(c.constProps_),
|
||||
subModelProperties_(c.subModelProperties_),
|
||||
@ -460,6 +483,19 @@ Foam::KinematicCloud<CloudType>::KinematicCloud
|
||||
false
|
||||
)
|
||||
),
|
||||
outputProperties_
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
name + "OutputProperties",
|
||||
mesh_.time().timeName(),
|
||||
"uniform"/cloud::prefix/name,
|
||||
mesh_,
|
||||
IOobject::NO_READ,
|
||||
IOobject::NO_WRITE,
|
||||
false
|
||||
)
|
||||
),
|
||||
solution_(mesh),
|
||||
constProps_(),
|
||||
subModelProperties_(dictionary::null),
|
||||
@ -639,7 +675,7 @@ void Foam::KinematicCloud<CloudType>::motion(TrackData& td)
|
||||
|
||||
|
||||
template<class CloudType>
|
||||
void Foam::KinematicCloud<CloudType>::info() const
|
||||
void Foam::KinematicCloud<CloudType>::info()
|
||||
{
|
||||
vector linearMomentum = linearMomentumOfSystem();
|
||||
reduce(linearMomentum, sumOp<vector>());
|
||||
|
||||
@ -143,6 +143,9 @@ protected:
|
||||
//- Dictionary of particle properties
|
||||
IOdictionary particleProperties_;
|
||||
|
||||
//- Dictionary of output properties
|
||||
IOdictionary outputProperties_;
|
||||
|
||||
//- Solution properties
|
||||
cloudSolution solution_;
|
||||
|
||||
@ -324,6 +327,12 @@ public:
|
||||
//- Return particle properties dictionary
|
||||
inline const IOdictionary& particleProperties() const;
|
||||
|
||||
//- Return output properties dictionary
|
||||
inline const IOdictionary& outputProperties() const;
|
||||
|
||||
//- Return non-const access to the output properties dictionary
|
||||
inline IOdictionary& outputProperties();
|
||||
|
||||
//- Return const access to the solution properties
|
||||
inline const cloudSolution& solution() const;
|
||||
|
||||
@ -468,6 +477,9 @@ public:
|
||||
//- Mean diameter Dij
|
||||
inline scalar Dij(const label i, const label j) const;
|
||||
|
||||
//- Max diameter
|
||||
inline scalar Dmax() const;
|
||||
|
||||
|
||||
// Fields
|
||||
|
||||
@ -543,8 +555,11 @@ public:
|
||||
template<class TrackData>
|
||||
void motion(TrackData& td);
|
||||
|
||||
|
||||
// I-O
|
||||
|
||||
//- Print cloud information
|
||||
void info() const;
|
||||
void info();
|
||||
};
|
||||
|
||||
|
||||
|
||||
@ -50,6 +50,21 @@ Foam::KinematicCloud<CloudType>::particleProperties() const
|
||||
}
|
||||
|
||||
|
||||
template<class CloudType>
|
||||
inline const Foam::IOdictionary&
|
||||
Foam::KinematicCloud<CloudType>::outputProperties() const
|
||||
{
|
||||
return outputProperties_;
|
||||
}
|
||||
|
||||
|
||||
template<class CloudType>
|
||||
inline Foam::IOdictionary& Foam::KinematicCloud<CloudType>::outputProperties()
|
||||
{
|
||||
return outputProperties_;
|
||||
}
|
||||
|
||||
|
||||
template<class CloudType>
|
||||
inline const Foam::cloudSolution&
|
||||
Foam::KinematicCloud<CloudType>::solution() const
|
||||
@ -302,6 +317,22 @@ inline Foam::scalar Foam::KinematicCloud<CloudType>::Dij
|
||||
}
|
||||
|
||||
|
||||
template<class CloudType>
|
||||
inline Foam::scalar Foam::KinematicCloud<CloudType>::Dmax() const
|
||||
{
|
||||
scalar d = -GREAT;
|
||||
forAllConstIter(typename KinematicCloud<CloudType>, *this, iter)
|
||||
{
|
||||
const parcelType& p = iter();
|
||||
d = max(d, p.d());
|
||||
}
|
||||
|
||||
reduce(d, maxOp<scalar>());
|
||||
|
||||
return d;
|
||||
}
|
||||
|
||||
|
||||
template<class CloudType>
|
||||
inline Foam::scalar Foam::KinematicCloud<CloudType>::penetration
|
||||
(
|
||||
|
||||
@ -341,20 +341,13 @@ void Foam::ReactingCloud<CloudType>::evolve()
|
||||
}
|
||||
|
||||
|
||||
template<class CloudType>
|
||||
void Foam::ReactingCloud<CloudType>::addToMassPhaseChange(const scalar dMass)
|
||||
{
|
||||
dMassPhaseChange_ += dMass;
|
||||
}
|
||||
|
||||
|
||||
template<class CloudType>
|
||||
void Foam::ReactingCloud<CloudType>::info() const
|
||||
void Foam::ReactingCloud<CloudType>::info()
|
||||
{
|
||||
CloudType::info();
|
||||
|
||||
Info<< " Mass transfer phase change = "
|
||||
<< returnReduce(dMassPhaseChange_, sumOp<scalar>()) << nl;
|
||||
this->phaseChange().info(Info);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -215,14 +215,18 @@ public:
|
||||
|
||||
// Sub-models
|
||||
|
||||
//- Return reference to reacting composition model
|
||||
//- Return const access to reacting composition model
|
||||
inline const CompositionModel<ReactingCloud<CloudType> >&
|
||||
composition() const;
|
||||
|
||||
//- Return reference to reacting phase change model
|
||||
//- Return const access to reacting phase change model
|
||||
inline const PhaseChangeModel<ReactingCloud<CloudType> >&
|
||||
phaseChange() const;
|
||||
|
||||
//- Return reference to reacting phase change model
|
||||
inline PhaseChangeModel<ReactingCloud<CloudType> >&
|
||||
phaseChange();
|
||||
|
||||
|
||||
// Sources
|
||||
|
||||
@ -259,12 +263,6 @@ public:
|
||||
inline tmp<fvScalarMatrix> Srho(volScalarField& rho) const;
|
||||
|
||||
|
||||
// Check
|
||||
|
||||
//- Add to cumulative phase change mass transfer
|
||||
void addToMassPhaseChange(const scalar dMass);
|
||||
|
||||
|
||||
// Cloud evolution functions
|
||||
|
||||
//- Set parcel thermo properties
|
||||
@ -300,12 +298,12 @@ public:
|
||||
//- Evolve the cloud
|
||||
void evolve();
|
||||
|
||||
//- Print cloud information
|
||||
void info() const;
|
||||
|
||||
|
||||
// I-O
|
||||
|
||||
//- Print cloud information
|
||||
void info();
|
||||
|
||||
//- Write the field data for the cloud
|
||||
virtual void writeFields() const;
|
||||
};
|
||||
|
||||
@ -57,6 +57,14 @@ Foam::ReactingCloud<CloudType>::phaseChange() const
|
||||
}
|
||||
|
||||
|
||||
template<class CloudType>
|
||||
inline Foam::PhaseChangeModel<Foam::ReactingCloud<CloudType> >&
|
||||
Foam::ReactingCloud<CloudType>::phaseChange()
|
||||
{
|
||||
return phaseChangeModel_();
|
||||
}
|
||||
|
||||
|
||||
template<class CloudType>
|
||||
inline Foam::DimensionedField<Foam::scalar, Foam::volMesh>&
|
||||
Foam::ReactingCloud<CloudType>::rhoTrans(const label i)
|
||||
|
||||
@ -253,33 +253,12 @@ void Foam::ReactingMultiphaseCloud<CloudType>::evolve()
|
||||
|
||||
|
||||
template<class CloudType>
|
||||
void Foam::ReactingMultiphaseCloud<CloudType>::addToMassDevolatilisation
|
||||
(
|
||||
const scalar dMass
|
||||
)
|
||||
{
|
||||
dMassDevolatilisation_ += dMass;
|
||||
}
|
||||
|
||||
|
||||
template<class CloudType>
|
||||
void Foam::ReactingMultiphaseCloud<CloudType>::addToMassSurfaceReaction
|
||||
(
|
||||
const scalar dMass
|
||||
)
|
||||
{
|
||||
dMassSurfaceReaction_ += dMass;
|
||||
}
|
||||
|
||||
|
||||
template<class CloudType>
|
||||
void Foam::ReactingMultiphaseCloud<CloudType>::info() const
|
||||
void Foam::ReactingMultiphaseCloud<CloudType>::info()
|
||||
{
|
||||
CloudType::info();
|
||||
Info<< " Mass transfer devolatilisation = "
|
||||
<< returnReduce(dMassDevolatilisation_, sumOp<scalar>()) << nl;
|
||||
Info<< " Mass transfer surface reaction = "
|
||||
<< returnReduce(dMassSurfaceReaction_, sumOp<scalar>()) << nl;
|
||||
|
||||
this->devolatilisation().info(Info);
|
||||
this->surfaceReaction().info(Info);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -214,28 +214,33 @@ public:
|
||||
|
||||
// Sub-models
|
||||
|
||||
//- Return reference to devolatilisation model
|
||||
//- Return const access to devolatilisation model
|
||||
inline const DevolatilisationModel
|
||||
<
|
||||
ReactingMultiphaseCloud<CloudType>
|
||||
>&
|
||||
devolatilisation() const;
|
||||
|
||||
//- Return reference to reacting surface reaction model
|
||||
//- Return reference to devolatilisation model
|
||||
inline DevolatilisationModel
|
||||
<
|
||||
ReactingMultiphaseCloud<CloudType>
|
||||
>&
|
||||
devolatilisation();
|
||||
|
||||
//- Return const access to reacting surface reaction model
|
||||
inline const SurfaceReactionModel
|
||||
<
|
||||
ReactingMultiphaseCloud<CloudType>
|
||||
>&
|
||||
surfaceReaction() const;
|
||||
|
||||
|
||||
// Check
|
||||
|
||||
//- Add to cumulative volatilisation mass transfer
|
||||
void addToMassDevolatilisation(const scalar dMass);
|
||||
|
||||
//- Add to cumulative surface reaction transfer
|
||||
void addToMassSurfaceReaction(const scalar dMass);
|
||||
//- Return reference to reacting surface reaction model
|
||||
inline SurfaceReactionModel
|
||||
<
|
||||
ReactingMultiphaseCloud<CloudType>
|
||||
>&
|
||||
surfaceReaction();
|
||||
|
||||
|
||||
// Cloud evolution functions
|
||||
@ -267,12 +272,12 @@ public:
|
||||
//- Evolve the cloud
|
||||
void evolve();
|
||||
|
||||
//- Print cloud information
|
||||
void info() const;
|
||||
|
||||
|
||||
// I-O
|
||||
|
||||
//- Print cloud information
|
||||
void info();
|
||||
|
||||
//- Write the field data for the cloud
|
||||
virtual void writeFields() const;
|
||||
};
|
||||
|
||||
@ -52,6 +52,17 @@ Foam::ReactingMultiphaseCloud<CloudType>::devolatilisation() const
|
||||
}
|
||||
|
||||
|
||||
template<class CloudType>
|
||||
inline Foam::DevolatilisationModel
|
||||
<
|
||||
Foam::ReactingMultiphaseCloud<CloudType>
|
||||
>&
|
||||
Foam::ReactingMultiphaseCloud<CloudType>::devolatilisation()
|
||||
{
|
||||
return devolatilisationModel_();
|
||||
}
|
||||
|
||||
|
||||
template<class CloudType>
|
||||
inline const Foam::SurfaceReactionModel
|
||||
<
|
||||
@ -63,4 +74,15 @@ Foam::ReactingMultiphaseCloud<CloudType>::surfaceReaction() const
|
||||
}
|
||||
|
||||
|
||||
template<class CloudType>
|
||||
inline Foam::SurfaceReactionModel
|
||||
<
|
||||
Foam::ReactingMultiphaseCloud<CloudType>
|
||||
>&
|
||||
Foam::ReactingMultiphaseCloud<CloudType>::surfaceReaction()
|
||||
{
|
||||
return surfaceReactionModel_();
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
|
||||
@ -334,7 +334,7 @@ void Foam::ThermoCloud<CloudType>::evolve()
|
||||
|
||||
|
||||
template<class CloudType>
|
||||
void Foam::ThermoCloud<CloudType>::info() const
|
||||
void Foam::ThermoCloud<CloudType>::info()
|
||||
{
|
||||
CloudType::info();
|
||||
}
|
||||
|
||||
@ -321,7 +321,7 @@ public:
|
||||
// Check
|
||||
|
||||
//- Print cloud information
|
||||
void info() const;
|
||||
void info();
|
||||
};
|
||||
|
||||
|
||||
|
||||
@ -240,6 +240,7 @@ void Foam::ReactingMultiphaseParcel<ParcelType>::calc
|
||||
dt,
|
||||
cellI,
|
||||
Res,
|
||||
Prs,
|
||||
Ts,
|
||||
mus/rhos,
|
||||
d0,
|
||||
@ -368,7 +369,7 @@ void Foam::ReactingMultiphaseParcel<ParcelType>::calc
|
||||
|
||||
td.cloud().hsTrans()[cellI] += dm*HsEff(td, pc, T0, idG, idL, idS);
|
||||
|
||||
td.cloud().addToMassPhaseChange(dm);
|
||||
td.cloud().phaseChange().addToPhaseChangeMass(dm);
|
||||
}
|
||||
|
||||
return;
|
||||
@ -519,7 +520,10 @@ void Foam::ReactingMultiphaseParcel<ParcelType>::calcDevolatilisation
|
||||
|
||||
scalar dMassTot = sum(dMassDV);
|
||||
|
||||
td.cloud().addToMassDevolatilisation(this->nParticle_*dMassTot);
|
||||
td.cloud().devolatilisation().addToDevolatilisationMass
|
||||
(
|
||||
this->nParticle_*dMassTot
|
||||
);
|
||||
|
||||
Sh -= dMassTot*td.cloud().constProps().LDevol()/dt;
|
||||
|
||||
@ -607,7 +611,7 @@ void Foam::ReactingMultiphaseParcel<ParcelType>::calcSurfaceReactions
|
||||
dMassSRCarrier
|
||||
);
|
||||
|
||||
td.cloud().addToMassSurfaceReaction
|
||||
td.cloud().surfaceReaction().addToSurfaceReactionMass
|
||||
(
|
||||
this->nParticle_
|
||||
*(sum(dMassSRGas) + sum(dMassSRLiquid) + sum(dMassSRSolid))
|
||||
|
||||
@ -329,6 +329,7 @@ void Foam::ReactingParcel<ParcelType>::calc
|
||||
dt,
|
||||
cellI,
|
||||
Res,
|
||||
Prs,
|
||||
Ts,
|
||||
mus/rhos,
|
||||
d0,
|
||||
@ -384,7 +385,7 @@ void Foam::ReactingParcel<ParcelType>::calc
|
||||
}
|
||||
td.cloud().UTrans()[cellI] += dm*U0;
|
||||
|
||||
td.cloud().addToMassPhaseChange(dm);
|
||||
td.cloud().phaseChange().addToPhaseChangeMass(dm);
|
||||
}
|
||||
|
||||
return;
|
||||
@ -464,6 +465,7 @@ void Foam::ReactingParcel<ParcelType>::calcPhaseChange
|
||||
const scalar dt,
|
||||
const label cellI,
|
||||
const scalar Re,
|
||||
const scalar Pr,
|
||||
const scalar Ts,
|
||||
const scalar nus,
|
||||
const scalar d,
|
||||
@ -500,11 +502,14 @@ void Foam::ReactingParcel<ParcelType>::calcPhaseChange
|
||||
dt,
|
||||
cellI,
|
||||
Re,
|
||||
Pr,
|
||||
d,
|
||||
nus,
|
||||
T,
|
||||
Ts,
|
||||
pc_,
|
||||
this->Tc_,
|
||||
YComponents,
|
||||
dMassPC
|
||||
);
|
||||
|
||||
@ -514,7 +519,7 @@ void Foam::ReactingParcel<ParcelType>::calcPhaseChange
|
||||
const scalar dMassTot = sum(dMassPC);
|
||||
|
||||
// Add to cumulative phase change mass
|
||||
td.cloud().addToMassPhaseChange(this->nParticle_*dMassTot);
|
||||
td.cloud().phaseChange().addToPhaseChangeMass(this->nParticle_*dMassTot);
|
||||
|
||||
forAll(dMassPC, i)
|
||||
{
|
||||
|
||||
@ -210,6 +210,7 @@ protected:
|
||||
const scalar dt, // timestep
|
||||
const label cellI, // owner cell
|
||||
const scalar Re, // Reynolds number
|
||||
const scalar Pr, // Prandtl number
|
||||
const scalar Ts, // Surface temperature
|
||||
const scalar nus, // Surface kinematic viscosity
|
||||
const scalar d, // diameter
|
||||
|
||||
@ -30,6 +30,7 @@ License
|
||||
|
||||
#include "NoPhaseChange.H"
|
||||
#include "LiquidEvaporation.H"
|
||||
#include "LiquidEvaporationBoil.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
@ -37,7 +38,8 @@ License
|
||||
\
|
||||
makePhaseChangeModel(CloudType); \
|
||||
makePhaseChangeModelType(NoPhaseChange, CloudType); \
|
||||
makePhaseChangeModelType(LiquidEvaporation, CloudType);
|
||||
makePhaseChangeModelType(LiquidEvaporation, CloudType); \
|
||||
makePhaseChangeModelType(LiquidEvaporationBoil, CloudType);
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
@ -51,7 +51,7 @@ Foam::CloudFunctionObject<CloudType>::CloudFunctionObject
|
||||
const word& type
|
||||
)
|
||||
:
|
||||
SubModelBase<CloudType>(owner, dict, type, "")
|
||||
SubModelBase<CloudType>(owner, dict, typeName, type, "")
|
||||
{}
|
||||
|
||||
|
||||
|
||||
@ -64,7 +64,7 @@ class CloudFunctionObject
|
||||
public:
|
||||
|
||||
//- Runtime type information
|
||||
TypeName("postProcessingModel");
|
||||
TypeName("cloudFunctionObject");
|
||||
|
||||
//- Declare runtime constructor selection table
|
||||
declareRunTimeSelectionTable
|
||||
|
||||
@ -42,7 +42,7 @@ Foam::CollisionModel<CloudType>::CollisionModel
|
||||
const word& type
|
||||
)
|
||||
:
|
||||
SubModelBase<CloudType>(owner, dict, type)
|
||||
SubModelBase<CloudType>(owner, dict, typeName, type)
|
||||
{}
|
||||
|
||||
|
||||
|
||||
@ -42,7 +42,7 @@ Foam::DispersionModel<CloudType>::DispersionModel
|
||||
const word& type
|
||||
)
|
||||
:
|
||||
SubModelBase<CloudType>(owner, dict, type)
|
||||
SubModelBase<CloudType>(owner, dict, typeName, type)
|
||||
{}
|
||||
|
||||
|
||||
|
||||
@ -31,76 +31,6 @@ using namespace Foam::constant::mathematical;
|
||||
|
||||
// * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * * //
|
||||
|
||||
template<class CloudType>
|
||||
void Foam::InjectionModel<CloudType>::readProps()
|
||||
{
|
||||
if (!this->owner().solution().transient())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
IOobject propsDictHeader
|
||||
(
|
||||
"injectionProperties",
|
||||
this->owner().db().time().timeName(),
|
||||
"uniform"/cloud::prefix/this->owner().name(),
|
||||
this->owner().db(),
|
||||
IOobject::MUST_READ_IF_MODIFIED,
|
||||
IOobject::NO_WRITE,
|
||||
false
|
||||
);
|
||||
|
||||
if (propsDictHeader.headerOk())
|
||||
{
|
||||
const IOdictionary propsDict(propsDictHeader);
|
||||
|
||||
propsDict.readIfPresent("massInjected", massInjected_);
|
||||
propsDict.readIfPresent("nInjections", nInjections_);
|
||||
propsDict.readIfPresent("parcelsAddedTotal", parcelsAddedTotal_);
|
||||
propsDict.readIfPresent("timeStep0", timeStep0_);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
template<class CloudType>
|
||||
void Foam::InjectionModel<CloudType>::writeProps()
|
||||
{
|
||||
if (!this->owner().solution().transient())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (this->owner().db().time().outputTime())
|
||||
{
|
||||
IOdictionary propsDict
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"injectionProperties",
|
||||
this->owner().db().time().timeName(),
|
||||
"uniform"/cloud::prefix/this->owner().name(),
|
||||
this->owner().db(),
|
||||
IOobject::NO_READ,
|
||||
IOobject::NO_WRITE,
|
||||
false
|
||||
)
|
||||
);
|
||||
|
||||
propsDict.add("massInjected", massInjected_);
|
||||
propsDict.add("nInjections", nInjections_);
|
||||
propsDict.add("parcelsAddedTotal", parcelsAddedTotal_);
|
||||
propsDict.add("timeStep0", timeStep0_);
|
||||
|
||||
propsDict.writeObject
|
||||
(
|
||||
IOstream::ASCII,
|
||||
IOstream::currentVersion,
|
||||
this->owner().db().time().writeCompression()
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
template<class CloudType>
|
||||
bool Foam::InjectionModel<CloudType>::validInjection(const label parcelI)
|
||||
{
|
||||
@ -328,9 +258,6 @@ void Foam::InjectionModel<CloudType>::postInjectCheck
|
||||
|
||||
// Increment number of injections
|
||||
nInjections_++;
|
||||
|
||||
// Write current state to properties file
|
||||
writeProps();
|
||||
}
|
||||
|
||||
|
||||
@ -343,16 +270,17 @@ Foam::InjectionModel<CloudType>::InjectionModel(CloudType& owner)
|
||||
SOI_(0.0),
|
||||
volumeTotal_(0.0),
|
||||
massTotal_(0.0),
|
||||
massInjected_(0.0),
|
||||
nInjections_(0),
|
||||
parcelsAddedTotal_(0),
|
||||
massInjected_(this->template getBaseProperty<scalar>("massInjected")),
|
||||
nInjections_(this->template getBaseProperty<scalar>("nInjections")),
|
||||
parcelsAddedTotal_
|
||||
(
|
||||
this->template getBaseProperty<scalar>("parcelsAddedTotal")
|
||||
),
|
||||
parcelBasis_(pbNumber),
|
||||
nParticleFixed_(0.0),
|
||||
time0_(0.0),
|
||||
timeStep0_(0.0)
|
||||
{
|
||||
readProps();
|
||||
}
|
||||
timeStep0_(this->template getBaseProperty<scalar>("timeStep0"))
|
||||
{}
|
||||
|
||||
|
||||
template<class CloudType>
|
||||
@ -363,17 +291,20 @@ Foam::InjectionModel<CloudType>::InjectionModel
|
||||
const word& type
|
||||
)
|
||||
:
|
||||
SubModelBase<CloudType>(owner, dict, type),
|
||||
SubModelBase<CloudType>(owner, dict, typeName, type),
|
||||
SOI_(0.0),
|
||||
volumeTotal_(0.0),
|
||||
massTotal_(0.0),
|
||||
massInjected_(0.0),
|
||||
nInjections_(0),
|
||||
parcelsAddedTotal_(0),
|
||||
massInjected_(this->template getBaseProperty<scalar>("massInjected")),
|
||||
nInjections_(this->template getBaseProperty<scalar>("nInjections")),
|
||||
parcelsAddedTotal_
|
||||
(
|
||||
this->template getBaseProperty<scalar>("parcelsAddedTotal")
|
||||
),
|
||||
parcelBasis_(pbNumber),
|
||||
nParticleFixed_(0.0),
|
||||
time0_(owner.db().time().value()),
|
||||
timeStep0_(0.0)
|
||||
timeStep0_(this->template getBaseProperty<scalar>("timeStep0"))
|
||||
{
|
||||
// Provide some info
|
||||
// - also serves to initialise mesh dimensions - needed for parallel runs
|
||||
@ -424,8 +355,6 @@ Foam::InjectionModel<CloudType>::InjectionModel
|
||||
)<< "parcelBasisType must be either 'number', 'mass' or 'fixed'" << nl
|
||||
<< exit(FatalError);
|
||||
}
|
||||
|
||||
readProps();
|
||||
}
|
||||
|
||||
|
||||
@ -803,10 +732,22 @@ bool Foam::InjectionModel<CloudType>::fullyDescribed() const
|
||||
|
||||
|
||||
template<class CloudType>
|
||||
void Foam::InjectionModel<CloudType>::info(Ostream& os) const
|
||||
void Foam::InjectionModel<CloudType>::info(Ostream& os)
|
||||
{
|
||||
os << " Total number of parcels added = " << parcelsAddedTotal_ << nl
|
||||
<< " Total mass introduced = " << massInjected_ << nl;
|
||||
|
||||
if
|
||||
(
|
||||
this->owner().solution().transient()
|
||||
&& this->owner().db().time().outputTime()
|
||||
)
|
||||
{
|
||||
this->setBaseProperty("massInjected", massInjected_);
|
||||
this->setBaseProperty("nInjections", nInjections_);
|
||||
this->setBaseProperty("parcelsAddedTotal", parcelsAddedTotal_);
|
||||
this->setBaseProperty("timeStep0", timeStep0_);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -85,17 +85,6 @@ public:
|
||||
};
|
||||
|
||||
|
||||
private:
|
||||
|
||||
// Private Member Functions
|
||||
|
||||
//- Read injector properties from previous run (if applicable)
|
||||
void readProps();
|
||||
|
||||
//- Write injector properties
|
||||
void writeProps();
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
// Protected data
|
||||
@ -328,7 +317,7 @@ public:
|
||||
// I-O
|
||||
|
||||
//- Write injection info to stream
|
||||
virtual void info(Ostream& os) const;
|
||||
virtual void info(Ostream& os);
|
||||
};
|
||||
|
||||
|
||||
|
||||
@ -25,83 +25,6 @@ License
|
||||
|
||||
#include "LocalInteraction.H"
|
||||
|
||||
// * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * * //
|
||||
|
||||
template<class CloudType>
|
||||
void Foam::LocalInteraction<CloudType>::readProps()
|
||||
{
|
||||
if (!this->owner().solution().transient())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
IOobject propsDictHeader
|
||||
(
|
||||
"localInteractionProperties",
|
||||
this->owner().db().time().timeName(),
|
||||
"uniform"/cloud::prefix/this->owner().name(),
|
||||
this->owner().db(),
|
||||
IOobject::MUST_READ_IF_MODIFIED,
|
||||
IOobject::NO_WRITE,
|
||||
false
|
||||
);
|
||||
|
||||
if (propsDictHeader.headerOk())
|
||||
{
|
||||
const IOdictionary propsDict(propsDictHeader);
|
||||
propsDict.readIfPresent("nEscape", nEscape0_);
|
||||
propsDict.readIfPresent("massEscape", massEscape0_);
|
||||
propsDict.readIfPresent("nStick", nStick0_);
|
||||
propsDict.readIfPresent("massStick", massStick0_);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
template<class CloudType>
|
||||
void Foam::LocalInteraction<CloudType>::writeProps
|
||||
(
|
||||
const labelList& nEscape,
|
||||
const scalarList& massEscape,
|
||||
const labelList& nStick,
|
||||
const scalarList& massStick
|
||||
) const
|
||||
{
|
||||
if (!this->owner().solution().transient())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (this->owner().db().time().outputTime())
|
||||
{
|
||||
IOdictionary propsDict
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"localInteractionProperties",
|
||||
this->owner().db().time().timeName(),
|
||||
"uniform"/cloud::prefix/this->owner().name(),
|
||||
this->owner().db(),
|
||||
IOobject::NO_READ,
|
||||
IOobject::NO_WRITE,
|
||||
false
|
||||
)
|
||||
);
|
||||
|
||||
propsDict.add("nEscape", nEscape);
|
||||
propsDict.add("massEscape", massEscape);
|
||||
propsDict.add("nStick", nStick);
|
||||
propsDict.add("massStick", massStick);
|
||||
|
||||
propsDict.writeObject
|
||||
(
|
||||
IOstream::ASCII,
|
||||
IOstream::currentVersion,
|
||||
this->owner().db().time().writeCompression()
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * * //
|
||||
|
||||
template<class CloudType>
|
||||
@ -122,6 +45,12 @@ Foam::LocalInteraction<CloudType>::LocalInteraction
|
||||
nStick_(patchData_.size(), 0),
|
||||
massStick_(patchData_.size(), 0.0)
|
||||
{
|
||||
// intialise starting counters
|
||||
this->getModelProperty("nEscape", nEscape0_);
|
||||
this->getModelProperty("massEscape", massEscape0_);
|
||||
this->getModelProperty("nStick", nStick0_);
|
||||
this->getModelProperty("massStick", massStick0_);
|
||||
|
||||
// check that interactions are valid/specified
|
||||
forAll(patchData_, patchI)
|
||||
{
|
||||
@ -141,8 +70,6 @@ Foam::LocalInteraction<CloudType>::LocalInteraction
|
||||
<< nl << exit(FatalError);
|
||||
}
|
||||
}
|
||||
|
||||
readProps();
|
||||
}
|
||||
|
||||
|
||||
@ -255,7 +182,7 @@ bool Foam::LocalInteraction<CloudType>::correct
|
||||
"typename CloudType::parcelType&, "
|
||||
"const polyPatch&, "
|
||||
"bool&, "
|
||||
"scalar&, "
|
||||
"const scalar, "
|
||||
"const tetIndices&"
|
||||
") const"
|
||||
) << "Unknown interaction type "
|
||||
@ -275,7 +202,7 @@ bool Foam::LocalInteraction<CloudType>::correct
|
||||
|
||||
|
||||
template<class CloudType>
|
||||
void Foam::LocalInteraction<CloudType>::info(Ostream& os) const
|
||||
void Foam::LocalInteraction<CloudType>::info(Ostream& os)
|
||||
{
|
||||
labelList npe(nEscape_);
|
||||
Pstream::listCombineGather(npe, plusEqOp<label>());
|
||||
@ -304,7 +231,17 @@ void Foam::LocalInteraction<CloudType>::info(Ostream& os) const
|
||||
<< ", " << mps[i] << nl;
|
||||
}
|
||||
|
||||
writeProps(npe, mpe, nps, mps);
|
||||
if
|
||||
(
|
||||
this->owner().solution().transient()
|
||||
&& this->owner().db().time().outputTime()
|
||||
)
|
||||
{
|
||||
this->setModelProperty("nEscape", npe);
|
||||
this->setModelProperty("massEscape", mpe);
|
||||
this->setModelProperty("nStick", nps);
|
||||
this->setModelProperty("massStick", mps);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -84,21 +84,6 @@ class LocalInteraction
|
||||
List<scalar> massStick_;
|
||||
|
||||
|
||||
// Private Member Functions
|
||||
|
||||
//- Read interaction properties from file
|
||||
void readProps();
|
||||
|
||||
//- Write interaction properties to file
|
||||
void writeProps
|
||||
(
|
||||
const labelList& nEscape,
|
||||
const scalarList& massEscape,
|
||||
const labelList& nStick,
|
||||
const scalarList& massStick
|
||||
) const;
|
||||
|
||||
|
||||
public:
|
||||
|
||||
//- Runtime type information
|
||||
@ -144,7 +129,7 @@ public:
|
||||
// I-O
|
||||
|
||||
//- Write patch interaction info to stream
|
||||
virtual void info(Ostream& os) const;
|
||||
virtual void info(Ostream& os);
|
||||
};
|
||||
|
||||
|
||||
|
||||
@ -122,7 +122,7 @@ Foam::PatchInteractionModel<CloudType>::PatchInteractionModel
|
||||
const word& type
|
||||
)
|
||||
:
|
||||
SubModelBase<CloudType>(owner, dict, type),
|
||||
SubModelBase<CloudType>(owner, dict, typeName, type),
|
||||
UName_(this->coeffDict().lookupOrDefault("UName", word("U")))
|
||||
{}
|
||||
|
||||
@ -333,7 +333,7 @@ void Foam::PatchInteractionModel<CloudType>::patchData
|
||||
|
||||
|
||||
template<class CloudType>
|
||||
void Foam::PatchInteractionModel<CloudType>::info(Ostream& os) const
|
||||
void Foam::PatchInteractionModel<CloudType>::info(Ostream& os)
|
||||
{
|
||||
// do nothing
|
||||
}
|
||||
|
||||
@ -180,7 +180,7 @@ public:
|
||||
// I-O
|
||||
|
||||
//- Write patch interaction info to stream
|
||||
virtual void info(Ostream& os) const;
|
||||
virtual void info(Ostream& os);
|
||||
};
|
||||
|
||||
|
||||
|
||||
@ -25,83 +25,6 @@ License
|
||||
|
||||
#include "StandardWallInteraction.H"
|
||||
|
||||
// * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * * //
|
||||
|
||||
template<class CloudType>
|
||||
void Foam::StandardWallInteraction<CloudType>::readProps()
|
||||
{
|
||||
if (!this->owner().solution().transient())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
IOobject propsDictHeader
|
||||
(
|
||||
"standardWallInteractionProperties",
|
||||
this->owner().db().time().timeName(),
|
||||
"uniform"/cloud::prefix/this->owner().name(),
|
||||
this->owner().db(),
|
||||
IOobject::MUST_READ_IF_MODIFIED,
|
||||
IOobject::NO_WRITE,
|
||||
false
|
||||
);
|
||||
|
||||
if (propsDictHeader.headerOk())
|
||||
{
|
||||
const IOdictionary propsDict(propsDictHeader);
|
||||
propsDict.readIfPresent("nEscape", nEscape0_);
|
||||
propsDict.readIfPresent("massEscape", massEscape0_);
|
||||
propsDict.readIfPresent("nStick", nStick0_);
|
||||
propsDict.readIfPresent("massStick", massStick0_);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
template<class CloudType>
|
||||
void Foam::StandardWallInteraction<CloudType>::writeProps
|
||||
(
|
||||
const label nEscape,
|
||||
const scalar massEscape,
|
||||
const label nStick,
|
||||
const scalar massStick
|
||||
) const
|
||||
{
|
||||
if (!this->owner().solution().transient())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (this->owner().db().time().outputTime())
|
||||
{
|
||||
IOdictionary propsDict
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"standardWallInteractionProperties",
|
||||
this->owner().db().time().timeName(),
|
||||
"uniform"/cloud::prefix/this->owner().name(),
|
||||
this->owner().db(),
|
||||
IOobject::NO_READ,
|
||||
IOobject::NO_WRITE,
|
||||
false
|
||||
)
|
||||
);
|
||||
|
||||
propsDict.add("nEscape", nEscape);
|
||||
propsDict.add("massEscape", massEscape);
|
||||
propsDict.add("nStick", nStick);
|
||||
propsDict.add("massStick", massStick);
|
||||
|
||||
propsDict.writeObject
|
||||
(
|
||||
IOstream::ASCII,
|
||||
IOstream::currentVersion,
|
||||
this->owner().db().time().writeCompression()
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
template<class CloudType>
|
||||
@ -118,10 +41,10 @@ Foam::StandardWallInteraction<CloudType>::StandardWallInteraction
|
||||
),
|
||||
e_(0.0),
|
||||
mu_(0.0),
|
||||
nEscape0_(0),
|
||||
massEscape0_(0.0),
|
||||
nStick0_(0),
|
||||
massStick0_(0.0),
|
||||
nEscape0_(this->template getModelProperty<label>("nEscape")),
|
||||
massEscape0_(this->template getModelProperty<scalar>("massEscape")),
|
||||
nStick0_(this->template getModelProperty<label>("nStick")),
|
||||
massStick0_(this->template getModelProperty<scalar>("massStick")),
|
||||
nEscape_(0),
|
||||
massEscape_(0.0),
|
||||
nStick_(0),
|
||||
@ -279,7 +202,7 @@ bool Foam::StandardWallInteraction<CloudType>::correct
|
||||
|
||||
|
||||
template<class CloudType>
|
||||
void Foam::StandardWallInteraction<CloudType>::info(Ostream& os) const
|
||||
void Foam::StandardWallInteraction<CloudType>::info(Ostream& os)
|
||||
{
|
||||
label npe = returnReduce(nEscape_, sumOp<label>()) + nEscape0_;
|
||||
scalar mpe = returnReduce(massEscape_, sumOp<scalar>()) + massEscape0_;
|
||||
@ -287,11 +210,21 @@ void Foam::StandardWallInteraction<CloudType>::info(Ostream& os) const
|
||||
label nps = returnReduce(nStick_, sumOp<label>()) + nStick0_;
|
||||
scalar mps = returnReduce(massStick_, sumOp<scalar>()) + massStick0_;
|
||||
|
||||
os << " Parcel fates:" << nl
|
||||
os << " Parcel fate (number, mass)" << nl
|
||||
<< " - escape = " << npe << ", " << mpe << nl
|
||||
<< " - stick = " << nps << ", " << mps << nl;
|
||||
|
||||
writeProps(npe, mpe, nps, mps);
|
||||
if
|
||||
(
|
||||
this->owner().solution().transient()
|
||||
&& this->owner().db().time().outputTime()
|
||||
)
|
||||
{
|
||||
this->setModelProperty("nEscape", npe);
|
||||
this->setModelProperty("massEscape", mpe);
|
||||
this->setModelProperty("nStick", nps);
|
||||
this->setModelProperty("massStick", mps);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -104,21 +104,6 @@ protected:
|
||||
scalar massStick_;
|
||||
|
||||
|
||||
// Protected Member Functions
|
||||
|
||||
//- Read interaction properties from file
|
||||
void readProps();
|
||||
|
||||
//- Write interaction properties to file
|
||||
void writeProps
|
||||
(
|
||||
const label nEscape,
|
||||
const scalar massEscape,
|
||||
const label nStick,
|
||||
const scalar massStick
|
||||
) const;
|
||||
|
||||
|
||||
public:
|
||||
|
||||
//- Runtime type information
|
||||
@ -164,7 +149,7 @@ public:
|
||||
// I-O
|
||||
|
||||
//- Write patch interaction info to stream
|
||||
virtual void info(Ostream& os) const;
|
||||
virtual void info(Ostream& os);
|
||||
};
|
||||
|
||||
|
||||
|
||||
@ -57,7 +57,7 @@ Foam::SurfaceFilmModel<CloudType>::SurfaceFilmModel
|
||||
const word& type
|
||||
)
|
||||
:
|
||||
SubModelBase<CloudType>(owner, dict, type),
|
||||
SubModelBase<CloudType>(owner, dict, typeName, type),
|
||||
g_(g),
|
||||
ejectedParcelType_
|
||||
(
|
||||
|
||||
@ -44,7 +44,7 @@ Foam::CompositionModel<CloudType>::CompositionModel
|
||||
const word& type
|
||||
)
|
||||
:
|
||||
SubModelBase<CloudType>(owner, dict, type),
|
||||
SubModelBase<CloudType>(owner, dict, typeName, type),
|
||||
thermo_(owner.thermo()),
|
||||
phaseProps_
|
||||
(
|
||||
|
||||
@ -140,20 +140,20 @@ void Foam::LiquidEvaporation<CloudType>::calculate
|
||||
const scalar dt,
|
||||
const label cellI,
|
||||
const scalar Re,
|
||||
const scalar Pr,
|
||||
const scalar d,
|
||||
const scalar nu,
|
||||
const scalar T,
|
||||
const scalar Ts,
|
||||
const scalar pc,
|
||||
const scalar Tc,
|
||||
const scalarField& Yl,
|
||||
scalarField& dMassPC
|
||||
) const
|
||||
{
|
||||
// construct carrier phase species volume fractions for cell, cellI
|
||||
const scalarField Xc(calcXc(cellI));
|
||||
|
||||
// droplet surface area
|
||||
const scalar A = pi*sqr(d);
|
||||
|
||||
// calculate mass transfer of each specie in liquid
|
||||
forAll(activeLiquids_, i)
|
||||
{
|
||||
@ -180,7 +180,7 @@ void Foam::LiquidEvaporation<CloudType>::calculate
|
||||
// mass transfer coefficient [m/s]
|
||||
const scalar kc = Sh*Dab/(d + ROOTVSMALL);
|
||||
|
||||
// vapour concentration at droplet surface [kmol/m3] at film temperature
|
||||
// vapour concentration at surface [kmol/m3] at film temperature
|
||||
const scalar Cs = pSat/(specie::RR*Ts);
|
||||
|
||||
// vapour concentration in bulk gas [kmol/m3] at film temperature
|
||||
@ -190,7 +190,7 @@ void Foam::LiquidEvaporation<CloudType>::calculate
|
||||
const scalar Ni = max(kc*(Cs - Cinf), 0.0);
|
||||
|
||||
// mass transfer [kg]
|
||||
dMassPC[lid] += Ni*A*liquids_.properties()[lid].W()*dt;
|
||||
dMassPC[lid] += Ni*pi*sqr(d)*liquids_.properties()[lid].W()*dt;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -111,11 +111,14 @@ public:
|
||||
const scalar dt,
|
||||
const label cellI,
|
||||
const scalar Re,
|
||||
const scalar Pr,
|
||||
const scalar d,
|
||||
const scalar nu,
|
||||
const scalar T,
|
||||
const scalar Ts,
|
||||
const scalar pc,
|
||||
const scalar Tc,
|
||||
const scalarField& Yl,
|
||||
scalarField& dMassPC
|
||||
) const;
|
||||
|
||||
|
||||
@ -0,0 +1,299 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "LiquidEvaporationBoil.H"
|
||||
#include "specie.H"
|
||||
#include "mathematicalConstants.H"
|
||||
|
||||
using namespace Foam::constant::mathematical;
|
||||
|
||||
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
||||
|
||||
template<class CloudType>
|
||||
Foam::tmp<Foam::scalarField> Foam::LiquidEvaporationBoil<CloudType>::calcXc
|
||||
(
|
||||
const label cellI
|
||||
) const
|
||||
{
|
||||
scalarField Xc(this->owner().thermo().carrier().Y().size());
|
||||
|
||||
forAll(Xc, i)
|
||||
{
|
||||
Xc[i] =
|
||||
this->owner().thermo().carrier().Y()[i][cellI]
|
||||
/this->owner().thermo().carrier().W(i);
|
||||
}
|
||||
|
||||
return Xc/sum(Xc);
|
||||
}
|
||||
|
||||
|
||||
template<class CloudType>
|
||||
Foam::scalar Foam::LiquidEvaporationBoil<CloudType>::Sh
|
||||
(
|
||||
const scalar Re,
|
||||
const scalar Sc
|
||||
) const
|
||||
{
|
||||
return 2.0 + 0.6*Foam::sqrt(Re)*cbrt(Sc);
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
template<class CloudType>
|
||||
Foam::LiquidEvaporationBoil<CloudType>::LiquidEvaporationBoil
|
||||
(
|
||||
const dictionary& dict,
|
||||
CloudType& owner
|
||||
)
|
||||
:
|
||||
PhaseChangeModel<CloudType>(dict, owner, typeName),
|
||||
liquids_(owner.thermo().liquids()),
|
||||
activeLiquids_(this->coeffDict().lookup("activeLiquids")),
|
||||
liqToCarrierMap_(activeLiquids_.size(), -1),
|
||||
liqToLiqMap_(activeLiquids_.size(), -1)
|
||||
{
|
||||
if (activeLiquids_.size() == 0)
|
||||
{
|
||||
WarningIn
|
||||
(
|
||||
"Foam::LiquidEvaporationBoil<CloudType>::LiquidEvaporationBoil"
|
||||
"("
|
||||
"const dictionary& dict, "
|
||||
"CloudType& owner"
|
||||
")"
|
||||
) << "Evaporation model selected, but no active liquids defined"
|
||||
<< nl << endl;
|
||||
}
|
||||
else
|
||||
{
|
||||
Info<< "Participating liquid species:" << endl;
|
||||
|
||||
// Determine mapping between liquid and carrier phase species
|
||||
forAll(activeLiquids_, i)
|
||||
{
|
||||
Info<< " " << activeLiquids_[i] << endl;
|
||||
liqToCarrierMap_[i] =
|
||||
owner.composition().globalCarrierId(activeLiquids_[i]);
|
||||
}
|
||||
|
||||
// Determine mapping between model active liquids and global liquids
|
||||
const label idLiquid = owner.composition().idLiquid();
|
||||
forAll(activeLiquids_, i)
|
||||
{
|
||||
liqToLiqMap_[i] =
|
||||
owner.composition().localId(idLiquid, activeLiquids_[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
template<class CloudType>
|
||||
Foam::LiquidEvaporationBoil<CloudType>::LiquidEvaporationBoil
|
||||
(
|
||||
const LiquidEvaporationBoil<CloudType>& pcm
|
||||
)
|
||||
:
|
||||
PhaseChangeModel<CloudType>(pcm),
|
||||
liquids_(pcm.owner().thermo().liquids()),
|
||||
activeLiquids_(pcm.activeLiquids_),
|
||||
liqToCarrierMap_(pcm.liqToCarrierMap_),
|
||||
liqToLiqMap_(pcm.liqToLiqMap_)
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
||||
|
||||
template<class CloudType>
|
||||
Foam::LiquidEvaporationBoil<CloudType>::~LiquidEvaporationBoil()
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
template<class CloudType>
|
||||
void Foam::LiquidEvaporationBoil<CloudType>::calculate
|
||||
(
|
||||
const scalar dt,
|
||||
const label cellI,
|
||||
const scalar Re,
|
||||
const scalar Pr,
|
||||
const scalar d,
|
||||
const scalar nu,
|
||||
const scalar T,
|
||||
const scalar Ts,
|
||||
const scalar pc,
|
||||
const scalar Tc,
|
||||
const scalarField& Yl,
|
||||
scalarField& dMassPC
|
||||
) const
|
||||
{
|
||||
// construct carrier phase species volume fractions for cell, cellI
|
||||
const scalarField XcMix(calcXc(cellI));
|
||||
|
||||
// liquid volume fraction
|
||||
const scalarField X(liquids_.X(Yl));
|
||||
|
||||
// droplet surface pressure
|
||||
scalar ps = liquids_.pv(pc, T, X);
|
||||
|
||||
// vapour density at droplet surface [kg/m3]
|
||||
scalar rhos = ps*liquids_.W(X)/(specie::RR*Ts);
|
||||
|
||||
// thermal conductivity of carrier [W/m/K]
|
||||
scalar kappac = 0.0;
|
||||
forAll(this->owner().thermo().carrier().Y(), i)
|
||||
{
|
||||
const scalar Yc = this->owner().thermo().carrier().Y()[i][cellI];
|
||||
kappac += Yc*this->owner().thermo().carrier().kappa(i, Ts);
|
||||
}
|
||||
|
||||
// calculate mass transfer of each specie in liquid
|
||||
forAll(activeLiquids_, i)
|
||||
{
|
||||
const label gid = liqToCarrierMap_[i];
|
||||
const label lid = liqToLiqMap_[i];
|
||||
|
||||
// boiling temperature at cell pressure for liquid species lid [K]
|
||||
const scalar TBoil = liquids_.properties()[lid].pvInvert(pc);
|
||||
|
||||
// limit droplet temperature to boiling/critical temperature
|
||||
const scalar Td = min(T, 0.999*TBoil);
|
||||
|
||||
// saturation pressure for liquid species lid [Pa]
|
||||
const scalar pSat = liquids_.properties()[lid].pv(pc, Td);
|
||||
|
||||
// carrier phase concentration
|
||||
const scalar Xc = XcMix[gid];
|
||||
|
||||
if (Xc*pc > pSat)
|
||||
{
|
||||
// saturated vapour - no phase change
|
||||
}
|
||||
else
|
||||
{
|
||||
if (pSat > 0.999*pc)
|
||||
{
|
||||
// boiling
|
||||
|
||||
// const scalar deltaT = max(Tc - Td, 0.5);
|
||||
const scalar deltaT = max(Tc - T, 0.5);
|
||||
|
||||
// liquid specific heat capacity
|
||||
const scalar Cp = liquids_.properties()[lid].Cp(pc, Td);
|
||||
|
||||
// vapour heat of fomation
|
||||
const scalar hv = liquids_.properties()[lid].hl(pc, Td);
|
||||
|
||||
// Nusselt number
|
||||
const scalar Nu = 2.0 + 0.6*sqrt(Re)*cbrt(Pr);
|
||||
|
||||
const scalar lg = log(1.0 + Cp*deltaT/max(SMALL, hv));
|
||||
|
||||
// mass transfer [kg]
|
||||
dMassPC[lid] += pi*kappac*Nu*lg*d/Cp*dt;
|
||||
}
|
||||
else
|
||||
{
|
||||
// evaporation
|
||||
|
||||
// surface molar fraction - Raoult's Law
|
||||
const scalar Xs = X[lid]*pSat/pc;
|
||||
|
||||
// molar ratio
|
||||
const scalar Xr = (Xs - Xc)/max(SMALL, 1.0 - Xs);
|
||||
|
||||
|
||||
if (Xr > 0)
|
||||
{
|
||||
// vapour diffusivity [m2/s]
|
||||
const scalar Dab = liquids_.properties()[lid].D(pc, Td);
|
||||
|
||||
// Schmidt number
|
||||
const scalar Sc = nu/(Dab + ROOTVSMALL);
|
||||
|
||||
// Sherwood number
|
||||
const scalar Sh = this->Sh(Re, Sc);
|
||||
|
||||
// mass transfer coefficient [m/s]
|
||||
const scalar kc = Sh*Dab/(d + ROOTVSMALL);
|
||||
|
||||
// mass transfer [kg]
|
||||
dMassPC[lid] += pi*sqr(d)*kc*rhos*log(1.0 + Xr)*dt;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
template<class CloudType>
|
||||
Foam::scalar Foam::LiquidEvaporationBoil<CloudType>::dh
|
||||
(
|
||||
const label idc,
|
||||
const label idl,
|
||||
const label p,
|
||||
const label T
|
||||
) const
|
||||
{
|
||||
scalar dh = 0;
|
||||
|
||||
typedef PhaseChangeModel<CloudType> parent;
|
||||
switch (parent::enthalpyTransfer_)
|
||||
{
|
||||
case (parent::etLatentHeat):
|
||||
{
|
||||
dh = liquids_.properties()[idl].hl(p, T);
|
||||
break;
|
||||
}
|
||||
case (parent::etEnthalpyDifference):
|
||||
{
|
||||
scalar hc = this->owner().composition().carrier().H(idc, T);
|
||||
scalar hp = liquids_.properties()[idl].h(p, T);
|
||||
|
||||
dh = hc - hp;
|
||||
break;
|
||||
}
|
||||
default:
|
||||
{
|
||||
FatalErrorIn
|
||||
(
|
||||
"Foam::scalar Foam::LiquidEvaporationBoil<CloudType>::dh"
|
||||
"("
|
||||
"const label, "
|
||||
"const label, "
|
||||
"const label, "
|
||||
"const label"
|
||||
")"
|
||||
) << "Unknown enthalpyTransfer type" << abort(FatalError);
|
||||
}
|
||||
}
|
||||
|
||||
return dh;
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,151 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Class
|
||||
Foam::LiquidEvaporationBoil
|
||||
|
||||
Description
|
||||
Liquid evaporation model
|
||||
- uses ideal gas assumption
|
||||
- includes boiling model
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef LiquidEvaporationBoil_H
|
||||
#define LiquidEvaporationBoil_H
|
||||
|
||||
#include "PhaseChangeModel.H"
|
||||
#include "liquidMixtureProperties.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class LiquidEvaporationBoil Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
template<class CloudType>
|
||||
class LiquidEvaporationBoil
|
||||
:
|
||||
public PhaseChangeModel<CloudType>
|
||||
{
|
||||
protected:
|
||||
|
||||
// Protected data
|
||||
|
||||
//- Global liquid properties data
|
||||
const liquidMixtureProperties& liquids_;
|
||||
|
||||
//- List of active liquid names
|
||||
List<word> activeLiquids_;
|
||||
|
||||
//- Mapping between liquid and carrier species
|
||||
List<label> liqToCarrierMap_;
|
||||
|
||||
//- Mapping between local and global liquid species
|
||||
List<label> liqToLiqMap_;
|
||||
|
||||
|
||||
// Protected Member Functions
|
||||
|
||||
//- Sherwood number as a function of Reynolds and Schmidt numbers
|
||||
scalar Sh(const scalar Re, const scalar Sc) const;
|
||||
|
||||
//- Calculate the carrier phase component volume fractions at cellI
|
||||
tmp<scalarField> calcXc(const label cellI) const;
|
||||
|
||||
|
||||
public:
|
||||
|
||||
//- Runtime type information
|
||||
TypeName("liquidEvaporationBoil");
|
||||
|
||||
|
||||
// Constructors
|
||||
|
||||
//- Construct from dictionary
|
||||
LiquidEvaporationBoil(const dictionary& dict, CloudType& cloud);
|
||||
|
||||
//- Construct copy
|
||||
LiquidEvaporationBoil(const LiquidEvaporationBoil<CloudType>& pcm);
|
||||
|
||||
//- Construct and return a clone
|
||||
virtual autoPtr<PhaseChangeModel<CloudType> > clone() const
|
||||
{
|
||||
return autoPtr<PhaseChangeModel<CloudType> >
|
||||
(
|
||||
new LiquidEvaporationBoil<CloudType>(*this)
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
//- Destructor
|
||||
virtual ~LiquidEvaporationBoil();
|
||||
|
||||
|
||||
// Member Functions
|
||||
|
||||
//- Update model
|
||||
virtual void calculate
|
||||
(
|
||||
const scalar dt,
|
||||
const label cellI,
|
||||
const scalar Re,
|
||||
const scalar Pr,
|
||||
const scalar d,
|
||||
const scalar nu,
|
||||
const scalar T,
|
||||
const scalar Ts,
|
||||
const scalar pc,
|
||||
const scalar Tc,
|
||||
const scalarField& Yl,
|
||||
scalarField& dMassPC
|
||||
) const;
|
||||
|
||||
//- Return the enthalpy per unit mass
|
||||
virtual scalar dh
|
||||
(
|
||||
const label idc,
|
||||
const label idl,
|
||||
const label p,
|
||||
const label T
|
||||
) const;
|
||||
};
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#ifdef NoRepository
|
||||
# include "LiquidEvaporationBoil.C"
|
||||
#endif
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -76,7 +76,8 @@ Foam::PhaseChangeModel<CloudType>::PhaseChangeModel
|
||||
)
|
||||
:
|
||||
SubModelBase<CloudType>(owner),
|
||||
enthalpyTransfer_(etLatentHeat)
|
||||
enthalpyTransfer_(etLatentHeat),
|
||||
dMass_(0.0)
|
||||
{}
|
||||
|
||||
|
||||
@ -87,7 +88,8 @@ Foam::PhaseChangeModel<CloudType>::PhaseChangeModel
|
||||
)
|
||||
:
|
||||
SubModelBase<CloudType>(pcm),
|
||||
enthalpyTransfer_(pcm.enthalpyTransfer_)
|
||||
enthalpyTransfer_(pcm.enthalpyTransfer_),
|
||||
dMass_(pcm.dMass_)
|
||||
{}
|
||||
|
||||
|
||||
@ -99,11 +101,12 @@ Foam::PhaseChangeModel<CloudType>::PhaseChangeModel
|
||||
const word& type
|
||||
)
|
||||
:
|
||||
SubModelBase<CloudType>(owner, dict, type),
|
||||
SubModelBase<CloudType>(owner, dict, typeName, type),
|
||||
enthalpyTransfer_
|
||||
(
|
||||
wordToEnthalpyTransfer(this->coeffDict().lookup("enthalpyTransfer"))
|
||||
)
|
||||
),
|
||||
dMass_(0.0)
|
||||
{}
|
||||
|
||||
|
||||
@ -135,6 +138,9 @@ void Foam::PhaseChangeModel<CloudType>::calculate
|
||||
const scalar,
|
||||
const scalar,
|
||||
const scalar,
|
||||
const scalar,
|
||||
const scalar,
|
||||
const scalarField&,
|
||||
scalarField&
|
||||
) const
|
||||
{
|
||||
@ -150,6 +156,9 @@ void Foam::PhaseChangeModel<CloudType>::calculate
|
||||
"const scalar, "
|
||||
"const scalar, "
|
||||
"const scalar, "
|
||||
"const scalar, "
|
||||
"const scalar, "
|
||||
"const scalarField&,"
|
||||
"scalarField&"
|
||||
") const"
|
||||
);
|
||||
@ -169,6 +178,33 @@ Foam::scalar Foam::PhaseChangeModel<CloudType>::dh
|
||||
}
|
||||
|
||||
|
||||
template<class CloudType>
|
||||
void Foam::PhaseChangeModel<CloudType>::addToPhaseChangeMass(const scalar dMass)
|
||||
{
|
||||
dMass_ += dMass;
|
||||
}
|
||||
|
||||
|
||||
template<class CloudType>
|
||||
void Foam::PhaseChangeModel<CloudType>::info(Ostream& os)
|
||||
{
|
||||
const scalar mass0 = this->template getBaseProperty<scalar>("mass");
|
||||
const scalar massTotal = mass0 + returnReduce(dMass_, sumOp<scalar>());
|
||||
|
||||
Info<< " Mass transfer phase change = " << massTotal << nl;
|
||||
|
||||
if
|
||||
(
|
||||
this->owner().solution().transient()
|
||||
&& this->owner().db().time().outputTime()
|
||||
)
|
||||
{
|
||||
this->setBaseProperty("mass", massTotal);
|
||||
dMass_ = 0.0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#include "PhaseChangeModelNew.C"
|
||||
|
||||
@ -78,6 +78,12 @@ protected:
|
||||
enthalpyTransferType enthalpyTransfer_;
|
||||
|
||||
|
||||
// Counters
|
||||
|
||||
//- Mass of lagrangian phase converted
|
||||
scalar dMass_;
|
||||
|
||||
|
||||
// Protected Member Functions
|
||||
|
||||
//- Convert word to enthalpy transfer type
|
||||
@ -158,11 +164,14 @@ public:
|
||||
const scalar dt,
|
||||
const label cellI,
|
||||
const scalar Re,
|
||||
const scalar Pr,
|
||||
const scalar d,
|
||||
const scalar nu,
|
||||
const scalar T,
|
||||
const scalar Ts,
|
||||
const scalar pc,
|
||||
const scalar Tc,
|
||||
const scalarField& Yl,
|
||||
scalarField& dMassPC
|
||||
) const;
|
||||
|
||||
@ -174,6 +183,16 @@ public:
|
||||
const label p,
|
||||
const label T
|
||||
) const;
|
||||
|
||||
|
||||
//- Add to phase change mass
|
||||
void addToPhaseChangeMass(const scalar dMass);
|
||||
|
||||
|
||||
// I-O
|
||||
|
||||
//- Write injection info to stream
|
||||
virtual void info(Ostream& os);
|
||||
};
|
||||
|
||||
|
||||
|
||||
@ -33,7 +33,8 @@ Foam::DevolatilisationModel<CloudType>::DevolatilisationModel
|
||||
CloudType& owner
|
||||
)
|
||||
:
|
||||
SubModelBase<CloudType>(owner)
|
||||
SubModelBase<CloudType>(owner),
|
||||
dMass_(0.0)
|
||||
{}
|
||||
|
||||
|
||||
@ -45,7 +46,8 @@ Foam::DevolatilisationModel<CloudType>::DevolatilisationModel
|
||||
const word& type
|
||||
)
|
||||
:
|
||||
SubModelBase<CloudType>(owner, dict, type)
|
||||
SubModelBase<CloudType>(owner, dict, typeName, type),
|
||||
dMass_(0.0)
|
||||
{}
|
||||
|
||||
|
||||
@ -55,7 +57,8 @@ Foam::DevolatilisationModel<CloudType>::DevolatilisationModel
|
||||
const DevolatilisationModel<CloudType>& dm
|
||||
)
|
||||
:
|
||||
SubModelBase<CloudType>(dm)
|
||||
SubModelBase<CloudType>(dm),
|
||||
dMass_(dm.dMass_)
|
||||
{}
|
||||
|
||||
|
||||
@ -96,6 +99,36 @@ void Foam::DevolatilisationModel<CloudType>::calculate
|
||||
}
|
||||
|
||||
|
||||
template<class CloudType>
|
||||
void Foam::DevolatilisationModel<CloudType>::addToDevolatilisationMass
|
||||
(
|
||||
const scalar dMass
|
||||
)
|
||||
{
|
||||
dMass_ += dMass;
|
||||
}
|
||||
|
||||
|
||||
template<class CloudType>
|
||||
void Foam::DevolatilisationModel<CloudType>::info(Ostream& os)
|
||||
{
|
||||
const scalar mass0 = this->template getBaseProperty<scalar>("mass");
|
||||
const scalar massTotal = mass0 + returnReduce(dMass_, sumOp<scalar>());
|
||||
|
||||
Info<< " Mass transfer devolatilisation = " << massTotal << nl;
|
||||
|
||||
if
|
||||
(
|
||||
this->owner().solution().transient()
|
||||
&& this->owner().db().time().outputTime()
|
||||
)
|
||||
{
|
||||
this->setBaseProperty("mass", massTotal);
|
||||
dMass_ = 0.0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#include "DevolatilisationModelNew.C"
|
||||
|
||||
@ -55,6 +55,14 @@ class DevolatilisationModel
|
||||
:
|
||||
public SubModelBase<CloudType>
|
||||
{
|
||||
protected:
|
||||
|
||||
// Protected data
|
||||
|
||||
//- Mass of lagrangian phase converted
|
||||
scalar dMass_;
|
||||
|
||||
|
||||
public:
|
||||
|
||||
//- Runtime type information
|
||||
@ -125,6 +133,15 @@ public:
|
||||
bool& canCombust,
|
||||
scalarField& dMassDV
|
||||
) const;
|
||||
|
||||
//- Add to devolatilisation mass
|
||||
void addToDevolatilisationMass(const scalar dMass);
|
||||
|
||||
|
||||
// I-O
|
||||
|
||||
//- Write injection info to stream
|
||||
virtual void info(Ostream& os);
|
||||
};
|
||||
|
||||
|
||||
|
||||
@ -33,7 +33,8 @@ Foam::SurfaceReactionModel<CloudType>::SurfaceReactionModel
|
||||
CloudType& owner
|
||||
)
|
||||
:
|
||||
SubModelBase<CloudType>(owner)
|
||||
SubModelBase<CloudType>(owner),
|
||||
dMass_(0.0)
|
||||
{}
|
||||
|
||||
|
||||
@ -45,7 +46,8 @@ Foam::SurfaceReactionModel<CloudType>::SurfaceReactionModel
|
||||
const word& type
|
||||
)
|
||||
:
|
||||
SubModelBase<CloudType>(owner, dict, type)
|
||||
SubModelBase<CloudType>(owner, dict, typeName, type),
|
||||
dMass_(0.0)
|
||||
{}
|
||||
|
||||
|
||||
@ -55,7 +57,8 @@ Foam::SurfaceReactionModel<CloudType>::SurfaceReactionModel
|
||||
const SurfaceReactionModel<CloudType>& srm
|
||||
)
|
||||
:
|
||||
SubModelBase<CloudType>(srm)
|
||||
SubModelBase<CloudType>(srm),
|
||||
dMass_(srm.dMass_)
|
||||
{}
|
||||
|
||||
|
||||
@ -118,6 +121,36 @@ Foam::scalar Foam::SurfaceReactionModel<CloudType>::calculate
|
||||
}
|
||||
|
||||
|
||||
template<class CloudType>
|
||||
void Foam::SurfaceReactionModel<CloudType>::addToSurfaceReactionMass
|
||||
(
|
||||
const scalar dMass
|
||||
)
|
||||
{
|
||||
dMass_ += dMass;
|
||||
}
|
||||
|
||||
|
||||
template<class CloudType>
|
||||
void Foam::SurfaceReactionModel<CloudType>::info(Ostream& os)
|
||||
{
|
||||
const scalar mass0 = this->template getBaseProperty<scalar>("mass");
|
||||
const scalar massTotal = mass0 + returnReduce(dMass_, sumOp<scalar>());
|
||||
|
||||
Info<< " Mass transfer surface reaction = " << massTotal << nl;
|
||||
|
||||
if
|
||||
(
|
||||
this->owner().solution().transient()
|
||||
&& this->owner().db().time().outputTime()
|
||||
)
|
||||
{
|
||||
this->setBaseProperty("mass", massTotal);
|
||||
dMass_ = 0.0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#include "SurfaceReactionModelNew.C"
|
||||
|
||||
@ -56,6 +56,14 @@ class SurfaceReactionModel
|
||||
:
|
||||
public SubModelBase<CloudType>
|
||||
{
|
||||
protected:
|
||||
|
||||
// Protected data
|
||||
|
||||
//- Mass of lagrangian phase converted
|
||||
scalar dMass_;
|
||||
|
||||
|
||||
public:
|
||||
|
||||
//-Runtime type information
|
||||
@ -138,6 +146,15 @@ public:
|
||||
scalarField& dMassSolid,
|
||||
scalarField& dMassSRCarrier
|
||||
) const;
|
||||
|
||||
//- Add to devolatilisation mass
|
||||
void addToSurfaceReactionMass(const scalar dMass);
|
||||
|
||||
|
||||
// I-O
|
||||
|
||||
//- Write injection info to stream
|
||||
virtual void info(Ostream& os);
|
||||
};
|
||||
|
||||
|
||||
|
||||
@ -32,6 +32,8 @@ Foam::SubModelBase<CloudType>::SubModelBase(CloudType& owner)
|
||||
:
|
||||
owner_(owner),
|
||||
dict_(dictionary::null),
|
||||
baseName_("none"),
|
||||
name_("none"),
|
||||
coeffDict_(dictionary::null)
|
||||
{}
|
||||
|
||||
@ -41,12 +43,15 @@ Foam::SubModelBase<CloudType>::SubModelBase
|
||||
(
|
||||
CloudType& owner,
|
||||
const dictionary& dict,
|
||||
const word& baseName,
|
||||
const word& name,
|
||||
const word& dictExt
|
||||
)
|
||||
:
|
||||
owner_(owner),
|
||||
dict_(dict),
|
||||
baseName_(baseName),
|
||||
name_(name),
|
||||
coeffDict_(dict.subDict(name + dictExt))
|
||||
{}
|
||||
|
||||
@ -56,6 +61,8 @@ Foam::SubModelBase<CloudType>::SubModelBase(const SubModelBase<CloudType>& smb)
|
||||
:
|
||||
owner_(smb.owner_),
|
||||
dict_(smb.dict_),
|
||||
baseName_(smb.baseName_),
|
||||
name_(smb.name_),
|
||||
coeffDict_(smb.coeffDict_)
|
||||
{}
|
||||
|
||||
@ -83,6 +90,20 @@ const Foam::dictionary& Foam::SubModelBase<CloudType>::dict() const
|
||||
}
|
||||
|
||||
|
||||
template<class CloudType>
|
||||
const Foam::word& Foam::SubModelBase<CloudType>::baseName() const
|
||||
{
|
||||
return baseName_;
|
||||
}
|
||||
|
||||
|
||||
template<class CloudType>
|
||||
const Foam::word& Foam::SubModelBase<CloudType>::name() const
|
||||
{
|
||||
return name_;
|
||||
}
|
||||
|
||||
|
||||
template<class CloudType>
|
||||
const Foam::dictionary& Foam::SubModelBase<CloudType>::coeffDict() const
|
||||
{
|
||||
@ -126,6 +147,129 @@ void Foam::SubModelBase<CloudType>::cacheFields(const bool)
|
||||
}
|
||||
|
||||
|
||||
template<class CloudType>
|
||||
template<class Type>
|
||||
Type Foam::SubModelBase<CloudType>::getBaseProperty
|
||||
(
|
||||
const word& entryName
|
||||
) const
|
||||
{
|
||||
Type result = pTraits<Type>::zero;
|
||||
|
||||
const dictionary& properties = this->owner().outputProperties();
|
||||
|
||||
if (properties.found(baseName_))
|
||||
{
|
||||
const dictionary& baseDict = properties.subDict(baseName_);
|
||||
baseDict.readIfPresent(entryName, result);
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
template<class CloudType>
|
||||
template<class Type>
|
||||
void Foam::SubModelBase<CloudType>::setBaseProperty
|
||||
(
|
||||
const word& entryName,
|
||||
const Type& value
|
||||
)
|
||||
{
|
||||
dictionary& properties = this->owner().outputProperties();
|
||||
|
||||
if (properties.found(baseName_))
|
||||
{
|
||||
dictionary& baseDict = properties.subDict(baseName_);
|
||||
baseDict.add(entryName, value, true);
|
||||
}
|
||||
else
|
||||
{
|
||||
properties.add(baseName_, dictionary());
|
||||
properties.subDict(baseName_).add(entryName, value);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
template<class CloudType>
|
||||
template<class Type>
|
||||
Type Foam::SubModelBase<CloudType>::getModelProperty
|
||||
(
|
||||
const word& entryName
|
||||
) const
|
||||
{
|
||||
Type result = pTraits<Type>::zero;
|
||||
|
||||
const dictionary& properties = this->owner().outputProperties();
|
||||
|
||||
if (properties.found(baseName_))
|
||||
{
|
||||
const dictionary& baseDict = properties.subDict(baseName_);
|
||||
|
||||
if (baseDict.found(name_))
|
||||
{
|
||||
baseDict.subDict(name_).readIfPresent(entryName, result);
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
template<class CloudType>
|
||||
template<class Type>
|
||||
void Foam::SubModelBase<CloudType>::getModelProperty
|
||||
(
|
||||
const word& entryName,
|
||||
Type& value
|
||||
) const
|
||||
{
|
||||
const dictionary& properties = this->owner().outputProperties();
|
||||
|
||||
if (properties.found(baseName_))
|
||||
{
|
||||
const dictionary& baseDict = properties.subDict(baseName_);
|
||||
|
||||
if (baseDict.found(name_))
|
||||
{
|
||||
baseDict.subDict(name_).readIfPresent(entryName, value);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
template<class CloudType>
|
||||
template<class Type>
|
||||
void Foam::SubModelBase<CloudType>::setModelProperty
|
||||
(
|
||||
const word& entryName,
|
||||
const Type& value
|
||||
)
|
||||
{
|
||||
dictionary& properties = this->owner().outputProperties();
|
||||
|
||||
if (properties.found(baseName_))
|
||||
{
|
||||
dictionary& baseDict = properties.subDict(baseName_);
|
||||
if (baseDict.found(name_))
|
||||
{
|
||||
baseDict.subDict(name_).add(entryName, value, true);
|
||||
}
|
||||
else
|
||||
{
|
||||
baseDict.add(name_, dictionary());
|
||||
baseDict.subDict(name_).add(entryName, value, true);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
properties.add(baseName_, dictionary());
|
||||
properties.subDict(baseName_).add(name_, dictionary());
|
||||
properties.subDict(baseName_).subDict(name_).add(entryName, value);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
template<class CloudType>
|
||||
void Foam::SubModelBase<CloudType>::write(Ostream& os) const
|
||||
{
|
||||
|
||||
@ -63,6 +63,12 @@ protected:
|
||||
//- Reference to the cloud dictionary
|
||||
const dictionary& dict_;
|
||||
|
||||
//- Name of the sub-model bas class
|
||||
const word baseName_;
|
||||
|
||||
//- Name of the sub-model
|
||||
const word name_;
|
||||
|
||||
//- Coefficients dictionary
|
||||
const dictionary& coeffDict_;
|
||||
|
||||
@ -79,6 +85,7 @@ public:
|
||||
(
|
||||
CloudType& owner,
|
||||
const dictionary& dict,
|
||||
const word& baseName,
|
||||
const word& name,
|
||||
const word& dictExt = "Coeffs"
|
||||
);
|
||||
@ -98,15 +105,24 @@ public:
|
||||
|
||||
// Access
|
||||
|
||||
//- Return const access to the cloud dictionary
|
||||
const dictionary& dict() const;
|
||||
|
||||
//- Return const access to the owner cloud
|
||||
const CloudType& owner() const;
|
||||
|
||||
//- Return const access to the cloud dictionary
|
||||
const dictionary& dict() const;
|
||||
|
||||
//- Return const access to the base name of the sub-model
|
||||
const word& baseName() const;
|
||||
|
||||
//- Return const access to the name of the sub-model
|
||||
const word& name() const;
|
||||
|
||||
//- Return const access to the coefficients dictionary
|
||||
const dictionary& coeffDict() const;
|
||||
|
||||
//- Return const access to the properties dictionary
|
||||
const IOdictionary& properties() const;
|
||||
|
||||
//- Returns true if defaultCoeffs is true and outputs on printMsg
|
||||
bool defaultCoeffs(const bool printMsg) const;
|
||||
|
||||
@ -122,6 +138,26 @@ public:
|
||||
//- Return non-const access to the owner cloud for manipulation
|
||||
CloudType& owner();
|
||||
|
||||
//- Retrieve generic property from sub-model
|
||||
template<class Type>
|
||||
Type getModelProperty(const word& entryName) const;
|
||||
|
||||
//- Retrieve generic property from sub-model
|
||||
template<class Type>
|
||||
void getModelProperty(const word& entryName, Type& value) const;
|
||||
|
||||
//- Add generic property from sub-model
|
||||
template<class Type>
|
||||
void setModelProperty(const word& entryName, const Type& value);
|
||||
|
||||
//- Retrieve generic property from base model
|
||||
template<class Type>
|
||||
Type getBaseProperty(const word& entryName) const;
|
||||
|
||||
//- Add generic property from base model
|
||||
template<class Type>
|
||||
void setBaseProperty(const word& entryName, const Type& value);
|
||||
|
||||
|
||||
// I-O
|
||||
|
||||
|
||||
@ -43,7 +43,7 @@ Foam::HeatTransferModel<CloudType>::HeatTransferModel
|
||||
const word& type
|
||||
)
|
||||
:
|
||||
SubModelBase<CloudType>(owner, dict, type),
|
||||
SubModelBase<CloudType>(owner, dict, typeName, type),
|
||||
BirdCorrection_(this->coeffDict().lookup("BirdCorrection"))
|
||||
{}
|
||||
|
||||
|
||||
@ -358,14 +358,17 @@ void Foam::SprayCloud<CloudType>::motion(TrackData& td)
|
||||
|
||||
|
||||
template<class CloudType>
|
||||
void Foam::SprayCloud<CloudType>::info() const
|
||||
void Foam::SprayCloud<CloudType>::info()
|
||||
{
|
||||
CloudType::info();
|
||||
scalar d32 = 1.0e+6*this->Dij(3, 2);
|
||||
scalar d10 = 1.0e+6*this->Dij(1, 0);
|
||||
scalar dMax = 1.0e+6*this->Dmax();
|
||||
scalar pen = this->penetration(0.95);
|
||||
|
||||
Info << " D32 (mu) = " << d32 << endl;
|
||||
Info << " Liquid penetration 95% mass (m) = " << pen << endl;
|
||||
Info << " D10, D32, Dmax (mu) = " << d10 << ", " << d32
|
||||
<< ", " << dMax << nl
|
||||
<< " Liquid penetration 95% mass (m) = " << pen << endl;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -192,19 +192,23 @@ public:
|
||||
inline const AtomizationModel<SprayCloud<CloudType> >&
|
||||
atomization() const;
|
||||
|
||||
//- Return reference to the atomization model
|
||||
inline AtomizationModel<SprayCloud<CloudType> >& atomization();
|
||||
|
||||
//- Return const-access to the breakup model
|
||||
inline const BreakupModel<SprayCloud<CloudType> >&
|
||||
breakup() const;
|
||||
|
||||
//- Return reference to the breakup model
|
||||
inline BreakupModel<SprayCloud<CloudType> >& breakup();
|
||||
|
||||
//- Return const-access to the breakup model
|
||||
inline const StochasticCollisionModel<SprayCloud<CloudType> >&
|
||||
stochasticCollision() const;
|
||||
|
||||
|
||||
// Check
|
||||
|
||||
//- Print cloud information
|
||||
void info() const;
|
||||
//- Return reference to the breakup model
|
||||
inline StochasticCollisionModel<SprayCloud<CloudType> >&
|
||||
stochasticCollision();
|
||||
|
||||
|
||||
// Cloud evolution functions
|
||||
@ -236,6 +240,12 @@ public:
|
||||
|
||||
template<class TrackData>
|
||||
void motion(TrackData& td);
|
||||
|
||||
|
||||
// I-O
|
||||
|
||||
//- Print cloud information
|
||||
void info();
|
||||
};
|
||||
|
||||
|
||||
|
||||
@ -41,6 +41,14 @@ Foam::SprayCloud<CloudType>::atomization() const
|
||||
}
|
||||
|
||||
|
||||
template<class CloudType>
|
||||
inline Foam::AtomizationModel<Foam::SprayCloud<CloudType> >&
|
||||
Foam::SprayCloud<CloudType>::atomization()
|
||||
{
|
||||
return atomizationModel_();
|
||||
}
|
||||
|
||||
|
||||
template<class CloudType>
|
||||
inline const Foam::BreakupModel<Foam::SprayCloud<CloudType> >&
|
||||
Foam::SprayCloud<CloudType>::breakup() const
|
||||
@ -49,6 +57,14 @@ Foam::SprayCloud<CloudType>::breakup() const
|
||||
}
|
||||
|
||||
|
||||
template<class CloudType>
|
||||
inline Foam::BreakupModel<Foam::SprayCloud<CloudType> >&
|
||||
Foam::SprayCloud<CloudType>::breakup()
|
||||
{
|
||||
return breakupModel_();
|
||||
}
|
||||
|
||||
|
||||
template<class CloudType>
|
||||
inline const Foam::StochasticCollisionModel<Foam::SprayCloud<CloudType> >&
|
||||
Foam::SprayCloud<CloudType>::stochasticCollision() const
|
||||
@ -57,9 +73,19 @@ Foam::SprayCloud<CloudType>::stochasticCollision() const
|
||||
}
|
||||
|
||||
|
||||
template<class CloudType>
|
||||
inline Foam::StochasticCollisionModel<Foam::SprayCloud<CloudType> >&
|
||||
Foam::SprayCloud<CloudType>::stochasticCollision()
|
||||
{
|
||||
return stochasticCollisionModel_();
|
||||
}
|
||||
|
||||
|
||||
template<class CloudType>
|
||||
inline Foam::scalar Foam::SprayCloud<CloudType>::averageParcelMass() const
|
||||
{
|
||||
return averageParcelMass_;
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
|
||||
@ -274,10 +274,8 @@ void Foam::SprayParcel<ParcelType>::calcBreakup
|
||||
Urel,
|
||||
Urmag,
|
||||
tMom,
|
||||
td.cloud().averageParcelMass(),
|
||||
dChild,
|
||||
massChild,
|
||||
td.cloud().rndGen()
|
||||
massChild
|
||||
)
|
||||
)
|
||||
{
|
||||
|
||||
@ -55,7 +55,7 @@ Foam::AtomizationModel<CloudType>::AtomizationModel
|
||||
const word& type
|
||||
)
|
||||
:
|
||||
SubModelBase<CloudType>(owner, dict, type)
|
||||
SubModelBase<CloudType>(owner, dict, typeName, type)
|
||||
{}
|
||||
|
||||
|
||||
|
||||
@ -67,7 +67,7 @@ Foam::BreakupModel<CloudType>::BreakupModel
|
||||
const word& type
|
||||
)
|
||||
:
|
||||
SubModelBase<CloudType>(owner, dict, type),
|
||||
SubModelBase<CloudType>(owner, dict, typeName, type),
|
||||
solveOscillationEq_(this->coeffDict().lookup("solveOscillationEq")),
|
||||
y0_(0.0),
|
||||
yDot0_(0.0),
|
||||
@ -120,11 +120,9 @@ bool Foam::BreakupModel<CloudType>::update
|
||||
const vector& Urel,
|
||||
const scalar Urmag,
|
||||
const scalar tMom,
|
||||
const scalar averageParcelMass,
|
||||
scalar& dChild,
|
||||
scalar& massChild,
|
||||
cachedRandom& rndGen
|
||||
) const
|
||||
scalar& massChild
|
||||
)
|
||||
{
|
||||
notImplemented
|
||||
(
|
||||
@ -149,11 +147,9 @@ bool Foam::BreakupModel<CloudType>::update
|
||||
"const vector&, "
|
||||
"const scalar, "
|
||||
"const scalar, "
|
||||
"const scalar, "
|
||||
"scalar&, "
|
||||
"scalar&, "
|
||||
"cachedRandom&"
|
||||
") const;"
|
||||
"scalar&"
|
||||
");"
|
||||
);
|
||||
|
||||
return false;
|
||||
|
||||
@ -183,11 +183,9 @@ public:
|
||||
const vector& Urel,
|
||||
const scalar Urmag,
|
||||
const scalar tMom,
|
||||
const scalar averageParcelMass,
|
||||
scalar& dChild,
|
||||
scalar& massChild,
|
||||
cachedRandom& rndGen
|
||||
) const;
|
||||
scalar& massChild
|
||||
);
|
||||
};
|
||||
|
||||
|
||||
|
||||
@ -112,11 +112,9 @@ bool Foam::ETAB<CloudType>::update
|
||||
const vector& Urel,
|
||||
const scalar Urmag,
|
||||
const scalar tMom,
|
||||
const scalar averageParcelMass,
|
||||
scalar& dChild,
|
||||
scalar& massChild,
|
||||
cachedRandom& rndGen
|
||||
) const
|
||||
scalar& massChild
|
||||
)
|
||||
{
|
||||
scalar r = 0.5*d;
|
||||
scalar r2 = r*r;
|
||||
@ -156,7 +154,7 @@ bool Foam::ETAB<CloudType>::update
|
||||
scalar quad = -y2/a;
|
||||
if (quad < 0)
|
||||
{
|
||||
phi = 2*constant::mathematical::pi - phit;
|
||||
phi = constant::mathematical::twoPi - phit;
|
||||
}
|
||||
|
||||
scalar tb = 0;
|
||||
@ -167,11 +165,11 @@ bool Foam::ETAB<CloudType>::update
|
||||
|
||||
if (theta < phi)
|
||||
{
|
||||
if (2*constant::mathematical::pi - theta >= phi)
|
||||
if (constant::mathematical::twoPi - theta >= phi)
|
||||
{
|
||||
theta = -theta;
|
||||
}
|
||||
theta += 2*constant::mathematical::pi;
|
||||
theta += constant::mathematical::twoPi;
|
||||
}
|
||||
tb = (theta - phi)*romega;
|
||||
|
||||
|
||||
@ -57,7 +57,7 @@ See Also
|
||||
namespace Foam
|
||||
{
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class ETAB Declaration
|
||||
Class ETAB Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
template<class CloudType>
|
||||
@ -134,11 +134,9 @@ public:
|
||||
const vector& Urel,
|
||||
const scalar Urmag,
|
||||
const scalar tMom,
|
||||
const scalar averageParcelMass,
|
||||
scalar& dChild,
|
||||
scalar& massChild,
|
||||
cachedRandom& rndGen
|
||||
) const;
|
||||
scalar& massChild
|
||||
);
|
||||
};
|
||||
|
||||
|
||||
|
||||
@ -84,11 +84,9 @@ bool Foam::NoBreakup<CloudType>::update
|
||||
const vector& Urel,
|
||||
const scalar Urmag,
|
||||
const scalar tMom,
|
||||
const scalar averageParcelMass,
|
||||
scalar& dChild,
|
||||
scalar& massChild,
|
||||
cachedRandom& rndGen
|
||||
) const
|
||||
scalar& massChild
|
||||
)
|
||||
{
|
||||
// Do nothing
|
||||
return false;
|
||||
|
||||
@ -102,11 +102,9 @@ public:
|
||||
const vector& Urel,
|
||||
const scalar Urmag,
|
||||
const scalar tMom,
|
||||
const scalar averageParcelMass,
|
||||
scalar& dChild,
|
||||
scalar& massChild,
|
||||
cachedRandom& rndGen
|
||||
) const;
|
||||
scalar& massChild
|
||||
);
|
||||
};
|
||||
|
||||
|
||||
|
||||
@ -86,15 +86,13 @@ bool Foam::PilchErdman<CloudType>::update
|
||||
const vector& Urel,
|
||||
const scalar Urmag,
|
||||
const scalar tMom,
|
||||
const scalar averageParcelMass,
|
||||
scalar& dChild,
|
||||
scalar& massChild,
|
||||
cachedRandom& rndGen
|
||||
) const
|
||||
scalar& massChild
|
||||
)
|
||||
{
|
||||
scalar semiMass = nParticle*pow3(d);
|
||||
scalar We = 0.5*rhoc*sqr(Urmag)*d/sigma;
|
||||
scalar Oh = mu/pow(rho*d*sigma, 0.5);
|
||||
scalar Oh = mu/sqrt(rho*d*sigma);
|
||||
|
||||
scalar Wec = 6.0*(1.0 + 1.077*pow(Oh, 1.6));
|
||||
|
||||
@ -124,7 +122,7 @@ bool Foam::PilchErdman<CloudType>::update
|
||||
taubBar = 6.0*pow(2.0*We - 12.0, -0.25);
|
||||
}
|
||||
|
||||
scalar rho12 = pow(rhoc/rho, 0.5);
|
||||
scalar rho12 = sqrt(rhoc/rho);
|
||||
|
||||
scalar Vd = Urmag*rho12*(B1_*taubBar * B2_*taubBar*taubBar);
|
||||
scalar Vd1 = sqr(1.0 - Vd/Urmag);
|
||||
|
||||
@ -47,7 +47,7 @@ Description
|
||||
namespace Foam
|
||||
{
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class PilchErdman Declaration
|
||||
Class PilchErdman Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
template<class CloudType>
|
||||
@ -115,11 +115,9 @@ public:
|
||||
const vector& Urel,
|
||||
const scalar Urmag,
|
||||
const scalar tMom,
|
||||
const scalar averageParcelMass,
|
||||
scalar& dChild,
|
||||
scalar& massChild,
|
||||
cachedRandom& rndGen
|
||||
) const;
|
||||
scalar& massChild
|
||||
);
|
||||
};
|
||||
|
||||
|
||||
|
||||
@ -92,11 +92,9 @@ bool Foam::ReitzDiwakar<CloudType>::update
|
||||
const vector& Urel,
|
||||
const scalar Urmag,
|
||||
const scalar tMom,
|
||||
const scalar averageParcelMass,
|
||||
scalar& dChild,
|
||||
scalar& massChild,
|
||||
cachedRandom& rndGen
|
||||
) const
|
||||
scalar& massChild
|
||||
)
|
||||
{
|
||||
scalar d1 = d;
|
||||
scalar nuc = muc/rhoc;
|
||||
@ -130,7 +128,7 @@ bool Foam::ReitzDiwakar<CloudType>::update
|
||||
|
||||
// preserve the total mass/volume by updating the number of
|
||||
// particles in parcels due to breakup
|
||||
nParticle *= pow(d1/d, 3.0);
|
||||
nParticle *= pow3(d1/d);
|
||||
}
|
||||
|
||||
return false;
|
||||
|
||||
@ -127,11 +127,9 @@ public:
|
||||
const vector& Urel,
|
||||
const scalar Urmag,
|
||||
const scalar tMom,
|
||||
const scalar averageParcelMass,
|
||||
scalar& dChild,
|
||||
scalar& massChild,
|
||||
cachedRandom& rndGen
|
||||
) const;
|
||||
scalar& massChild
|
||||
);
|
||||
};
|
||||
|
||||
|
||||
|
||||
@ -98,14 +98,14 @@ bool Foam::ReitzKHRT<CloudType>::update
|
||||
const vector& Urel,
|
||||
const scalar Urmag,
|
||||
const scalar tMom,
|
||||
const scalar averageParcelMass,
|
||||
scalar& dChild,
|
||||
scalar& massChild,
|
||||
cachedRandom& rndGen
|
||||
) const
|
||||
scalar& massChild
|
||||
)
|
||||
{
|
||||
bool addParcel = false;
|
||||
|
||||
const scalar averageParcelMass = this->owner().averageParcelMass();
|
||||
|
||||
scalar r = 0.5*d;
|
||||
scalar d3 = pow3(d);
|
||||
scalar d03 = pow3(d0);
|
||||
@ -158,7 +158,7 @@ bool Foam::ReitzKHRT<CloudType>::update
|
||||
scalar KRT = sqrt(helpVariable/(3.0*sigma + VSMALL));
|
||||
|
||||
// wavelength of the fastest growing RT frequency
|
||||
scalar lambdaRT = 2.0*constant::mathematical::pi*cRT_/(KRT + VSMALL);
|
||||
scalar lambdaRT = constant::mathematical::twoPi*cRT_/(KRT + VSMALL);
|
||||
|
||||
// if lambdaRT < diameter, then RT waves are growing on the surface
|
||||
// and we start to keep track of how long they have been growing
|
||||
@ -244,7 +244,7 @@ bool Foam::ReitzKHRT<CloudType>::update
|
||||
// Technology 3 (1987) 309-337, p.322) pIndKH() should be introduced
|
||||
|
||||
scalar lengthScale =
|
||||
min(lambdaKH, 2.0*constant::mathematical::pi*Urmag/omegaKH);
|
||||
min(lambdaKH, constant::mathematical::twoPi*Urmag/omegaKH);
|
||||
scalar diameterLargerDrop = cbrt(1.5*d*d*lengthScale);
|
||||
d = diameterLargerDrop;
|
||||
ms = 0.0;
|
||||
|
||||
@ -41,7 +41,7 @@ Description
|
||||
namespace Foam
|
||||
{
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class ReitzKHRT Declaration
|
||||
Class ReitzKHRT Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
template<class CloudType>
|
||||
@ -114,11 +114,9 @@ public:
|
||||
const vector& Urel,
|
||||
const scalar Urmag,
|
||||
const scalar tMom,
|
||||
const scalar averageParcelMass,
|
||||
scalar& dChild,
|
||||
scalar& massChild,
|
||||
cachedRandom& rndGen
|
||||
) const;
|
||||
scalar& massChild
|
||||
);
|
||||
};
|
||||
|
||||
|
||||
|
||||
@ -134,12 +134,12 @@ bool Foam::SHF<CloudType>::update
|
||||
const vector& Urel,
|
||||
const scalar Urmag,
|
||||
const scalar tMom,
|
||||
const scalar averageParcelMass,
|
||||
scalar& dChild,
|
||||
scalar& massChild,
|
||||
cachedRandom& rndGen
|
||||
) const
|
||||
scalar& massChild
|
||||
)
|
||||
{
|
||||
cachedRandom& rndGen = this->owner().rndGen();
|
||||
|
||||
bool addChild = false;
|
||||
|
||||
scalar d03 = pow3(d);
|
||||
@ -232,7 +232,7 @@ bool Foam::SHF<CloudType>::update
|
||||
|
||||
scalar p =
|
||||
x
|
||||
/(2.0*sqrt(2.0*constant::mathematical::pi)*sigma_)
|
||||
/(2.0*sqrt(constant::mathematical::twoPi)*sigma_)
|
||||
*exp(-0.5*sqr((x - mu_)/sigma_));
|
||||
|
||||
if (yGuess < p)
|
||||
@ -264,7 +264,7 @@ bool Foam::SHF<CloudType>::update
|
||||
|
||||
scalar p =
|
||||
x
|
||||
/(2.0*sqrt(2.0*constant::mathematical::pi)*sigma_)
|
||||
/(2.0*sqrt(constant::mathematical::twoPi)*sigma_)
|
||||
*exp(-0.5*sqr((x - mu_)/sigma_));
|
||||
|
||||
if (yGuess<p)
|
||||
|
||||
@ -48,7 +48,7 @@ Description
|
||||
namespace Foam
|
||||
{
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class SHF Declaration
|
||||
Class SHF Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
template<class CloudType>
|
||||
@ -156,12 +156,9 @@ public:
|
||||
const vector& Urel,
|
||||
const scalar Urmag,
|
||||
const scalar tMom,
|
||||
const scalar averageParcelMass,
|
||||
scalar& dChild,
|
||||
scalar& massChild,
|
||||
cachedRandom& rndGen
|
||||
) const;
|
||||
|
||||
scalar& massChild
|
||||
);
|
||||
};
|
||||
|
||||
|
||||
|
||||
@ -43,7 +43,7 @@ Foam::TAB<CloudType>::TAB
|
||||
// calculate the inverse function of the Rossin-Rammler Distribution
|
||||
const scalar xx0 = 12.0;
|
||||
const scalar rrd100 =
|
||||
1.0/(1.0-exp(-xx0)*(1.0 + xx0 + sqr(xx0)/2.0 + pow3(xx0)/6.0));
|
||||
1.0/(1.0 - exp(-xx0)*(1.0 + xx0 + sqr(xx0)/2.0 + pow3(xx0)/6.0));
|
||||
|
||||
forAll(rrd_, n)
|
||||
{
|
||||
@ -54,7 +54,8 @@ Foam::TAB<CloudType>::TAB
|
||||
|
||||
if (!BreakupModel<CloudType>::solveOscillationEq_)
|
||||
{
|
||||
Info<< "Warning: solveOscillationEq is set to "
|
||||
WarningIn("Foam::TAB<CloudType>::TAB(const dictionary&, CloudType&)")
|
||||
<< "solveOscillationEq is set to "
|
||||
<< BreakupModel<CloudType>::solveOscillationEq_ << nl
|
||||
<< " Setting it to true in order for the TAB model to work."
|
||||
<< endl;
|
||||
@ -72,8 +73,9 @@ Foam::TAB<CloudType>::TAB
|
||||
else
|
||||
{
|
||||
SMDMethod_ = method2;
|
||||
Info<< "Warning: SMDCalculationMethod unknown. Options are "
|
||||
"(method1 | method2). Using method2" << endl;
|
||||
WarningIn("Foam::TAB<CloudType>::TAB(const dictionary&, CloudType&)")
|
||||
<< "Unknown SMDCalculationMethod. Valid options are "
|
||||
<< "(method1 | method2). Using method2" << endl;
|
||||
}
|
||||
}
|
||||
|
||||
@ -120,12 +122,12 @@ bool Foam::TAB<CloudType>::update
|
||||
const vector& Urel,
|
||||
const scalar Urmag,
|
||||
const scalar tMom,
|
||||
const scalar averageParcelMass,
|
||||
scalar& dChild,
|
||||
scalar& massChild,
|
||||
cachedRandom& rndGen
|
||||
) const
|
||||
scalar& massChild
|
||||
)
|
||||
{
|
||||
cachedRandom& rndGen = this->owner().rndGen();
|
||||
|
||||
scalar r = 0.5*d;
|
||||
scalar r2 = r*r;
|
||||
scalar r3 = r*r2;
|
||||
@ -162,7 +164,7 @@ bool Foam::TAB<CloudType>::update
|
||||
scalar quad = -y2/a;
|
||||
if (quad < 0)
|
||||
{
|
||||
phi = 2.0*constant::mathematical::pi - phit;
|
||||
phi = constant::mathematical::twoPi - phit;
|
||||
}
|
||||
|
||||
scalar tb = 0;
|
||||
@ -179,11 +181,11 @@ bool Foam::TAB<CloudType>::update
|
||||
|
||||
if (theta < phi)
|
||||
{
|
||||
if (2*constant::mathematical::pi-theta >= phi)
|
||||
if (constant::mathematical::twoPi - theta >= phi)
|
||||
{
|
||||
theta = -theta;
|
||||
}
|
||||
theta += 2*constant::mathematical::pi;
|
||||
theta += constant::mathematical::twoPi;
|
||||
}
|
||||
tb = (theta-phi)/omega;
|
||||
|
||||
|
||||
@ -54,7 +54,7 @@ See Also
|
||||
namespace Foam
|
||||
{
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class TAB Declaration
|
||||
Class TAB Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
template<class CloudType>
|
||||
@ -142,11 +142,9 @@ public:
|
||||
const vector& Urel,
|
||||
const scalar Urmag,
|
||||
const scalar tMom,
|
||||
const scalar averageParcelMass,
|
||||
scalar& dChild,
|
||||
scalar& massChild,
|
||||
cachedRandom& rndGen
|
||||
) const;
|
||||
scalar& massChild
|
||||
);
|
||||
};
|
||||
|
||||
|
||||
|
||||
@ -55,7 +55,7 @@ Foam::StochasticCollisionModel<CloudType>::StochasticCollisionModel
|
||||
const word& type
|
||||
)
|
||||
:
|
||||
SubModelBase<CloudType>(owner, dict, type)
|
||||
SubModelBase<CloudType>(owner, dict, typeName, type)
|
||||
{}
|
||||
|
||||
|
||||
|
||||
@ -18,6 +18,9 @@ fieldValues/cellSource/cellSourceFunctionObject.C
|
||||
nearWallFields/nearWallFields.C
|
||||
nearWallFields/nearWallFieldsFunctionObject.C
|
||||
|
||||
processorField/processorField.C
|
||||
processorField/processorFieldFunctionObject.C
|
||||
|
||||
readFields/readFields.C
|
||||
readFields/readFieldsFunctionObject.C
|
||||
|
||||
|
||||
@ -0,0 +1,49 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Typedef
|
||||
Foam::IOprocessorField
|
||||
|
||||
Description
|
||||
Instance of the generic IOOutputFilter for processorField.
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef IOprocessorField_H
|
||||
#define IOprocessorField_H
|
||||
|
||||
#include "processorField.H"
|
||||
#include "IOOutputFilter.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
typedef IOOutputFilter<processorField> IOprocessorField;
|
||||
}
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,35 @@
|
||||
/*--------------------------------*- C++ -*----------------------------------*\
|
||||
| ========= | |
|
||||
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||
| \\ / O peration | Version: dev |
|
||||
| \\ / A nd | Web: www.OpenFOAM.org |
|
||||
| \\/ M anipulation | |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
FoamFile
|
||||
{
|
||||
version 2.0;
|
||||
format ascii;
|
||||
class dictionary;
|
||||
object postProcessingDict;
|
||||
}
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
functions
|
||||
{
|
||||
processorField1
|
||||
{
|
||||
// Type of functionObject
|
||||
type processorField;
|
||||
|
||||
// Where to load it from (if not already in solver)
|
||||
functionObjectLibs ("libfieldFunctionObjects.so");
|
||||
|
||||
// Function object enabled flag
|
||||
enabled true;
|
||||
|
||||
// When to output the average fields
|
||||
outputControl outputTime;
|
||||
}
|
||||
}
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,120 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "processorField.H"
|
||||
#include "dictionary.H"
|
||||
#include "Pstream.H"
|
||||
|
||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||
|
||||
defineTypeNameAndDebug(Foam::processorField, 0);
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::processorField::processorField
|
||||
(
|
||||
const word& name,
|
||||
const objectRegistry& obr,
|
||||
const dictionary& dict,
|
||||
const bool loadFromFiles
|
||||
)
|
||||
:
|
||||
name_(name),
|
||||
obr_(obr),
|
||||
active_(true)
|
||||
{
|
||||
// Check if the available mesh is an fvMesh otherise deactivate
|
||||
if (!isA<fvMesh>(obr_))
|
||||
{
|
||||
active_ = false;
|
||||
WarningIn
|
||||
(
|
||||
"processorField::processorField"
|
||||
"("
|
||||
"const word&, "
|
||||
"const objectRegistry&, "
|
||||
"const dictionary&, "
|
||||
"const bool"
|
||||
")"
|
||||
) << "No fvMesh available, deactivating."
|
||||
<< endl;
|
||||
}
|
||||
|
||||
read(dict);
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::processorField::~processorField()
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
void Foam::processorField::read(const dictionary& dict)
|
||||
{
|
||||
// do nothing
|
||||
}
|
||||
|
||||
|
||||
void Foam::processorField::execute()
|
||||
{
|
||||
// Do nothing
|
||||
}
|
||||
|
||||
|
||||
void Foam::processorField::end()
|
||||
{
|
||||
// Do nothing
|
||||
}
|
||||
|
||||
|
||||
void Foam::processorField::write()
|
||||
{
|
||||
if (active_)
|
||||
{
|
||||
const fvMesh& mesh = refCast<const fvMesh>(obr_);
|
||||
volScalarField procField
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"processorID",
|
||||
mesh.time().timeName(),
|
||||
mesh,
|
||||
IOobject::NO_READ,
|
||||
IOobject::NO_WRITE
|
||||
),
|
||||
mesh,
|
||||
dimensionedScalar("procI", dimless, Pstream::myProcNo())
|
||||
);
|
||||
|
||||
procField.write();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,146 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Class
|
||||
Foam::processorField
|
||||
|
||||
Description
|
||||
Writes a scalar field whose value is the local processor ID. Output
|
||||
field name is processorID.
|
||||
|
||||
SourceFiles
|
||||
processorField.C
|
||||
IOprocessorField.H
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef processorField_H
|
||||
#define processorField_H
|
||||
|
||||
#include "OFstream.H"
|
||||
#include "pointFieldFwd.H"
|
||||
#include "volFields.H"
|
||||
#include "surfaceFields.H"
|
||||
#include "coordinateSystem.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
|
||||
// Forward declaration of classes
|
||||
class objectRegistry;
|
||||
class dictionary;
|
||||
class mapPolyMesh;
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class processorField Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
class processorField
|
||||
{
|
||||
protected:
|
||||
|
||||
// Protected data
|
||||
|
||||
//- Name of this set of nearWallFields object
|
||||
word name_;
|
||||
|
||||
//- Reference to the database
|
||||
const objectRegistry& obr_;
|
||||
|
||||
//- on/off switch
|
||||
bool active_;
|
||||
|
||||
|
||||
// Protected Member Functions
|
||||
|
||||
//- Disallow default bitwise copy construct
|
||||
processorField(const processorField&);
|
||||
|
||||
//- Disallow default bitwise assignment
|
||||
void operator=(const processorField&);
|
||||
|
||||
|
||||
public:
|
||||
|
||||
//- Runtime type information
|
||||
TypeName("processorField");
|
||||
|
||||
|
||||
// Constructors
|
||||
|
||||
//- Construct for given objectRegistry and dictionary.
|
||||
// Allow the possibility to load fields from files
|
||||
processorField
|
||||
(
|
||||
const word& name,
|
||||
const objectRegistry&,
|
||||
const dictionary&,
|
||||
const bool loadFromFiles = false
|
||||
);
|
||||
|
||||
|
||||
//- Destructor
|
||||
virtual ~processorField();
|
||||
|
||||
|
||||
// Member Functions
|
||||
|
||||
//- Return name of the processorField object
|
||||
virtual const word& name() const
|
||||
{
|
||||
return name_;
|
||||
}
|
||||
|
||||
//- Read the input data
|
||||
virtual void read(const dictionary&);
|
||||
|
||||
//- Execute, currently does nothing
|
||||
virtual void execute();
|
||||
|
||||
//- Execute at the final time-loop, currently does nothing
|
||||
virtual void end();
|
||||
|
||||
//- Write
|
||||
virtual void write();
|
||||
|
||||
//- Update for changes of mesh
|
||||
virtual void updateMesh(const mapPolyMesh&)
|
||||
{}
|
||||
|
||||
//- Update for changes of mesh
|
||||
virtual void movePoints(const pointField&)
|
||||
{}
|
||||
};
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,42 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "processorFieldFunctionObject.H"
|
||||
|
||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
defineNamedTemplateTypeNameAndDebug(processorFieldFunctionObject, 0);
|
||||
|
||||
addToRunTimeSelectionTable
|
||||
(
|
||||
functionObject,
|
||||
processorFieldFunctionObject,
|
||||
dictionary
|
||||
);
|
||||
}
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,54 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Typedef
|
||||
Foam::processorFieldFunctionObject
|
||||
|
||||
Description
|
||||
FunctionObject wrapper around processorField to allow
|
||||
them to be created via the functions entry within controlDict.
|
||||
|
||||
SourceFiles
|
||||
processorFieldFunctionObject.C
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef processorFieldFunctionObject_H
|
||||
#define processorFieldFunctionObject_H
|
||||
|
||||
#include "processorField.H"
|
||||
#include "OutputFilterFunctionObject.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
typedef OutputFilterFunctionObject<processorField>
|
||||
processorFieldFunctionObject;
|
||||
}
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,158 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "processorField.H"
|
||||
#include "volFields.H"
|
||||
#include "surfaceFields.H"
|
||||
#include "Time.H"
|
||||
#include "transformGeometricField.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
template<class Type>
|
||||
void Foam::processorField::transformField
|
||||
(
|
||||
const Type& field
|
||||
) const
|
||||
{
|
||||
const word& fieldName = field.name() + "Transformed";
|
||||
|
||||
dimensionedTensor R("R", field.dimensions(), coordSys_.R());
|
||||
|
||||
if (obr_.foundObject<Type>(fieldName))
|
||||
{
|
||||
Type& transField =
|
||||
const_cast<Type&>(obr_.lookupObject<Type>(fieldName));
|
||||
|
||||
transField == field;
|
||||
|
||||
forAll(field, i)
|
||||
{
|
||||
Foam::transform(transField, R, transField);
|
||||
}
|
||||
|
||||
transField.write();
|
||||
}
|
||||
else
|
||||
{
|
||||
Type& transField = obr_.store
|
||||
(
|
||||
new Type
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
fieldName,
|
||||
obr_.time().timeName(),
|
||||
obr_,
|
||||
IOobject::READ_IF_PRESENT,
|
||||
IOobject::NO_WRITE
|
||||
),
|
||||
field
|
||||
)
|
||||
);
|
||||
|
||||
forAll(field, i)
|
||||
{
|
||||
Foam::transform(transField, R, transField);
|
||||
}
|
||||
|
||||
transField.write();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
template<class Type>
|
||||
void Foam::processorField::transform
|
||||
(
|
||||
const word& fieldName
|
||||
) const
|
||||
{
|
||||
typedef GeometricField<Type, fvPatchField, volMesh> vfType;
|
||||
typedef GeometricField<Type, fvsPatchField, surfaceMesh> sfType;
|
||||
|
||||
if (obr_.foundObject<vfType>(fieldName))
|
||||
{
|
||||
if (debug)
|
||||
{
|
||||
Info<< type() << ": Field " << fieldName << " already in database"
|
||||
<< endl;
|
||||
}
|
||||
|
||||
transformField<vfType>(obr_.lookupObject<vfType>(fieldName));
|
||||
}
|
||||
else if (obr_.foundObject<sfType>(fieldName))
|
||||
{
|
||||
if (debug)
|
||||
{
|
||||
Info<< type() << ": Field " << fieldName << " already in database"
|
||||
<< endl;
|
||||
}
|
||||
|
||||
transformField<sfType>(obr_.lookupObject<sfType>(fieldName));
|
||||
}
|
||||
else
|
||||
{
|
||||
IOobject fieldHeader
|
||||
(
|
||||
fieldName,
|
||||
obr_.time().timeName(),
|
||||
obr_,
|
||||
IOobject::MUST_READ,
|
||||
IOobject::NO_WRITE
|
||||
);
|
||||
|
||||
if
|
||||
(
|
||||
fieldHeader.headerOk()
|
||||
&& fieldHeader.headerClassName() == vfType::typeName
|
||||
)
|
||||
{
|
||||
if (debug)
|
||||
{
|
||||
Info<< type() << ": Field " << fieldName << " read from file"
|
||||
<< endl;
|
||||
}
|
||||
|
||||
transformField<vfType>(obr_.lookupObject<vfType>(fieldName));
|
||||
}
|
||||
else if
|
||||
(
|
||||
fieldHeader.headerOk()
|
||||
&& fieldHeader.headerClassName() == sfType::typeName
|
||||
)
|
||||
{
|
||||
if (debug)
|
||||
{
|
||||
Info<< type() << ": Field " << fieldName << " read from file"
|
||||
<< endl;
|
||||
}
|
||||
|
||||
transformField<sfType>(obr_.lookupObject<sfType>(fieldName));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -42,7 +42,7 @@ namespace Foam
|
||||
{
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class CuthillMcKeeRenumber Declaration
|
||||
Class CuthillMcKeeRenumber Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
class CuthillMcKeeRenumber
|
||||
@ -72,6 +72,7 @@ public:
|
||||
//- Construct given the renumber dictionary
|
||||
CuthillMcKeeRenumber(const dictionary& renumberDict);
|
||||
|
||||
|
||||
//- Destructor
|
||||
virtual ~CuthillMcKeeRenumber()
|
||||
{}
|
||||
@ -103,7 +104,6 @@ public:
|
||||
const labelListList& cellCells,
|
||||
const pointField& cc
|
||||
);
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
@ -41,7 +41,7 @@ namespace Foam
|
||||
{
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class manualRenumber Declaration
|
||||
Class manualRenumber Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
class manualRenumber
|
||||
@ -71,6 +71,7 @@ public:
|
||||
//- Construct given the renumber dictionary
|
||||
manualRenumber(const dictionary& renumberDict);
|
||||
|
||||
|
||||
//- Destructor
|
||||
virtual ~manualRenumber()
|
||||
{}
|
||||
@ -110,7 +111,6 @@ public:
|
||||
);
|
||||
return labelList(0);
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
@ -41,7 +41,7 @@ namespace Foam
|
||||
{
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class randomRenumber Declaration
|
||||
Class randomRenumber Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
class randomRenumber
|
||||
@ -66,6 +66,7 @@ public:
|
||||
//- Construct given the renumber dictionary
|
||||
randomRenumber(const dictionary& renumberDict);
|
||||
|
||||
|
||||
//- Destructor
|
||||
virtual ~randomRenumber()
|
||||
{}
|
||||
|
||||
@ -52,7 +52,7 @@ namespace Foam
|
||||
{
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class springRenumber Declaration
|
||||
Class springRenumber Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
class springRenumber
|
||||
@ -87,6 +87,7 @@ public:
|
||||
//- Construct given the renumber dictionary
|
||||
springRenumber(const dictionary& renumberDict);
|
||||
|
||||
|
||||
//- Destructor
|
||||
virtual ~springRenumber()
|
||||
{}
|
||||
@ -117,7 +118,6 @@ public:
|
||||
const labelListList& cellCells,
|
||||
const pointField& cc
|
||||
);
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
@ -63,14 +63,16 @@ class cuttingPlane
|
||||
public plane,
|
||||
public MeshedSurface<face>
|
||||
{
|
||||
//- Private typedefs for convenience
|
||||
typedef MeshedSurface<face> MeshStorage;
|
||||
//- Private typedef for convenience
|
||||
typedef MeshedSurface<face> MeshStorage;
|
||||
|
||||
|
||||
// Private data
|
||||
|
||||
//- List of cells cut by the plane
|
||||
labelList cutCells_;
|
||||
|
||||
|
||||
// Private Member Functions
|
||||
|
||||
//- Determine cut cells, possibly restricted to a list of cells
|
||||
@ -129,6 +131,7 @@ protected:
|
||||
//- remap action on triangulation or cleanup
|
||||
virtual void remapFaces(const labelUList& faceMap);
|
||||
|
||||
|
||||
public:
|
||||
|
||||
// Constructors
|
||||
|
||||
@ -36,31 +36,21 @@ const Foam::scalar Foam::liquidMixtureProperties::TrMax = 0.999;
|
||||
|
||||
Foam::liquidMixtureProperties::liquidMixtureProperties
|
||||
(
|
||||
const dictionary& thermophysicalProperties
|
||||
const dictionary& dict
|
||||
)
|
||||
:
|
||||
components_(thermophysicalProperties.lookup("liquidComponents")),
|
||||
properties_(components_.size())
|
||||
components_(),
|
||||
properties_()
|
||||
{
|
||||
// can use sub-dictionary "liquidProperties" to avoid
|
||||
// collisions with identically named gas-phase entries
|
||||
// (eg, H2O liquid vs. gas)
|
||||
const dictionary* subDictPtr = thermophysicalProperties.subDictPtr
|
||||
(
|
||||
"liquidProperties"
|
||||
);
|
||||
|
||||
const dictionary& props =
|
||||
(
|
||||
subDictPtr ? *subDictPtr : thermophysicalProperties
|
||||
);
|
||||
components_ = dict.toc();
|
||||
properties_.setSize(components_.size());
|
||||
|
||||
forAll(components_, i)
|
||||
{
|
||||
properties_.set
|
||||
(
|
||||
i,
|
||||
liquidProperties::New(props.subDict(components_[i]))
|
||||
liquidProperties::New(dict.subDict(components_[i]))
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@ -25,60 +25,33 @@ Class
|
||||
Foam::liquidMixtureProperties
|
||||
|
||||
Description
|
||||
A mixture of liquids.
|
||||
A mixture of liquids
|
||||
|
||||
The theory in this class is to a very large extent based on the book:
|
||||
'The Properties of Gases & Liquids' 4th ed.
|
||||
by Reid, Prausnitz and Poling
|
||||
|
||||
For now it does not do much, since the perfect gas equation is used.
|
||||
|
||||
The dictionary constructor searches for the entry \c liquidComponents,
|
||||
which is a wordList. The liquid properties of each component can either
|
||||
be contained within a \c liquidProperties sub-dictionary or (for legacy
|
||||
purposes) can be found directly in the dictionary.
|
||||
The \c liquidProperties sub-dictionary entry should be used when possible
|
||||
to avoid conflicts with identically named gas-phase entries.
|
||||
|
||||
A simple example of a single-component liquidMixtureProperties:
|
||||
An example of a two component liquid mixture:
|
||||
\verbatim
|
||||
liquidComponents
|
||||
(
|
||||
H2O
|
||||
);
|
||||
|
||||
// the gas-phase species
|
||||
species
|
||||
(
|
||||
AIR H2O
|
||||
);
|
||||
|
||||
// thermo values from BurcatCpData
|
||||
AIR
|
||||
AIR 1 28.96518 // specie: name/nMoles/MolWt
|
||||
200 6000 1000 // low/high/common temperature
|
||||
3.0879272 0.0012459718 -4.2371895e-07 6.7477479e-11
|
||||
-3.9707697e-15 -995.26275 5.9596093 // 7 upper Temp. coeffs
|
||||
3.5683962 -0.00067872943 1.5537148e-06 -3.2993706e-12
|
||||
-4.6639539e-13 -1062.3466 3.7158296 // 7 lower Temp. coeffs
|
||||
1.4792e-06 116 // sutherlandTransport for AIR (STAR-CD)
|
||||
;
|
||||
H2O
|
||||
H2O 1 18.01528 // specie: name/nMoles/MolWt
|
||||
200 6000 1000 // low/high/common temperature
|
||||
2.6770389 0.0029731816 -7.7376889e-07 9.4433514e-11
|
||||
-4.2689991e-15 -29885.894 6.88255 // 7 upper Temp. coeffs
|
||||
4.1986352 -0.0020364017 6.5203416e-06 -5.4879269e-09
|
||||
1.771968e-12 -30293.726 -0.84900901 // 7 lower Temp. coeffs
|
||||
1.4792e-06 116 // sutherlandTransport for AIR (STAR-CD)
|
||||
;
|
||||
|
||||
liquidProperties
|
||||
<parentDictionary>
|
||||
{
|
||||
H2O H2O defaultCoeffs;
|
||||
H2O
|
||||
{
|
||||
defaultCoeffs yes; // employ default coefficients
|
||||
}
|
||||
C7H16
|
||||
{
|
||||
defaultCoeffs no;
|
||||
C7H16Coeffs
|
||||
{
|
||||
... user defined properties for C7H16
|
||||
}
|
||||
}
|
||||
}
|
||||
\endverbatim
|
||||
|
||||
SourceFiles
|
||||
liquidMixtureProperties.C
|
||||
|
||||
SeeAlso
|
||||
Foam::liquidProperties
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef liquidMixtureProperties_H
|
||||
|
||||
@ -342,7 +342,7 @@ Foam::scalar Foam::liquidProperties::D(scalar p, scalar T, scalar Wb) const
|
||||
}
|
||||
|
||||
|
||||
Foam::scalar Foam::liquidProperties::pvInvert(scalar p)
|
||||
Foam::scalar Foam::liquidProperties::pvInvert(scalar p) const
|
||||
{
|
||||
scalar T = Tc_;
|
||||
scalar deltaT = 10.0;
|
||||
|
||||
@ -253,7 +253,7 @@ public:
|
||||
|
||||
//- Invert the vapour pressure relationship to retrieve the
|
||||
// boiling temperuture as a function of temperature
|
||||
virtual scalar pvInvert(scalar p);
|
||||
virtual scalar pvInvert(scalar p) const;
|
||||
|
||||
|
||||
// I-O
|
||||
|
||||
@ -27,29 +27,16 @@ License
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::solidMixtureProperties::solidMixtureProperties
|
||||
(
|
||||
const dictionary& thermophysicalProperties
|
||||
)
|
||||
Foam::solidMixtureProperties::solidMixtureProperties(const dictionary& dict)
|
||||
:
|
||||
components_(thermophysicalProperties.lookup("solidComponents")),
|
||||
properties_(components_.size())
|
||||
components_(),
|
||||
properties_()
|
||||
{
|
||||
// can use sub-dictionary "solidProperties" to avoid
|
||||
// collisions with identically named gas-phase entries
|
||||
const dictionary* subDictPtr = thermophysicalProperties.subDictPtr
|
||||
(
|
||||
"solidProperties"
|
||||
);
|
||||
|
||||
const dictionary& props =
|
||||
(
|
||||
subDictPtr ? *subDictPtr : thermophysicalProperties
|
||||
);
|
||||
|
||||
components_ = dict.toc();
|
||||
properties_.setSize(components_.size());
|
||||
forAll(components_, i)
|
||||
{
|
||||
properties_.set(i, solidProperties::New(props.subDict(components_[i])));
|
||||
properties_.set(i, solidProperties::New(dict.subDict(components_[i])));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -25,18 +25,33 @@ Class
|
||||
Foam::solidMixtureProperties
|
||||
|
||||
Description
|
||||
A mixture of solids.
|
||||
A mixture of solids
|
||||
|
||||
Note
|
||||
The dictionary constructor searches for the entry \c solidComponents,
|
||||
which is a wordList. The solid properties of each component can either
|
||||
be contained within a \c solidProperties sub-dictionary or (for legacy
|
||||
purposes) can be found directly in the dictionary.
|
||||
The \c solidProperties sub-dictionary entry should be used when possible
|
||||
to avoid conflicts with identically named gas-phase entries.
|
||||
An example of a two component solid mixture:
|
||||
\verbatim
|
||||
<parentDictionary>
|
||||
{
|
||||
C
|
||||
{
|
||||
defaultCoeffs yes; // employ default coefficients
|
||||
}
|
||||
ash
|
||||
{
|
||||
defaultCoeffs no;
|
||||
ashCoeffs
|
||||
{
|
||||
... user defined properties for ash
|
||||
}
|
||||
}
|
||||
}
|
||||
\endverbatim
|
||||
|
||||
|
||||
SourceFiles
|
||||
solidMixtureProperties.C
|
||||
|
||||
SeeAlso
|
||||
Foam::solidMixtureProperties
|
||||
Foam::solidProperties
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
|
||||
@ -46,14 +46,14 @@ divSchemes
|
||||
laplacianSchemes
|
||||
{
|
||||
default none;
|
||||
laplacian(muEff,U) Gauss linear corrected;
|
||||
laplacian(mut,U) Gauss linear corrected;
|
||||
laplacian(DkEff,k) Gauss linear corrected;
|
||||
laplacian(DepsilonEff,epsilon) Gauss linear corrected;
|
||||
laplacian(DREff,R) Gauss linear corrected;
|
||||
laplacian(DomegaEff,omega) Gauss linear corrected;
|
||||
laplacian((rho*(1|A(U))),p) Gauss linear corrected;
|
||||
laplacian(alphaEff,h) Gauss linear corrected;
|
||||
laplacian(muEff,U) Gauss linear orthogonal;
|
||||
laplacian(mut,U) Gauss linear orthogonal;
|
||||
laplacian(DkEff,k) Gauss linear orthogonal;
|
||||
laplacian(DepsilonEff,epsilon) Gauss linear orthogonal;
|
||||
laplacian(DREff,R) Gauss linear orthogonal;
|
||||
laplacian(DomegaEff,omega) Gauss linear orthogonal;
|
||||
laplacian((rho*(1|A(U))),p) Gauss linear orthogonal;
|
||||
laplacian(alphaEff,h) Gauss linear orthogonal;
|
||||
}
|
||||
|
||||
interpolationSchemes
|
||||
@ -63,7 +63,7 @@ interpolationSchemes
|
||||
|
||||
snGradSchemes
|
||||
{
|
||||
default corrected;
|
||||
default orthogonal;
|
||||
}
|
||||
|
||||
fluxRequired
|
||||
|
||||
@ -40,9 +40,9 @@ divSchemes
|
||||
laplacianSchemes
|
||||
{
|
||||
default none;
|
||||
laplacian((rho*(1|A(U))),p) Gauss linear corrected;
|
||||
laplacian(muEff,U) Gauss linear corrected;
|
||||
laplacian(alphaEff,e) Gauss linear corrected;
|
||||
laplacian((rho*(1|A(U))),p) Gauss linear orthogonal;
|
||||
laplacian(muEff,U) Gauss linear orthogonal;
|
||||
laplacian(alphaEff,e) Gauss linear orthogonal;
|
||||
}
|
||||
|
||||
interpolationSchemes
|
||||
@ -52,7 +52,7 @@ interpolationSchemes
|
||||
|
||||
snGradSchemes
|
||||
{
|
||||
default corrected;
|
||||
default orthogonal;
|
||||
}
|
||||
|
||||
fluxRequired
|
||||
|
||||
@ -39,12 +39,12 @@ divSchemes
|
||||
laplacianSchemes
|
||||
{
|
||||
default none;
|
||||
laplacian(muEff,U) Gauss linear uncorrected;
|
||||
laplacian((rho*(1|A(U))),p_rgh) Gauss linear uncorrected;
|
||||
laplacian(alphaEff,h) Gauss linear uncorrected;
|
||||
laplacian(DkEff,k) Gauss linear uncorrected;
|
||||
laplacian(DepsilonEff,epsilon) Gauss linear uncorrected;
|
||||
laplacian(DomegaEff,omega) Gauss linear uncorrected;
|
||||
laplacian(muEff,U) Gauss linear orthogonal;
|
||||
laplacian((rho*(1|A(U))),p_rgh) Gauss linear orthogonal;
|
||||
laplacian(alphaEff,h) Gauss linear orthogonal;
|
||||
laplacian(DkEff,k) Gauss linear orthogonal;
|
||||
laplacian(DepsilonEff,epsilon) Gauss linear orthogonal;
|
||||
laplacian(DomegaEff,omega) Gauss linear orthogonal;
|
||||
}
|
||||
|
||||
interpolationSchemes
|
||||
@ -54,7 +54,7 @@ interpolationSchemes
|
||||
|
||||
snGradSchemes
|
||||
{
|
||||
default uncorrected;
|
||||
default orthogonal;
|
||||
}
|
||||
|
||||
fluxRequired
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user