Commit 93a3083d authored by andy's avatar andy
Browse files

ENH: lagrangian/intermediate updated injection models

parent 5ce74a27
......@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
......@@ -164,10 +164,11 @@ template<class CloudType>
Foam::CellZoneInjection<CloudType>::CellZoneInjection
(
const dictionary& dict,
CloudType& owner
CloudType& owner,
const word& modelName
)
:
InjectionModel<CloudType>(dict, owner, typeName),
InjectionModel<CloudType>(dict, owner, modelName, typeName),
cellZoneName_(this->coeffDict().lookup("cellZone")),
numberDensity_(readScalar(this->coeffDict().lookup("numberDensity"))),
positions_(),
......
......@@ -104,7 +104,12 @@ public:
// Constructors
//- Construct from dictionary
CellZoneInjection(const dictionary& dict, CloudType& owner);
CellZoneInjection
(
const dictionary& dict,
CloudType& owner,
const word& modelName
);
//- Construct copy
CellZoneInjection(const CellZoneInjection<CloudType>& im);
......
......@@ -36,10 +36,11 @@ template<class CloudType>
Foam::ConeInjection<CloudType>::ConeInjection
(
const dictionary& dict,
CloudType& owner
CloudType& owner,
const word& modelName
)
:
InjectionModel<CloudType>(dict, owner, typeName),
InjectionModel<CloudType>(dict, owner, modelName, typeName),
positionAxis_(this->coeffDict().lookup("positionAxis")),
injectorCells_(positionAxis_.size()),
injectorTetFaces_(positionAxis_.size()),
......
......@@ -118,7 +118,12 @@ public:
// Constructors
//- Construct from dictionary
ConeInjection(const dictionary& dict, CloudType& owner);
ConeInjection
(
const dictionary& dict,
CloudType& owner,
const word& modelName
);
//- Construct copy
ConeInjection(const ConeInjection<CloudType>& im);
......
......@@ -98,10 +98,11 @@ template<class CloudType>
Foam::ConeNozzleInjection<CloudType>::ConeNozzleInjection
(
const dictionary& dict,
CloudType& owner
CloudType& owner,
const word& modelName
)
:
InjectionModel<CloudType>(dict, owner, typeName),
InjectionModel<CloudType>(dict, owner, modelName, typeName),
injectionMethod_(imPoint),
flowType_(ftConstantVelocity),
outerDiameter_(readScalar(this->coeffDict().lookup("outerDiameter"))),
......
......@@ -186,7 +186,12 @@ public:
// Constructors
//- Construct from dictionary
ConeNozzleInjection(const dictionary& dict, CloudType& owner);
ConeNozzleInjection
(
const dictionary& dict,
CloudType& owner,
const word& modelName
);
//- Construct copy
ConeNozzleInjection(const ConeNozzleInjection<CloudType>& im);
......
......@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
......@@ -35,10 +35,11 @@ template<class CloudType>
Foam::FieldActivatedInjection<CloudType>::FieldActivatedInjection
(
const dictionary& dict,
CloudType& owner
CloudType& owner,
const word& modelName
)
:
InjectionModel<CloudType>(dict, owner, typeName),
InjectionModel<CloudType>(dict, owner, modelName, typeName),
factor_(readScalar(this->coeffDict().lookup("factor"))),
referenceField_
(
......
......@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
......@@ -124,7 +124,12 @@ public:
// Constructors
//- Construct from dictionary
FieldActivatedInjection(const dictionary& dict, CloudType& owner);
FieldActivatedInjection
(
const dictionary& dict,
CloudType& owner,
const word& modelName
);
//- Construct copy
FieldActivatedInjection(const FieldActivatedInjection<CloudType>& im);
......
......@@ -37,10 +37,11 @@ template<class CloudType>
Foam::InflationInjection<CloudType>::InflationInjection
(
const dictionary& dict,
CloudType& owner
CloudType& owner,
const word& modelName
)
:
InjectionModel<CloudType>(dict, owner, typeName),
InjectionModel<CloudType>(dict, owner, modelName, typeName),
generationSetName_(this->coeffDict().lookup("generationCellSet")),
inflationSetName_(this->coeffDict().lookup("inflationCellSet")),
generationCells_(),
......
......@@ -120,7 +120,12 @@ public:
// Constructors
//- Construct from dictionary
InflationInjection(const dictionary& dict, CloudType& owner);
InflationInjection
(
const dictionary& dict,
CloudType& owner,
const word& modelName
);
//- Construct copy
InflationInjection(const InflationInjection<CloudType>& im);
......
......@@ -243,7 +243,8 @@ void Foam::InjectionModel<CloudType>::postInjectCheck
if (allParcelsAdded > 0)
{
Info<< nl
<< "--> Cloud: " << this->owner().name() << nl
<< "--> Cloud: " << this->owner().name()
<< " injector: " << this->modelName() << nl
<< " Added " << allParcelsAdded << " new parcels" << nl << endl;
}
......@@ -270,16 +271,16 @@ Foam::InjectionModel<CloudType>::InjectionModel(CloudType& owner)
SOI_(0.0),
volumeTotal_(0.0),
massTotal_(0.0),
massInjected_(this->template getBaseProperty<scalar>("massInjected")),
nInjections_(this->template getBaseProperty<scalar>("nInjections")),
massInjected_(this->template getModelProperty<scalar>("massInjected")),
nInjections_(this->template getModelProperty<label>("nInjections")),
parcelsAddedTotal_
(
this->template getBaseProperty<scalar>("parcelsAddedTotal")
this->template getModelProperty<scalar>("parcelsAddedTotal")
),
parcelBasis_(pbNumber),
nParticleFixed_(0.0),
time0_(0.0),
timeStep0_(this->template getBaseProperty<scalar>("timeStep0"))
timeStep0_(this->template getModelProperty<scalar>("timeStep0"))
{}
......@@ -288,23 +289,24 @@ Foam::InjectionModel<CloudType>::InjectionModel
(
const dictionary& dict,
CloudType& owner,
const word& type
const word& modelName,
const word& modelType
)
:
SubModelBase<CloudType>(owner, dict, typeName, type),
SubModelBase<CloudType>(modelName, owner, dict, typeName, modelType),
SOI_(0.0),
volumeTotal_(0.0),
massTotal_(0.0),
massInjected_(this->template getBaseProperty<scalar>("massInjected")),
nInjections_(this->template getBaseProperty<scalar>("nInjections")),
massInjected_(this->template getModelProperty<scalar>("massInjected")),
nInjections_(this->template getModelProperty<scalar>("nInjections")),
parcelsAddedTotal_
(
this->template getBaseProperty<scalar>("parcelsAddedTotal")
this->template getModelProperty<scalar>("parcelsAddedTotal")
),
parcelBasis_(pbNumber),
nParticleFixed_(0.0),
time0_(owner.db().time().value()),
timeStep0_(this->template getBaseProperty<scalar>("timeStep0"))
timeStep0_(this->template getModelProperty<scalar>("timeStep0"))
{
// Provide some info
// - also serves to initialise mesh dimensions - needed for parallel runs
......@@ -735,19 +737,16 @@ bool Foam::InjectionModel<CloudType>::fullyDescribed() const
template<class CloudType>
void Foam::InjectionModel<CloudType>::info(Ostream& os)
{
os << " Total number of parcels added = " << parcelsAddedTotal_ << nl
<< " Total mass introduced = " << massInjected_ << nl;
os << " " << this->modelName() << ":" << nl
<< " number of parcels added = " << parcelsAddedTotal_ << nl
<< " mass introduced = " << massInjected_ << nl;
if
(
this->owner().solution().transient()
&& this->owner().db().time().outputTime()
)
if (this->outputTime())
{
this->setBaseProperty("massInjected", massInjected_);
this->setBaseProperty("nInjections", nInjections_);
this->setBaseProperty("parcelsAddedTotal", parcelsAddedTotal_);
this->setBaseProperty("timeStep0", timeStep0_);
this->setModelProperty("massInjected", massInjected_);
this->setModelProperty("nInjections", nInjections_);
this->setModelProperty("parcelsAddedTotal", parcelsAddedTotal_);
this->setModelProperty("timeStep0", timeStep0_);
}
}
......
......@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
......@@ -59,7 +59,7 @@ namespace Foam
{
/*---------------------------------------------------------------------------*\
Class InjectionModel Declaration
Class InjectionModel Declaration
\*---------------------------------------------------------------------------*/
template<class CloudType>
......@@ -186,9 +186,10 @@ public:
dictionary,
(
const dictionary& dict,
CloudType& owner
CloudType& owner,
const word& modelType
),
(dict, owner)
(dict, owner, modelType)
);
......@@ -202,7 +203,8 @@ public:
(
const dictionary& dict,
CloudType& owner,
const word& type
const word& modelName,
const word& modelType
);
//- Construct copy
......@@ -222,12 +224,23 @@ public:
virtual ~InjectionModel();
//- Selector
static autoPtr<InjectionModel<CloudType> > New
(
const dictionary& dict,
CloudType& owner
);
// Selectors
//- Selector with lookup from dictionary
static autoPtr<InjectionModel<CloudType> > New
(
const dictionary& dict,
CloudType& owner
);
//- Selector with name and type
static autoPtr<InjectionModel<CloudType> > New
(
const dictionary& dict,
const word& modelName,
const word& modelType,
CloudType& owner
);
// Member Functions
......
......@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
......@@ -61,4 +61,49 @@ Foam::InjectionModel<CloudType>::New
}
template<class CloudType>
Foam::autoPtr<Foam::InjectionModel<CloudType> >
Foam::InjectionModel<CloudType>::New
(
const dictionary& dict,
const word& modelName,
const word& modelType,
CloudType& owner
)
{
Info<< "Selecting injection model " << modelType << endl;
typename dictionaryConstructorTable::iterator cstrIter =
dictionaryConstructorTablePtr_->find(modelType);
if (cstrIter == dictionaryConstructorTablePtr_->end())
{
FatalErrorIn
(
"InjectionModel<CloudType>::New"
"("
"const dictionary&, "
"const word&, "
"const word&, "
"CloudType&"
")"
) << "Unknown injection model type "
<< modelType << nl << nl
<< "Valid injection model types are:" << nl
<< dictionaryConstructorTablePtr_->sortedToc() << exit(FatalError);
}
return
autoPtr<InjectionModel<CloudType> >
(
cstrIter()
(
dict,
owner,
modelName
)
);
}
// ************************************************************************* //
......@@ -32,10 +32,11 @@ template<class CloudType>
Foam::KinematicLookupTableInjection<CloudType>::KinematicLookupTableInjection
(
const dictionary& dict,
CloudType& owner
CloudType& owner,
const word& modelName
)
:
InjectionModel<CloudType>(dict, owner, typeName),
InjectionModel<CloudType>(dict, owner, modelName, typeName),
inputFileName_(this->coeffDict().lookup("inputFile")),
duration_(readScalar(this->coeffDict().lookup("duration"))),
parcelsPerSecond_
......
......@@ -100,7 +100,12 @@ public:
// Constructors
//- Construct from dictionary
KinematicLookupTableInjection(const dictionary& dict, CloudType& owner);
KinematicLookupTableInjection
(
const dictionary& dict,
CloudType& owner,
const word& modelName
);
//- Construct copy
KinematicLookupTableInjection
......
......@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
......@@ -36,10 +36,11 @@ template<class CloudType>
Foam::ManualInjection<CloudType>::ManualInjection
(
const dictionary& dict,
CloudType& owner
CloudType& owner,
const word& modelName
)
:
InjectionModel<CloudType>(dict, owner, typeName),
InjectionModel<CloudType>(dict, owner, modelName, typeName),
positionsFile_(this->coeffDict().lookup("positionsFile")),
positions_
(
......
......@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
......@@ -94,7 +94,12 @@ public:
// Constructors
//- Construct from dictionary
ManualInjection(const dictionary& dict, CloudType& owner);
ManualInjection
(
const dictionary& dict,
CloudType& owner,
const word& modelName
);
//- Construct copy
ManualInjection(const ManualInjection<CloudType>& im);
......
......@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
......@@ -29,7 +29,12 @@ License
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
template<class CloudType>
Foam::NoInjection<CloudType>::NoInjection(const dictionary&, CloudType& owner)
Foam::NoInjection<CloudType>::NoInjection
(
const dictionary&,
CloudType& owner,
const word&
)
:
InjectionModel<CloudType>(owner)
{}
......
......@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
......@@ -61,7 +61,7 @@ public:
// Constructors
//- Construct from components
NoInjection(const dictionary&, CloudType&);
NoInjection(const dictionary&, CloudType&, const word&);
//- Construct copy
NoInjection(const NoInjection<CloudType>& im);
......
......@@ -33,10 +33,11 @@ template<class CloudType>
Foam::PatchInjection<CloudType>::PatchInjection
(
const dictionary& dict,
CloudType& owner
CloudType& owner,
const word& modelName
)
:
InjectionModel<CloudType>(dict, owner, typeName),
InjectionModel<CloudType>(dict, owner, modelName, typeName),
patchName_(this->coeffDict().lookup("patchName")),
patchId_(owner.mesh().boundaryMesh().findPatchID(patchName_)),
duration_(readScalar(this->coeffDict().lookup("duration"))),
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment