piclas-framework / piclas

PICLas is a parallel, three-dimensional PIC-DSMC solver developed cooperatively by the Institute of Space Systems, Institute of Aerodynamics and Gas Dynamics at the University of Stuttgart and the spin-off boltzplatz. PICLas is a flexible particle-based plasma simulation suite.
https://piclas.readthedocs.io
GNU General Public License v3.0
71 stars 17 forks source link

Potential vibrational and rotational energy bug in 3.1 and 3.2 #20

Closed BillyTheKidPhysicist closed 3 months ago

BillyTheKidPhysicist commented 3 months ago

I updated piclas to 3.2 from 2.9 and found that model would no longer run. Some of the errors claimed particles were now traveling at >1e14 m/s, while others claimed that the collision energy was negative because of huge rotational and vibrational energies. Inspecting the individual particle trajectories in ParaView reveals that none of the particles have a speed greater than 1e7 m/s at any point. Also, all of my species are atoms or electrons. An example of an error is shown below. This errors on 3.1 as well, but not 3.0. Additionally, I've attached the relevant files to run the model

      10 DSMC Chemisry: Added vibrational and electronic energy
      10 iReac       =           1
      10 ReactInx(1) =          22  ReactInx(2) =          21
      10 Weight(1)   =   1.0000000000000000       Weight(2)   =   1.0000000000000000
      10 Coll_pData(iPair)%Ec     =   -1313184574.0972304
      10 MassRed                  =    9.1081352874341743E-031
      10 ChemReac%EForm(iReac)    =  -3.9393348230575261E-018
      10 Coll_pData(iPair)%CRela2 =    19207580690518.855
      10 PartStateIntEn(1:2,ReactInx(1)) =   28.000000000000000       -1313184602.0972304
      10 PartStateIntEn(1:2,ReactInx(2)) =   0.0000000000000000        0.0000000000000000

Program abort caused on Proc 10 in File : src/particles/dsmc/dsmc_chemical_reactions.f90 Line 666 This file was compiled at Apr 26 2024 08:36:04 Message: Coll_pData(iPair)%Ec < 0.) -1.31318457409723E+009 case_14.zip

BillyTheKidPhysicist commented 3 months ago

It seems that by commenting out lines 642 and 643 in dsmc_chemical_reactions.f90 allows the code to work again

pnizenkov commented 3 months ago

Thanks for letting us know, I will take a look at it!

pnizenkov commented 3 months ago

So there were actually two issues, which we fixed in the upcoming release 3.2.1. I was able to run your test case without problems. Closing the issue for now.