chalmersplasmatheory / DREAM

The Disruption Runaway Electron Analysis Model
MIT License
24 stars 5 forks source link

Problem with SPI shard position calculation #285

Open lvotta98 opened 6 months ago

lvotta98 commented 6 months ago

It seems to be a bug in /DREAM/src/Equations/Scalar/ConstantSPIVelocityPositionTerm.cpp in the calculation of the shard position (lines 53-55):

         currentData[3*ip]=initial_data[3*ip]+vp[3*ip]*(t+dt-t_delay[ip]);
         currentData[3*ip+1]=initial_data[3*ip+1]+vp[3*ip+1]*(t+dt-t_delay[ip]
         currentData[3*ip+2]=initial_data[3*ip+2]+vp[3*ip+2]*(t+dt-t_delay[ip]

The dt is not supposed to be there.

hoppe93 commented 6 months ago

(since currentData is supposed to represent the shard positions at time t (which is the time for which the nonlinear solver is trying to find a solution), and not time t+dt)