📄 analog.pas
字号:
unit Analog;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, Menus, TeEngine, Series, ExtCtrls, TeeProcs, Chart, ComCtrls,StrUtils,
StdCtrls,IniFiles;
type
TAnalogForm = class(TForm)
AnalogMenu: TMainMenu;
AnalogFile: TMenuItem;
AnalogSave: TMenuItem;
AnalogClose: TMenuItem;
Analog: TMenuItem;
Regenerator: TMenuItem;
Simulate: TMenuItem;
AnalogOpenHsdFile: TMenuItem;
AnalogOpenDialog: TOpenDialog;
AnalogSaveDialog: TSaveDialog;
AnalogMemo: TMemo;
Display: TMenuItem;
BurnTime: TMenuItem;
FumeByTime: TMenuItem;
FumeByHeight: TMenuItem;
BurnRegeneratorByTime: TMenuItem;
BurnRegeneratorByHeight: TMenuItem;
BlowTime: TMenuItem;
AirByTime: TMenuItem;
AirByHeight: TMenuItem;
BlowRegeneratorByTime: TMenuItem;
BlowRegeneratorByHeight: TMenuItem;
Precision: TMenuItem;
AnalogOpenHsdAndHsaFile: TMenuItem;
procedure FormClose(Sender: TObject; var Action: TCloseAction);
procedure AnalogCloseClick(Sender: TObject);
procedure SimulateClick(Sender: TObject);
procedure RegeneratorClick(Sender: TObject);
procedure AnalogOpenHsdFileClick(Sender: TObject);
procedure AnalogSaveClick(Sender: TObject);
procedure PrecisionClick(Sender: TObject);
procedure FumeByTimeClick(Sender: TObject);
procedure FumeByHeightClick(Sender: TObject);
procedure BurnRegeneratorByTimeClick(Sender: TObject);
procedure BurnRegeneratorByHeightClick(Sender: TObject);
procedure AirByTimeClick(Sender: TObject);
procedure AirByHeightClick(Sender: TObject);
procedure BlowRegeneratorByTimeClick(Sender: TObject);
procedure BlowRegeneratorByHeightClick(Sender: TObject);
procedure AnalogOpenHsdAndHsaFileClick(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
AnalogForm: TAnalogForm;
implementation
{$R *.dfm}
uses SESytemMDI, Regenerator,Declare,AnalogSet,DisplayAnalog;
procedure TAnalogForm.FormClose(Sender: TObject; var Action: TCloseAction);
begin
SESystemMDIForm.CommandRichEdit.Lines.Add('命令:关闭CLOSE'+chr(13));
Action:=caFree;
end;
procedure TAnalogForm.AnalogCloseClick(Sender: TObject);
begin
Close;
end;
procedure TAnalogForm.SimulateClick(Sender: TObject);
var k,i,j:integer;
tsolid,Tgas,Tair:array[1..41,1..41]of real;
Te1,Te2,ui0,ui,
A10,A20,B10,B20,Dw0,H10,H20,H30,H40,H50,K10,K20,K30,K40:Real;
tsolide,tsolids:array[1..41]of Real;
IniFile:TIniFile;
CurrentIterativeNumber:Int64;
a,b,c,d:String;
begin
SESystemMDIForm.CommandRichEdit.Lines.Add('命令:模拟SIMULATE'+chr(13));
IniFile := TIniFile.Create(ExtractFilePath(Application.exename)+'/SESystem.ini');
PrecisionValue:=Inifile.ReadFloat('Analog Parameter', 'PrecisionValue', 1 );
IterativeNumber:=Inifile.ReadInteger('Analog Parameter', 'IterativeNumber', 200);
IniFile.Free;
AnalogForm.AnalogMemo.Lines.Add('模拟参数设置');
AnalogForm.AnalogMemo.Lines.Add('精度:'+FloatToStr(PrecisionValue)+','+
'迭代次数:'+IntToStr(IterativeNumber));
k:=0;
for j:=1 to (MaxTime) do //j表示时间
begin
for i:=1 to (MaxPosition) do //i表示位置
begin
tsolid[i,1]:=1000; //tsolid蓄热体入口温度分布
tsolid[MaxPosition-i+1,MaxTime]:=1000; //tsolid[M-i-1,N-1] 表示蓄热体末时刻时的温度
Tgas[1,j]:=SESystemElement.Result_heatcompute[7]; //Tgas烟气温度分布,mainForm.ty表示理论燃烧温度
Tair[1,j]:= SESystemElement.q4_inheat[1];//冷风平均温度
end;
end;
Te1:=10;
Te2:=0;
CurrentIterativeNumber:=1;
while abs(Te1-Te2)>PrecisionValue do
begin
Te2:=Te1;
AnalogForm.AnalogMemo.Lines.Add('当前迭代次数:'+IntToStr(CurrentIterativeNumber)
+','+'日期:'+DateToStr(Date)+',时间:'+TimeToStr(Time));
CurrentIterativeNumber:=CurrentIterativeNumber+1;
if(CurrentIterativeNumber>IterativeNumber)then break;
for i:=1 to MaxPosition do
begin
tsolid[i,1]:=tsolid[MaxPosition-i+1,MaxTime]; //换炉,蓄热室温度交换
end;
for i:=1 to MaxPosition-1 do
begin
bRanShao:=TRUE;
EquationCoefficient(Tgas[i,1],i*36/MaxPosition, tsolid[i,1],1);
A10:=AnalogElement.CommonCoefficient[1];
A20:=AnalogElement.CommonCoefficient[2];
B10:=AnalogElement.CommonCoefficient[3];
B20:=AnalogElement.CommonCoefficient[4];
Dw0:=AnalogElement.CommonCoefficient[5]; //
Tgas[i+1,1]:=A10*Tgas[i,1]+A20*(tsolid[i+1,1]+ tsolid[i,1])-Dw0;
tsolid[1,1]:=B10*tsolid[1,1]+B20*(Tgas[1,1]+Tgas[1,1]);
end;
//燃烧期
for j:=1 to (MaxTime-1) do
begin
for i:=1 to (MaxPosition) do
begin
bRanShao:=TRUE;
EquationCoefficient(Tgas[i,j],i*36/MaxPosition, tsolid[i,j],1);
A10:=AnalogElement.CommonCoefficient[1];
A20:=AnalogElement.CommonCoefficient[2];
B10:=AnalogElement.CommonCoefficient[3];
B20:=AnalogElement.CommonCoefficient[4];
Dw0:=AnalogElement.CommonCoefficient[5]; //
K10:=AnalogElement.CommonCoefficient[11];
K20:=AnalogElement.CommonCoefficient[12];
K30:=AnalogElement.CommonCoefficient[13];
K40:=AnalogElement.CommonCoefficient[14];
if i=1 then tsolid[i,j+1]:=B10*tsolid[i,j]+B20*(Tgas[i,j+1]+Tgas[i,j])
else
begin
tsolid[i,j+1]:=K10*tsolid[i,j]+K20*Tgas[i,j]+K30*tsolid[i-1,j+1]+K40*Tgas[i-1,j+1];
Tgas[i,j+1]:=A10*Tgas[i-1,j+1]+A20*(tsolid[i,j+1]+ tsolid[i-1,j+1])-Dw0;
end;
end; //燃烧期i循环结束
end; //燃烧期j循环结束
AnalogForm.AnalogMemo.Lines.Add('燃烧期');
for j:=1 to MaxTime do
begin
a:='蓄热体:'+IntToStr(j)+',';
b:='烟气:'+IntToStr(j)+',';
for i:=1 to MaxPosition do
begin
a:=a+IntToStr(i)+',';
b:=b+IntToStr(i)+',';
AnalogElement.TempRegenerator[1,i,j]:=int(100*tsolid[i,j])/100;
AnalogElement.TempFume[i,j]:=int(100*Tgas[i,j])/100;
a:=a+FloatToStr(AnalogElement.TempRegenerator[1,i,j])+',';
b:=b+FloatToStr(AnalogElement.TempFume[i,j])+',';
end;
a:=a+';';
b:=b+';';
AnalogForm.AnalogMemo.Lines.Add(a);
AnalogForm.AnalogMemo.Lines.Add(b);
end;
for i:=1 to MaxPosition do
tsolide[i]:=tsolid[i,MaxTime]; //保存燃烧期末期数据
//送风期
for i:=1 to MaxPosition do
begin
tsolid[i,1]:=tsolid[MaxPosition-i+1,MaxTime]; //换炉,蓄热室温度交换
end;
ui0:=SESystemElement.wind;
for j:=1 to (MaxTime-1) do //时间
begin
ui:=FUT(ui0,j*SESystemElement.q1_inheat[4]/(MaxTime-1));
for i:=1 to (MaxPosition) do //位置
begin
bRanShao:=FALSE;
EquationCoefficient(Tair[i,j],i*36/MaxPosition, tsolid[i,j],ui);
A10:=AnalogElement.CommonCoefficient[1];
A20:=AnalogElement.CommonCoefficient[2];
B10:=AnalogElement.CommonCoefficient[3];
B20:=AnalogElement.CommonCoefficient[4];
Dw0:=AnalogElement.CommonCoefficient[5]; //
K10:=AnalogElement.CommonCoefficient[11];
K20:=AnalogElement.CommonCoefficient[12];
K30:=AnalogElement.CommonCoefficient[13];
K40:=AnalogElement.CommonCoefficient[14];
if i<MaxPosition then Tair[i+1,1]:=A10*Tair[i,1]+A20*(tsolid[i+1,1]+ tsolid[i,1])-Dw0;
tsolid[1,1]:=B10*tsolid[1,1]+B20*(Tair[1,1]+Tair[1,1]);
if (i=1) then tsolid[i,j+1]:=B10*tsolid[i,j]+B20*(Tair[i,j+1]+Tair[i,j])
else
begin
tsolid[i,j+1]:=K10*tsolid[i,j]+K20*Tair[i,j]+K30*tsolid[i-1,j+1]+K40*Tair[i-1,j+1];
Tair[i,j+1]:=A10*Tair[i-1,j+1]+A20*(tsolid[i,j+1]+ tsolid[i-1,j+1])-Dw0;
end;
end; //送风期i的循环结束
end; //送风期j循环结束
for i:=1to MaxPosition do
tsolids[i]:=tsolid[i,MaxTime]; //保存燃烧期初期数据
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -