View Issue Details

IDProjectCategoryView StatusLast Update
0000832OpenFOAMBugpublic2013-05-13 15:21
Reporteruser507Assigned Touser2 
PrioritynormalSeverityfeatureReproducibilityalways
Status resolvedResolutionfixed 
Platformx86-64OSMintOS Version14
Summary0000832: KinematicLookupTableInjection inject parcels in the same points each timestep
DescriptionKinematicLookupTableInjection inject parcels in the same points each timestep if the number of points does not match the number of parcels to be injected. Say that one has defined 1000 injection points in the table and a total of 100 parcels are to be introduced every timestep (set by the parcelsPerSecond variable). What the code does now is to select the very same 100 injection points each timestep, thus resulting in the 900 other points being ignored completely.

This behaviour might of course be desired, but it is questionable if it is a logic way of operation. I think many people's first assumption is that when you define 1000 points, and ask for 100 parcels each timestep, there is some alternation between the points selected for injection. This can be done either by an systematic, deterministic alternation method, or by random selection of points.
Additional InformationThis feature can be added easily by creating a setting/property in the injection model, to switch to a stochastic behaviour. Lets call this switch randomInject. Then the setPositionAndCell() function need to be modified:

void Foam::KinematicLookupTableInjection<CloudType>::setPositionAndCell
(
    const label parcelI,
    const label nParcels,
    const scalar time,
    vector& position,
    label& cellOwner,
    label& tetFaceI,
    label& tetPtI
)
{
    label injectorI;
    
    if (randomInject_)
    {
        cachedRandom& rnd = this->owner().rndGen();
        injectorI = rnd.position<label>(0, injectorCells_.size() - 1);
    }
    else
    {
        injectorI = parcelI*injectorCells_.size()/nParcels;
    }

    position = injectors_[injectorI].x();
    cellOwner = injectorCells_[injectorI];
    tetFaceI = injectorTetFaces_[injectorI];
    tetPtI = injectorTetPts_[injectorI];
}

This behaviour is, when randomInject_=true, equal to that of patchInjection, where cells are chosen on a random basis. When doing it this way one opens a lot more uses for the KinematicLookupTableInjection model than what currently is the case.

One also need to modify the header file KinematicLookupTableInjection.H and the function reading the injection configuration dictionary, but that is (hopefully) trivial.
TagsNo tags attached.

Activities

user2

2013-05-13 15:21

  ~0002191

Thanks for the suggestion - we'll look to include this functionality in all lookup table injection models in future releases

Issue History

Date Modified Username Field Change
2013-05-03 10:26 user507 New Issue
2013-05-13 15:21 user2 Note Added: 0002191
2013-05-13 15:21 user2 Status new => resolved
2013-05-13 15:21 user2 Resolution open => fixed
2013-05-13 15:21 user2 Assigned To => user2