如何解决 Abaqus Python 脚本中的 OdbError?

How to solve OdbError in Abaqus Python script?

我是运行 Abaqus Python脚本中的3D实体模型,应该分析200次,因为模型已经安排在for循环中(for i in range( 0,199):)。有时,我收到以下错误,然后分析终止。我不明白原因。

Odb_0=session.openOdb(name='Job-1'+'.odb')

odberrror: the .lck file for the output database D:/abaqus/Model/Job-1.odb indicates that the analysis Input File Processor is currently modifying the database. The database cannot be opened at this time.

请注意,包括“Odb_0”和....在内的所有变量在循环的每个步骤结束时都会在开始下一个循环之前被删除。

我认为更改元素类型不会解决您的问题。

消息和 .lck 文件表明数据库中存在访问死锁。输出文件丢失,无法更新 .odb 数据库。

我不确定 Abaqus 使用什么数据库。我猜想在解决方案和输出处理开始之前,输入流会扫描输入文件并将任何必要的记录写入数据库。

来自 Abaqus documentation

The lock file (job_name.lck) is written whenever an output database file is opened with write access, including when an analysis is running and writing output to an output database file. The lock file prevents you from having simultaneous write permission to the output database from multiple sources. It is deleted automatically when the output database file is closed or when the analysis that creates it ends.

当您删除以前的分析时,您应该确保与该模拟相关的所有进程都已终止。有几种可能性:

  • 通过 subprocess.popen 启动模拟可以让您更好地控制该过程(例如,等待它结束、写入特定日志等);
  • 以不同的方式命名您的模拟(例如 'Job-1'、'Job-2' 等)并延迟删除旧的(例如在 'Job-3' 开始时删除 'Job-1') ;
  • 不太受欢迎:using the time module