KinematicLookupTableInjection: Use 64bit integers to avoid overflow for large numbers of injectors.

This commit is contained in:
Henry Weller
2015-09-28 14:30:48 +01:00
parent c8135cee57
commit e846c991ad

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -187,7 +187,7 @@ void Foam::KinematicLookupTableInjection<CloudType>::setPositionAndCell
} }
else else
{ {
injectorI = parcelI*injectorCells_.size()/nParcels; injectorI = int64_t(parcelI)*int64_t(injectors_.size())/nParcels;
} }
position = injectors_[injectorI].x(); position = injectors_[injectorI].x();
@ -206,7 +206,7 @@ void Foam::KinematicLookupTableInjection<CloudType>::setProperties
typename CloudType::parcelType& parcel typename CloudType::parcelType& parcel
) )
{ {
label injectorI = parcelI*injectorCells_.size()/nParcels; label injectorI = int64_t(parcelI)*int64_t(injectors_.size())/nParcels;
// set particle velocity // set particle velocity
parcel.U() = injectors_[injectorI].U(); parcel.U() = injectors_[injectorI].U();