mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
caching injector cell
This commit is contained in:
@ -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_;
|
||||
|
||||
Reference in New Issue
Block a user