简体   繁体   English

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

[英]How to solve OdbError in Abaqus Python script?

I am running a 3D solid model in Abaqus Python script, which is supposed to be analyzed for 200 times as the model has been arranged in a for loop (for i in range(0,199):). I am running a 3D solid model in Abaqus Python script, which is supposed to be analyzed for 200 times as the model has been arranged in a for loop (for i in range(0,199):). Sometimes, I receive the following error and then the analysis terminates.有时,我收到以下错误,然后分析终止。 I can't realize the reason.我无法理解原因。

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. odberrror:output数据库的.lck文件D:/abaqus/Model/Job-1.odb表示分析Input File Processor当前正在修改数据库。 The database cannot be opened at this time.此时无法打开数据库。

It is noted that all the variables including "Odb_0" and.... are deleted at the end of each step of the loop prior to starting the further one.请注意,在开始下一个循环之前,在循环的每个步骤结束时,包括“Odb_0”和....在内的所有变量都将被删除。

I don't believe your problem will be helped by a change in element type.我不相信元素类型的改变会帮助你解决问题。

The message and the .lck file say that there's an access deadlock in the database.该消息和.lck文件表明数据库中存在访问死锁。 The output file lost out and cannot update the .odb database. output 文件丢失,无法更新.odb数据库。

I'm not sure what database Abaqus uses.我不确定 Abaqus 使用什么数据库。 I would have guessed that the input stream would have scanned the input file and written whatever records were necessary to the database before the solution and output processing began.我猜想输入 ZF7B44CFFAFD5C52223D5498196C8A2E7BZ 会扫描输入文件并在解决方案和 output 处理开始之前将任何必要的记录写入数据库。

From the Abaqus documentation来自 Abaqus 文档

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.每当使用写访问权限打开 output 数据库文件时都会写入锁定文件 (job_name.lck),包括在运行分析并将 output 写入 Z78E6221F6393D1356681DB398F14CE6 数据库文件时。 The lock file prevents you from having simultaneous write permission to the output database from multiple sources.锁定文件可防止您从多个来源同时拥有对 output 数据库的写入权限。 It is deleted automatically when the output database file is closed or when the analysis that creates it ends.当 output 数据库文件关闭或创建它的分析结束时,它会自动删除。

When you are deleting your previous analysis you should be sure that all processes connected with that simulation have been terminated.当您删除之前的分析时,您应该确保与该模拟相关的所有进程都已终止。 There are several possibilities to do so:这样做有几种可能性:

  • Launching simulation through subprocess.popen could give you much more control over the process (eg waiting until it ends, writing of a specific log, etc.);通过subprocess.popen启动模拟可以让您对进程有更多的控制(例如,等到它结束,写入特定日志等);
  • Naming your simulations differently (eg 'Job-1', 'Job-2', etc.) and deleting old ones with a delay (eg deleting 'Job-1' while 'Job-3' has started);以不同的方式命名您的模拟(例如“Job-1”、“Job-2”等)并延迟删除旧的模拟(例如在“Job-3”开始时删除“Job-1”);
  • Less preferable: using the time module不太可取:使用time模块

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM