ENH: Extended spray cone nozzle injection

This commit is contained in:
andy
2011-06-01 10:36:46 +01:00
parent b6f71fd541
commit abb392047d
4 changed files with 182 additions and 73 deletions

View File

@ -30,6 +30,82 @@ License
using namespace Foam::constant; using namespace Foam::constant;
// * * * * * * * * * * * Private Member Functions * * * * * * * * * * * * * //
template<class CloudType>
void Foam::ConeNozzleInjection<CloudType>::setInjectionMethod()
{
word injectionMethodType = this->coeffDict().lookup("injectionMethod");
if (injectionMethodType == "disc")
{
injectionMethod_ = imDisc;
}
else if (injectionMethodType == "point")
{
injectionMethod_ = imPoint;
// Set/cache the injector cell
this->findCellAtPosition
(
injectorCell_,
tetFaceI_,
tetPtI_,
position_,
false
);
}
else
{
FatalErrorIn("Foam::InjectionModel<CloudType>::setInjectionMethod()")
<< "injectionMethod must be either 'point' or 'disc'"
<< exit(FatalError);
}
}
template<class CloudType>
void Foam::ConeNozzleInjection<CloudType>::setFlowType()
{
word flowType = this->coeffDict().lookup("flowType");
if (flowType == "constantVelocity")
{
this->coeffDict().lookup("UMag") >> UMag_;
flowType_ = ftConstantVelocity;
}
else if (flowType == "pressureDrivenVelocity")
{
Pinj_.reset
(
DataEntry<scalar>::New
(
"Pinj",
this->coeffDict()
).ptr()
);
flowType_ = ftPressureDrivenVelocity;
}
else if (flowType == "flowRateAndDischarge")
{
Cd_.reset
(
DataEntry<scalar>::New
(
"Cd",
this->coeffDict()
).ptr()
);
flowType_ = ftFlowRateAndDischarge;
}
else
{
FatalErrorIn("Foam::InjectionModel<CloudType>::setFlowType()")
<< "flowType must be either 'constantVelocity', "
<<"'pressureDrivenVelocity' or 'flowRateAndDischarge'"
<< exit(FatalError);
}
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
template<class CloudType> template<class CloudType>
@ -41,14 +117,9 @@ Foam::ConeNozzleInjection<CloudType>::ConeNozzleInjection
: :
InjectionModel<CloudType>(dict, owner, typeName), InjectionModel<CloudType>(dict, owner, typeName),
injectionMethod_(imPoint), injectionMethod_(imPoint),
outerNozzleDiameter_ flowType_(ftConstantVelocity),
( outerDiameter_(readScalar(this->coeffDict().lookup("outerDiameter"))),
readScalar(this->coeffDict().lookup("outerNozzleDiameter")) innerDiameter_(readScalar(this->coeffDict().lookup("innerDiameter"))),
),
innerNozzleDiameter_
(
readScalar(this->coeffDict().lookup("innerNozzleDiameter"))
),
duration_(readScalar(this->coeffDict().lookup("duration"))), duration_(readScalar(this->coeffDict().lookup("duration"))),
position_(this->coeffDict().lookup("position")), position_(this->coeffDict().lookup("position")),
injectorCell_(-1), injectorCell_(-1),
@ -67,14 +138,6 @@ Foam::ConeNozzleInjection<CloudType>::ConeNozzleInjection
this->coeffDict() this->coeffDict()
) )
), ),
Cd_
(
DataEntry<scalar>::New
(
"Cd",
this->coeffDict()
)
),
thetaInner_ thetaInner_
( (
DataEntry<scalar>::New DataEntry<scalar>::New
@ -101,9 +164,13 @@ Foam::ConeNozzleInjection<CloudType>::ConeNozzleInjection
), ),
tanVec1_(vector::zero), tanVec1_(vector::zero),
tanVec2_(vector::zero), tanVec2_(vector::zero),
normal_(vector::zero) normal_(vector::zero),
UMag_(0.0),
Cd_(NULL),
Pinj_(NULL)
{ {
if (innerNozzleDiameter_ >= outerNozzleDiameter_) if (innerDiameter_ >= outerDiameter_)
{ {
FatalErrorIn FatalErrorIn
( (
@ -116,38 +183,9 @@ Foam::ConeNozzleInjection<CloudType>::ConeNozzleInjection
<< exit(FatalError); << exit(FatalError);
} }
word injectionMethodType = this->coeffDict().lookup("injectionMethod"); setInjectionMethod();
if (injectionMethodType == "disc") setFlowType();
{
injectionMethod_ = imDisc;
}
else if (injectionMethodType == "point")
{
injectionMethod_ = imPoint;
// Set/cache the injector cell
this->findCellAtPosition
(
injectorCell_,
tetFaceI_,
tetPtI_,
position_,
false
);
}
else
{
FatalErrorIn
(
"Foam::InjectionModel<CloudType>::InjectionModel"
"("
"const dictionary&, "
"CloudType&"
")"
)<< "injectionMethod must be either 'point' or 'disc'" << nl
<< exit(FatalError);
}
cachedRandom& rndGen = this->owner().rndGen(); cachedRandom& rndGen = this->owner().rndGen();
@ -182,21 +220,23 @@ Foam::ConeNozzleInjection<CloudType>::ConeNozzleInjection
: :
InjectionModel<CloudType>(im), InjectionModel<CloudType>(im),
injectionMethod_(im.injectionMethod_), injectionMethod_(im.injectionMethod_),
outerNozzleDiameter_(im.outerNozzleDiameter_), outerDiameter_(im.outerDiameter_),
innerNozzleDiameter_(im.innerNozzleDiameter_), innerDiameter_(im.innerDiameter_),
duration_(im.duration_), duration_(im.duration_),
position_(im.position_), position_(im.position_),
injectorCell_(im.injectorCell_), injectorCell_(im.injectorCell_),
direction_(im.direction_), direction_(im.direction_),
parcelsPerSecond_(im.parcelsPerSecond_), parcelsPerSecond_(im.parcelsPerSecond_),
volumeFlowRate_(im.volumeFlowRate_().clone().ptr()), volumeFlowRate_(im.volumeFlowRate_().clone().ptr()),
Cd_(im.Cd_().clone().ptr()),
thetaInner_(im.thetaInner_().clone().ptr()), thetaInner_(im.thetaInner_().clone().ptr()),
thetaOuter_(im.thetaOuter_().clone().ptr()), thetaOuter_(im.thetaOuter_().clone().ptr()),
sizeDistribution_(im.sizeDistribution_().clone().ptr()), sizeDistribution_(im.sizeDistribution_().clone().ptr()),
tanVec1_(im.tanVec1_), tanVec1_(im.tanVec1_),
tanVec2_(im.tanVec1_), tanVec2_(im.tanVec1_),
normal_(im.normal_) normal_(im.normal_),
UMag_(im.UMag_),
Cd_(im.Cd_().clone().ptr()),
Pinj_(im.Pinj_().clone().ptr())
{} {}
@ -283,8 +323,8 @@ void Foam::ConeNozzleInjection<CloudType>::setPositionAndCell
case imDisc: case imDisc:
{ {
scalar frac = rndGen.sample01<scalar>(); scalar frac = rndGen.sample01<scalar>();
scalar dr = outerNozzleDiameter_ - innerNozzleDiameter_; scalar dr = outerDiameter_ - innerDiameter_;
scalar r = 0.5*(innerNozzleDiameter_ + frac*dr); scalar r = 0.5*(innerDiameter_ + frac*dr);
position = position_ + r*normal_; position = position_ + r*normal_;
this->findCellAtPosition this->findCellAtPosition
@ -344,13 +384,38 @@ void Foam::ConeNozzleInjection<CloudType>::setProperties
dirVec += normal; dirVec += normal;
dirVec /= mag(dirVec); dirVec /= mag(dirVec);
scalar Ao = 0.25*mathematical::pi*outerNozzleDiameter_*outerNozzleDiameter_; switch (flowType_)
scalar Ai = 0.25*mathematical::pi*innerNozzleDiameter_*innerNozzleDiameter_; {
case ftConstantVelocity:
{
parcel.U() = UMag_*dirVec;
break;
}
case ftPressureDrivenVelocity:
{
scalar pAmbient = this->owner().pAmbient();
scalar rho = parcel.rho();
scalar UMag = ::sqrt(2.0*(Pinj_().value(t) - pAmbient)/rho);
parcel.U() = UMag*dirVec;
break;
}
case ftFlowRateAndDischarge:
{
scalar Ao = 0.25*mathematical::pi*outerDiameter_*outerDiameter_;
scalar Ai = 0.25*mathematical::pi*innerDiameter_*innerDiameter_;
scalar massFlowRate = scalar massFlowRate =
this->massTotal()*volumeFlowRate_().value(t)/this->volumeTotal(); this->massTotal()
*volumeFlowRate_().value(t)
/this->volumeTotal();
scalar Umag = massFlowRate/(parcel.rho()*Cd_().value(t)*(Ao - Ai)); scalar Umag = massFlowRate/(parcel.rho()*Cd_().value(t)*(Ao - Ai));
parcel.U() = Umag*dirVec; parcel.U() = Umag*dirVec;
break;
}
default:
{
}
}
// set particle diameter // set particle diameter
parcel.d() = sizeDistribution_->sample(); parcel.d() = sizeDistribution_->sample();

View File

@ -32,16 +32,18 @@ Description
- injector position - injector position
- direction (along injection axis) - direction (along injection axis)
- parcel flow rate - parcel flow rate
- discharge coefficient, Cd
- inner and outer cone angles - inner and outer cone angles
- Parcel diameters obtained by size distribution model - Parcel diameters obtained by size distribution model
- Parcel velocity is calculated as: - Parcel velocity is calculated as:
U = V_dot/(A * Cd), where V_dot is the volume flow rate - Constant velocity
U = <specified by user>
Based on the old 'unitInjection' model - Pressure driven velocity
U = sqrt(2*(Pinj - Pamb)/rho)
- Flow rate and discharge
U = V_dot/(A*Cd)
SourceFiles SourceFiles
ConeNozzleInjection.C ConeNozzleInjection.C
@ -83,19 +85,30 @@ public:
imDisc imDisc
}; };
//- Flow type enumeration
enum flowType
{
ftConstantVelocity,
ftPressureDrivenVelocity,
ftFlowRateAndDischarge
};
private: private:
// Private data // Private data
//- point/disc injection method //- Point/disc injection method
injectionMethod injectionMethod_; injectionMethod injectionMethod_;
//- Flow type
flowType flowType_;
//- Outer nozzle diameter [m] //- Outer nozzle diameter [m]
const scalar outerNozzleDiameter_; const scalar outerDiameter_;
//- Inner nozzle diameter [m] //- Inner nozzle diameter [m]
const scalar innerNozzleDiameter_; const scalar innerDiameter_;
//- Injection duration [s] //- Injection duration [s]
const scalar duration_; const scalar duration_;
@ -121,9 +134,6 @@ private:
//- Volume flow rate of parcels to introduce relative to SOI [m^3/s] //- Volume flow rate of parcels to introduce relative to SOI [m^3/s]
const autoPtr<DataEntry<scalar> > volumeFlowRate_; const autoPtr<DataEntry<scalar> > volumeFlowRate_;
//- Discharge coefficient, relative to SOI [m/s]
const autoPtr<DataEntry<scalar> > Cd_;
//- Inner cone angle relative to SOI [deg] //- Inner cone angle relative to SOI [deg]
const autoPtr<DataEntry<scalar> > thetaInner_; const autoPtr<DataEntry<scalar> > thetaInner_;
@ -146,6 +156,27 @@ private:
vector normal_; vector normal_;
// Velocity model coefficients
//- Constant velocity [m/s]
scalar UMag_;
//- Discharge coefficient, relative to SOI [m/s]
autoPtr<DataEntry<scalar> > Cd_;
//- Injection pressure [Pa]
autoPtr<DataEntry<scalar> > Pinj_;
// Private Member Functions
//- Set the injection type
void setInjectionMethod();
//- Set the injection flow type
void setFlowType();
public: public:
//- Runtime type information //- Runtime type information

View File

@ -175,6 +175,18 @@ cloudFunctions
cycLeft_half1 cycLeft_half1
); );
} }
facePostProcessing
{
surfaceFormat vtk;
resetOnWrite no;
log yes;
faceZones
(
cycLeft
);
}
} }

View File

@ -112,8 +112,9 @@ subModels
massTotal 6.0e-6; massTotal 6.0e-6;
parcelBasisType mass; parcelBasisType mass;
injectionMethod disc; injectionMethod disc;
outerNozzleDiameter 1.9e-4; flowType flowRateAndDischarge;
innerNozzleDiameter 0; outerDiameter 1.9e-4;
innerDiameter 0;
duration 1.25e-3; duration 1.25e-3;
position ( 0 0.0995 0 ); position ( 0 0.0995 0 );
direction ( 0 -1 0 ); direction ( 0 -1 0 );