要生成包含所需結果的輸出文件(.rwo格式),我們必須運行報告程序的可執行文件,該程序使用參數文件(.rwd格式)。輸出文件是ReportBHP1.rwo,該文件將包含導出的變量。Matlab在使用'system'調用軟件時無法打開.dat文件作爲數據文件
現在要在Matlab中實現這一點,下面是一個小腳本,它給出了我試圖實現的目標。它爲每個實現調用CMG(軟件)並提取數據。
for nr=1:NREAL
dlmwrite(‘PERM.INC’,PERM(:,nr),’delimiter’,’\n’); % Writes the permeability file for each realization
system('mx200810.exe -f ReservoirModel_CMGBulider.dat') % Calls CMG
system('report.exe /f ReportBHP1.rwd /o ReportBHP1.rwo') % Calls Parameter file and generates output file
[TIME(:,j),BHP1(:,j)]=textread('ReportBHP1.rwo','%f\t%f','headerlines',5); % reading the time and BHP from output file generated for well 1
end
我所有的軟件需要.exe
和.dll
文件是在我有我的ReservoirModel_CMGBulider.dat
文件相同的文件夾。所以我通過我擁有所有這些文件的相同文件夾運行.m
文件。
我能夠生成輸出(.rwo)文件。但是,有在軟件的模擬報告,其中顯示在Matlab的命令窗口如下錯誤:
"...STOP: Unable to open the following file as data file:
'ReservoirModel_CMGBuilder.dat'
Check path name for spaces, special character or a total length greater than 256 characters
Cannot find data file named 'ReservoirModel_CMGBuilder.dat'
Date and Time of End of Run: .....
ans = 0"
我認爲它的讀取.dat文件只有一次,然後覆蓋第一個實現結果的休息實現。因此,所有實現的結果都與第一次實現相同。我需要幫助糾正這個錯誤。
不知道如何解決這個問題,但請讓我知道,如果你找到一些好油口袋:-) – Mau 2010-07-11 22:48:49
我不明白你的短語'油口袋'。 – Pupil 2010-07-11 22:53:44
必和必拓,滲透率,井,油藏... – Mau 2010-07-12 09:53:16