資源簡介
matlab開發-mtype340。基于H.Drueck的TRNSYS“多端口存儲模型”340型的儲熱罐模型

代碼片段和文件信息
%%?Test?simulation?of?the?mtype340:?charging/discharging?scenario?(stratified)?with?a?double?port?each
%-->?constant?power
%%?fixed?inputs:
Vs?=?1.25;?%?[m砞?->?1250?litre?tank
Hs?=?1.7;?%?[m]?height?of?storage?tank
UA_a?=?4.2691;?%?heat?loss?rates?of?the?zones?1..4?[W/K]
UA_u?=?0.333;?%?heat?loss?rate?bottom?[W/K]
UA_o?=?0.333;?%?heat?loss?rate?top?[W/K]
%?Heat?exchangers?not?used?-?HX?variables?are?set?to?nans:
zhi?=?-ones(41);?zho?=?zhi;?Vh?=?nan(41);?UA_h?=?zhi;?Thi?=?zhi;?mdoth?=?zhi;
zs?=?linspace(0.050.9510);?%?10?temperature?sensors?(relative?positions)
aux.var?=?2;?Paux?=?nan;?%?no?auxiliary?heater
delt?=?5;?%60;%300;%300;?%?time?step?size?[s]
nsth?=?3600./delt;?%?Number?of?passes?per?hour
Tamb?=?15;?%?ambient?temperature?[癈]
scdp?=?1;?%?stratified?charging
Nmax?=?10;?%?number?of?nodes
%%?Variable?parameters?(change?in?the?course?of?the?simulation)
%?double?ports
zdi?=?0.05;?%?Charging?from?below?(relative?position)
zdo?=?0.04;?%?rel.?position?of?the?DP?output
%?Tdi?=?90;?%DP-input?temperature?[癈]
Tz?=?15.*ones(Nmax1);?%?Start:?15?癈?in?the?whole?storage?tank
%%?Initialize?mtype340?object
ty?=?mtype340(Hs?Vs?UA_a?UA_u?UA_o?UA_h?zdi?zdo?scdp?aux?zhi?zho?Vh?zs?delt);
%?Init?temperature-matrix
Tmat?=?nan(Nmax14.*nsth-1);
Tmat(:1)?=?Tz;
SOC?=?nan(114.*nsth-1);
SOC(1)?=?(mean(Tz)-15)./75.*100;
Qout?=?zeros(114.*nsth-1);
eta?=?Qout;?eta(1)?=?1;
mdots?=?zeros(115.*nsth-1);?%Massenstr鰉e
mmdots?=?zeros(16);%mittlerer?Massenstrom?bei?jedem?Abschnitt
Qloss?=?zeros(size(SOC));
Qinput?=?Qloss;
%%?[1]?Heating?to?stand-by?temperature?30?kW?1?hour
%Assumption?DP-output.?Tdo?=?15?癈
%with?cpw?=?41795?Ws/(kg*K)
cpw?=?4179.5;
Qin?=?30000;?%Input-power?[W]
%?Set?properties
ty.Tdi?=?90;?%?DP-input?temperature?[癈]
ty.mdotd?=?-Qin./(cpw.*(ty.Tdi-15));?%?mass?flow?rate?[kg/s]
ty.Tamb?=?15;?%?ambient?temperature?[癈]
%?Initialize?simulation
ty.simulate;
%?Save?values
Qinput(2)?=?Qin;
Tmat(:2)?=?ty.Ts;
SOC(2)?=?(mean(ty.Tz)-15)./75.*100;
Qout(2)?=?ty.Qd;
eta(2)?=?ty.Qd./Qin;
Qloss(2)?=?ty.Qls;
t?=?ty.delt./3600;?%?simulated?time?in?hours
%?Loop?for?further?simulations?in?section?[1]
for?i?=?2:nsth-1?%#ok<*BDSCI>
????%?Determine?new?mass?flow?rate?for?constant?power
????ty.mdotd?=?-Qin./(cpw.*(ty.Tdi-ty.Tdo));
????mdots(i)?=?ty.mdotd;
????ty.simulate;
????%?Save?properties?in?arrays
????Tmat(:i)?=?ty.Ts;
????SOC(i)?=?(mean(ty.Tz)-15)./75.*100;
????t?=?[t;?t(end)?+?ty.delt./3600];?%#ok<*AGROW>
????Qout(i)?=?ty.Qd;
????eta(i)?=?ty.Qd./Qin;
????Qloss(i)?=?ty.Qls;
????Qinput(i)?=?Qin;
end
mmdots(1)?=?mean(mdots(1:i));
%{
fig?=?figure;
plot(tTmat(:1:nsth-1)‘);?hold?on
%}
%%?[2]?down?time?1?hour
Qin?=?0;
ty.mdotd?=?0;
for?i?=?nsth:2*nsth-1
????ty.simulate;
????%?Save?properties?in?array
????Tmat(:i)?=?ty.Ts;
????t?=?[t;?t(end)?+?delt./3600];
????SOC(i)?=?(mean(ty.Tz)-15)./75.*100;
????Qout(i)?=?ty.Qd;
????eta(i)?=?ty.Qd./Qin;
??
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????目錄???????????0??2016-12-19?23:14??MrcJkb-mtype340-6e9a9fd\
?????文件????????1316??2016-12-19?23:14??MrcJkb-mtype340-6e9a9fd\LICENSE
?????文件?????????448??2016-12-19?23:14??MrcJkb-mtype340-6e9a9fd\Matlab.gitignore
?????文件?????????163??2016-12-19?23:14??MrcJkb-mtype340-6e9a9fd\README.md
?????文件????????7460??2016-12-19?23:14??MrcJkb-mtype340-6e9a9fd\example_sc
?????文件???????53592??2016-12-19?23:14??MrcJkb-mtype340-6e9a9fd\mtype340.m
評論
共有 條評論