马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?注册
x
自己编写了一个宏文件来读取 .mf文件中定义的功率 一直没有成功 大家帮忙分析一下 谢谢各位
project_file = ';F:/论文资料/design3D-2/test/test_Design_1/_trk/_flow/computation_1/computation_1.run';
data_filename = ';F:/论文资料/design3D-2/test/test_Design_1/_trk/_flow/_results/computation_1_u_power.dat';
solution_file = ';3D';
quantity_name = ';U_power';
entry_type = ';REAL_ENTRY';
import string
from f3d_macro import *
length=len(project_file)
Results_file=project_file[0:length-3]+';mf';
word='; ';
f=open(Results_file)
while get_string(word,1)!='ower'; :
word=f.readline()
value=get_float(word,2)
return value
f = open (data_filename, ';w';, 0)
f.write ('ARAMETER\n';)
s = ';NAME %s\n'; %(quantity_name)
f.write (s)
s = ';TYPE %s\n'; %(entry_type)
f.write (s)
s = ';VALUE %12.6f\n'; %(value)
f.write (s)
f.close ()
FileCloseProject()
Quit()
|