View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0000832 | OpenFOAM | Bug | public | 2013-05-03 10:26 | 2013-05-13 15:21 |
Reporter | Assigned To | ||||
Priority | normal | Severity | feature | Reproducibility | always |
Status | resolved | Resolution | fixed | ||
Platform | x86-64 | OS | Mint | OS Version | 14 |
Summary | 0000832: KinematicLookupTableInjection inject parcels in the same points each timestep | ||||
Description | KinematicLookupTableInjection 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 Information | This 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. | ||||
Tags | No tags attached. | ||||