Merge branch 'master' of ssh://dm/home/dm4/OpenFOAM/OpenFOAM-dev

This commit is contained in:
Henry
2013-05-03 17:48:20 +01:00
89 changed files with 1877 additions and 1218 deletions

View File

@ -37,7 +37,7 @@ Description
#include "fvCFD.H" #include "fvCFD.H"
#include "turbulenceModel.H" #include "turbulenceModel.H"
#include "fluidThermoCloud.H" #include "basicThermoCloud.H"
#include "coalCloud.H" #include "coalCloud.H"
#include "psiCombustionModel.H" #include "psiCombustionModel.H"
#include "fvIOoptionList.H" #include "fvIOoptionList.H"

View File

@ -9,7 +9,7 @@ coalCloud coalParcels
); );
Info<< "\nConstructing limestone cloud" << endl; Info<< "\nConstructing limestone cloud" << endl;
fluidThermoCloud limestoneParcels basicThermoCloud limestoneParcels
( (
"limestoneCloud1", "limestoneCloud1",
rho, rho,

View File

@ -148,7 +148,7 @@ bool Foam::checkWedges
{ {
Info<< " ***Wedge patch " << pp.name() << " not planar." Info<< " ***Wedge patch " << pp.name() << " not planar."
<< " Point " << pt << " is not in patch plane by " << " Point " << pt << " is not in patch plane by "
<< d << " meter." << d << " metre."
<< endl; << endl;
} }
return true; return true;

View File

@ -62,7 +62,7 @@ int main(int argc, char *argv[])
boundBox bb(points); boundBox bb(points);
Info<< "bounding box: min = " << bb.min() Info<< "bounding box: min = " << bb.min()
<< " max = " << bb.max() << " meters." << " max = " << bb.max() << " metres."
<< endl; << endl;

View File

@ -179,7 +179,8 @@ void Foam::vtkPV398Foam::convertMeshPatches
const word patchName = getPartName(partId); const word patchName = getPartName(partId);
labelHashSet patchIds(patches.patchSet(List<wordRe>(1, patchName))); labelHashSet
patchIds(patches.patchSet(List<wordRe>(1, wordRe(patchName))));
if (debug) if (debug)
{ {

View File

@ -435,7 +435,7 @@ int main(int argc, char *argv[])
scalar smallDim = 1e-6 * bb.mag(); scalar smallDim = 1e-6 * bb.mag();
Info<< "Checking for points less than 1e-6 of bounding box (" Info<< "Checking for points less than 1e-6 of bounding box ("
<< bb.span() << " meter) apart." << bb.span() << " metre) apart."
<< endl; << endl;
// Sort points // Sort points

View File

@ -54,7 +54,7 @@ int main(int argc, char *argv[])
const fileName outFileName = args[3]; const fileName outFileName = args[3];
Info<< "Reading surface from " << surfFileName << " ..." << endl; Info<< "Reading surface from " << surfFileName << " ..." << endl;
Info<< "Merging points within " << mergeTol << " meter." << endl; Info<< "Merging points within " << mergeTol << " metre." << endl;
triSurface surf1(surfFileName); triSurface surf1(surfFileName);

View File

@ -1542,7 +1542,7 @@ void Foam::faceCoupleInfo::perfectPointMatch
) << "Did not match all of the master faces to the slave faces" ) << "Did not match all of the master faces to the slave faces"
<< endl << endl
<< "This usually means that the slave patch and master patch" << "This usually means that the slave patch and master patch"
<< " do not align to within " << absTol << " meter." << " do not align to within " << absTol << " metre."
<< abort(FatalError); << abort(FatalError);
} }

View File

@ -485,7 +485,7 @@ Foam::polyMeshFilter::polyMeshFilter(const fvMesh& mesh)
faceFilterFactor_() faceFilterFactor_()
{ {
Info<< "Merging:" << nl Info<< "Merging:" << nl
<< " edges with length less than " << minLen_ << " meters" << nl << " edges with length less than " << minLen_ << " metres" << nl
<< " edges split by a point with edges in line to within " << " edges split by a point with edges in line to within "
<< radToDeg(::acos(maxCos_)) << " degrees" << nl << radToDeg(::acos(maxCos_)) << " degrees" << nl
<< " Minimum edge length reduction factor = " << " Minimum edge length reduction factor = "

View File

@ -181,6 +181,7 @@ $(derivedFvPatchFields)/translatingWallVelocity/translatingWallVelocityFvPatchVe
$(derivedFvPatchFields)/turbulentInlet/turbulentInletFvPatchFields.C $(derivedFvPatchFields)/turbulentInlet/turbulentInletFvPatchFields.C
$(derivedFvPatchFields)/turbulentIntensityKineticEnergyInlet/turbulentIntensityKineticEnergyInletFvPatchScalarField.C $(derivedFvPatchFields)/turbulentIntensityKineticEnergyInlet/turbulentIntensityKineticEnergyInletFvPatchScalarField.C
$(derivedFvPatchFields)/uniformDensityHydrostaticPressure/uniformDensityHydrostaticPressureFvPatchScalarField.C $(derivedFvPatchFields)/uniformDensityHydrostaticPressure/uniformDensityHydrostaticPressureFvPatchScalarField.C
$(derivedFvPatchFields)/uniformFixedGradient/uniformFixedGradientFvPatchFields.C
$(derivedFvPatchFields)/uniformFixedValue/uniformFixedValueFvPatchFields.C $(derivedFvPatchFields)/uniformFixedValue/uniformFixedValueFvPatchFields.C
$(derivedFvPatchFields)/uniformJump/uniformJumpFvPatchFields.C $(derivedFvPatchFields)/uniformJump/uniformJumpFvPatchFields.C
$(derivedFvPatchFields)/uniformJumpAMI/uniformJumpAMIFvPatchFields.C $(derivedFvPatchFields)/uniformJumpAMI/uniformJumpAMIFvPatchFields.C
@ -402,5 +403,4 @@ $(SRF)/SRFModel/rpm/rpm.C
$(SRF)/derivedFvPatchFields/SRFVelocityFvPatchVectorField/SRFVelocityFvPatchVectorField.C $(SRF)/derivedFvPatchFields/SRFVelocityFvPatchVectorField/SRFVelocityFvPatchVectorField.C
$(SRF)/derivedFvPatchFields/SRFFreestreamVelocityFvPatchVectorField/SRFFreestreamVelocityFvPatchVectorField.C $(SRF)/derivedFvPatchFields/SRFFreestreamVelocityFvPatchVectorField/SRFFreestreamVelocityFvPatchVectorField.C
LIB = $(FOAM_LIBBIN)/libfiniteVolume LIB = $(FOAM_LIBBIN)/libfiniteVolume

View File

@ -0,0 +1,172 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2013 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 "uniformFixedGradientFvPatchField.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
template<class Type>
uniformFixedGradientFvPatchField<Type>::uniformFixedGradientFvPatchField
(
const fvPatch& p,
const DimensionedField<Type, volMesh>& iF
)
:
fixedGradientFvPatchField<Type>(p, iF),
uniformGradient_()
{}
template<class Type>
uniformFixedGradientFvPatchField<Type>::uniformFixedGradientFvPatchField
(
const fvPatch& p,
const DimensionedField<Type, volMesh>& iF,
const Field<Type>& fld
)
:
fixedGradientFvPatchField<Type>(p, iF, fld),
uniformGradient_()
{}
template<class Type>
uniformFixedGradientFvPatchField<Type>::uniformFixedGradientFvPatchField
(
const uniformFixedGradientFvPatchField<Type>& ptf,
const fvPatch& p,
const DimensionedField<Type, volMesh>& iF,
const fvPatchFieldMapper& mapper
)
:
fixedGradientFvPatchField<Type>(ptf, p, iF, mapper),
uniformGradient_(ptf.uniformGradient_().clone().ptr())
{
// For safety re-evaluate
const scalar t = this->db().time().timeOutputValue();
this->gradient() = uniformGradient_->value(t);
}
template<class Type>
uniformFixedGradientFvPatchField<Type>::uniformFixedGradientFvPatchField
(
const fvPatch& p,
const DimensionedField<Type, volMesh>& iF,
const dictionary& dict
)
:
fixedGradientFvPatchField<Type>(p, iF),
uniformGradient_(DataEntry<Type>::New("uniformGradient", dict))
{
if (dict.found("gradient"))
{
this->gradient() = Field<Type>("gradient", dict, p.size());
}
else
{
const scalar t = this->db().time().timeOutputValue();
this->gradient() = uniformGradient_->value(t);
}
}
template<class Type>
uniformFixedGradientFvPatchField<Type>::uniformFixedGradientFvPatchField
(
const uniformFixedGradientFvPatchField<Type>& ptf
)
:
fixedGradientFvPatchField<Type>(ptf),
uniformGradient_
(
ptf.uniformGradient_.valid()
? ptf.uniformGradient_().clone().ptr()
: NULL
)
{}
template<class Type>
uniformFixedGradientFvPatchField<Type>::uniformFixedGradientFvPatchField
(
const uniformFixedGradientFvPatchField<Type>& ptf,
const DimensionedField<Type, volMesh>& iF
)
:
fixedGradientFvPatchField<Type>(ptf, iF),
uniformGradient_
(
ptf.uniformGradient_.valid()
? ptf.uniformGradient_().clone().ptr()
: NULL
)
{
// For safety re-evaluate
const scalar t = this->db().time().timeOutputValue();
if (ptf.uniformGradient_.valid())
{
this->gradient() = uniformGradient_->value(t);
}
}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template<class Type>
void uniformFixedGradientFvPatchField<Type>::updateCoeffs()
{
if (this->updated())
{
return;
}
const scalar t = this->db().time().timeOutputValue();
this->gradient() = uniformGradient_->value(t);
fixedGradientFvPatchField<Type>::updateCoeffs();
}
template<class Type>
void uniformFixedGradientFvPatchField<Type>::write(Ostream& os) const
{
fixedGradientFvPatchField<Type>::write(os);
uniformGradient_->writeData(os);
this->writeEntry("value", os);
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// ************************************************************************* //

View File

@ -0,0 +1,193 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2013 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::uniformFixedGradientFvPatchField
Group
grpGenericBoundaryConditions
Description
This boundary condition provides a uniform fixed gradient condition.
\heading Patch usage
\table
Property | Description | Required | Default value
uniformGradient | uniform gradient | yes |
\endtable
Example of the boundary condition specification:
\verbatim
myPatch
{
type uniformFixedGradient;
uniformGradient constant 0.2;
}
\endverbatim
Note
The uniformGradient entry is a DataEntry type, able to describe time
varying functions. The example above gives the usage for supplying a
constant value.
SeeAlso
Foam::DataEntry
Foam::fixedGradientFvPatchField
SourceFiles
uniformFixedGradientFvPatchField.C
\*---------------------------------------------------------------------------*/
#ifndef uniformFixedGradientFvPatchField_H
#define uniformFixedGradientFvPatchField_H
#include "fixedGradientFvPatchFields.H"
#include "DataEntry.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
/*---------------------------------------------------------------------------*\
Class uniformFixedGradientFvPatchField Declaration
\*---------------------------------------------------------------------------*/
template<class Type>
class uniformFixedGradientFvPatchField
:
public fixedGradientFvPatchField<Type>
{
// Private data
//- Gradient
autoPtr<DataEntry<Type> > uniformGradient_;
public:
//- Runtime type information
TypeName("uniformFixedGradient");
// Constructors
//- Construct from patch and internal field
uniformFixedGradientFvPatchField
(
const fvPatch&,
const DimensionedField<Type, volMesh>&
);
//- Construct from patch and internal field and patch field
uniformFixedGradientFvPatchField
(
const fvPatch&,
const DimensionedField<Type, volMesh>&,
const Field<Type>& fld
);
//- Construct from patch, internal field and dictionary
uniformFixedGradientFvPatchField
(
const fvPatch&,
const DimensionedField<Type, volMesh>&,
const dictionary&
);
//- Construct by mapping given uniformFixedGradientFvPatchField
// onto a new patch
uniformFixedGradientFvPatchField
(
const uniformFixedGradientFvPatchField<Type>&,
const fvPatch&,
const DimensionedField<Type, volMesh>&,
const fvPatchFieldMapper&
);
//- Construct as copy
uniformFixedGradientFvPatchField
(
const uniformFixedGradientFvPatchField<Type>&
);
//- Construct and return a clone
virtual tmp<fvPatchField<Type> > clone() const
{
return tmp<fvPatchField<Type> >
(
new uniformFixedGradientFvPatchField<Type>(*this)
);
}
//- Construct as copy setting internal field reference
uniformFixedGradientFvPatchField
(
const uniformFixedGradientFvPatchField<Type>&,
const DimensionedField<Type, volMesh>&
);
//- Construct and return a clone setting internal field reference
virtual tmp<fvPatchField<Type> > clone
(
const DimensionedField<Type, volMesh>& iF
) const
{
return tmp<fvPatchField<Type> >
(
new uniformFixedGradientFvPatchField<Type>(*this, iF)
);
}
// Member functions
// Evaluation functions
//- Update the coefficients associated with the patch field
virtual void updateCoeffs();
//- Write
virtual void write(Ostream&) const;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#ifdef NoRepository
# include "uniformFixedGradientFvPatchField.C"
#endif
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -0,0 +1,43 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2013 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 "uniformFixedGradientFvPatchFields.H"
#include "addToRunTimeSelectionTable.H"
#include "volFields.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
makePatchFields(uniformFixedGradient);
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// ************************************************************************* //

View File

@ -0,0 +1,49 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2013 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/>.
\*---------------------------------------------------------------------------*/
#ifndef uniformFixedGradientFvPatchFields_H
#define uniformFixedGradientFvPatchFields_H
#include "uniformFixedGradientFvPatchField.H"
#include "fieldTypes.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
makePatchTypeFieldTypedefs(uniformFixedGradient);
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -0,0 +1,50 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2013 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/>.
\*---------------------------------------------------------------------------*/
#ifndef uniformFixedGradientFvPatchFieldsFwd_H
#define uniformFixedGradientFvPatchFieldsFwd_H
#include "fieldTypes.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
template<class Type> class uniformFixedGradientFvPatchField;
makePatchTypeFieldTypedefs(uniform);
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -47,8 +47,7 @@ Foam::distributionModels::uniform::uniform
: :
distributionModel(typeName, dict, rndGen), distributionModel(typeName, dict, rndGen),
minValue_(readScalar(distributionModelDict_.lookup("minValue"))), minValue_(readScalar(distributionModelDict_.lookup("minValue"))),
maxValue_(readScalar(distributionModelDict_.lookup("maxValue"))), maxValue_(readScalar(distributionModelDict_.lookup("maxValue")))
range_(maxValue_ - minValue_)
{ {
check(); check();
} }

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -60,9 +60,6 @@ class uniform
//- Distribution maximum //- Distribution maximum
scalar maxValue_; scalar maxValue_;
//- Distribution range
scalar range_;
public: public:

View File

@ -25,7 +25,7 @@ $(KINEMATICCOLLIDINGPARCEL)/makeBasicKinematicCollidingParcelSubmodels.C
/* thermo parcel sub-models */ /* thermo parcel sub-models */
THERMOPARCEL=$(DERIVEDPARCELS)/fluidThermoParcel THERMOPARCEL=$(DERIVEDPARCELS)/basicThermoParcel
$(THERMOPARCEL)/defineBasicThermoParcel.C $(THERMOPARCEL)/defineBasicThermoParcel.C
$(THERMOPARCEL)/makeBasicThermoParcelSubmodels.C $(THERMOPARCEL)/makeBasicThermoParcelSubmodels.C

View File

@ -31,6 +31,7 @@ License
#include "InjectionModelList.H" #include "InjectionModelList.H"
#include "DispersionModel.H" #include "DispersionModel.H"
#include "PatchInteractionModel.H" #include "PatchInteractionModel.H"
#include "StochasticCollisionModel.H"
#include "SurfaceFilmModel.H" #include "SurfaceFilmModel.H"
// * * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * // // * * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * //
@ -56,6 +57,15 @@ void Foam::KinematicCloud<CloudType>::setModels()
).ptr() ).ptr()
); );
stochasticCollisionModel_.reset
(
StochasticCollisionModel<KinematicCloud<CloudType> >::New
(
subModelProperties_,
*this
).ptr()
);
surfaceFilmModel_.reset surfaceFilmModel_.reset
( (
SurfaceFilmModel<KinematicCloud<CloudType> >::New SurfaceFilmModel<KinematicCloud<CloudType> >::New
@ -181,7 +191,6 @@ void Foam::KinematicCloud<CloudType>::evolveCloud(TrackData& td)
if (preInjectionSize != this->size()) if (preInjectionSize != this->size())
{ {
updateCellOccupancy(); updateCellOccupancy();
preInjectionSize = this->size(); preInjectionSize = this->size();
} }
@ -191,6 +200,8 @@ void Foam::KinematicCloud<CloudType>::evolveCloud(TrackData& td)
// Assume that motion will update the cellOccupancy as necessary // Assume that motion will update the cellOccupancy as necessary
// before it is required. // before it is required.
td.cloud().motion(td); td.cloud().motion(td);
stochasticCollision().update(solution_.trackTime());
} }
else else
{ {
@ -249,6 +260,7 @@ void Foam::KinematicCloud<CloudType>::cloudReset(KinematicCloud<CloudType>& c)
dispersionModel_.reset(c.dispersionModel_.ptr()); dispersionModel_.reset(c.dispersionModel_.ptr());
patchInteractionModel_.reset(c.patchInteractionModel_.ptr()); patchInteractionModel_.reset(c.patchInteractionModel_.ptr());
stochasticCollisionModel_.reset(c.stochasticCollisionModel_.ptr());
surfaceFilmModel_.reset(c.surfaceFilmModel_.ptr()); surfaceFilmModel_.reset(c.surfaceFilmModel_.ptr());
UIntegrator_.reset(c.UIntegrator_.ptr()); UIntegrator_.reset(c.UIntegrator_.ptr());
@ -338,6 +350,7 @@ Foam::KinematicCloud<CloudType>::KinematicCloud
), ),
dispersionModel_(NULL), dispersionModel_(NULL),
patchInteractionModel_(NULL), patchInteractionModel_(NULL),
stochasticCollisionModel_(NULL),
surfaceFilmModel_(NULL), surfaceFilmModel_(NULL),
UIntegrator_(NULL), UIntegrator_(NULL),
UTrans_ UTrans_
@ -418,6 +431,7 @@ Foam::KinematicCloud<CloudType>::KinematicCloud
injectors_(c.injectors_), injectors_(c.injectors_),
dispersionModel_(c.dispersionModel_->clone()), dispersionModel_(c.dispersionModel_->clone()),
patchInteractionModel_(c.patchInteractionModel_->clone()), patchInteractionModel_(c.patchInteractionModel_->clone()),
stochasticCollisionModel_(c.stochasticCollisionModel_->clone()),
surfaceFilmModel_(c.surfaceFilmModel_->clone()), surfaceFilmModel_(c.surfaceFilmModel_->clone()),
UIntegrator_(c.UIntegrator_->clone()), UIntegrator_(c.UIntegrator_->clone()),
UTrans_ UTrans_
@ -507,6 +521,7 @@ Foam::KinematicCloud<CloudType>::KinematicCloud
injectors_(*this), injectors_(*this),
dispersionModel_(NULL), dispersionModel_(NULL),
patchInteractionModel_(NULL), patchInteractionModel_(NULL),
stochasticCollisionModel_(NULL),
surfaceFilmModel_(NULL), surfaceFilmModel_(NULL),
UIntegrator_(NULL), UIntegrator_(NULL),
UTrans_(NULL), UTrans_(NULL),

View File

@ -39,6 +39,7 @@ Description
- dispersion model - dispersion model
- injection model - injection model
- patch interaction model - patch interaction model
- stochastic collision model
- surface film model - surface film model
SourceFiles SourceFiles
@ -84,6 +85,9 @@ class PatchInteractionModel;
template<class CloudType> template<class CloudType>
class SurfaceFilmModel; class SurfaceFilmModel;
template<class CloudType>
class StochasticCollisionModel;
/*---------------------------------------------------------------------------*\ /*---------------------------------------------------------------------------*\
Class KinematicCloud Declaration Class KinematicCloud Declaration
@ -203,6 +207,10 @@ protected:
autoPtr<PatchInteractionModel<KinematicCloud<CloudType> > > autoPtr<PatchInteractionModel<KinematicCloud<CloudType> > >
patchInteractionModel_; patchInteractionModel_;
//- Stochastic collision model
autoPtr<StochasticCollisionModel<KinematicCloud<CloudType> > >
stochasticCollisionModel_;
//- Surface film model //- Surface film model
autoPtr<SurfaceFilmModel<KinematicCloud<CloudType> > > autoPtr<SurfaceFilmModel<KinematicCloud<CloudType> > >
surfaceFilmModel_; surfaceFilmModel_;
@ -416,6 +424,15 @@ public:
inline PatchInteractionModel<KinematicCloud<CloudType> >& inline PatchInteractionModel<KinematicCloud<CloudType> >&
patchInteraction(); patchInteraction();
//- Return const-access to the stochastic collision model
inline const
StochasticCollisionModel<KinematicCloud<CloudType> >&
stochasticCollision() const;
//- Return reference to the stochastic collision model
inline StochasticCollisionModel<KinematicCloud<CloudType> >&
stochasticCollision();
//- Return const-access to the surface film model //- Return const-access to the surface film model
inline const SurfaceFilmModel<KinematicCloud<CloudType> >& inline const SurfaceFilmModel<KinematicCloud<CloudType> >&
surfaceFilm() const; surfaceFilm() const;
@ -482,6 +499,9 @@ public:
// Fields // Fields
//- Volume swept rate of parcels per cell
inline const tmp<volScalarField> vDotSweep() const;
//- Return the particle volume fraction field //- Return the particle volume fraction field
// Note: for particles belonging to this cloud only // Note: for particles belonging to this cloud only
inline const tmp<volScalarField> theta() const; inline const tmp<volScalarField> theta() const;

View File

@ -204,6 +204,22 @@ Foam::KinematicCloud<CloudType>::patchInteraction()
} }
template<class CloudType>
inline const Foam::StochasticCollisionModel<Foam::KinematicCloud<CloudType> >&
Foam::KinematicCloud<CloudType>::stochasticCollision() const
{
return stochasticCollisionModel_();
}
template<class CloudType>
inline Foam::StochasticCollisionModel<Foam::KinematicCloud<CloudType> >&
Foam::KinematicCloud<CloudType>::stochasticCollision()
{
return stochasticCollisionModel_();
}
template<class CloudType> template<class CloudType>
inline const Foam::SurfaceFilmModel<Foam::KinematicCloud<CloudType> >& inline const Foam::SurfaceFilmModel<Foam::KinematicCloud<CloudType> >&
Foam::KinematicCloud<CloudType>::surfaceFilm() const Foam::KinematicCloud<CloudType>::surfaceFilm() const
@ -571,6 +587,45 @@ Foam::KinematicCloud<CloudType>::SU(volVectorField& U) const
} }
template<class CloudType>
inline const Foam::tmp<Foam::volScalarField>
Foam::KinematicCloud<CloudType>::vDotSweep() const
{
tmp<volScalarField> tvDotSweep
(
new volScalarField
(
IOobject
(
this->name() + ":vDotSweep",
this->db().time().timeName(),
this->db(),
IOobject::NO_READ,
IOobject::NO_WRITE,
false
),
mesh_,
dimensionedScalar("zero", dimless/dimTime, 0.0),
zeroGradientFvPatchScalarField::typeName
)
);
volScalarField& vDotSweep = tvDotSweep();
forAllConstIter(typename KinematicCloud<CloudType>, *this, iter)
{
const parcelType& p = iter();
const label cellI = p.cell();
vDotSweep[cellI] += p.nParticle()*p.areaP()*mag(p.U() - U_[cellI]);
}
vDotSweep.internalField() /= mesh_.V();
vDotSweep.correctBoundaryConditions();
return tvDotSweep;
}
template<class CloudType> template<class CloudType>
inline const Foam::tmp<Foam::volScalarField> inline const Foam::tmp<Foam::volScalarField>
Foam::KinematicCloud<CloudType>::theta() const Foam::KinematicCloud<CloudType>::theta() const

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -100,6 +100,9 @@ public:
// Fields // Fields
//- Volume swept rate of parcels per cell
virtual const tmp<volScalarField> vDotSweep() const = 0;
//- Return the particle volume fraction field //- Return the particle volume fraction field
// Note: for particles belonging to this cloud only // Note: for particles belonging to this cloud only
virtual const tmp<volScalarField> theta() const = 0; virtual const tmp<volScalarField> theta() const = 0;

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -22,18 +22,18 @@ License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Class Class
Foam::fluidThermoCloud Foam::basicThermoCloud
Description Description
Cloud class to introduce thermodynamic parcels Cloud class to introduce thermodynamic parcels
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
#ifndef fluidThermoCloud_H #ifndef basicThermoCloud_H
#define fluidThermoCloud_H #define basicThermoCloud_H
#include "ThermoCloud.H" #include "ThermoCloud.H"
#include "fluidThermoParcel.H" #include "basicThermoParcel.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -45,10 +45,10 @@ namespace Foam
< <
Cloud Cloud
< <
fluidThermoParcel basicThermoParcel
> >
> >
> fluidThermoCloud; > basicThermoCloud;
} }
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -138,6 +138,8 @@ bool Foam::CollidingParcel<ParcelType>::move
} }
p.age() += dt; p.age() += dt;
td.cloud().functions().postMove(p, cellI, dt, td.keepParticle);
} }
break; break;

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -520,8 +520,7 @@ public:
// Helper functions // Helper functions
//- Return the index of the face to be used in the interpolation //- Return the index of the face used in the interpolation routine
// routine
inline label faceInterpolation() const; inline label faceInterpolation() const;
//- Cell owner mass //- Cell owner mass

View File

@ -498,7 +498,7 @@ void Foam::ReactingMultiphaseParcel<ParcelType>::calcDevolatilisation
const scalarField& YGasEff, const scalarField& YGasEff,
const scalarField& YLiquidEff, const scalarField& YLiquidEff,
const scalarField& YSolidEff, const scalarField& YSolidEff,
bool& canCombust, label& canCombust,
scalarField& dMassDV, scalarField& dMassDV,
scalar& Sh, scalar& Sh,
scalar& N, scalar& N,
@ -512,6 +512,7 @@ void Foam::ReactingMultiphaseParcel<ParcelType>::calcDevolatilisation
( (
!td.cloud().devolatilisation().active() !td.cloud().devolatilisation().active()
|| T < td.cloud().constProps().Tvap() || T < td.cloud().constProps().Tvap()
|| canCombust == -1
) )
{ {
return; return;
@ -588,7 +589,7 @@ void Foam::ReactingMultiphaseParcel<ParcelType>::calcSurfaceReactions
const scalar d, const scalar d,
const scalar T, const scalar T,
const scalar mass, const scalar mass,
const bool canCombust, const label canCombust,
const scalar N, const scalar N,
const scalarField& YMix, const scalarField& YMix,
const scalarField& YGas, const scalarField& YGas,
@ -603,7 +604,7 @@ void Foam::ReactingMultiphaseParcel<ParcelType>::calcSurfaceReactions
) const ) const
{ {
// Check that model is active // Check that model is active
if (!td.cloud().surfaceReaction().active() || !canCombust) if (!td.cloud().surfaceReaction().active() || (canCombust != 1))
{ {
return; return;
} }

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -183,9 +183,13 @@ protected:
//- Mass fractions of solids [] //- Mass fractions of solids []
scalarField YSolid_; scalarField YSolid_;
//- Flag to say that the particle is allowed to combust //- Flag to identify if the particle can devolatilise and combust
// Only true after volatile content falls below threshold value // Combustion possible only after volatile content falls below
bool canCombust_; // threshold value. States include:
// 0 = can devolatilise, cannot combust but can change
// 1 = can devolatilise, can combust
// -1 = cannot devolatilise or combust, and cannot change
label canCombust_;
// Protected Member Functions // Protected Member Functions
@ -205,7 +209,7 @@ protected:
const scalarField& YGasEff,// gas component mass fractions const scalarField& YGasEff,// gas component mass fractions
const scalarField& YLiquidEff,// liquid component mass fractions const scalarField& YLiquidEff,// liquid component mass fractions
const scalarField& YSolidEff,// solid component mass fractions const scalarField& YSolidEff,// solid component mass fractions
bool& canCombust, // 'can combust' flag label& canCombust, // 'can combust' flag
scalarField& dMassDV, // mass transfer - local to particle scalarField& dMassDV, // mass transfer - local to particle
scalar& Sh, // explicit particle enthalpy source scalar& Sh, // explicit particle enthalpy source
scalar& N, // flux of species emitted from particle scalar& N, // flux of species emitted from particle
@ -223,7 +227,7 @@ protected:
const scalar d, // diameter const scalar d, // diameter
const scalar T, // temperature const scalar T, // temperature
const scalar mass, // mass const scalar mass, // mass
const bool canCombust, // 'can combust' flag const label canCombust, // 'can combust' flag
const scalar N, // flux of species emitted from particle const scalar N, // flux of species emitted from particle
const scalarField& YMix, // mixture mass fractions const scalarField& YMix, // mixture mass fractions
const scalarField& YGas, // gas-phase mass fractions const scalarField& YGas, // gas-phase mass fractions
@ -362,7 +366,7 @@ public:
inline const scalarField& YSolid() const; inline const scalarField& YSolid() const;
//- Return const access to the canCombust flag //- Return const access to the canCombust flag
inline bool canCombust() const; inline label canCombust() const;
// Edit // Edit
@ -377,7 +381,7 @@ public:
inline scalarField& YSolid(); inline scalarField& YSolid();
//- Return access to the canCombust flag //- Return access to the canCombust flag
inline bool& canCombust(); inline label& canCombust();
// Main calculation loop // Main calculation loop

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -94,7 +94,7 @@ inline Foam::ReactingMultiphaseParcel<ParcelType>::ReactingMultiphaseParcel
YGas_(0), YGas_(0),
YLiquid_(0), YLiquid_(0),
YSolid_(0), YSolid_(0),
canCombust_(false) canCombust_(0)
{} {}
@ -142,7 +142,7 @@ inline Foam::ReactingMultiphaseParcel<ParcelType>::ReactingMultiphaseParcel
YGas_(YGas0), YGas_(YGas0),
YLiquid_(YLiquid0), YLiquid_(YLiquid0),
YSolid_(YSolid0), YSolid_(YSolid0),
canCombust_(false) canCombust_(0)
{} {}
@ -192,7 +192,8 @@ YSolid() const
template<class ParcelType> template<class ParcelType>
inline bool Foam::ReactingMultiphaseParcel<ParcelType>::canCombust() const inline Foam::label
Foam::ReactingMultiphaseParcel<ParcelType>::canCombust() const
{ {
return canCombust_; return canCombust_;
} }
@ -220,7 +221,7 @@ inline Foam::scalarField& Foam::ReactingMultiphaseParcel<ParcelType>::YSolid()
template<class ParcelType> template<class ParcelType>
inline bool& Foam::ReactingMultiphaseParcel<ParcelType>::canCombust() inline Foam::label& Foam::ReactingMultiphaseParcel<ParcelType>::canCombust()
{ {
return canCombust_; return canCombust_;
} }

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -47,7 +47,7 @@ Foam::ReactingMultiphaseParcel<ParcelType>::ReactingMultiphaseParcel
YGas_(0), YGas_(0),
YLiquid_(0), YLiquid_(0),
YSolid_(0), YSolid_(0),
canCombust_(false) canCombust_(0)
{ {
if (readFields) if (readFields)
{ {

View File

@ -32,6 +32,169 @@ using namespace Foam::constant::mathematical;
// * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * * // // * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * * //
template<class ParcelType>
template<class TrackData>
void Foam::ReactingParcel<ParcelType>::calcPhaseChange
(
TrackData& td,
const scalar dt,
const label cellI,
const scalar Re,
const scalar Pr,
const scalar Ts,
const scalar nus,
const scalar d,
const scalar T,
const scalar mass,
const label idPhase,
const scalar YPhase,
const scalarField& YComponents,
scalarField& dMassPC,
scalar& Sh,
scalar& N,
scalar& NCpW,
scalarField& Cs
)
{
if
(
!td.cloud().phaseChange().active()
|| T < td.cloud().constProps().Tvap()
|| YPhase < SMALL
)
{
return;
}
typedef typename TrackData::cloudType::reactingCloudType reactingCloudType;
const CompositionModel<reactingCloudType>& composition =
td.cloud().composition();
const scalar TMax = td.cloud().phaseChange().TMax(pc_, this->Tc_);
const scalar Tdash = min(T, TMax);
const scalar Tsdash = min(Ts, TMax);
// Calculate mass transfer due to phase change
td.cloud().phaseChange().calculate
(
dt,
cellI,
Re,
Pr,
d,
nus,
Tdash,
Tsdash,
pc_,
this->Tc_,
YComponents,
dMassPC
);
// Limit phase change mass by availability of each specie
dMassPC = min(mass*YPhase*YComponents, dMassPC);
const scalar dMassTot = sum(dMassPC);
// Add to cumulative phase change mass
td.cloud().phaseChange().addToPhaseChangeMass(this->nParticle_*dMassTot);
forAll(dMassPC, i)
{
const label idc = composition.localToGlobalCarrierId(idPhase, i);
const label idl = composition.globalIds(idPhase)[i];
const scalar dh = td.cloud().phaseChange().dh(idc, idl, pc_, Tdash);
Sh -= dMassPC[i]*dh/dt;
}
// Update molar emissions
if (td.cloud().heatTransfer().BirdCorrection())
{
// Average molecular weight of carrier mix - assumes perfect gas
const scalar Wc = this->rhoc_*specie::RR*this->Tc_/this->pc_;
forAll(dMassPC, i)
{
const label idc = composition.localToGlobalCarrierId(idPhase, i);
const label idl = composition.globalIds(idPhase)[i];
const scalar Cp = composition.carrier().Cp(idc, pc_, Tsdash);
const scalar W = composition.carrier().W(idc);
const scalar Ni = dMassPC[i]/(this->areaS(d)*dt*W);
const scalar Dab =
composition.liquids().properties()[idl].D(pc_, Tsdash, Wc);
// Molar flux of species coming from the particle (kmol/m^2/s)
N += Ni;
// Sum of Ni*Cpi*Wi of emission species
NCpW += Ni*Cp*W;
// Concentrations of emission species
Cs[idc] += Ni*d/(2.0*Dab);
}
}
}
template<class ParcelType>
Foam::scalar Foam::ReactingParcel<ParcelType>::updateMassFraction
(
const scalar mass0,
const scalarField& dMass,
scalarField& Y
) const
{
scalar mass1 = mass0 - sum(dMass);
// only update the mass fractions if the new particle mass is finite
if (mass1 > ROOTVSMALL)
{
forAll(Y, i)
{
Y[i] = (Y[i]*mass0 - dMass[i])/mass1;
}
}
return mass1;
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
template<class ParcelType>
Foam::ReactingParcel<ParcelType>::ReactingParcel
(
const ReactingParcel<ParcelType>& p
)
:
ParcelType(p),
mass0_(p.mass0_),
Y_(p.Y_),
pc_(p.pc_)
{}
template<class ParcelType>
Foam::ReactingParcel<ParcelType>::ReactingParcel
(
const ReactingParcel<ParcelType>& p,
const polyMesh& mesh
)
:
ParcelType(p, mesh),
mass0_(p.mass0_),
Y_(p.Y_),
pc_(p.pc_)
{}
// * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * * //
template<class ParcelType> template<class ParcelType>
template<class TrackData> template<class TrackData>
void Foam::ReactingParcel<ParcelType>::setCellValues void Foam::ReactingParcel<ParcelType>::setCellValues
@ -165,7 +328,7 @@ void Foam::ReactingParcel<ParcelType>::correctSurfaceValues
const SLGThermo& thermo = td.cloud().thermo(); const SLGThermo& thermo = td.cloud().thermo();
// Far field carrier molar fractions // Far field carrier molar fractions
scalarField Xinf(td.cloud().thermo().carrier().species().size()); scalarField Xinf(thermo.carrier().species().size());
forAll(Xinf, i) forAll(Xinf, i)
{ {
@ -234,29 +397,6 @@ void Foam::ReactingParcel<ParcelType>::correctSurfaceValues
} }
template<class ParcelType>
Foam::scalar Foam::ReactingParcel<ParcelType>::updateMassFraction
(
const scalar mass0,
const scalarField& dMass,
scalarField& Y
) const
{
scalar mass1 = mass0 - sum(dMass);
// only update the mass fractions if the new particle mass is finite
if (mass1 > ROOTVSMALL)
{
forAll(Y, i)
{
Y[i] = (Y[i]*mass0 - dMass[i])/mass1;
}
}
return mass1;
}
template<class ParcelType> template<class ParcelType>
template<class TrackData> template<class TrackData>
void Foam::ReactingParcel<ParcelType>::calc void Foam::ReactingParcel<ParcelType>::calc
@ -472,144 +612,6 @@ void Foam::ReactingParcel<ParcelType>::calc
} }
template<class ParcelType>
template<class TrackData>
void Foam::ReactingParcel<ParcelType>::calcPhaseChange
(
TrackData& td,
const scalar dt,
const label cellI,
const scalar Re,
const scalar Pr,
const scalar Ts,
const scalar nus,
const scalar d,
const scalar T,
const scalar mass,
const label idPhase,
const scalar YPhase,
const scalarField& YComponents,
scalarField& dMassPC,
scalar& Sh,
scalar& N,
scalar& NCpW,
scalarField& Cs
)
{
if
(
!td.cloud().phaseChange().active()
|| T < td.cloud().constProps().Tvap()
|| YPhase < SMALL
)
{
return;
}
typedef typename TrackData::cloudType::reactingCloudType reactingCloudType;
const CompositionModel<reactingCloudType>& composition =
td.cloud().composition();
const scalar TMax = td.cloud().phaseChange().TMax(pc_, this->Tc_);
const scalar Tdash = min(T, TMax);
const scalar Tsdash = min(Ts, TMax);
// Calculate mass transfer due to phase change
td.cloud().phaseChange().calculate
(
dt,
cellI,
Re,
Pr,
d,
nus,
Tdash,
Tsdash,
pc_,
this->Tc_,
YComponents,
dMassPC
);
// Limit phase change mass by availability of each specie
dMassPC = min(mass*YPhase*YComponents, dMassPC);
const scalar dMassTot = sum(dMassPC);
// Add to cumulative phase change mass
td.cloud().phaseChange().addToPhaseChangeMass(this->nParticle_*dMassTot);
forAll(dMassPC, i)
{
const label idc = composition.localToGlobalCarrierId(idPhase, i);
const label idl = composition.globalIds(idPhase)[i];
const scalar dh = td.cloud().phaseChange().dh(idc, idl, pc_, Tdash);
Sh -= dMassPC[i]*dh/dt;
}
// Update molar emissions
if (td.cloud().heatTransfer().BirdCorrection())
{
// Average molecular weight of carrier mix - assumes perfect gas
const scalar Wc = this->rhoc_*specie::RR*this->Tc_/this->pc_;
forAll(dMassPC, i)
{
const label idc = composition.localToGlobalCarrierId(idPhase, i);
const label idl = composition.globalIds(idPhase)[i];
const scalar Cp = composition.carrier().Cp(idc, pc_, Tsdash);
const scalar W = composition.carrier().W(idc);
const scalar Ni = dMassPC[i]/(this->areaS(d)*dt*W);
const scalar Dab =
composition.liquids().properties()[idl].D(pc_, Tsdash, Wc);
// Molar flux of species coming from the particle (kmol/m^2/s)
N += Ni;
// Sum of Ni*Cpi*Wi of emission species
NCpW += Ni*Cp*W;
// Concentrations of emission species
Cs[idc] += Ni*d/(2.0*Dab);
}
}
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
template<class ParcelType>
Foam::ReactingParcel<ParcelType>::ReactingParcel
(
const ReactingParcel<ParcelType>& p
)
:
ParcelType(p),
mass0_(p.mass0_),
Y_(p.Y_),
pc_(p.pc_)
{}
template<class ParcelType>
Foam::ReactingParcel<ParcelType>::ReactingParcel
(
const ReactingParcel<ParcelType>& p,
const polyMesh& mesh
)
:
ParcelType(p, mesh),
mass0_(p.mass0_),
Y_(p.Y_),
pc_(p.pc_)
{}
// * * * * * * * * * * * * * * IOStream operators * * * * * * * * * * * * * // // * * * * * * * * * * * * * * IOStream operators * * * * * * * * * * * * * //
#include "ReactingParcelIO.C" #include "ReactingParcelIO.C"

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -33,6 +33,7 @@ License
#include "makeParcelInjectionModels.H" #include "makeParcelInjectionModels.H"
#include "makeParcelCollisionModels.H" #include "makeParcelCollisionModels.H"
#include "makeParcelPatchInteractionModels.H" #include "makeParcelPatchInteractionModels.H"
#include "makeParcelStochasticCollisionModels.H"
#include "makeParcelSurfaceFilmModels.H" #include "makeParcelSurfaceFilmModels.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -47,6 +48,7 @@ namespace Foam
makeParcelInjectionModels(basicKinematicCollidingCloud); makeParcelInjectionModels(basicKinematicCollidingCloud);
makeParcelCollisionModels(basicKinematicCollidingCloud); makeParcelCollisionModels(basicKinematicCollidingCloud);
makeParcelPatchInteractionModels(basicKinematicCollidingCloud); makeParcelPatchInteractionModels(basicKinematicCollidingCloud);
makeParcelStochasticCollisionModels(basicKinematicCollidingCloud);
makeParcelSurfaceFilmModels(basicKinematicCollidingCloud); makeParcelSurfaceFilmModels(basicKinematicCollidingCloud);
} }

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -32,6 +32,7 @@ License
#include "makeParcelDispersionModels.H" #include "makeParcelDispersionModels.H"
#include "makeParcelInjectionModels.H" #include "makeParcelInjectionModels.H"
#include "makeParcelPatchInteractionModels.H" #include "makeParcelPatchInteractionModels.H"
#include "makeParcelStochasticCollisionModels.H"
#include "makeParcelSurfaceFilmModels.H" #include "makeParcelSurfaceFilmModels.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -45,6 +46,7 @@ namespace Foam
makeParcelDispersionModels(basicKinematicCloud); makeParcelDispersionModels(basicKinematicCloud);
makeParcelInjectionModels(basicKinematicCloud); makeParcelInjectionModels(basicKinematicCloud);
makeParcelPatchInteractionModels(basicKinematicCloud); makeParcelPatchInteractionModels(basicKinematicCloud);
makeParcelStochasticCollisionModels(basicKinematicCloud);
makeParcelSurfaceFilmModels(basicKinematicCloud); makeParcelSurfaceFilmModels(basicKinematicCloud);
} }

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -32,6 +32,8 @@ License
#include "makeParcelDispersionModels.H" #include "makeParcelDispersionModels.H"
#include "makeReactingMultiphaseParcelInjectionModels.H" // MP variant #include "makeReactingMultiphaseParcelInjectionModels.H" // MP variant
#include "makeParcelPatchInteractionModels.H" #include "makeParcelPatchInteractionModels.H"
#include "makeReactingMultiphaseParcelStochasticCollisionModels.H" // MP variant
#include "makeReactingParcelSurfaceFilmModels.H" // Reacting variant
// Thermodynamic // Thermodynamic
#include "makeParcelHeatTransferModels.H" #include "makeParcelHeatTransferModels.H"
@ -39,7 +41,6 @@ License
// Reacting // Reacting
#include "makeReactingMultiphaseParcelCompositionModels.H" // MP Variant #include "makeReactingMultiphaseParcelCompositionModels.H" // MP Variant
#include "makeReactingParcelPhaseChangeModels.H" #include "makeReactingParcelPhaseChangeModels.H"
#include "makeReactingParcelSurfaceFilmModels.H"
// Reacting multiphase // Reacting multiphase
#include "makeReactingMultiphaseParcelDevolatilisationModels.H" #include "makeReactingMultiphaseParcelDevolatilisationModels.H"
@ -56,6 +57,11 @@ namespace Foam
makeParcelDispersionModels(basicReactingMultiphaseCloud); makeParcelDispersionModels(basicReactingMultiphaseCloud);
makeReactingMultiphaseParcelInjectionModels(basicReactingMultiphaseCloud); makeReactingMultiphaseParcelInjectionModels(basicReactingMultiphaseCloud);
makeParcelPatchInteractionModels(basicReactingMultiphaseCloud); makeParcelPatchInteractionModels(basicReactingMultiphaseCloud);
makeReactingMultiphaseParcelStochasticCollisionModels
(
basicReactingMultiphaseCloud
);
makeReactingParcelSurfaceFilmModels(basicReactingMultiphaseCloud);
// Thermo sub-models // Thermo sub-models
makeParcelHeatTransferModels(basicReactingMultiphaseCloud); makeParcelHeatTransferModels(basicReactingMultiphaseCloud);
@ -72,10 +78,6 @@ namespace Foam
( (
basicReactingMultiphaseCloud basicReactingMultiphaseCloud
); );
makeReactingParcelSurfaceFilmModels
(
basicReactingMultiphaseCloud
);
makeReactingMultiphaseParcelSurfaceReactionModels makeReactingMultiphaseParcelSurfaceReactionModels
( (
basicReactingMultiphaseCloud basicReactingMultiphaseCloud

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -32,6 +32,8 @@ License
#include "makeParcelDispersionModels.H" #include "makeParcelDispersionModels.H"
#include "makeReactingParcelInjectionModels.H" // Reacting variant #include "makeReactingParcelInjectionModels.H" // Reacting variant
#include "makeParcelPatchInteractionModels.H" #include "makeParcelPatchInteractionModels.H"
#include "makeParcelStochasticCollisionModels.H"
#include "makeReactingParcelSurfaceFilmModels.H" // Reacting variant
// Thermodynamic // Thermodynamic
#include "makeParcelHeatTransferModels.H" #include "makeParcelHeatTransferModels.H"
@ -39,7 +41,6 @@ License
// Reacting // Reacting
#include "makeReactingParcelCompositionModels.H" #include "makeReactingParcelCompositionModels.H"
#include "makeReactingParcelPhaseChangeModels.H" #include "makeReactingParcelPhaseChangeModels.H"
#include "makeReactingParcelSurfaceFilmModels.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -52,6 +53,8 @@ namespace Foam
makeParcelDispersionModels(basicReactingCloud); makeParcelDispersionModels(basicReactingCloud);
makeReactingParcelInjectionModels(basicReactingCloud); makeReactingParcelInjectionModels(basicReactingCloud);
makeParcelPatchInteractionModels(basicReactingCloud); makeParcelPatchInteractionModels(basicReactingCloud);
makeParcelStochasticCollisionModels(basicReactingCloud);
makeReactingParcelSurfaceFilmModels(basicReactingCloud);
// Thermo sub-models // Thermo sub-models
makeParcelHeatTransferModels(basicReactingCloud); makeParcelHeatTransferModels(basicReactingCloud);
@ -59,7 +62,6 @@ namespace Foam
// Reacting sub-models // Reacting sub-models
makeReactingParcelCompositionModels(basicReactingCloud); makeReactingParcelCompositionModels(basicReactingCloud);
makeReactingParcelPhaseChangeModels(basicReactingCloud); makeReactingParcelPhaseChangeModels(basicReactingCloud);
makeReactingParcelSurfaceFilmModels(basicReactingCloud);
} }

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -22,18 +22,18 @@ License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Class Class
Foam::fluidThermoParcel Foam::basicThermoParcel
Description Description
Definition of basic thermo parcel Definition of basic thermo parcel
SourceFiles SourceFiles
fluidThermoParcel.C basicThermoParcel.C
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
#ifndef fluidThermoParcel_H #ifndef basicThermoParcel_H
#define fluidThermoParcel_H #define basicThermoParcel_H
#include "contiguous.H" #include "contiguous.H"
#include "particle.H" #include "particle.H"
@ -44,10 +44,10 @@ SourceFiles
namespace Foam namespace Foam
{ {
typedef ThermoParcel<KinematicParcel<particle> > fluidThermoParcel; typedef ThermoParcel<KinematicParcel<particle> > basicThermoParcel;
template<> template<>
inline bool contiguous<fluidThermoParcel>() inline bool contiguous<basicThermoParcel>()
{ {
return true; return true;
} }

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -23,15 +23,15 @@ License
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
#include "fluidThermoParcel.H" #include "basicThermoParcel.H"
#include "Cloud.H" #include "Cloud.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam namespace Foam
{ {
defineTemplateTypeNameAndDebug(fluidThermoParcel, 0); defineTemplateTypeNameAndDebug(basicThermoParcel, 0);
defineTemplateTypeNameAndDebug(Cloud<fluidThermoParcel>, 0); defineTemplateTypeNameAndDebug(Cloud<basicThermoParcel>, 0);
} }
// ************************************************************************* // // ************************************************************************* //

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -23,7 +23,7 @@ License
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
#include "fluidThermoCloud.H" #include "basicThermoCloud.H"
#include "makeParcelCloudFunctionObjects.H" #include "makeParcelCloudFunctionObjects.H"
@ -32,26 +32,28 @@ License
#include "makeParcelDispersionModels.H" #include "makeParcelDispersionModels.H"
#include "makeParcelInjectionModels.H" #include "makeParcelInjectionModels.H"
#include "makeParcelPatchInteractionModels.H" #include "makeParcelPatchInteractionModels.H"
#include "makeParcelStochasticCollisionModels.H"
#include "makeThermoParcelSurfaceFilmModels.H" // thermo variant
// Thermodynamic // Thermodynamic
#include "makeParcelHeatTransferModels.H" #include "makeParcelHeatTransferModels.H"
#include "makeThermoParcelSurfaceFilmModels.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam namespace Foam
{ {
makeParcelCloudFunctionObjects(fluidThermoCloud); makeParcelCloudFunctionObjects(basicThermoCloud);
// Kinematic sub-models // Kinematic sub-models
makeThermoParcelForces(fluidThermoCloud); makeThermoParcelForces(basicThermoCloud);
makeParcelDispersionModels(fluidThermoCloud); makeParcelDispersionModels(basicThermoCloud);
makeParcelInjectionModels(fluidThermoCloud); makeParcelInjectionModels(basicThermoCloud);
makeParcelPatchInteractionModels(fluidThermoCloud); makeParcelPatchInteractionModels(basicThermoCloud);
makeParcelStochasticCollisionModels(basicThermoCloud);
makeParcelSurfaceFilmModels(basicThermoCloud);
// Thermo sub-models // Thermo sub-models
makeParcelHeatTransferModels(fluidThermoCloud); makeParcelHeatTransferModels(basicThermoCloud);
makeParcelSurfaceFilmModels(fluidThermoCloud);
} }

View File

@ -0,0 +1,45 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2013 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/>.
\*---------------------------------------------------------------------------*/
#ifndef makeParcelStochasticCollisionModels_H
#define makeParcelStochasticCollisionModels_H
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#include "NoStochasticCollision.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#define makeParcelStochasticCollisionModels(CloudType) \
\
makeStochasticCollisionModel(CloudType); \
makeStochasticCollisionModelType(NoStochasticCollision, CloudType);
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -0,0 +1,47 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2013 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/>.
\*---------------------------------------------------------------------------*/
#ifndef makeReactingMultiphaseParcelStochasticCollisionModels_H
#define makeReactingMultiphaseParcelStochasticCollisionModels_H
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#include "NoStochasticCollision.H"
#include "SuppressionCollision.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#define makeReactingMultiphaseParcelStochasticCollisionModels(CloudType) \
\
makeStochasticCollisionModel(CloudType); \
makeStochasticCollisionModelType(NoStochasticCollision, CloudType); \
makeStochasticCollisionModelType(SuppressionCollision, CloudType);
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -25,6 +25,15 @@ License
#include "NoStochasticCollision.H" #include "NoStochasticCollision.H"
// * * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * //
template<class CloudType>
void Foam::NoStochasticCollision<CloudType>::collide(const scalar)
{
// do nothing
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
template<class CloudType> template<class CloudType>
@ -64,37 +73,4 @@ bool Foam::NoStochasticCollision<CloudType>::active() const
} }
template<class CloudType>
bool Foam::NoStochasticCollision<CloudType>::update
(
const scalar dt,
cachedRandom& rndGen,
vector& pos1,
scalar& m1,
scalar& d1,
scalar& N1,
vector& U,
scalar& rho1,
scalar& T1,
scalarField& Y1,
const scalar sigma1,
const label celli,
const scalar voli,
vector& pos2,
scalar& m2,
scalar& d2,
scalar& N2,
vector& U2,
scalar& rho2,
scalar& T2,
scalarField& Y2,
const scalar sigma2,
const label cellj,
const scalar volj
) const
{
return false;
}
// ************************************************************************* // // ************************************************************************* //

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -47,6 +47,14 @@ class NoStochasticCollision
: :
public StochasticCollisionModel<CloudType> public StochasticCollisionModel<CloudType>
{ {
protected:
// Protected Member Functions
//- Update the model
virtual void collide(const scalar dt);
public: public:
//- Runtime type information //- Runtime type information
@ -79,34 +87,6 @@ public:
//- Flag to indicate whether model activates collision model //- Flag to indicate whether model activates collision model
virtual bool active() const; virtual bool active() const;
virtual bool update
(
const scalar dt,
cachedRandom& rndGen,
vector& pos1,
scalar& m1,
scalar& d1,
scalar& N1,
vector& U,
scalar& rho1,
scalar& T1,
scalarField& Y1,
const scalar sigma1,
const label celli,
const scalar voli,
vector& pos2,
scalar& m2,
scalar& d2,
scalar& N2,
vector& U2,
scalar& rho2,
scalar& T2,
scalarField& Y2,
const scalar sigma2,
const label cellj,
const scalar volj
) const;
}; };

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -25,6 +25,18 @@ License
#include "StochasticCollisionModel.H" #include "StochasticCollisionModel.H"
// * * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * //
template<class CloudType>
void Foam::StochasticCollisionModel<CloudType>::collide(const scalar dt)
{
notImplemented
(
"void Foam::NoStochasticCollision<CloudType>::collide(const scalar)"
);
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
template<class CloudType> template<class CloudType>
@ -69,66 +81,12 @@ Foam::StochasticCollisionModel<CloudType>::~StochasticCollisionModel()
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template<class CloudType> template<class CloudType>
bool Foam::StochasticCollisionModel<CloudType>::update void Foam::StochasticCollisionModel<CloudType>::update(const scalar dt)
(
const scalar dt,
cachedRandom& rndGen,
vector& pos1,
scalar& m1,
scalar& d1,
scalar& N1,
vector& U1,
scalar& rho1,
scalar& T1,
scalarField& Y1,
const scalar sigma1,
const label celli,
const scalar voli,
vector& pos2,
scalar& m2,
scalar& d2,
scalar& N2,
vector& U2,
scalar& rho2,
scalar& T2,
scalarField& Y2,
const scalar sigma2,
const label cellj,
const scalar volj
) const
{ {
notImplemented if (this->active())
( {
"bool Foam::StochasticCollisionModel<CloudType>::update" this->collide(dt);
"(" }
"const scalar, "
"cachedRandom&, "
"vector&, "
"scalar&, "
"scalar&, "
"scalar&, "
"vector&, "
"scalar&, "
"scalar&, "
"scalarField&, "
"const scalar, "
"const label, "
"const scalar, "
"vector&, "
"scalar&, "
"scalar&, "
"scalar&, "
"vector&, "
"scalar&, "
"scalar&, "
"scalarField&, "
"const scalar, "
"const label, "
"const scalar"
") const"
);
return false;
} }
@ -137,4 +95,3 @@ bool Foam::StochasticCollisionModel<CloudType>::update
#include "StochasticCollisionModelNew.C" #include "StochasticCollisionModelNew.C"
// ************************************************************************* // // ************************************************************************* //

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -55,6 +55,12 @@ class StochasticCollisionModel
: :
public SubModelBase<CloudType> public SubModelBase<CloudType>
{ {
protected:
//- Main collision routine
virtual void collide(const scalar dt);
public: public:
//- Runtime type information //- Runtime type information
@ -114,33 +120,8 @@ public:
// Member Functions // Member Functions
virtual bool update //- Update the model
( void update(const scalar dt);
const scalar dt,
cachedRandom& rndGen,
vector& pos1,
scalar& m1,
scalar& d1,
scalar& N1,
vector& U1,
scalar& rho1,
scalar& T1,
scalarField& Y1,
const scalar sigma1,
const label celli,
const scalar voli,
vector& pos2,
scalar& m2,
scalar& d2,
scalar& N2,
vector& U2,
scalar& rho2,
scalar& T2,
scalarField& Y2,
const scalar sigma2,
const label cellj,
const scalar volj
) const;
}; };
@ -152,27 +133,27 @@ public:
#define makeStochasticCollisionModel(CloudType) \ #define makeStochasticCollisionModel(CloudType) \
\ \
typedef CloudType::sprayCloudType sprayCloudType; \ typedef CloudType::kinematicCloudType kinematicCloudType; \
defineNamedTemplateTypeNameAndDebug \ defineNamedTemplateTypeNameAndDebug \
( \ ( \
StochasticCollisionModel<sprayCloudType>, \ StochasticCollisionModel<kinematicCloudType>, \
0 \ 0 \
); \ ); \
defineTemplateRunTimeSelectionTable \ defineTemplateRunTimeSelectionTable \
( \ ( \
StochasticCollisionModel<sprayCloudType>, \ StochasticCollisionModel<kinematicCloudType>, \
dictionary \ dictionary \
); );
#define makeStochasticCollisionModelType(SS, CloudType) \ #define makeStochasticCollisionModelType(SS, CloudType) \
\ \
typedef CloudType::sprayCloudType sprayCloudType; \ typedef CloudType::kinematicCloudType kinematicCloudType; \
defineNamedTemplateTypeNameAndDebug(SS<sprayCloudType>, 0); \ defineNamedTemplateTypeNameAndDebug(SS<kinematicCloudType>, 0); \
\ \
StochasticCollisionModel<sprayCloudType>:: \ StochasticCollisionModel<kinematicCloudType>:: \
adddictionaryConstructorToTable<SS<sprayCloudType> > \ adddictionaryConstructorToTable<SS<kinematicCloudType> > \
add##SS##CloudType##sprayCloudType##ConstructorToTable_; add##SS##CloudType##kinematicCloudType##ConstructorToTable_;

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -37,7 +37,7 @@ Foam::StochasticCollisionModel<CloudType>::New
{ {
word modelType(dict.lookup("stochasticCollisionModel")); word modelType(dict.lookup("stochasticCollisionModel"));
Info<< "Selecting StochasticCollisionModel " << modelType << endl; Info<< "Selecting stochastic collision model " << modelType << endl;
typename dictionaryConstructorTable::iterator cstrIter = typename dictionaryConstructorTable::iterator cstrIter =
dictionaryConstructorTablePtr_->find(modelType); dictionaryConstructorTablePtr_->find(modelType);
@ -51,9 +51,9 @@ Foam::StochasticCollisionModel<CloudType>::New
"const dictionary&, " "const dictionary&, "
"CloudType&" "CloudType&"
")" ")"
) << "Unknown StochasticCollisionModelType type " ) << "Unknown model type type "
<< modelType << ", constructor not in hash table" << nl << nl << modelType << ", constructor not in hash table" << nl << nl
<< " Valid StochasticCollisionModel types are:" << nl << " Valid model types are:" << nl
<< dictionaryConstructorTablePtr_->sortedToc() << exit(FatalError); << dictionaryConstructorTablePtr_->sortedToc() << exit(FatalError);
} }

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -109,7 +109,7 @@ void Foam::ConstantRateDevolatilisation<CloudType>::calculate
const scalarField& YGasEff, const scalarField& YGasEff,
const scalarField& YLiquidEff, const scalarField& YLiquidEff,
const scalarField& YSolidEff, const scalarField& YSolidEff,
bool& canCombust, label& canCombust,
scalarField& dMassDV scalarField& dMassDV
) const ) const
{ {
@ -130,7 +130,10 @@ void Foam::ConstantRateDevolatilisation<CloudType>::calculate
dMassDV[id] = min(dt*A0*massVolatile0, massVolatile); dMassDV[id] = min(dt*A0*massVolatile0, massVolatile);
} }
canCombust = done; if (done && canCombust != -1)
{
canCombust = 1;
}
} }

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -111,7 +111,7 @@ public:
const scalarField& YGasEff, const scalarField& YGasEff,
const scalarField& YLiquidEff, const scalarField& YLiquidEff,
const scalarField& YSolidEff, const scalarField& YSolidEff,
bool& canCombust, label& canCombust,
scalarField& dMassDV scalarField& dMassDV
) const; ) const;
}; };

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -82,7 +82,7 @@ void Foam::DevolatilisationModel<CloudType>::calculate
const scalarField&, const scalarField&,
const scalarField&, const scalarField&,
const scalarField&, const scalarField&,
bool&, label&,
scalarField& scalarField&
) const ) const
{ {
@ -98,7 +98,7 @@ void Foam::DevolatilisationModel<CloudType>::calculate
"const scalarField&, " "const scalarField&, "
"const scalarField&, " "const scalarField&, "
"const scalarField&, " "const scalarField&, "
"bool&, " "label&, "
"scalarField&" "scalarField&"
") const" ") const"
); );

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -133,7 +133,7 @@ public:
const scalarField& YGasEff, const scalarField& YGasEff,
const scalarField& YLiquidEff, const scalarField& YLiquidEff,
const scalarField& YSolidEff, const scalarField& YSolidEff,
bool& canCombust, label& canCombust,
scalarField& dMassDV scalarField& dMassDV
) const; ) const;

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -112,7 +112,7 @@ void Foam::SingleKineticRateDevolatilisation<CloudType>::calculate
const scalarField& YGasEff, const scalarField& YGasEff,
const scalarField& YLiquidEff, const scalarField& YLiquidEff,
const scalarField& YSolidEff, const scalarField& YSolidEff,
bool& canCombust, label& canCombust,
scalarField& dMassDV scalarField& dMassDV
) const ) const
{ {
@ -137,7 +137,10 @@ void Foam::SingleKineticRateDevolatilisation<CloudType>::calculate
dMassDV[id] = min(dt*kappa*massVolatile, massVolatile); dMassDV[id] = min(dt*kappa*massVolatile, massVolatile);
} }
canCombust = done; if (done && canCombust != -1)
{
canCombust = 1;
}
} }

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -236,7 +236,7 @@ public:
const scalarField& YGasEff, const scalarField& YGasEff,
const scalarField& YLiquidEff, const scalarField& YLiquidEff,
const scalarField& YSolidEff, const scalarField& YSolidEff,
bool& canCombust, label& canCombust,
scalarField& dMassDV scalarField& dMassDV
) const; ) const;
}; };

View File

@ -0,0 +1,96 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2013 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 "SuppressionCollision.H"
#include "kinematicCloud.H"
// * * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * //
template<class CloudType>
void Foam::SuppressionCollision<CloudType>::collide(const scalar dt)
{
const kinematicCloud& sc =
this->owner().mesh().template
lookupObject<kinematicCloud>(suppressionCloud_);
volScalarField vDotSweep(sc.vDotSweep());
dimensionedScalar Dt("dt", dimTime, dt);
volScalarField P(type() + ":p", 1.0 - exp(-vDotSweep*Dt));
forAllIter(typename CloudType, this->owner(), iter)
{
typename CloudType::parcelType& p = iter();
label cellI = p.cell();
scalar xx = this->owner().rndGen().template sample01<scalar>();
if (xx < P[cellI])
{
p.canCombust() = -1;
p.typeId() = max(p.typeId(), suppressedParcelType_);
}
}
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
template<class CloudType>
Foam::SuppressionCollision<CloudType>::SuppressionCollision
(
const dictionary& dict,
CloudType& owner
)
:
StochasticCollisionModel<CloudType>(dict, owner, typeName),
suppressionCloud_(this->coeffDict().lookup("suppressionCloud")),
suppressedParcelType_
(
this->coeffDict().lookupOrDefault("suppressedParcelType", -1)
)
{}
template<class CloudType>
Foam::SuppressionCollision<CloudType>::SuppressionCollision
(
const SuppressionCollision<CloudType>& cm
)
:
StochasticCollisionModel<CloudType>(cm),
suppressionCloud_(cm.suppressionCloud_),
suppressedParcelType_(cm.suppressedParcelType_)
{}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
template<class CloudType>
Foam::SuppressionCollision<CloudType>::~SuppressionCollision()
{}
// ************************************************************************* //

View File

@ -0,0 +1,111 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2013 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::SuppressionCollision
Description
Inter-cloud collision model, whereby the \c canReact flag can be used
to inhibit devolatilisation and surface reactions
\*---------------------------------------------------------------------------*/
#ifndef SuppressionCollision_H
#define SuppressionCollision_H
#include "StochasticCollisionModel.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
/*---------------------------------------------------------------------------*\
Class SuppressionCollision Declaration
\*---------------------------------------------------------------------------*/
template<class CloudType>
class SuppressionCollision
:
public StochasticCollisionModel<CloudType>
{
protected:
// Protected data
//- Name of cloud used for suppression
const word suppressionCloud_;
//- Suppressed parcel type - optional
const label suppressedParcelType_;
// Protected Member Functions
//- Update the model
virtual void collide(const scalar dt);
public:
//- Runtime type information
TypeName("suppressionCollision");
// Constructors
//- Construct from dictionary
SuppressionCollision(const dictionary& dict, CloudType& owner);
//- Construct copy
SuppressionCollision(const SuppressionCollision<CloudType>& cm);
//- Construct and return a clone
virtual autoPtr<StochasticCollisionModel<CloudType> > clone() const
{
return autoPtr<StochasticCollisionModel<CloudType> >
(
new SuppressionCollision<CloudType>(*this)
);
}
//- Destructor
virtual ~SuppressionCollision();
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#ifdef NoRepository
# include "SuppressionCollision.C"
#endif
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -26,7 +26,6 @@ License
#include "SprayCloud.H" #include "SprayCloud.H"
#include "AtomizationModel.H" #include "AtomizationModel.H"
#include "BreakupModel.H" #include "BreakupModel.H"
#include "StochasticCollisionModel.H"
// * * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * // // * * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * //
@ -50,15 +49,6 @@ void Foam::SprayCloud<CloudType>::setModels()
*this *this
).ptr() ).ptr()
); );
stochasticCollisionModel_.reset
(
StochasticCollisionModel<SprayCloud<CloudType> >::New
(
this->subModelProperties(),
*this
).ptr()
);
} }
@ -72,7 +62,6 @@ void Foam::SprayCloud<CloudType>::cloudReset
atomizationModel_.reset(c.atomizationModel_.ptr()); atomizationModel_.reset(c.atomizationModel_.ptr());
breakupModel_.reset(c.breakupModel_.ptr()); breakupModel_.reset(c.breakupModel_.ptr());
stochasticCollisionModel_.reset(c.stochasticCollisionModel_.ptr());
} }
@ -94,8 +83,7 @@ Foam::SprayCloud<CloudType>::SprayCloud
cloudCopyPtr_(NULL), cloudCopyPtr_(NULL),
averageParcelMass_(0.0), averageParcelMass_(0.0),
atomizationModel_(NULL), atomizationModel_(NULL),
breakupModel_(NULL), breakupModel_(NULL)
stochasticCollisionModel_(NULL)
{ {
if (this->solution().active()) if (this->solution().active())
{ {
@ -130,8 +118,7 @@ Foam::SprayCloud<CloudType>::SprayCloud
cloudCopyPtr_(NULL), cloudCopyPtr_(NULL),
averageParcelMass_(c.averageParcelMass_), averageParcelMass_(c.averageParcelMass_),
atomizationModel_(c.atomizationModel_->clone()), atomizationModel_(c.atomizationModel_->clone()),
breakupModel_(c.breakupModel_->clone()), breakupModel_(c.breakupModel_->clone())
stochasticCollisionModel_(c.stochasticCollisionModel_->clone())
{} {}
@ -148,8 +135,7 @@ Foam::SprayCloud<CloudType>::SprayCloud
cloudCopyPtr_(NULL), cloudCopyPtr_(NULL),
averageParcelMass_(0.0), averageParcelMass_(0.0),
atomizationModel_(NULL), atomizationModel_(NULL),
breakupModel_(NULL), breakupModel_(NULL)
stochasticCollisionModel_(NULL)
{} {}
@ -179,6 +165,8 @@ void Foam::SprayCloud<CloudType>::setParcelThermoProperties
// override rho and Cp from constantProperties // override rho and Cp from constantProperties
parcel.Cp() = liqMix.Cp(parcel.pc(), parcel.T(), X); parcel.Cp() = liqMix.Cp(parcel.pc(), parcel.T(), X);
parcel.rho() = liqMix.rho(parcel.pc(), parcel.T(), X); parcel.rho() = liqMix.rho(parcel.pc(), parcel.T(), X);
parcel.sigma() = liqMix.sigma(parcel.pc(), parcel.T(), X);
parcel.mu() = liqMix.mu(parcel.pc(), parcel.T(), X);
} }
@ -237,128 +225,6 @@ void Foam::SprayCloud<CloudType>::evolve()
} }
template<class CloudType>
template<class TrackData>
void Foam::SprayCloud<CloudType>::motion(TrackData& td)
{
const scalar dt = this->solution().trackTime();
td.part() = TrackData::tpLinearTrack;
CloudType::move(td, dt);
this->updateCellOccupancy();
if (stochasticCollision().active())
{
const liquidMixtureProperties& liqMix = this->composition().liquids();
label i = 0;
forAllIter(typename SprayCloud<CloudType>, *this, iter)
{
label j = 0;
forAllIter(typename SprayCloud<CloudType>, *this, jter)
{
if (j > i)
{
parcelType& p = iter();
scalar Vi = this->mesh().V()[p.cell()];
scalarField X1(liqMix.X(p.Y()));
scalar sigma1 = liqMix.sigma(p.pc(), p.T(), X1);
scalar mp = p.mass()*p.nParticle();
parcelType& q = jter();
scalar Vj = this->mesh().V()[q.cell()];
scalarField X2(liqMix.X(q.Y()));
scalar sigma2 = liqMix.sigma(q.pc(), q.T(), X2);
scalar mq = q.mass()*q.nParticle();
bool updateProperties = stochasticCollision().update
(
dt,
this->rndGen(),
p.position(),
mp,
p.d(),
p.nParticle(),
p.U(),
p.rho(),
p.T(),
p.Y(),
sigma1,
p.cell(),
Vi,
q.position(),
mq,
q.d(),
q.nParticle(),
q.U(),
q.rho(),
q.T(),
q.Y(),
sigma2,
q.cell(),
Vj
);
// for coalescence we need to update the density and
// the diameter cause of the temp/conc/mass-change
if (updateProperties)
{
if (mp > VSMALL)
{
scalarField Xp(liqMix.X(p.Y()));
p.rho() = liqMix.rho(p.pc(), p.T(), Xp);
p.Cp() = liqMix.Cp(p.pc(), p.T(), Xp);
p.d() =
cbrt
(
6.0*mp
/(
p.nParticle()
*p.rho()
*constant::mathematical::pi
)
);
}
if (mq > VSMALL)
{
scalarField Xq(liqMix.X(q.Y()));
q.rho() = liqMix.rho(q.pc(), q.T(), Xq);
q.Cp() = liqMix.Cp(q.pc(), q.T(), Xq);
q.d() =
cbrt
(
6.0*mq
/(
q.nParticle()
*q.rho()
*constant::mathematical::pi
)
);
}
}
}
j++;
}
i++;
}
// remove coalesced parcels that fall below minimum mass threshold
forAllIter(typename SprayCloud<CloudType>, *this, iter)
{
parcelType& p = iter();
scalar mass = p.nParticle()*p.mass();
if (mass < td.cloud().constProps().minParticleMass())
{
this->deleteParticle(p);
}
}
}
}
template<class CloudType> template<class CloudType>
void Foam::SprayCloud<CloudType>::info() void Foam::SprayCloud<CloudType>::info()
{ {

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -27,6 +27,10 @@ Class
Description Description
Templated base class for spray cloud Templated base class for spray cloud
- sub-models:
- atomization model
- break-up model
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
#ifndef SprayCloud_H #ifndef SprayCloud_H
@ -46,9 +50,6 @@ class AtomizationModel;
template<class CloudType> template<class CloudType>
class BreakupModel; class BreakupModel;
template<class CloudType>
class StochasticCollisionModel;
/*---------------------------------------------------------------------------*\ /*---------------------------------------------------------------------------*\
Class SprayCloud Declaration Class SprayCloud Declaration
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
@ -106,10 +107,6 @@ protected:
//- Break-up model //- Break-up model
autoPtr<BreakupModel<SprayCloud<CloudType> > > breakupModel_; autoPtr<BreakupModel<SprayCloud<CloudType> > > breakupModel_;
//- Collision model
autoPtr<StochasticCollisionModel<SprayCloud<CloudType> > >
stochasticCollisionModel_;
// Protected Member Functions // Protected Member Functions
@ -202,14 +199,6 @@ public:
//- Return reference to the breakup model //- Return reference to the breakup model
inline BreakupModel<SprayCloud<CloudType> >& breakup(); inline BreakupModel<SprayCloud<CloudType> >& breakup();
//- Return const-access to the breakup model
inline const StochasticCollisionModel<SprayCloud<CloudType> >&
stochasticCollision() const;
//- Return reference to the breakup model
inline StochasticCollisionModel<SprayCloud<CloudType> >&
stochasticCollision();
// Cloud evolution functions // Cloud evolution functions
@ -236,10 +225,6 @@ public:
//- Evolve the spray (inject, move) //- Evolve the spray (inject, move)
void evolve(); void evolve();
//- Particle motion
template<class TrackData>
void motion(TrackData& td);
// I-O // I-O
@ -249,7 +234,6 @@ public:
}; };
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam } // End namespace Foam

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -65,22 +65,6 @@ Foam::SprayCloud<CloudType>::breakup()
} }
template<class CloudType>
inline const Foam::StochasticCollisionModel<Foam::SprayCloud<CloudType> >&
Foam::SprayCloud<CloudType>::stochasticCollision() const
{
return stochasticCollisionModel_;
}
template<class CloudType>
inline Foam::StochasticCollisionModel<Foam::SprayCloud<CloudType> >&
Foam::SprayCloud<CloudType>::stochasticCollision()
{
return stochasticCollisionModel_();
}
template<class CloudType> template<class CloudType>
inline Foam::scalar Foam::SprayCloud<CloudType>::averageParcelMass() const inline Foam::scalar Foam::SprayCloud<CloudType>::averageParcelMass() const
{ {

View File

@ -82,6 +82,7 @@ void Foam::SprayParcel<ParcelType>::calc
scalar T0 = this->T(); scalar T0 = this->T();
this->Cp() = td.cloud().composition().liquids().Cp(this->pc_, T0, X); this->Cp() = td.cloud().composition().liquids().Cp(this->pc_, T0, X);
sigma_ = td.cloud().composition().liquids().sigma(this->pc_, T0, X);
scalar rho0 = td.cloud().composition().liquids().rho(this->pc_, T0, X); scalar rho0 = td.cloud().composition().liquids().rho(this->pc_, T0, X);
this->rho() = rho0; this->rho() = rho0;
@ -89,13 +90,14 @@ void Foam::SprayParcel<ParcelType>::calc
if (td.keepParticle) if (td.keepParticle)
{ {
// update Cp, diameter and density due to change in temperature // update Cp, sigma, diameter and density due to change in temperature
// and/or composition // and/or composition
scalar T1 = this->T(); scalar T1 = this->T();
const scalarField& Y1(this->Y()); const scalarField& Y1(this->Y());
scalarField X1(td.cloud().composition().liquids().X(Y1)); scalarField X1(td.cloud().composition().liquids().X(Y1));
this->Cp() = td.cloud().composition().liquids().Cp(this->pc_, T1, X1); this->Cp() = td.cloud().composition().liquids().Cp(this->pc_, T1, X1);
sigma_ = td.cloud().composition().liquids().sigma(this->pc_, T1, X);
scalar rho1 = td.cloud().composition().liquids().rho(this->pc_, T1, X1); scalar rho1 = td.cloud().composition().liquids().rho(this->pc_, T1, X1);
this->rho() = rho1; this->rho() = rho1;
@ -139,15 +141,6 @@ void Foam::SprayParcel<ParcelType>::calcAtomization
const AtomizationModel<sprayCloudType>& atomization = const AtomizationModel<sprayCloudType>& atomization =
td.cloud().atomization(); td.cloud().atomization();
// cell state info is updated in ReactingParcel calc
const scalarField& Y(this->Y());
scalarField X(composition.liquids().X(Y));
scalar rho = composition.liquids().rho(this->pc(), this->T(), X);
scalar mu = composition.liquids().mu(this->pc(), this->T(), X);
scalar sigma = composition.liquids().sigma(this->pc(), this->T(), X);
// Average molecular weight of carrier mix - assumes perfect gas // Average molecular weight of carrier mix - assumes perfect gas
scalar Wc = this->rhoc_*specie::RR*this->Tc()/this->pc(); scalar Wc = this->rhoc_*specie::RR*this->Tc()/this->pc();
scalar R = specie::RR/Wc; scalar R = specie::RR/Wc;
@ -174,7 +167,7 @@ void Foam::SprayParcel<ParcelType>::calcAtomization
scalar chi = 0.0; scalar chi = 0.0;
if (atomization.calcChi()) if (atomization.calcChi())
{ {
chi = this->chi(td, X); chi = this->chi(td, composition.liquids().X(this->Y()));
} }
atomization.update atomization.update
@ -183,9 +176,9 @@ void Foam::SprayParcel<ParcelType>::calcAtomization
this->d(), this->d(),
this->liquidCore(), this->liquidCore(),
this->tc(), this->tc(),
rho, this->rho(),
mu, mu_,
sigma, sigma_,
volFlowRate, volFlowRate,
rhoAv, rhoAv,
Urel, Urel,
@ -207,10 +200,6 @@ void Foam::SprayParcel<ParcelType>::calcBreakup
const label cellI const label cellI
) )
{ {
typedef typename TrackData::cloudType::reactingCloudType reactingCloudType;
const CompositionModel<reactingCloudType>& composition =
td.cloud().composition();
typedef typename TrackData::cloudType cloudType; typedef typename TrackData::cloudType cloudType;
typedef typename cloudType::parcelType parcelType; typedef typename cloudType::parcelType parcelType;
typedef typename cloudType::forceType forceType; typedef typename cloudType::forceType forceType;
@ -223,14 +212,6 @@ void Foam::SprayParcel<ParcelType>::calcBreakup
solveTABEq(td, dt); solveTABEq(td, dt);
} }
// cell state info is updated in ReactingParcel calc
const scalarField& Y(this->Y());
scalarField X(composition.liquids().X(Y));
scalar rho = composition.liquids().rho(this->pc(), this->T(), X);
scalar mu = composition.liquids().mu(this->pc(), this->T(), X);
scalar sigma = composition.liquids().sigma(this->pc(), this->T(), X);
// Average molecular weight of carrier mix - assumes perfect gas // Average molecular weight of carrier mix - assumes perfect gas
scalar Wc = this->rhoc()*specie::RR*this->Tc()/this->pc(); scalar Wc = this->rhoc()*specie::RR*this->Tc()/this->pc();
scalar R = specie::RR/Wc; scalar R = specie::RR/Wc;
@ -266,9 +247,9 @@ void Foam::SprayParcel<ParcelType>::calcBreakup
this->y(), this->y(),
this->yDot(), this->yDot(),
this->d0(), this->d0(),
rho, this->rho(),
mu, mu_,
sigma, sigma_,
this->U(), this->U(),
rhoAv, rhoAv,
muAv, muAv,
@ -287,7 +268,7 @@ void Foam::SprayParcel<ParcelType>::calcBreakup
SprayParcel<ParcelType>* child = new SprayParcel<ParcelType>(*this); SprayParcel<ParcelType>* child = new SprayParcel<ParcelType>(*this);
child->mass0() = massChild; child->mass0() = massChild;
child->d() = dChild; child->d() = dChild;
child->nParticle() = massChild/rho*this->volume(dChild); child->nParticle() = massChild/this->rho()*this->volume(dChild);
const forceSuSp Fcp = const forceSuSp Fcp =
forces.calcCoupled(*child, dt, massChild, Re, muAv); forces.calcCoupled(*child, dt, massChild, Re, muAv);
@ -447,6 +428,8 @@ Foam::SprayParcel<ParcelType>::SprayParcel(const SprayParcel<ParcelType>& p)
ParcelType(p), ParcelType(p),
d0_(p.d0_), d0_(p.d0_),
position0_(p.position0_), position0_(p.position0_),
sigma_(p.sigma_),
mu_(p.mu_),
liquidCore_(p.liquidCore_), liquidCore_(p.liquidCore_),
KHindex_(p.KHindex_), KHindex_(p.KHindex_),
y_(p.y_), y_(p.y_),
@ -469,6 +452,8 @@ Foam::SprayParcel<ParcelType>::SprayParcel
ParcelType(p, mesh), ParcelType(p, mesh),
d0_(p.d0_), d0_(p.d0_),
position0_(p.position0_), position0_(p.position0_),
sigma_(p.sigma_),
mu_(p.mu_),
liquidCore_(p.liquidCore_), liquidCore_(p.liquidCore_),
KHindex_(p.KHindex_), KHindex_(p.KHindex_),
y_(p.y_), y_(p.y_),

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -59,6 +59,74 @@ class SprayParcel
public ParcelType public ParcelType
{ {
public:
//- Class to hold reacting particle constant properties
class constantProperties
:
public ParcelType::constantProperties
{
// Private data
//- Particle initial surface tension [N/m]
scalar sigma0_;
//- Particle initial dynamic viscosity [Pa.s]
scalar mu0_;
public:
// Constructors
//- Null constructor
constantProperties();
//- Copy constructor
constantProperties(const constantProperties& cp);
//- Constructor from dictionary
constantProperties
(
const dictionary& parentDict,
const bool readFields = true
);
//- Construct from components
constantProperties
(
const label parcelTypeId,
const scalar rhoMin,
const scalar rho0,
const scalar minParticleMass,
const scalar youngsModulus,
const scalar poissonsRatio,
const scalar T0,
const scalar TMin,
const scalar TMax,
const scalar Cp0,
const scalar epsilon0,
const scalar f0,
const scalar Pr,
const scalar pMin,
const Switch& constantVolume,
const scalar Tvap,
const scalar Tbp,
const scalar sigma0,
const scalar mu0
);
// Access
//- Return const access to the initial surface tension
inline scalar sigma0() const;
//- Return const access to the initial dynamic viscosity
inline scalar mu0() const;
};
protected: protected:
// Protected data // Protected data
@ -71,6 +139,12 @@ protected:
//- Injection position //- Injection position
vector position0_; vector position0_;
//- Liquid surface tension [N/m]
scalar sigma_;
//- Liquid dynamic viscosity [Pa.s]
scalar mu_;
//- Part of liquid core ( >0.5=liquid, <0.5=droplet ) //- Part of liquid core ( >0.5=liquid, <0.5=droplet )
scalar liquidCore_; scalar liquidCore_;
@ -219,6 +293,12 @@ public:
//- Return const access to initial droplet position //- Return const access to initial droplet position
inline const vector& position0() const; inline const vector& position0() const;
//- Return const access to the liquid surface tension
inline scalar sigma() const;
//- Return const access to the liquid dynamic viscosity
inline scalar mu() const;
//- Return const access to liquid core //- Return const access to liquid core
inline scalar liquidCore() const; inline scalar liquidCore() const;
@ -255,6 +335,12 @@ public:
//- Return access to initial droplet position //- Return access to initial droplet position
inline vector& position0(); inline vector& position0();
//- Return access to the liquid surface tension
inline scalar& sigma();
//- Return access to the liquid dynamic viscosity
inline scalar& mu();
//- Return access to liquid core //- Return access to liquid core
inline scalar& liquidCore(); inline scalar& liquidCore();

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -25,6 +25,94 @@ License
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
template<class ParcelType>
inline Foam::SprayParcel<ParcelType>::constantProperties::constantProperties()
:
ParcelType::constantProperties(),
sigma0_(0.0),
mu0_(0.0)
{}
template<class ParcelType>
inline Foam::SprayParcel<ParcelType>::constantProperties::constantProperties
(
const constantProperties& cp
)
:
ParcelType::constantProperties(cp),
sigma0_(cp.sigma0_),
mu0_(cp.mu0_)
{}
template<class ParcelType>
inline Foam::SprayParcel<ParcelType>::constantProperties::constantProperties
(
const dictionary& parentDict,
const bool readFields
)
:
ParcelType::constantProperties(parentDict, readFields),
sigma0_(0.0),
mu0_(0.0)
{
if (readFields)
{
this->dict().lookup("sigma0") >> sigma0_;
}
}
template<class ParcelType>
inline Foam::SprayParcel<ParcelType>::constantProperties::constantProperties
(
const label parcelTypeId,
const scalar rhoMin,
const scalar rho0,
const scalar minParticleMass,
const scalar youngsModulus,
const scalar poissonsRatio,
const scalar T0,
const scalar TMin,
const scalar TMax,
const scalar Cp0,
const scalar epsilon0,
const scalar f0,
const scalar Pr,
const scalar pMin,
const Switch& constantVolume,
const scalar Tvap,
const scalar Tbp,
const scalar sigma0,
const scalar mu0
)
:
ParcelType::constantProperties
(
parcelTypeId,
rhoMin,
rho0,
minParticleMass,
youngsModulus,
poissonsRatio,
T0,
TMin,
TMax,
Cp0,
epsilon0,
f0,
Pr,
pMin,
constantVolume,
Tvap,
Tbp
),
sigma0_(sigma0),
mu0_(mu0)
{}
template<class ParcelType> template<class ParcelType>
inline Foam::SprayParcel<ParcelType>::SprayParcel inline Foam::SprayParcel<ParcelType>::SprayParcel
( (
@ -38,6 +126,8 @@ inline Foam::SprayParcel<ParcelType>::SprayParcel
ParcelType(mesh, position, cellI, tetFaceI, tetPtI), ParcelType(mesh, position, cellI, tetFaceI, tetPtI),
d0_(this->d()), d0_(this->d()),
position0_(position), position0_(position),
sigma_(0.0),
mu_(0.0),
liquidCore_(0.0), liquidCore_(0.0),
KHindex_(0.0), KHindex_(0.0),
y_(0.0), y_(0.0),
@ -99,6 +189,8 @@ inline Foam::SprayParcel<ParcelType>::SprayParcel
), ),
d0_(d0), d0_(d0),
position0_(position), position0_(position),
sigma_(constProps.sigma0()),
mu_(constProps.mu0()),
liquidCore_(liquidCore), liquidCore_(liquidCore),
KHindex_(KHindex), KHindex_(KHindex),
y_(y), y_(y),
@ -127,6 +219,20 @@ inline const Foam::vector& Foam::SprayParcel<ParcelType>::position0() const
} }
template<class ParcelType>
inline Foam::scalar Foam::SprayParcel<ParcelType>::sigma() const
{
return sigma_;
}
template<class ParcelType>
inline Foam::scalar Foam::SprayParcel<ParcelType>::mu() const
{
return mu_;
}
template<class ParcelType> template<class ParcelType>
inline Foam::scalar Foam::SprayParcel<ParcelType>::liquidCore() const inline Foam::scalar Foam::SprayParcel<ParcelType>::liquidCore() const
{ {
@ -204,6 +310,20 @@ inline Foam::vector& Foam::SprayParcel<ParcelType>::position0()
} }
template<class ParcelType>
inline Foam::scalar& Foam::SprayParcel<ParcelType>::sigma()
{
return sigma_;
}
template<class ParcelType>
inline Foam::scalar& Foam::SprayParcel<ParcelType>::mu()
{
return mu_;
}
template<class ParcelType> template<class ParcelType>
inline Foam::scalar& Foam::SprayParcel<ParcelType>::liquidCore() inline Foam::scalar& Foam::SprayParcel<ParcelType>::liquidCore()
{ {

View File

@ -33,6 +33,8 @@ Foam::string Foam::SprayParcel<ParcelType>::propHeader =
ParcelType::propHeader ParcelType::propHeader
+ " d0" + " d0"
+ " position0" + " position0"
+ " sigma"
+ " mu"
+ " liquidCore" + " liquidCore"
+ " KHindex" + " KHindex"
+ " y" + " y"
@ -57,6 +59,8 @@ Foam::SprayParcel<ParcelType>::SprayParcel
ParcelType(mesh, is, readFields), ParcelType(mesh, is, readFields),
d0_(0.0), d0_(0.0),
position0_(vector::zero), position0_(vector::zero),
sigma_(0.0),
mu_(0.0),
liquidCore_(0.0), liquidCore_(0.0),
KHindex_(0.0), KHindex_(0.0),
y_(0.0), y_(0.0),
@ -74,6 +78,8 @@ Foam::SprayParcel<ParcelType>::SprayParcel
{ {
d0_ = readScalar(is); d0_ = readScalar(is);
is >> position0_; is >> position0_;
sigma_ = readScalar(is);
mu_ = readScalar(is);
liquidCore_ = readScalar(is); liquidCore_ = readScalar(is);
KHindex_ = readScalar(is); KHindex_ = readScalar(is);
y_ = readScalar(is); y_ = readScalar(is);
@ -91,6 +97,8 @@ Foam::SprayParcel<ParcelType>::SprayParcel
reinterpret_cast<char*>(&d0_), reinterpret_cast<char*>(&d0_),
sizeof(d0_) sizeof(d0_)
+ sizeof(position0_) + sizeof(position0_)
+ sizeof(sigma_)
+ sizeof(mu_)
+ sizeof(liquidCore_) + sizeof(liquidCore_)
+ sizeof(KHindex_) + sizeof(KHindex_)
+ sizeof(y_) + sizeof(y_)
@ -154,6 +162,12 @@ void Foam::SprayParcel<ParcelType>::readFields
); );
c.checkFieldIOobject(c, position0); c.checkFieldIOobject(c, position0);
IOField<scalar> sigma(c.fieldIOobject("sigma", IOobject::MUST_READ));
c.checkFieldIOobject(c, sigma);
IOField<scalar> mu(c.fieldIOobject("mu", IOobject::MUST_READ));
c.checkFieldIOobject(c, mu);
IOField<scalar> liquidCore(c.fieldIOobject IOField<scalar> liquidCore(c.fieldIOobject
( (
"liquidCore", IOobject::MUST_READ) "liquidCore", IOobject::MUST_READ)
@ -190,6 +204,8 @@ void Foam::SprayParcel<ParcelType>::readFields
SprayParcel<ParcelType>& p = iter(); SprayParcel<ParcelType>& p = iter();
p.d0_ = d0[i]; p.d0_ = d0[i];
p.position0_ = position0[i]; p.position0_ = position0[i];
p.sigma_ = sigma[i];
p.mu_ = mu[i];
p.liquidCore_ = liquidCore[i]; p.liquidCore_ = liquidCore[i];
p.KHindex_ = KHindex[i]; p.KHindex_ = KHindex[i];
p.y_ = y[i]; p.y_ = y[i];
@ -230,6 +246,8 @@ void Foam::SprayParcel<ParcelType>::writeFields
c.fieldIOobject("position0", IOobject::NO_READ), c.fieldIOobject("position0", IOobject::NO_READ),
np np
); );
IOField<scalar> sigma(c.fieldIOobject("sigma", IOobject::NO_READ), np);
IOField<scalar> mu(c.fieldIOobject("mu", IOobject::NO_READ), np);
IOField<scalar> liquidCore IOField<scalar> liquidCore
( (
c.fieldIOobject("liquidCore", IOobject::NO_READ), c.fieldIOobject("liquidCore", IOobject::NO_READ),
@ -254,6 +272,8 @@ void Foam::SprayParcel<ParcelType>::writeFields
const SprayParcel<ParcelType>& p = iter(); const SprayParcel<ParcelType>& p = iter();
d0[i] = p.d0_; d0[i] = p.d0_;
position0[i] = p.position0_; position0[i] = p.position0_;
sigma[i] = p.sigma_;
mu[i] = p.mu_;
liquidCore[i] = p.liquidCore_; liquidCore[i] = p.liquidCore_;
KHindex[i] = p.KHindex_; KHindex[i] = p.KHindex_;
y[i] = p.y_; y[i] = p.y_;
@ -268,6 +288,8 @@ void Foam::SprayParcel<ParcelType>::writeFields
d0.write(); d0.write();
position0.write(); position0.write();
sigma.write();
mu.write();
liquidCore.write(); liquidCore.write();
KHindex.write(); KHindex.write();
y.write(); y.write();
@ -294,6 +316,8 @@ Foam::Ostream& Foam::operator<<
os << static_cast<const ParcelType&>(p) os << static_cast<const ParcelType&>(p)
<< token::SPACE << p.d0() << token::SPACE << p.d0()
<< token::SPACE << p.position0() << token::SPACE << p.position0()
<< token::SPACE << p.sigma()
<< token::SPACE << p.mu()
<< token::SPACE << p.liquidCore() << token::SPACE << p.liquidCore()
<< token::SPACE << p.KHindex() << token::SPACE << p.KHindex()
<< token::SPACE << p.y() << token::SPACE << p.y()
@ -312,6 +336,8 @@ Foam::Ostream& Foam::operator<<
reinterpret_cast<const char*>(&p.d0_), reinterpret_cast<const char*>(&p.d0_),
sizeof(p.d0()) sizeof(p.d0())
+ sizeof(p.position0()) + sizeof(p.position0())
+ sizeof(p.sigma())
+ sizeof(p.mu())
+ sizeof(p.liquidCore()) + sizeof(p.liquidCore())
+ sizeof(p.KHindex()) + sizeof(p.KHindex())
+ sizeof(p.y()) + sizeof(p.y())

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -32,6 +32,7 @@ License
#include "makeParcelDispersionModels.H" #include "makeParcelDispersionModels.H"
#include "makeSprayParcelInjectionModels.H" // Spray variant #include "makeSprayParcelInjectionModels.H" // Spray variant
#include "makeParcelPatchInteractionModels.H" #include "makeParcelPatchInteractionModels.H"
#include "makeSprayParcelStochasticCollisionModels.H" // Spray variant
// Thermodynamic // Thermodynamic
#include "makeParcelHeatTransferModels.H" #include "makeParcelHeatTransferModels.H"
@ -44,7 +45,6 @@ License
// Spray // Spray
#include "makeSprayParcelAtomizationModels.H" #include "makeSprayParcelAtomizationModels.H"
#include "makeSprayParcelBreakupModels.H" #include "makeSprayParcelBreakupModels.H"
#include "makeSprayParcelCollisionModels.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -57,6 +57,7 @@ namespace Foam
makeParcelDispersionModels(basicSprayCloud); makeParcelDispersionModels(basicSprayCloud);
makeSprayParcelInjectionModels(basicSprayCloud); makeSprayParcelInjectionModels(basicSprayCloud);
makeParcelPatchInteractionModels(basicSprayCloud); makeParcelPatchInteractionModels(basicSprayCloud);
makeSprayParcelStochasticCollisionModels(basicSprayCloud);
// Thermo sub-models // Thermo sub-models
makeParcelHeatTransferModels(basicSprayCloud); makeParcelHeatTransferModels(basicSprayCloud);
@ -69,7 +70,6 @@ namespace Foam
// Spray sub-models // Spray sub-models
makeSprayParcelAtomizationModels(basicSprayCloud); makeSprayParcelAtomizationModels(basicSprayCloud);
makeSprayParcelBreakupModels(basicSprayCloud); makeSprayParcelBreakupModels(basicSprayCloud);
makeSprayParcelCollisionModels(basicSprayCloud);
}; };

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -23,8 +23,8 @@ License
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
#ifndef makeSprayParcelCollisionModels_H #ifndef makeSprayParcelStochasticCollisionModels_H
#define makeSprayParcelCollisionModels_H #define makeSprayParcelStochasticCollisionModels_H
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -34,7 +34,7 @@ License
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#define makeSprayParcelCollisionModels(CloudType) \ #define makeSprayParcelStochasticCollisionModels(CloudType) \
\ \
makeStochasticCollisionModel(CloudType); \ makeStochasticCollisionModel(CloudType); \
makeStochasticCollisionModelType(NoStochasticCollision, CloudType); \ makeStochasticCollisionModelType(NoStochasticCollision, CloudType); \

View File

@ -24,150 +24,120 @@ License
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
#include "ORourkeCollision.H" #include "ORourkeCollision.H"
#include "mathematicalConstants.H"
#include "SLGThermo.H"
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // using namespace Foam::constant::mathematical;
// * * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * //
template<class CloudType> template<class CloudType>
Foam::ORourkeCollision<CloudType>::ORourkeCollision void Foam::ORourkeCollision<CloudType>::collide(const scalar dt)
( {
const dictionary& dict, label i = 0;
CloudType& owner forAllIter(typename CloudType, this->owner(), iter1)
) {
: label j = 0;
StochasticCollisionModel<CloudType>(dict, owner, typeName), forAllIter(typename CloudType, this->owner(), iter2)
coalescence_(this->coeffDict().lookup("coalescence")) {
{} if (j > i)
{
parcelType& p1 = iter1();
parcelType& p2 = iter2();
scalar m1 = p1.nParticle()*p1.mass();
scalar m2 = p2.nParticle()*p2.mass();
bool massChanged = collideParcels(dt, p1, p2, m1, m2);
if (massChanged)
{
if (m1 > ROOTVSMALL)
{
const scalarField X(liquids_.X(p1.Y()));
p1.rho() = liquids_.rho(p1.pc(), p1.T(), X);
p1.Cp() = liquids_.Cp(p1.pc(), p1.T(), X);
p1.sigma() = liquids_.sigma(p1.pc(), p1.T(), X);
p1.mu() = liquids_.mu(p1.pc(), p1.T(), X);
p1.d() = cbrt(6.0*m1/(p1.nParticle()*p1.rho()*pi));
}
if (m2 > ROOTVSMALL)
{
const scalarField X(liquids_.X(p2.Y()));
p2.rho() = liquids_.rho(p2.pc(), p2.T(), X);
p2.Cp() = liquids_.Cp(p2.pc(), p2.T(), X);
p2.sigma() = liquids_.sigma(p2.pc(), p2.T(), X);
p2.mu() = liquids_.mu(p2.pc(), p2.T(), X);
p2.d() = cbrt(6.0*m2/(p2.nParticle()*p2.rho()*pi));
}
}
}
j++;
}
i++;
}
// remove coalesced parcels that fall below minimum mass threshold
forAllIter(typename CloudType, this->owner(), iter)
{
parcelType& p = iter();
scalar mass = p.nParticle()*p.mass();
if (mass < this->owner().constProps().minParticleMass())
{
this->owner().deleteParticle(p);
}
}
}
template<class CloudType> template<class CloudType>
Foam::ORourkeCollision<CloudType>::ORourkeCollision bool Foam::ORourkeCollision<CloudType>::collideParcels
(
const ORourkeCollision<CloudType>& cm
)
:
StochasticCollisionModel<CloudType>(cm),
coalescence_(cm.coalescence_)
{}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
template<class CloudType>
Foam::ORourkeCollision<CloudType>::~ORourkeCollision()
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template<class CloudType>
bool Foam::ORourkeCollision<CloudType>::update
( (
const scalar dt, const scalar dt,
cachedRandom& rndGen, parcelType& p1,
vector& pos1, parcelType& p2,
scalar& m1, scalar& m1,
scalar& d1, scalar& m2
scalar& N1, )
vector& U1,
scalar& rho1,
scalar& T1,
scalarField& Y1,
const scalar sigma1,
const label celli,
const scalar voli,
vector& pos2,
scalar& m2,
scalar& d2,
scalar& N2,
vector& U2,
scalar& rho2,
scalar& T2,
scalarField& Y2,
const scalar sigma2,
const label cellj,
const scalar volj
) const
{ {
const label cell1 = p1.cell();
const label cell2 = p2.cell();
// check if parcels belong to same cell // check if parcels belong to same cell
if ((celli != cellj) || (m1 < VSMALL) || (m2 < VSMALL)) if ((cell1 != cell2) || (m1 < ROOTVSMALL) || (m2 < ROOTVSMALL))
{ {
return false; return false;
} }
bool coalescence = false; bool coalescence = false;
scalar magVrel = mag(U1-U2); const scalar Vc = this->owner().mesh().V()[cell1];
const scalar d1 = p1.d();
const scalar d2 = p2.d();
scalar magUrel = mag(p1.U() - p2.U());
scalar sumD = d1 + d2; scalar sumD = d1 + d2;
scalar nu0 = 0.25*constant::mathematical::pi*sumD*sumD*magVrel*dt/volj; scalar nu0 = 0.25*constant::mathematical::pi*sqr(sumD)*magUrel*dt/Vc;
scalar nMin = min(N1, N2); scalar nMin = min(p1.nParticle(), p2.nParticle());
scalar nu = nMin*nu0; scalar nu = nMin*nu0;
scalar collProb = exp(-nu); scalar collProb = exp(-nu);
scalar xx = rndGen.sample01<scalar>(); scalar xx = this->owner().rndGen().template sample01<scalar>();
// collision occurs // collision occurs
if (xx > collProb) if (xx > collProb)
{ {
if (d1 > d2) if (d1 > d2)
{ {
coalescence = collideSorted coalescence = collideSorted(dt, p1, p2, m1, m2);
(
dt,
rndGen,
pos1,
m1,
d1,
N1,
U1,
rho1,
T1,
Y1,
sigma1,
celli,
voli,
pos2,
m2,
d2,
N2,
U2,
rho2,
T2,
Y2,
sigma2,
cellj,
volj
);
} }
else else
{ {
coalescence = collideSorted coalescence = collideSorted(dt, p2, p1, m2, m1);
(
dt,
rndGen,
pos2,
m2,
d2,
N2,
U2,
rho2,
T2,
Y2,
sigma2,
cellj,
volj,
pos1,
m1,
d1,
N1,
U1,
rho1,
T1,
Y1,
sigma1,
celli,
voli
);
} }
} }
return coalescence; return coalescence;
} }
@ -176,85 +146,81 @@ template<class CloudType>
bool Foam::ORourkeCollision<CloudType>::collideSorted bool Foam::ORourkeCollision<CloudType>::collideSorted
( (
const scalar dt, const scalar dt,
cachedRandom& rndGen, parcelType& p1,
vector& pos1, parcelType& p2,
scalar& m1, scalar& m1,
scalar& d1, scalar& m2
scalar& N1, )
vector& U1,
scalar& rho1,
scalar& T1,
scalarField& Y1,
const scalar sigma1,
const label celli,
const scalar voli,
vector& pos2,
scalar& m2,
scalar& d2,
scalar& N2,
vector& U2,
scalar& rho2,
scalar& T2,
scalarField& Y2,
const scalar sigma2,
const label cellj,
const scalar volj
) const
{ {
bool coalescence = false; bool coalescence = false;
vector vRel = U1 - U2; const scalar sigma1 = p1.sigma();
scalar magVRel = mag(vRel); const scalar sigma2 = p2.sigma();
scalar mdMin = m2/N2; const scalar d1 = p1.d();
const scalar d2 = p2.d();
const scalar T1 = p1.T();
const scalar T2 = p2.T();
const scalar rho1 = p1.rho();
const scalar rho2 = p2.rho();
const vector& U1 = p1.U();
const vector& U2 = p2.U();
const label& nP1 = p1.nParticle();
const label& nP2 = p2.nParticle();
vector URel = U1 - U2;
scalar magURel = mag(URel);
scalar mTot = m1 + m2; scalar mTot = m1 + m2;
scalar gamma = d1/max(d2, 1.0e-12); scalar gamma = d1/max(ROOTVSMALL, d2);
scalar f = gamma*gamma*gamma + 2.7*gamma - 2.4*gamma*gamma; scalar f = pow3(gamma) + 2.7*gamma - 2.4*sqr(gamma);
vector momMax = m1*U1; // mass-averaged temperature
vector momMin = m2*U2; scalar Tave = (T1*m1 + T2*m2)/mTot;
// use mass-averaged temperature to calculate We number // interpolate to find average surface tension
scalar Tm = (T1*m1 + T2*m2)/mTot; scalar sigmaAve = sigma1 + (sigma2 - sigma1)*(Tave - T1)/(T2 - T1);
// interpolate the averaged surface tension
scalar sigma = sigma1 + (sigma2 - sigma1)*(Tm - T1)/(T2 - T1);
sigma = max(1.0e-6, sigma);
scalar Vtot = m1/rho1 + m2/rho2; scalar Vtot = m1/rho1 + m2/rho2;
scalar rho = mTot/Vtot; scalar rhoAve = mTot/Vtot;
scalar dMean = sqrt(d1*d2); scalar dAve = sqrt(d1*d2);
scalar WeColl = max(1.0e-12, 0.5*rho*magVRel*magVRel*dMean/sigma); scalar WeColl = 0.5*rhoAve*sqr(magURel)*dAve/max(ROOTVSMALL, sigmaAve);
scalar coalesceProb = min(1.0, 2.4*f/WeColl); scalar coalesceProb = min(1.0, 2.4*f/max(ROOTVSMALL, WeColl));
scalar prob = rndGen.sample01<scalar>(); scalar prob = this->owner().rndGen().template sample01<scalar>();
// Coalescence // Coalescence
if (prob < coalesceProb && coalescence_) if (prob < coalesceProb && coalescence_)
{ {
coalescence = true; coalescence = true;
// How 'many' of the droplets coalesce
scalar nProb = prob*N2/N1;
// Conservation of mass, momentum and energy // number of the droplets that coalesce
scalar m2Org = m2; scalar nProb = prob*nP2/nP1;
scalar dm = N1*nProb*mdMin;
m2 -= dm;
scalar V2 = constant::mathematical::pi*pow3(d2)/6.0;
N2 = m2/(rho2*V2);
// conservation of mass, momentum and energy
scalar m1Org = m1; scalar m1Org = m1;
scalar m2Org = m2;
scalar dm = nP1*nProb*m2/scalar(nP2);
m1 += dm; m1 += dm;
T1 = (Tm*mTot - m2*T2)/m1; m2 -= dm;
U1 =(momMax + (1.0 - m2/m2Org)*momMin)/m1; p1.T() = (Tave*mTot - m2*T2)/m1;
// update the liquid mass fractions p1.U() = (m1*U1 + (1.0 - m2/m2Org)*m2*U2)/m1;
Y1 = (m1Org*Y1 + dm*Y2)/m1;
p1.Y() = (m1Org*p1.Y() + dm*p2.Y())/m1;
p2.nParticle() = m2/(rho2*p2.volume());
} }
// Grazing collision (no coalescence) // Grazing collision (no coalescence)
else else
@ -271,28 +237,65 @@ bool Foam::ORourkeCollision<CloudType>::collideSorted
// and these parcels should have coalesced // and these parcels should have coalesced
gf = max(0.0, gf); gf = max(0.0, gf);
// gf -> 1 => v1p -> p1().U() ... // gf -> 1 => v1p -> U1 ...
// gf -> 0 => v1p -> momentum/(m1+m2) // gf -> 0 => v1p -> momentum/mTot
vector mr = m1*U1 + m2*U2; vector mr = m1*U1 + m2*U2;
vector v1p = (mr + m2*gf*vRel)/(m1+m2); vector v1p = (mr + m2*gf*URel)/mTot;
vector v2p = (mr - m1*gf*vRel)/(m1+m2); vector v2p = (mr - m1*gf*URel)/mTot;
if (N1 < N2) if (nP1 < nP2)
{ {
U1 = v1p; p1.U() = v1p;
U2 = (N1*v2p + (N2-N1)*U2)/N2; p2.U() = (nP1*v2p + (nP2 - nP1)*U2)/nP2;
} }
else else
{ {
U1 = (N2*v1p + (N1-N2)*U1)/N1; p1.U() = (nP2*v1p + (nP1 - nP2)*U1)/nP1;
U2 = v2p; p2.U() = v2p;
} }
} }
return coalescence; return coalescence;
} }
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
template<class CloudType>
Foam::ORourkeCollision<CloudType>::ORourkeCollision
(
const dictionary& dict,
CloudType& owner,
const word& modelName
)
:
StochasticCollisionModel<CloudType>(dict, owner, modelName),
liquids_
(
owner.db().template lookupObject<SLGThermo>("SLGThermo").liquids()
),
coalescence_(this->coeffDict().lookup("coalescence"))
{}
template<class CloudType>
Foam::ORourkeCollision<CloudType>::ORourkeCollision
(
const ORourkeCollision<CloudType>& cm
)
:
StochasticCollisionModel<CloudType>(cm),
liquids_(cm.liquids_),
coalescence_(cm.coalescence_)
{}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
template<class CloudType>
Foam::ORourkeCollision<CloudType>::~ORourkeCollision()
{}
// ************************************************************************* // // ************************************************************************* //

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -34,6 +34,7 @@ Description
#define ORourkeCollision_H #define ORourkeCollision_H
#include "StochasticCollisionModel.H" #include "StochasticCollisionModel.H"
#include "liquidMixtureProperties.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -48,11 +49,45 @@ class ORourkeCollision
: :
public StochasticCollisionModel<CloudType> public StochasticCollisionModel<CloudType>
{ {
private: protected:
dictionary coeffsDict_; // Protected Data
//- Convenience typedef to the cloud's parcel type
typedef typename CloudType::parcelType parcelType;
const liquidMixtureProperties& liquids_;
//- Coalescence activation switch
Switch coalescence_; Switch coalescence_;
// Protected Member Functions
//- Main collision routine
virtual void collide(const scalar dt);
//- Collide parcels and return true if mass has changed
virtual bool collideParcels
(
const scalar dt,
parcelType& p1,
parcelType& p2,
scalar& m1,
scalar& m2
);
// 1 is the larger drop and 2 is the smaller
virtual bool collideSorted
(
const scalar dt,
parcelType& p1,
parcelType& p2,
scalar& m1,
scalar& m2
);
public: public:
//- Runtime type information //- Runtime type information
@ -62,7 +97,12 @@ public:
// Constructors // Constructors
//- Construct from dictionary //- Construct from dictionary
ORourkeCollision(const dictionary& dict, CloudType& cloud); ORourkeCollision
(
const dictionary& dict,
CloudType& cloud,
const word& modelName = typeName
);
//- Construct copy //- Construct copy
ORourkeCollision(const ORourkeCollision<CloudType>& cm); ORourkeCollision(const ORourkeCollision<CloudType>& cm);
@ -79,67 +119,6 @@ public:
//- Destructor //- Destructor
virtual ~ORourkeCollision(); virtual ~ORourkeCollision();
// Member Functions
virtual bool update
(
const scalar dt,
cachedRandom& rndGen,
vector& pos1,
scalar& m1,
scalar& d1,
scalar& N1,
vector& U,
scalar& rho1,
scalar& T1,
scalarField& Y1,
const scalar sigma1,
const label celli,
const scalar voli,
vector& pos2,
scalar& m2,
scalar& d2,
scalar& N2,
vector& U2,
scalar& rho2,
scalar& T2,
scalarField& Y2,
const scalar sigma2,
const label cellj,
const scalar volj
) const;
// 1 is the larger drop and 2 is the smaller
bool collideSorted
(
const scalar dt,
cachedRandom& rndGen,
vector& pos1,
scalar& m1,
scalar& d1,
scalar& N1,
vector& U,
scalar& rho1,
scalar& T1,
scalarField& Y1,
const scalar sigma1,
const label celli,
const scalar voli,
vector& pos2,
scalar& m2,
scalar& d2,
scalar& N2,
vector& U2,
scalar& rho2,
scalar& T2,
scalarField& Y2,
const scalar sigma2,
const label cellj,
const scalar volj
) const;
}; };

View File

@ -25,6 +25,106 @@ License
#include "TrajectoryCollision.H" #include "TrajectoryCollision.H"
// * * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * //
template<class CloudType>
void Foam::TrajectoryCollision<CloudType>::collide(const scalar dt)
{
ORourkeCollision<CloudType>::collide(dt);
}
template<class CloudType>
bool Foam::TrajectoryCollision<CloudType>::collideParcels
(
const scalar dt,
parcelType& p1,
parcelType& p2,
scalar& m1,
scalar& m2
)
{
bool coalescence = false;
const vector& pos1 = p1.position();
const vector& pos2 = p2.position();
const vector& U1 = p1.U();
const vector& U2 = p2.U();
vector URel = U1 - U2;
vector d = pos2 - pos1;
scalar magd = mag(d);
scalar vAlign = URel & (d/(magd + ROOTVSMALL));
if (vAlign > 0)
{
const scalar d1 = p1.d();
const scalar d2 = p2.d();
scalar sumD = d1 + d2;
if (vAlign*dt > magd - 0.5*sumD)
{
scalar magU1 = mag(U1) + ROOTVSMALL;
scalar magU2 = mag(U2) + ROOTVSMALL;
vector n1 = U1/magU1;
vector n2 = U2/magU2;
scalar n1n2 = n1 & n2;
scalar n1d = n1 & d;
scalar n2d = n2 & d;
scalar det = 1.0 - sqr(n1n2);
scalar alpha = GREAT;
scalar beta = GREAT;
if (mag(det) > 1.0e-4)
{
beta = -(n2d - n1n2*n1d)/det;
alpha = n1d + n1n2*beta;
}
alpha /= magU1*dt;
beta /= magU2*dt;
// is collision possible within this timestep
if ((alpha > 0) && (alpha < 1.0) && (beta > 0) && (beta < 1.0))
{
vector p1c = pos1 + alpha*U1*dt;
vector p2c = pos2 + beta*U2*dt;
scalar closestDist = mag(p1c - p2c);
scalar collProb =
pow(0.5*sumD/max(0.5*sumD, closestDist), cSpace_)
*exp(-cTime_*mag(alpha - beta));
scalar xx = this->owner().rndGen().template sample01<scalar>();
// collision occurs
if (xx > collProb)
{
if (d1 > d2)
{
coalescence = this->collideSorted(dt, p1, p2, m1, m2);
}
else
{
coalescence = this->collideSorted(dt, p2, p1, m2, m1);
}
}
}
}
}
return coalescence;
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
template<class CloudType> template<class CloudType>
@ -34,10 +134,9 @@ Foam::TrajectoryCollision<CloudType>::TrajectoryCollision
CloudType& owner CloudType& owner
) )
: :
StochasticCollisionModel<CloudType>(dict, owner, typeName), ORourkeCollision<CloudType>(dict, owner, typeName),
cSpace_(readScalar(this->coeffDict().lookup("cSpace"))), cSpace_(readScalar(this->coeffDict().lookup("cSpace"))),
cTime_(readScalar(this->coeffDict().lookup("cTime"))), cTime_(readScalar(this->coeffDict().lookup("cTime")))
coalescence_(this->coeffDict().lookup("coalescence"))
{} {}
@ -47,10 +146,9 @@ Foam::TrajectoryCollision<CloudType>::TrajectoryCollision
const TrajectoryCollision<CloudType>& cm const TrajectoryCollision<CloudType>& cm
) )
: :
StochasticCollisionModel<CloudType>(cm), ORourkeCollision<CloudType>(cm),
cSpace_(cm.cSpace_), cSpace_(cm.cSpace_),
cTime_(cm.cTime_), cTime_(cm.cTime_)
coalescence_(cm.coalescence_)
{} {}
@ -61,283 +159,4 @@ Foam::TrajectoryCollision<CloudType>::~TrajectoryCollision()
{} {}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template<class CloudType>
bool Foam::TrajectoryCollision<CloudType>::update
(
const scalar dt,
cachedRandom& rndGen,
vector& pos1,
scalar& m1,
scalar& d1,
scalar& N1,
vector& U1,
scalar& rho1,
scalar& T1,
scalarField& Y1,
const scalar sigma1,
const label celli,
const scalar voli,
vector& pos2,
scalar& m2,
scalar& d2,
scalar& N2,
vector& U2,
scalar& rho2,
scalar& T2,
scalarField& Y2,
const scalar sigma2,
const label cellj,
const scalar volj
) const
{
bool coalescence = false;
vector vRel = U1 - U2;
vector p = pos2 - pos1;
scalar dist = mag(p);
scalar vAlign = vRel & (p/(dist + SMALL));
if (vAlign > 0)
{
scalar sumD = d1 + d2;
if (vAlign*dt > dist - 0.5*sumD)
{
scalar v1Mag = mag(U1);
scalar v2Mag = mag(U2);
vector nv1 = U1/v1Mag;
vector nv2 = U2/v2Mag;
scalar v1v2 = nv1 & nv2;
scalar v1p = nv1 & p;
scalar v2p = nv2 & p;
scalar det = 1.0 - v1v2*v1v2;
scalar alpha = 1.0e+20;
scalar beta = 1.0e+20;
if (mag(det) > 1.0e-4)
{
beta = -(v2p - v1v2*v1p)/det;
alpha = v1p + v1v2*beta;
}
alpha /= v1Mag*dt;
beta /= v2Mag*dt;
// is collision possible within this timestep
if ((alpha>0) && (alpha<1.0) && (beta>0) && (beta<1.0))
{
vector p1c = pos1 + alpha*U1*dt;
vector p2c = pos2 + beta*U2*dt;
scalar closestDist = mag(p1c-p2c);
scalar collProb =
pow(0.5*sumD/max(0.5*sumD, closestDist), cSpace_)
* exp(-cTime_*mag(alpha-beta));
scalar xx = rndGen.sample01<scalar>();
// collision occur
if ((xx < collProb) && (m1 > VSMALL) && (m2 > VSMALL))
{
if (d1 > d2)
{
coalescence = collideSorted
(
dt,
rndGen,
pos1,
m1,
d1,
N1,
U1,
rho1,
T1,
Y1,
sigma1,
celli,
voli,
pos2,
m2,
d2,
N2,
U2,
rho2,
T2,
Y2,
sigma2,
cellj,
volj
);
}
else
{
coalescence = collideSorted
(
dt,
rndGen,
pos2,
m2,
d2,
N2,
U2,
rho2,
T2,
Y2,
sigma2,
cellj,
volj,
pos1,
m1,
d1,
N1,
U1,
rho1,
T1,
Y1,
sigma1,
celli,
voli
);
}
}
}
}
}
return coalescence;
}
template<class CloudType>
bool Foam::TrajectoryCollision<CloudType>::collideSorted
(
const scalar dt,
cachedRandom& rndGen,
vector& pos1,
scalar& m1,
scalar& d1,
scalar& N1,
vector& U1,
scalar& rho1,
scalar& T1,
scalarField& Y1,
const scalar sigma1,
const label celli,
const scalar voli,
vector& pos2,
scalar& m2,
scalar& d2,
scalar& N2,
vector& U2,
scalar& rho2,
scalar& T2,
scalarField& Y2,
const scalar sigma2,
const label cellj,
const scalar volj
) const
{
bool coalescence = false;
vector vRel = U1 - U2;
scalar mdMin = m2/N2;
scalar mTot = m1 + m2;
scalar gamma = d1/max(d2, 1.0e-12);
scalar f = gamma*gamma*gamma + 2.7*gamma - 2.4*gamma*gamma;
vector momMax = m1*U1;
vector momMin = m2*U2;
// use mass-averaged temperature to calculate We number
scalar Tm = (T1*m1 + T2*m2)/mTot;
// and mass averaged fractions ...
//scalarField Yav((m1*Y1 + m2*Y2)/mTot;
// interpolate the averaged surface tension
scalar sigma = sigma1 + (sigma2 - sigma1)*(Tm - T1)/(T2 - T1);
sigma = max(1.0e-6, sigma);
scalar Vtot = m1/rho1 + m2/rho2;
scalar rho = mTot/Vtot;
scalar dMean = sqrt(d1*d2);
scalar WeColl = max(1.0e-12, 0.5*rho*magSqr(vRel)*dMean/sigma);
scalar coalesceProb = min(1.0, 2.4*f/WeColl);
scalar prob = rndGen.sample01<scalar>();
// Coalescence
if ( prob < coalesceProb && coalescence_)
{
coalescence = true;
// How 'many' of the droplets coalesce
scalar nProb = prob*N2/N1;
// Conservation of mass, momentum and energy
scalar m2Org = m2;
scalar dm = N1*nProb*mdMin;
m2 -= dm;
scalar V2 = constant::mathematical::pi*pow3(d2)/6.0;
N2 = m2/(rho2*V2);
scalar m1Org = m1;
m1 += dm;
T1 = (Tm*mTot - m2*T2)/m1;
U1 =(momMax + (1.0 - m2/m2Org)*momMin)/m1;
// update the liquid mass fractions
Y1 = (m1Org*Y1 + dm*Y2)/m1;
}
// Grazing collision (no coalescence)
else
{
scalar gf = sqrt(prob) - sqrt(coalesceProb);
scalar denom = 1.0 - sqrt(coalesceProb);
if (denom < 1.0e-5)
{
denom = 1.0;
}
gf /= denom;
// if gf negative, this means that coalescence is turned off
// and these parcels should have coalesced
gf = max(0.0, gf);
// gf -> 1 => v1p -> p1().U() ...
// gf -> 0 => v1p -> momentum/(m1 + m2)
vector mr = m1*U1 + m2*U2;
vector v1p = (mr + m2*gf*vRel)/(m1 + m2);
vector v2p = (mr - m1*gf*vRel)/(m1 + m2);
if (N1 < N2)
{
U1 = v1p;
U2 = (N1*v2p + (N2 - N1)*U2)/N2;
}
else
{
U1 = (N2*v1p + (N1 - N2)*U1)/N1;
U2 = v2p;
}
}
return coalescence;
}
// ************************************************************************* // // ************************************************************************* //

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -25,14 +25,15 @@ Class
Foam::TrajectoryCollision Foam::TrajectoryCollision
Description Description
Trajectory collision model by N. Nordin. Trajectory collision model by N. Nordin, based on O'Rourke's collision
model
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
#ifndef TrajectoryCollision_H #ifndef TrajectoryCollision_H
#define TrajectoryCollision_H #define TrajectoryCollision_H
#include "StochasticCollisionModel.H" #include "ORourkeCollision.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -45,15 +46,36 @@ namespace Foam
template<class CloudType> template<class CloudType>
class TrajectoryCollision class TrajectoryCollision
: :
public StochasticCollisionModel<CloudType> public ORourkeCollision<CloudType>
{ {
private: protected:
// Private data // Protected Data
//- Convenience typedef to the cloud's parcel type
typedef typename CloudType::parcelType parcelType;
//- Space coefficient
scalar cSpace_; scalar cSpace_;
//- Time coefficient
scalar cTime_; scalar cTime_;
Switch coalescence_;
// Protected Member Functions
//- Main collision routine
virtual void collide(const scalar dt);
//- Collide parcels and return true if mass has changed
virtual bool collideParcels
(
const scalar dt,
parcelType& p1,
parcelType& p2,
scalar& m1,
scalar& m2
);
public: public:
@ -82,66 +104,6 @@ public:
//- Destructor //- Destructor
virtual ~TrajectoryCollision(); virtual ~TrajectoryCollision();
// Member Functions
virtual bool update
(
const scalar dt,
cachedRandom& rndGen,
vector& pos1,
scalar& m1,
scalar& d1,
scalar& N1,
vector& U,
scalar& rho1,
scalar& T1,
scalarField& Y1,
const scalar sigma1,
const label celli,
const scalar voli,
vector& pos2,
scalar& m2,
scalar& d2,
scalar& N2,
vector& U2,
scalar& rho2,
scalar& T2,
scalarField& Y2,
const scalar sigma2,
const label cellj,
const scalar volj
) const;
// 1 is the larger drop and 2 is the smaller
bool collideSorted
(
const scalar dt,
cachedRandom& rndGen,
vector& pos1,
scalar& m1,
scalar& d1,
scalar& N1,
vector& U,
scalar& rho1,
scalar& T1,
scalarField& Y1,
const scalar sigma1,
const label celli,
const scalar voli,
vector& pos2,
scalar& m2,
scalar& d2,
scalar& N2,
vector& U2,
scalar& rho2,
scalar& T2,
scalarField& Y2,
const scalar sigma2,
const label cellj,
const scalar volj
) const;
}; };

View File

@ -918,7 +918,7 @@ Foam::vectorField Foam::autoSnapDriver::calcNearestSurface
<< " coordinate:" << localPoints[pointI] << " coordinate:" << localPoints[pointI]
<< " did not find any surface within:" << " did not find any surface within:"
<< minSnapDist[pointI] << minSnapDist[pointI]
<< " meter." << endl; << " metre." << endl;
} }
} }

View File

@ -133,7 +133,7 @@ void Foam::refinementFeatures::read
{ {
Info<< " level " << levels_[featI][j] Info<< " level " << levels_[featI][j]
<< " for all cells within " << distances_[featI][j] << " for all cells within " << distances_[featI][j]
<< " meter." << endl; << " metre." << endl;
} }
} }
} }

View File

@ -119,7 +119,7 @@ void Foam::shellSurfaces::setAndCheckLevels
{ {
Info<< " level " << levels_[shellI][j] Info<< " level " << levels_[shellI][j]
<< " for all cells within " << distances_[shellI][j] << " for all cells within " << distances_[shellI][j]
<< " meter." << endl; << " metre." << endl;
} }
} }
else else

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -69,7 +69,7 @@ class blockMesh
//- The list of curved edges //- The list of curved edges
curvedEdgeList edges_; curvedEdgeList edges_;
//- The scaling factor to convert to meters //- The scaling factor to convert to metres
scalar scaleFactor_; scalar scaleFactor_;
//- The blocks themselves (the topology) as a polyMesh //- The blocks themselves (the topology) as a polyMesh
@ -171,7 +171,7 @@ public:
return edges_; return edges_;
} }
//- The scaling factor used to convert to meters //- The scaling factor used to convert to metres
scalar scaleFactor() const; scalar scaleFactor() const;
//- The points for the entire mesh //- The points for the entire mesh

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -65,7 +65,7 @@ private:
// Private Member Data // Private Member Data
//- gap size in meter //- gap size in metre
const scalar gap_; const scalar gap_;
//- Underlying geometry (size 1) //- Underlying geometry (size 1)

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -269,7 +269,7 @@ void Foam::topoSet::writeDebug
boundBox bb(pointField(coords, toc()), true); boundBox bb(pointField(coords, toc()), true);
os << "Set bounding box: min = " os << "Set bounding box: min = "
<< bb.min() << " max = " << bb.max() << " meters. " << endl << endl; << bb.min() << " max = " << bb.max() << " metres. " << endl << endl;
label n = 0; label n = 0;

View File

@ -49,7 +49,7 @@ Description
d/dt(fmm) + div(U*fmm) d/dt(fmm) + div(U*fmm)
= =
(1/T)*(M && M - flm) (1/T)*(M && M - fmm)
where where

View File

@ -89,6 +89,8 @@ subModels
phaseChangeModel none; phaseChangeModel none;
stochasticCollisionModel none;
surfaceFilmModel thermoSurfaceFilm; surfaceFilmModel thermoSurfaceFilm;
radiation off; radiation off;

View File

@ -89,6 +89,8 @@ subModels
phaseChangeModel none; phaseChangeModel none;
stochasticCollisionModel none;
surfaceFilmModel thermoSurfaceFilm; surfaceFilmModel thermoSurfaceFilm;
radiation off; radiation off;

View File

@ -89,6 +89,8 @@ subModels
phaseChangeModel none; phaseChangeModel none;
stochasticCollisionModel none;
surfaceFilmModel thermoSurfaceFilm; surfaceFilmModel thermoSurfaceFilm;
radiation off; radiation off;

View File

@ -144,6 +144,8 @@ subModels
surfaceReactionModel none; surfaceReactionModel none;
stochasticCollisionModel none;
surfaceFilmModel none; surfaceFilmModel none;
radiation off; radiation off;

View File

@ -117,6 +117,8 @@ subModels
devolatilisationModel constantRateDevolatilisation; devolatilisationModel constantRateDevolatilisation;
stochasticCollisionModel none;
surfaceReactionModel COxidationKineticDiffusionLimitedRate; surfaceReactionModel COxidationKineticDiffusionLimitedRate;
surfaceFilmModel none; surfaceFilmModel none;

View File

@ -104,6 +104,8 @@ subModels
heatTransferModel RanzMarshall; heatTransferModel RanzMarshall;
stochasticCollisionModel none;
surfaceFilmModel none; surfaceFilmModel none;
radiation on; radiation on;

View File

@ -70,6 +70,8 @@ subModels
heatTransferModel none; heatTransferModel none;
stochasticCollisionModel none;
surfaceFilmModel none; surfaceFilmModel none;
collisionModel pairCollision; collisionModel pairCollision;

View File

@ -80,6 +80,8 @@ subModels
heatTransferModel none; heatTransferModel none;
stochasticCollisionModel none;
surfaceFilmModel none; surfaceFilmModel none;
collisionModel pairCollision; collisionModel pairCollision;

View File

@ -101,6 +101,8 @@ subModels
phaseChangeModel none; phaseChangeModel none;
stochasticCollisionModel none;
surfaceFilmModel thermoSurfaceFilm; surfaceFilmModel thermoSurfaceFilm;
radiation off; radiation off;

View File

@ -123,6 +123,8 @@ subModels
phaseChangeModel none; phaseChangeModel none;
stochasticCollisionModel none;
surfaceFilmModel thermoSurfaceFilm; surfaceFilmModel thermoSurfaceFilm;
radiation off; radiation off;

View File

@ -101,6 +101,8 @@ subModels
phaseChangeModel none; phaseChangeModel none;
stochasticCollisionModel none;
surfaceFilmModel thermoSurfaceFilm; surfaceFilmModel thermoSurfaceFilm;
radiation off; radiation off;

View File

@ -110,6 +110,8 @@ subModels
surfaceReactionModel none; surfaceReactionModel none;
stochasticCollisionModel none;
surfaceFilmModel none; surfaceFilmModel none;
radiation off; radiation off;

View File

@ -118,6 +118,8 @@ subModels
surfaceReactionModel none; surfaceReactionModel none;
stochasticCollisionModel none;
surfaceFilmModel none; surfaceFilmModel none;
radiation off; radiation off;

View File

@ -139,6 +139,8 @@ subModels
surfaceReactionModel none; surfaceReactionModel none;
stochasticCollisionModel none;
surfaceFilmModel none; surfaceFilmModel none;
radiation off; radiation off;

View File

@ -144,6 +144,8 @@ subModels
surfaceReactionModel none; surfaceReactionModel none;
stochasticCollisionModel none;
surfaceFilmModel none; surfaceFilmModel none;
radiation off; radiation off;

View File

@ -161,14 +161,14 @@ subModels
phaseChangeModel liquidEvaporationBoil; phaseChangeModel liquidEvaporationBoil;
stochasticCollisionModel none;
surfaceFilmModel none; surfaceFilmModel none;
atomizationModel none; atomizationModel none;
breakupModel ReitzDiwakar; // ReitzKHRT; breakupModel ReitzDiwakar; // ReitzKHRT;
stochasticCollisionModel none;
radiation off; radiation off;
standardWallInteractionCoeffs standardWallInteractionCoeffs