caching injector cell

This commit is contained in:
andy
2009-06-05 18:52:54 +01:00
parent 148c9f2291
commit 885016236e
2 changed files with 11 additions and 2 deletions

View File

@ -77,6 +77,7 @@ Foam::ConeInjection<CloudType>::ConeInjection
InjectionModel<CloudType>(dict, owner, typeName), InjectionModel<CloudType>(dict, owner, typeName),
duration_(readScalar(this->coeffDict().lookup("duration"))), duration_(readScalar(this->coeffDict().lookup("duration"))),
position_(this->coeffDict().lookup("position")), position_(this->coeffDict().lookup("position")),
injectorCell_(-1),
direction_(this->coeffDict().lookup("direction")), direction_(this->coeffDict().lookup("direction")),
parcelsPerSecond_ parcelsPerSecond_
( (
@ -145,6 +146,9 @@ Foam::ConeInjection<CloudType>::ConeInjection
// Set total volume to inject // Set total volume to inject
this->volumeTotal_ = volumeFlowRate_().integrate(0.0, duration_); 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_; position = position_;
this->findCellAtPosition(cellOwner, position); cellOwner = injectorCell_;
} }

View File

@ -53,6 +53,8 @@ SourceFiles
namespace Foam namespace Foam
{ {
// Forward declaration of classes
template<class Type> template<class Type>
class DataEntry; class DataEntry;
@ -71,7 +73,10 @@ class ConeInjection
const scalar duration_; const scalar duration_;
//- Injector position [m] //- Injector position [m]
const vector position_; vector position_;
//- Cell containing injector position []
label injectorCell_;
//- Injector direction [] //- Injector direction []
vector direction_; vector direction_;