Commit 9c7afd1b authored by andy's avatar andy
Browse files

EH: Bringing NN's developments up-to-date with main line

parent 8c7edbc0
......@@ -41,7 +41,6 @@ SourceFiles
#ifndef ReactingMultiphaseCloud_H
#define ReactingMultiphaseCloud_H
#include "ReactingCloud.H"
#include "reactingMultiphaseCloud.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
......
......@@ -45,9 +45,6 @@ License
namespace Foam
{
typedef basicReactingCloud::thermoCloudType thermoCloudType2;
typedef basicReactingCloud::kinematicCloudType kinematicCloudType2;
makeParcelCloudFunctionObjects(basicReactingCloud);
// Kinematic sub-models
......
clouds/baseClasses/sprayCloud/sprayCloud.C
SPRAYPARCEL=parcels/derived/BasicSprayParcel
SPRAYPARCEL=parcels/derived/basicSprayParcel
$(SPRAYPARCEL)/defineBasicSprayParcel.C
$(SPRAYPARCEL)/makeBasicSprayParcelSubmodels.C
......
EXE_INC = \
-I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/meshTools/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/radiation/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/properties/liquidProperties/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/properties/liquidMixtureProperties/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/properties/solidProperties/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/properties/solidMixtureProperties/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/reactionThermo/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/pdfs/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/liquids/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/liquidMixture/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/solids/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/solidMixture/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/SLGThermo/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/radiationModels/lnInclude \
-I$(LIB_SRC)/lagrangian/distributionModels/lnInclude \
-I$(LIB_SRC)/lagrangian/basic/lnInclude \
-I$(LIB_SRC)/lagrangian/intermediate/lnInclude \
-I$(LIB_SRC)/turbulenceModels \
-I$(LIB_SRC)/turbulenceModels/compressible/turbulenceModel \
-I$(LIB_SRC)/turbulenceModels/compressible/RAS/lnInclude \
-I$(LIB_SRC)/turbulenceModels/LES/LESdeltas/lnInclude \
-I$(LIB_SRC)/turbulenceModels/compressible/LES/lnInclude
-I$(LIB_SRC)/turbulenceModels/compressible/LES/lnInclude \
-I$(LIB_SRC)/regionModels/regionModel/lnInclude \
-I$(LIB_SRC)/regionModels/surfaceFilmModels/lnInclude \
-I$(LIB_SRC)/dynamicFvMesh/lnInclude \
-I$(LIB_SRC)/sampling/lnInclude
LIB_LIBS = \
-lfiniteVolume \
-lmeshTools \
-ldistributionModels \
-llagrangian \
-llagrangianIntermediate
-llagrangianIntermediate \
-lliquidProperties \
-lliquidMixtureProperties \
-lsolidProperties \
-lsolidMixtureProperties \
-lspecie \
-lbasicThermophysicalModels \
-lreactionThermophysicalModels \
-lSLGThermo \
-lchemistryModel \
-lradiationModels \
-lODE \
-lcompressibleRASModels \
-lcompressibleLESModels \
-ldynamicFvMesh \
-lsurfaceFilmModels
......@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2011 OpenCFD Ltd.
\\ / A nd | Copyright (C) 2011-2011 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
......@@ -27,96 +27,254 @@ License
#include "AtomizationModel.H"
#include "BreakupModel.H"
#include "CollisionModel.H"
#include "PtrList.H"
template<class ParcelType>
void Foam::SprayCloud<ParcelType>::preEvolve()
{
ReactingCloud<ParcelType>::preEvolve();
}
// * * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * //
template<class ParcelType>
void Foam::SprayCloud<ParcelType>::evolveCloud()
template<class CloudType>
void Foam::SprayCloud<CloudType>::setModels()
{
const volScalarField& T = this->carrierThermo().T();
const volScalarField cp = this->carrierThermo().Cp();
const volScalarField& p = this->carrierThermo().p();
autoPtr<interpolation<scalar> > rhoInterp = interpolation<scalar>::New
atomizationModel_.reset
(
this->interpolationSchemes(),
this->rho()
AtomizationModel<SprayCloud<CloudType> >::New
(
this->subModelProperties(),
*this
).ptr()
);
autoPtr<interpolation<vector> > UInterp = interpolation<vector>::New
breakupModel_.reset
(
this->interpolationSchemes(),
this->U()
BreakupModel<SprayCloud<CloudType> >::New
(
this->subModelProperties(),
*this
).ptr()
);
autoPtr<interpolation<scalar> > muInterp = interpolation<scalar>::New
collisionModel_.reset
(
this->interpolationSchemes(),
this->mu()
CollisionModel<SprayCloud<CloudType> >::New
(
this->subModelProperties(),
*this
).ptr()
);
}
autoPtr<interpolation<scalar> > TInterp = interpolation<scalar>::New
(
this->interpolationSchemes(),
T
);
autoPtr<interpolation<scalar> > cpInterp = interpolation<scalar>::New
template<class CloudType>
void Foam::SprayCloud<CloudType>::cloudReset
(
SprayCloud<CloudType>& c
)
{
CloudType::cloudReset(c);
atomizationModel_.reset(c.atomizationModel_.ptr());
breakupModel_.reset(c.breakupModel_.ptr());
collisionModel_.reset(c.collisionModel_.ptr());
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
template<class CloudType>
Foam::SprayCloud<CloudType>::SprayCloud
(
const word& cloudName,
const volScalarField& rho,
const volVectorField& U,
const dimensionedVector& g,
const SLGThermo& thermo,
bool readFields
)
:
CloudType(cloudName, rho, U, g, thermo, false),
sprayCloud(),
cloudCopyPtr_(NULL),
averageParcelMass_(this->injection().averageParcelMass()),
atomizationModel_
(
this->interpolationSchemes(),
cp
);
AtomizationModel<SprayCloud<CloudType> >::New
(
this->particleProperties(),
*this
)
),
breakupModel_
(
BreakupModel<SprayCloud<CloudType> >::New
(
this->particleProperties(),
*this
)
),
collisionModel_
(
CollisionModel<SprayCloud<CloudType> >::New
(
this->particleProperties(),
*this
)
)
{
if (this->solution().active())
{
setModels();
if (readFields)
{
parcelType::readFields(*this, this->composition());
}
}
if (this->solution().resetSourcesOnStartup())
{
resetSourceTerms();
}
Info << " Average parcel mass: " << averageParcelMass_ << endl;
}
template<class CloudType>
Foam::SprayCloud<CloudType>::SprayCloud
(
SprayCloud<CloudType>& c,
const word& name
)
:
CloudType(c, name),
sprayCloud(),
cloudCopyPtr_(NULL),
averageParcelMass_(c.averageParcelMass_),
atomizationModel_(c.atomizationModel_->clone()),
breakupModel_(c.breakupModel_->clone()),
collisionModel_(c.collisionModel_->clone())
{}
template<class CloudType>
Foam::SprayCloud<CloudType>::SprayCloud
(
const fvMesh& mesh,
const word& name,
const SprayCloud<CloudType>& c
)
:
CloudType(mesh, name, c),
sprayCloud(),
cloudCopyPtr_(NULL),
averageParcelMass_(0.0),
atomizationModel_(NULL),
breakupModel_(NULL),
collisionModel_(NULL)
{}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
template<class CloudType>
Foam::SprayCloud<CloudType>::~SprayCloud()
{}
autoPtr<interpolation<scalar> > pInterp = interpolation<scalar>::New
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template<class CloudType>
void Foam::SprayCloud<CloudType>::checkParcelProperties
(
parcelType& parcel,
const scalar lagrangianDt,
const bool fullyDescribed
)
{
CloudType::checkParcelProperties
(
this->interpolationSchemes(),
p
parcel,
lagrangianDt,
fullyDescribed
);
typename ParcelType::trackData td
const scalarField& Y(parcel.Y());
scalarField X(this->composition().liquids().X(Y));
// override rho and cp from constantProperties
parcel.Cp() = this->composition().liquids().Cp(parcel.pc(), parcel.T(), X);
parcel.rho() = this->composition().liquids().rho(parcel.pc(), parcel.T(), X);
// store the injection position and initial drop size
parcel.position0() = parcel.position();
parcel.d0() = parcel.d();
parcel.y() = breakup().y0();
parcel.yDot() = breakup().yDot0();
}
template<class CloudType>
void Foam::SprayCloud<CloudType>::storeState()
{
cloudCopyPtr_.reset
(
*this,
constProps_,
rhoInterp(),
UInterp(),
muInterp(),
TInterp(),
cpInterp(),
pInterp(),
this->g().value()
static_cast<SprayCloud<CloudType>*>
(
clone(this->name() + "Copy").ptr()
)
);
}
template<class CloudType>
void Foam::SprayCloud<CloudType>::restoreState()
{
cloudReset(cloudCopyPtr_());
cloudCopyPtr_.clear();
}
if (this->coupled())
template<class CloudType>
void Foam::SprayCloud<CloudType>::evolve()
{
if (this->solution().canEvolve())
{
resetSourceTerms();
typename parcelType::template
TrackingData<SprayCloud<CloudType> > td(*this);
this->solve(td);
}
}
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 (collision().active())
{
label i = 0;
scalar dt = this->db().time().deltaTValue();
forAllIter(typename Cloud<ParcelType>, *this, iter)
forAllIter(typename SprayCloud<CloudType>, *this, iter)
{
label j = 0;
forAllIter(typename Cloud<ParcelType>, *this, jter)
forAllIter(typename SprayCloud<CloudType>, *this, jter)
{
if (j > i)
{
ParcelType& p = iter();
parcelType& p = iter();
scalar Vi = this->mesh().V()[p.cell()];
scalarField X1(this->composition().liquids().X(p.Y()));
scalar sigma1 = this->composition().liquids().sigma(p.pc(), p.T(), X1);
scalar mp = p.mass()*p.nParticle();
ParcelType& q = jter();
parcelType& q = jter();
scalar Vj = this->mesh().V()[q.cell()];
scalarField X2(this->composition().liquids().X(q.Y()));
scalar sigma2 = this->composition().liquids().sigma(q.pc(), q.T(), X2);
......@@ -158,8 +316,8 @@ void Foam::SprayCloud<ParcelType>::evolveCloud()
{
scalarField Xp(this->composition().liquids().X(p.Y()));
p.rho() = this->composition().liquids().rho(p.pc(), p.T(), Xp);
p.cp() = this->composition().liquids().cp(p.pc(), p.T(), Xp);
scalar rhs = 6.0*mp/(p.nParticle()*p.rho()*mathematicalConstant::pi);
p.Cp() = this->composition().liquids().Cp(p.pc(), p.T(), Xp);
scalar rhs = 6.0*mp/(p.nParticle()*p.rho()*constant::mathematical::pi);
p.d() = pow(rhs, 1.0/3.0);
}
......@@ -167,140 +325,42 @@ void Foam::SprayCloud<ParcelType>::evolveCloud()
{
scalarField Xq(this->composition().liquids().X(q.Y()));
q.rho() = this->composition().liquids().rho(q.pc(), q.T(), Xq);
q.cp() = this->composition().liquids().cp(q.pc(), q.T(), Xq);
scalar rhs = 6.0*mq/(q.nParticle()*q.rho()*mathematicalConstant::pi);
q.Cp() = this->composition().liquids().Cp(q.pc(), q.T(), Xq);
scalar rhs = 6.0*mq/(q.nParticle()*q.rho()*constant::mathematical::pi);
q.d() = pow(rhs, 1.0/3.0);
}
}
}
j++;
}
i++;
}
// remove coalesced particles (diameter set to 0)
forAllIter(typename Cloud<ParcelType>, *this, iter)
forAllIter(typename SprayCloud<CloudType>, *this, iter)
{
ParcelType& p = iter();
parcelType& p = iter();
if (p.mass() < VSMALL)
{
deleteParticle(p);
}
}
}
Cloud<ParcelType>::move(td);
this->injection().inject(td);
}
template<class ParcelType>
void Foam::SprayCloud<ParcelType>::postEvolve()
{
ReactingCloud<ParcelType>::postEvolve();
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
template<class ParcelType>
Foam::SprayCloud<ParcelType>::SprayCloud
template<class CloudType>
Foam::scalar Foam::SprayCloud<CloudType>::D
(
const word& cloudName,
const volScalarField& rho,
const volVectorField& U,
const dimensionedVector& g,
basicThermo& thermo,
bool readFields
)
:
ReactingCloud<ParcelType>(cloudName, rho, U, g, thermo, false),
sprayCloud(),
averageParcelMass_(this->injection().averageParcelMass()),
constProps_(this->particleProperties()),
atomizationModel_
(
AtomizationModel<SprayCloud<ParcelType> >::New
(
this->particleProperties(),
*this
)
),
breakupModel_
(
BreakupModel<SprayCloud<ParcelType> >::New
(
this->particleProperties(),
*this
)
),
collisionModel_
(
CollisionModel<SprayCloud<ParcelType> >::New
(
this->particleProperties(),
*this
)
)
{
if (readFields)
{
ParcelType::readFields(*this);
}
Info << " Average parcel mass: " << averageParcelMass_ << endl;
}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
template<class ParcelType>
Foam::SprayCloud<ParcelType>::~SprayCloud()
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template<class ParcelType>
void Foam::SprayCloud<ParcelType>::checkParcelProperties
(
ParcelType& parcel,
const scalar lagrangianDt,
const bool fullyDescribed
)
{
ReactingCloud<ParcelType>::checkParcelProperties
(
parcel,
lagrangianDt,
fullyDescribed
);
const scalarField& Y(parcel.Y());
scalarField X(this->composition().liquids().X(Y));
// override rho and cp from constantProperties
parcel.cp() = this->composition().liquids().cp(parcel.pc(), parcel.T(), X);
parcel.rho() = this->composition().liquids().rho(parcel.pc(), parcel.T(), X);
// store the injection position and initial drop size
parcel.position0() = parcel.position();
parcel.d0() = parcel.d();
parcel.y() = breakup().y0();
parcel.yDot() = breakup().yDot0();
}
template<class ParcelType>
Foam::scalar Foam::SprayCloud<ParcelType>::D(const label i, const label j) const
const label i,
const label j
) const
{
scalar si = 0.0;
scalar sj = 0.0;
forAllConstIter(typename Cloud<ParcelType>, *this, iter)
forAllConstIter(typename SprayCloud<CloudType>, *this, iter)
{
const ParcelType& p = iter();
const parcelType& p = iter();
si += p.nParticle()*pow(p.d(), i);
sj += p.nParticle()*pow(p.d(), j);
}
......@@ -313,30 +373,32 @@ Foam::scalar Foam::SprayCloud<ParcelType>::D(const label i, const label j) const
}
template<class ParcelType>
Foam::scalar Foam::SprayCloud<ParcelType>::liquidPenetration(const scalar& prc) const
template<class CloudType>
Foam::scalar Foam::SprayCloud<CloudType>::liquidPenetration
(
const scalar& prc
) const
{
scalar distance = 0.0;
scalar mTot = 0.0;
label Np = this->size();
label np = this->size();
// arrays containing the parcels mass and
// distance from injector in ascending order
scalarField mass(Np);
scalarField dist(Np);
scalarField mass(np);
scalarField dist(np);
if (Np > 0)
if (np > 0)
{
label n = 0;
// first arrange the parcels in ascending order