ibell / pdsim

Steady-State simulation code for positive displacement machines
MIT License
38 stars 25 forks source link

PDSim GUI failed to use Euler/Heun integrator #84

Closed Wang-Zongwei closed 1 year ago

Wang-Zongwei commented 1 year ago

Today I found below issue, and I hope my feedback is useful.

PDSim GUI failed to use Euler/Heun integrator (RK45 is OK). All the scroll input data is from the default setting.

Wang-Zongwei commented 1 year ago

Euler error:

About to run the script file C:\Users\Administrator.pdsim-temp\script_bdf61f53bc46.py C:\ProgramData\anaconda3\envs\pdsimgb\lib\site-packages\PDSim\scroll\core.py:382: UserWarning: xport and yport not provided, defaulting back to circular discharge port; should be stored in self.geo.xvec_disc_port and self.geo.yvec_disc_port warnings.warn('xport and yport not provided, defaulting back to circular discharge port; should be stored in self.geo.xvec_disc_port and self.geo.yvec_disc_port') caching discharge port blockage, please wait... done Process Run1-1: Traceback (most recent call last): File "C:\ProgramData\anaconda3\envs\pdsimgb\lib\multiprocessing\process.py", line 315, in _bootstrap self.run() File "C:\pdsim-master0826\GUI\processes.py", line 77, in run script_module.run(self.sim, pipe_abort = self.pipe_abort) File "C:\Users\Administrator.pdsim-temp\script_bdf61f53bc46.py", line 273, in run sim.precond_solve(key_inlet = 'inlet.1', File "C:\ProgramData\anaconda3\envs\pdsimgb\lib\site-packages\PDSim\core\core.py", line 861, in precond_solve self.solve(**kwargs) File "C:\ProgramData\anaconda3\envs\pdsimgb\lib\site-packages\PDSim\core\core.py", line 1479, in solve self.OBJECTIVE_CYCLE(x0, self.x_state, File "C:\ProgramData\anaconda3\envs\pdsimgb\lib\site-packages\PDSim\core\core.py", line 1137, in OBJECTIVE_CYCLE self.one_cycle(X, File "C:\ProgramData\anaconda3\envs\pdsimgb\lib\site-packages\PDSim\core\core.py", line 1030, in one_cycle aborted = integrator.do_integration(N, tmin, tmax) File "C:\ProgramData\anaconda3\envs\pdsimgb\lib\site-packages\PDSim\core\integrators.py", line 74, in do_integration self.f1 = self.derivs(self.t0, self.xold) File "C:\ProgramData\anaconda3\envs\pdsimgb\lib\site-packages\PDSim\core\core.py", line 109, in derivs return self.sim.derivs(t, x) File "C:\ProgramData\anaconda3\envs\pdsimgb\lib\site-packages\PDSim\core\core.py", line 1632, in derivs self.core.properties_and_volumes(self.CVs.exists_CV, theta, STATE_VARS_TM, x) File "PDSim\core\containers.pyx", line 295, in PDSim.core.containers.CVArrays.properties_and_volumes File "PDSim\core\containers.pyx", line 342, in PDSim.core.containers.CVArrays.properties_and_volumes File "CoolProp\CoolProp.pyx", line 781, in CoolProp.CoolProp.State.update_Trho File "CoolProp\AbstractState.pyx", line 104, in CoolProp.CoolProp.AbstractState.update ValueError: p is not a valid number Thread-2: Process is done euler

Wang-Zongwei commented 1 year ago

Heun error:

About to run the script file C:\Users\Administrator.pdsim-temp\script_ae3e98385bb1.py C:\ProgramData\anaconda3\envs\pdsimgb\lib\site-packages\PDSim\scroll\core.py:382: UserWarning: xport and yport not provided, defaulting back to circular discharge port; should be stored in self.geo.xvec_disc_port and self.geo.yvec_disc_port warnings.warn('xport and yport not provided, defaulting back to circular discharge port; should be stored in self.geo.xvec_disc_port and self.geo.yvec_disc_port') caching discharge port blockage, please wait... done Process Run1-1: Traceback (most recent call last): File "C:\ProgramData\anaconda3\envs\pdsimgb\lib\multiprocessing\process.py", line 315, in _bootstrap self.run() File "C:\pdsim-master0826\GUI\processes.py", line 77, in run script_module.run(self.sim, pipe_abort = self.pipe_abort) File "C:\Users\Administrator.pdsim-temp\script_ae3e98385bb1.py", line 273, in run sim.precond_solve(key_inlet = 'inlet.1', File "C:\ProgramData\anaconda3\envs\pdsimgb\lib\site-packages\PDSim\core\core.py", line 861, in precond_solve self.solve(**kwargs) File "C:\ProgramData\anaconda3\envs\pdsimgb\lib\site-packages\PDSim\core\core.py", line 1479, in solve self.OBJECTIVE_CYCLE(x0, self.x_state, File "C:\ProgramData\anaconda3\envs\pdsimgb\lib\site-packages\PDSim\core\core.py", line 1137, in OBJECTIVE_CYCLE self.one_cycle(X, File "C:\ProgramData\anaconda3\envs\pdsimgb\lib\site-packages\PDSim\core\core.py", line 1035, in one_cycle aborted = integrator.do_integration(N, tmin, tmax) File "C:\ProgramData\anaconda3\envs\pdsimgb\lib\site-packages\PDSim\core\integrators.py", line 139, in do_integration self.f1 = self.derivs(self.t0, self.xold) File "C:\ProgramData\anaconda3\envs\pdsimgb\lib\site-packages\PDSim\core\core.py", line 109, in derivs return self.sim.derivs(t, x) File "C:\ProgramData\anaconda3\envs\pdsimgb\lib\site-packages\PDSim\core\core.py", line 1632, in derivs self.core.properties_and_volumes(self.CVs.exists_CV, theta, STATE_VARS_TM, x) File "PDSim\core\containers.pyx", line 295, in PDSim.core.containers.CVArrays.properties_and_volumes File "PDSim\core\containers.pyx", line 342, in PDSim.core.containers.CVArrays.properties_and_volumes File "CoolProp\CoolProp.pyx", line 781, in CoolProp.CoolProp.State.update_Trho File "CoolProp\AbstractState.pyx", line 104, in CoolProp.CoolProp.AbstractState.update ValueError: p is not a valid number Thread-2: Process is done

Heun

Wang-Zongwei commented 1 year ago

Attached is script file generated by PDSim GUI script_bdf61f53bc46.txt script_ae3e98385bb1.txt

ibell commented 1 year ago

The short answer is don't use anything other than adaptive RK45. The others are not reliable, and to get them to be reliable enough you need an enormous number of steps, so it ends up still being faster to just use adaptive RK45.

Wang-Zongwei commented 1 year ago

Clear! Thanks a lot for your answer.