GetSteamZoneParameters出错(第7行)[tcD] = FindtcD(fhv);
我没有更多的描述。
当我通过命令窗口调用它时,GetSteamZoneParameters函数工作正常。但是当我通过SAGD.m调用此函数时,我得到了错误。
此代码是油田蒸汽注入模拟器的一部分。
enter code here
function [ Cw, fhv, Mw, Mo, Mr, s,tD , tcD, WOR, OSR ] = SAGD(fPD, qo,length1, cumTime, cum_oil_tot,cum_wat_tot, cum_steam_tot, cycle, Ts,Ti, Xinj, API, Swi, phi, alpha,...
reservoirThickness, Ms, Qi, rl, soakTime, pi, absolutePerm, convFactor,g, Pwf,...
Sorw, WIP, rinj, injTime, qwcum, qw, timeStep, prodTime )
%UNTITLED Summary of this function goes here
% Detailed explanation goes here
cum_wat(cycle) = 0.0;
cum_oil(cycle) = 0.0;
if(cycle>1)
Qi(cycle) = Qi(cycle) + Q(cycle-1);
end
%Start cycle calculations
time=0.0;
while time <= injTime(cycle)+soakTime(cycle)+prodTime(cycle)
if time <= injTime(cycle)
cum_steam_tot = cum_steam_tot + 5.615*rinj(cycle)*timeStep;
Tavg = Ts;
end
if(time == 0.0)
[ ~, fhv, ~, ~, ~, ~, ~] = GetVolumetricHeatCapacities( Ts,Ti,Tavg, Xinj, API, Swi, phi, alpha, time, reservoirThickness, Ms);
[ tcD ] = FindtcD( fhv );
end
[Cw, fhv, Mw, Mo, Mr, s, tD] = GetVolumetricHeatCapacities( Ts,Ti,Tavg, Xinj, API, Swi, phi, alpha, time, reservoirThickness, Ms);
[Qi, angleOfInclination, steamZoneRadius, steamZoneVolume ] = GetSteamZoneParameters( Qi,fhv, tD, cycle, rinj, Xinj, time, injTime, Tavg, Ti, Mr, Ts, reservoirThickness, length1);
[ fVD, fHD ] = GetfVDfHD( time, injTime, cycle, alpha, reservoirThickness, steamZoneRadius );
[ fPD] = GetfPD( fPD, Qi, Mo,Mw, cycle, steamZoneVolume,steamZoneRadius, Mr, length1, rl ,Ts, Ti, soakTime, pi, alpha , Tavg, absolutePerm, convFactor, API,reservoirThickness,g, angleOfInclination, Pwf,Sorw, WIP, rinj, injTime, cum_wat, qwcum, qw, timeStep, Swi );
[ Tavg ] = GetTemperatures( cycle, time, Ts, injTime, timeStep, soakTime, Ti, fHD, fVD,fPD);
if time > injTime(cycle) + soakTime(cycle)
[ qo ] = GetInstantaneousOilRate( absolutePerm, convFactor, API,reservoirThickness,g, Tavg, angleOfInclination, pi, Pwf,Sorw, WIP, cycle, rinj, injTime, cum_wat, qwcum, qw, timeStep, Swi );
[ qw ] = GetInstantaneousWaterRate( WIP ,cycle ,Tavg, Sorw, angleOfInclination, rinj, injTime, cum_wat, qwcum, pi, timeStep, Swi, Pwf, g, reservoirThickness, convFactor, absolutePerm, qw, krw );
cum_oil_tot = cum_oil_tot + qo;
cum_wat_tot = cum_wat_tot + qw;
cum_oil(cycle) = cum_oil(cycle)+ qo;
cum_wat(cycle) = cum_wat(cycle) + qw;
end
if time <= injTime(cycle)
Tavg = Ts;
end
WOR = qw/qo;
OSR = cum_oil_tot/cum_steam_tot;
cumTime = cumTime + 1.0;
time = time + timeStep;
end
end
**Error:**
- Error in GetSteamZoneParameters (line 7) tcD = FindtcD( fhv );
Output argument "angleOfInclination" (and maybe others) not assigned
during call to
"H:\MATLAB\CSI-mine\GetSteamZoneParameters.m>GetSteamZoneParameters".
Error in SAGD (line 29) [Qi, angleOfInclination, steamZoneRadius,
steamZoneVolume ] = GetSteamZoneParameters( Qi,fhv, tD, cycle, rinj,
Xinj, time, injTime, Tavg, Ti, Mr, Ts, reservoirThickness, length1);
function [Qi, angleOfInclination, steamZoneRadius, steamZoneVolume ] = GetSteamZoneParameters( Qi,fhv, tD, cycle, rinj, Xinj, time,...
injTime, Tavg, Ti, Mr, Ts, reservoirThickness, length1)
%UNTITLED Summary of this function goes here
% Detailed explanation goes here
tcD = FindtcD( fhv );
Ehs = GetEhs( tD, tcD );
wt = 5.615*rinj(cycle)*62.4;
ws = Xinj*wt;
if( time ~= 0.0 && time <= injTime(cycle))
Qi = Qi+(wt*(h_wat(Tavg)-h_wat(Ti))+ws*latent_heat_vapor(Tavg));
end
if (time <= injTime(cycle))
steamZoneVolume = Ehs*Qi(cycle)/(Mr*(Ts-Ti));
steamZoneArea = steamZoneVolume/reservoirThickness;
steamZoneRadius = steamZoneArea / length1;
angleOfInclination =(180.0/pi)*atan(steamZoneRadius/reservoirThickness);
end
end
答案 0 :(得分:2)
嗯,阅读错误消息:
"angleOfInclination" was not assigned
这意味着,GetSteamZoneParameters
没有设置此变量,然后当它应该返回时当然会抛出错误。
其中,查看此函数意味着以下if条件显然不正确:
if (time <= injTime(cycle))
..
end
因此,您可能应该在else块中的if块中定义和替换变量值。