Skip to content
Snippets Groups Projects
Commit 88501623 authored by Andrew Heather's avatar Andrew Heather
Browse files

caching injector cell

parent 148c9f22
Branches
Tags
No related merge requests found
......@@ -77,6 +77,7 @@ Foam::ConeInjection<CloudType>::ConeInjection
InjectionModel<CloudType>(dict, owner, typeName),
duration_(readScalar(this->coeffDict().lookup("duration"))),
position_(this->coeffDict().lookup("position")),
injectorCell_(-1),
direction_(this->coeffDict().lookup("direction")),
parcelsPerSecond_
(
......@@ -145,6 +146,9 @@ Foam::ConeInjection<CloudType>::ConeInjection
// Set total volume to inject
this->volumeTotal_ = volumeFlowRate_().integrate(0.0, duration_);
// Set/cache the injector cell
this->findCellAtPosition(injectorCell_, position_);
}
......@@ -182,7 +186,7 @@ void Foam::ConeInjection<CloudType>::setPositionAndCell
)
{
position = position_;
this->findCellAtPosition(cellOwner, position);
cellOwner = injectorCell_;
}
......
......@@ -53,6 +53,8 @@ SourceFiles
namespace Foam
{
// Forward declaration of classes
template<class Type>
class DataEntry;
......@@ -71,7 +73,10 @@ class ConeInjection
const scalar duration_;
//- Injector position [m]
const vector position_;
vector position_;
//- Cell containing injector position []
label injectorCell_;
//- Injector direction []
vector direction_;
......
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