mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
KinematicLookupTableInjection: Use 64bit integers to avoid overflow for large numbers of injectors.
This commit is contained in:
@ -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();
|
||||||
|
|||||||
Reference in New Issue
Block a user