Battery-Intelligence-Lab / multiscale-coupling

Repository for the paper "multiscale coupling of surface temperature with solid diffusion in large lithium-ion pouch cells"
Other
11 stars 1 forks source link

Bug: Unknown parameter k a #3

Open jsimonclark opened 2 years ago

jsimonclark commented 2 years ago

Bug: After implementing a quick fix for Issue #2 and running the Main_Opt.m script, it runs for a few seconds and then returns the Error Unknown parameter k a. Full error message below.

Error using Battery_model Java exception occurred: Exception:

com.comsol.util.exceptions.FlException: Unknown parameter X#k a

Messages:

Unknown parameter k a.

- Feature: Porous Electrode - Negative

Stack trace:

at com.comsol.model.dbmodel.ParameterEntityDb.getParamValue(SourceFile:132)

at com.comsol.model.dbmodel.ParameterEntityDb.getParamValue(SourceFile:1)

at com.comsol.model.method.ParameterEntityMethod.b(SourceFile:486)

at com.comsol.model.method.ParameterEntityMethod.set(SourceFile:313)

at com.comsol.model.dbmodel.ParameterEntityDb.set(SourceFile:312)

at sun.reflect.GeneratedMethodAccessor56.invoke(Unknown Source)

at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

at java.lang.reflect.Method.invoke(Method.java:498)

at com.comsol.bridge.command.b.a(SourceFile:145)

at com.comsol.bridge.command.b.run(SourceFile:90)

at com.comsol.bridge.command.i.execute(SourceFile:46)

at com.comsol.bridge.command.j.d(SourceFile:719)

at com.comsol.bridge.command.j.a(SourceFile:707)

at com.comsol.bridge.command.j$3.a(SourceFile:608)

at com.comsol.bridge.command.j$3.call(SourceFile:1)

at java.util.concurrent.FutureTask.run(FutureTask.java:266)

at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)

at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)

at java.lang.Thread.run(Thread.java:748)

Error in ObjFunc (line 20) [hy,hz]=Battery_model(T0,Cp,k,h,ku,kappa,alfa_ka,i0ref,Ei0,Ds,DS,Vinit);

Error in Main_Opt (line 27) [Res,ResT,a_mod] = ObjFunc(x0);

matthieuruthven commented 1 year ago

Hello @jsimonclark and @davidhowey, @jsimonclark, I had the same issue in MATLAB R2022a and COMSOL v6.1. A workaround is to comment out lines 485, 486, 514 and 515, however, this prevents calculation of temperature concavity. @davidhowey, please can you advise how to avoid this issue?

davidhowey commented 1 year ago

Thank you @matthieuruthven for sharing your work-around. We are not quite sure what is causing this issue, but it may be to do with a version difference between your version of Comsol or Matlab and the one we used when we did this work. Did you have any further progress making it work? We are trying to see if we can dig out the mph file

matthieuruthven commented 1 year ago

You're welcome, @davidhowey. Yes, the issue is likely to be caused by different versions of MATLAB and COMSOL Multiphysics. I have not managed to fix the issue. Can you remember if, when setting up the model in COMSOL Multiphysics, additional steps were required to enable temperature concavity calculation? Or was calculation included by default?