From OpenSCADAWiki
Jump to: navigation, search

Other languages:
Name Version License Source Languages Author Description
Library of models of the technological apparatuses 2.0 GPLv2 OscadaLibs.db (SQL, GZip) > DAQ.JavaLikeCalc.techApp en, uk, ru Roman Savochenko
  Maxim Lysenko (2007,2010), Ksenia Yashina (2007)
Library of models of the technological apparatuses for creating complex simulators of the technological processes of block-schemes of the module DAQ.BlockCalc.

The library is created to provide models of devices of the technological processes. The library is not static, but based on the module JavaLikeCalc, allowing to create calculations on the Java-like language. The functions' names and its parameters are available in languages: English, Ukrainian and mRussian.

To address the library functions you can use the static call address DAQ.JavaLikeCalc.lib_techApp.{Func}() or dynamic SYS.DAQ.JavaLikeCalc["lib_techApp"]["{Func}"].call(), SYS.DAQ.JavaLikeCalc["lib_techApp"].{Func}()". Where {Func} — function identifier in the library.

For connection the library to a project of the OpenSCADA station you can obtain the database file as:

  • supplied with a ready and proper package of the Linux distribution like to "openscada-libdb-main", "openscada-LibDB.Main";
  • directly taken for most actual one from the subversion repository and converted to the DB SQLite file in way:
wget http://oscada.org/svn/trunk/OpenSCADA/data/LibsDB/OscadaLibs.sql
sqlite3 -init OscadaLibs.sql OscadaLibs.db .exit

This obtained file next you can place into the project directory of the station and create the database object for the DB module "SQLite", registering the database file in the configuration.

1 Conception

The basis of the model of each apparatus is the calculation of the input flow and output pressure, based on the input pressure and output flow. In general, models of the technological devices are described by difference equations for discrete machines.

Basing on the functions of this library you can easily and quickly build models of technological processes in the module BlockCalc, combining the blocks in accordance with the technological scheme. Example of combination of several devices of the technological scheme is shown in Figure 1.

Fig.1. An example of the block scheme of the technological process.

The basis of any model of the technological device are two basic formulas, that is the formula of flow and pressure. The canonical formula for flow of the environment for the intersection of the pipe or passageway of the narrowing has the form (1).

TechApps flow1.png (1)

Where:

F — mass flow (ton/hour).
S — section (m2).
Qr — real density of the environment (kg/m3).
∆P — pressure difference (at).

The actual density is calculated by the formula (2).

TechApps dens.png (2)

Where:

Q0 — density of the environment under the normal conditions (kg/m3).
Kpr — coefficient of the compressibility of the environment (0,001 — liquid; 0,95 — gas).
Pi — input pressure (at).

Each pipe makes the dynamic resistance to the flow, associated with the friction of the pipe walls and that depends on the flow speed. The dynamic resistance of the pipe is represented by (3). The total flow of the environment, taking into account the dynamic resistance is calculated by the formula (4).

TechApps flowR.png (3)

Where:

∆P — pressure difference (at), the resistance of the pipe walls to flow of the environment.
Kr — coefficient of friction of the pipe walls.
D — diameter of the pipeline (m).
l — pipeline length (m).
v — flow speed in the pipeline (m3/hour).

TechApps flow2.png (4)

The equation (1) describes the laminar flow of the environment up to the critical speeds. In the case of exceeding the critical flow speed, the calculation is made by the formula (5). A universal formula for calculating the flow at all speeds will have the view (6).

TechApps flowCrit.png (5)

Where:

Pi — pressure at the pipe beginning.

TechApps flow3.png (6)

Where:

Po — pressure at the pipe ending.

In the dynamical systems the change of the flow at the pipe ending does not change instantaneously, but lags behind the time travel of the environment part from the pipe beginning to its ending. The time depends on the length of the pipe and speed of the environment in the pipe. Delay of the flow changing at the pipe ending can be described by the formula (7). The resulting formula for calculating of the the flow in the pipe, taking into account the above features, is written in the view (8).

TechApps flowLag.png (7)

Where:

Fo — flow at the pipe ending.
t — time.
v — speed of the flow = F/(Qr*S).

TechApps flow4.png (8)

The environment pressure in the volume is usually calculated identically for all cases, by the formula (9).

TechApps pressure.png (9)

2 Structure of the library

The library contains about two dozen of models of the often needed devices of the technological processes and the additional elements. The functions' names and their parameters are available in three languages: English, Ukrainian and mRussian.

2.1 Lag (lag)

Lag model. Can be used for lag imitation of the sensor variables.

Parameters

Identifier Parameter Type Mode Hidden Default
out Output Real Return false 0
in Input Real Input false 0
t_lg Lag time, seconds Real Input false 10
f_frq Calculation frequency, Hz Real Input true 100

Program

out -= (out-in)/(t_lg*f_frq);

2.2 Noise: 2 harmonic + rand (noise)

Noise model. Contains three parts:

  • first harmonic part;
  • second harmonic part;
  • noise based on generator of the randomize numbers.

Parameters

Identifier Parameter Type Mode Hidden Default
out Output Real Return false 0
off Main offset Real Input false 1
a_g1 Amplitude of the harmonic 1 Real Input false 10
per_g1 Period of the harmonic part 1, seconds Real Input false 10
a_g2 Amplitude of the harmonic 2 Real Input false 5
per_g2 Period of the harmonic part 2, seconds Real Input false 0.1
a_rnd Amplitude of the random numbers Real Input false 1
f_frq Calculation frequency, Hz Real Input true 100
tmp_g1 Counter of the harmonic 1 Real Input true 0
tmp_g2 Counter of the harmonic 2 Real Input true 0

Program

tmp_g1 = (tmp_g1 > 6.28) ? 0 : tmp_g1+6.28/(per_g1*f_frq);
tmp_g2 = (tmp_g2 > 6.28) ? 0 : tmp_g2+6.28/(per_g2*f_frq);
out = off + a_g1*sin(tmp_g1) + a_g2*sin(tmp_g2) + a_rnd*(rand(2)-1);

2.3 Ball crane (ballCrane)

Model of the ball crane. Includes for the going and estrangement time.

Parameters

Identifier Parameter Type Mode Hidden Default
pos Position, % Real Output false 0
com Command Boolean Input false 0
st_open State "Opened" Boolean Output false 0
st_close State "Closed" Boolean Output false 1
t_full Going time, seconds Real Input false 5
t_up Estrangement time, seconds Real Input false 0.5
f_frq Calculation frequency, Hz Real Input true 100
tmp_up Estrangement counter Real Input true 0
lst_com Last command Boolean Input true 0

Program

if(!(st_close && !com) && !(st_open && com)) {
  tmp_up = (pos > 0 && pos < 100) ? 0 : (tmp_up>0&&lst_com==com)?tmp_up-1/f_frq:t_up;
  pos += (tmp_up > 0) ? 0 : (100*(com?1:-1))/(t_full*f_frq);
  pos = (pos > 100) ? 100 : (pos<0)?0:pos;
  st_open = (pos >= 100) ? true : false;
  st_close = (pos <= 0) ? true : false;
  lst_com = com;
}

2.4 Separator (separator)

Separator model with two phases, liquid and gas.

Parameters

Identifier Parameter Type Mode Hidden Default
Fi Input flow, ton/h Real Output false 0
Pi Input pressure, at Real Input false 1
Si Input cutset, m2 Real Input false 0.2
Fo Output flow, ton/h Real Input false 0
Po Output pressure, at Real Output false 1
So Output cutset, m2 Real Input false 0.2
lo Output length, m Real Input false 10
Fo_lq Output liquid flow, ton/h Real Input false 0
Po_lq Output liquid pressure, at Real Output false 1
Llq Liquid level, % Real Output false 0
PercLq  % liquid Real Input false 0.01
Vap Device capacity, m3 Real Input false 10
Q0 Norm density of the environment, kg/m3 Real Input false 1
Qlq Liquid density, kg/m3 Real Input false 1000
f_frq Calculation frequency, Hz Real Input true 200

Program

Flq = max(0, Fi*PercLq);
DAQ.JavaLikeCalc.lib_techApp.pipeBase(Fi, Pi, 293, Si, Fo+Flq, Po, 293, So, lo, Q0, 0.95, 0.01, f_frq);
Llq = max(0, min(100,Llq+0.27*(Flq-Fo_lq)/(Vap*Qlq*f_frq)));
Po_lq = Po + Llq*Vap/Qlq;

2.5 Valve (valve)

Valve model, include:

  • two valves in the one;
  • super-critical speed;
  • temperature changing at the throttling;
  • work in one direction, back valve;
  • speed control of the position changing;
  • nonlinearity of the intersection from the position.

Parameters

Identifier Parameter Type Mode Hidden Default
Fi Input flow, ton/h Real Output false 0
Pi Input pressure, at Real Input false 1
Ti Input temperature, K Real Input false 273
Fo Output flow, ton/h Real Input false 0
Po Output pressure, at Real Output false 1
To Output temperature, K Real Output false 273
So Output pipe cutset, m2 Real Input false 0.2
lo Output pipe length, m Real Input false 10
S_v1 Valve 1 cutset, m2 Real Input false 0.1
l_v1 Valve 1 position, % Real Input false 0
t_v1 Valve 1 opening time, seconds Real Input false 10
S_v2 Valve 2 cutset, m2 Real Input false 0.05
l_v2 Valve 2 position, % Real Input false 0
t_v2 Valve 2 opening time, seconds Real Input false 5
Q0 Norm density of the environment, kg/m3 Real Input false 1
Kln Coefficient of the linearity Real Input false 1
Kpr Coefficient of the compressibility [0...1] Real Input false 0.95
Ct Heat capacity of the environment Real Input false 20
Riz Heat resistance of the isolation Real Input false 20
noBack Back valve Boolean Input false 0
Fwind Air speed Real Input false 1
Twind Air temperature, K Real Input false 273
f_frq Calculation frequency, Hz Real Input true 200
tmp_l1 Lag of the position 1 Real Output true 0
tmp_l2 Lag of the position 2 Real Output true 0

Program

Qr = Q0+Q0*Kpr*(Pi-1);
tmp_l1 += (abs(l_kl1-tmp_l1) > 5) ? 100*sign(l_kl1-tmp_l1)/(t_kl1*f_frq) : (l_kl1-tmp_l1)/(t_kl1*f_frq);
tmp_l2 += (abs(l_kl2-tmp_l2) > 5) ? 100*sign(l_kl2-tmp_l2)/(t_kl2*f_frq) : (l_kl2-tmp_l2)/(t_kl2*f_frq);
Sr = (S_kl1*pow(tmp_l1,Kln)+S_kl2*pow(tmp_l2,Kln))/pow(100,Kln);

DAQ.JavaLikeCalc.lib_techApp.pipeBase(Fi, Pi, Ti, Sr, EVAL_REAL, Po, 293, So, lo, Q0, Kpr, 0.01, f_frq);
if(noBack) Fi = max(0, Fi);
Po = max(0, min(100,Po+0.27*(Fi-Fo)/(Q0*Kpr*So*lo*f_frq)));

To = max(0, min(2e3,To+(abs(Fi)*(Ti*pow(Po/Pi,0.02)-To)+(Fwind+1)*(Twind-To)/Riz)/(Ct*So*lo*Qr*f_frq)));

2.6 Lag: clean (lagClean)

Model of clean(transportable) lag. Realizes by incorporating several links of a simple delay. Appointed for lags into long pipes.

Parameters

Identifier Parameter Type Mode Hidden Default
out Output Real Return false 0
in Input Real Input false 0
t_lg Lag time, seconds Real Input false 10
f_frq Calculation frequency, Hz Real Input true 100
cl1 Link 1 Real Input true 0
cl2 Link 2 Real Input true 0
cl3 Link 3 Real Input true 0

Program

cl1 -= (cl1-in)/(t_lg*f_frq/4);
cl2 -= (cl2-cl1)/(t_lg*f_frq/4);
cl3 -= (cl3-cl2)/(t_lg*f_frq/4);
out -= (out-cl3)/(t_lg*f_frq/4);

2.7 Boiler: barrel (boilerBarrel)

The model of the boiler's barrel.

Parameters

Identifier Parameter Type Mode Hidden Default
Fi1 Input water flow, ton/h Real Output false 22
Pi1 Input water pressure, at Real Input false 43
Ti1 Input water temperature, K Real Input false 523
Si1 Input water pipes cutset, m2 Real Input false 0.6
Fi2 Input smoke gas flow, ton/h Real Output false
Pi2 Input smoke gas pressure, at Real Input false 1.3
Ti2 Input smoke gas temperature, K Real Input false 1700
Si2 Input smoke gas pipes cutset, m2 Real Input false 10
Vi1 Barrel volume, m3 Real Input false 3
Lo Barrel level, % Real Output false 10
S Heating surface, m2 Real Input false 15
k Heat transfer coefficient Real Input false 0.8
Fo Output steam flow, ton/h Real Input false 20
Po1 Output steam pressure, at Real Output false 41.68
To1 Output steam temperature, K Real Output false 10
So1 Output steam pipe cutset, m2 Real Input false 0.5
lo1 Output steam pipe length, m Real Input false 5
Fo2 Output smoke gas flow, ton/h Real Input false 180
Po2 Output smoke gas pressure, at Real Output false 1
To2 Output smoke gas temperature, K Real Input false 0
Fstm Inner barrel steam flow, ton/h Real Output false 0
Tv Inner water temperature, K Real Output false 0
f_frq Calculation frequency, Hz Real Input false 200

Program

// Water
DAQ.JavaLikeCalc.lib_techApp.pipeBase(Fi1, Pi1, 293, Si1, EVAL_REAL, Po1, 293, So1, lo1, 1e3, 0.001, 0.01, f_frq);
Fi1 = max(0, Fi1);

// Steam
Lo = max(0, min(100,Lo+(Fi1-Fstm)*100/(Vi1*1000*f_frq)));
To1 = (100*pow(Po1,0.241)+5) + 273;

if(Tv < To1) {
  Tv += (k*S*(Ti2-Tv)-Fi1*0.00418*(Tv-Ti1))/f_frq;
  Fstm = 0;
}
if(Tv >= To1) {
  Tv = To1;
  Lambda = 2750-0.00418*(Tv-273);
  Fstm = (5*S*Fi2*(Ti2-Tv)-Fi1*0.00418*(Tv-Ti1))/(Po1*Lambda);
}

To2 = Ti2-Tv/k;
Po1 = max(0, min(100,Po1+0.27*(Fstm-Fo)/(1.2*0.98*((1-Lo/100)*Vi1+So1*lo1)*f_frq)));

// Smoke gas
DAQ.JavaLikeCalc.lib_techApp.pipeBase(Fi2, Pi2, 293, Si2, Fo2, Po2, 293, Si2, 30, 1.2, 0.98, 0.01, f_frq);

2.8 Boiler: burner (boilerBurner)

The fire-chamber model of the boiler unit, which operates on three types of fuel, initially is: blast-furnace, coke and natural gases.

Parameters

Identifier Parameter Type Mode Hidden Default
Fi1 Input blast furnace gas flow, ton/h Real Output false
Pi1 Input blast furnace gas pressure, at Real Input false
Ti1 Input blast furnace gas temperature, K Real Input false 40
Si1 Input blast furnace gas pipe cutset, m2 Real Input false
Fi2 Input natural gas flow, ton/h Real Output false
Pi2 Input natural gas pressure, at Real Input false
Ti2 Input natural gas temperature, K Real Input false 20
Si2 Input natural gas pipe cutset, m2 Real Input false
Fi3 Input coke oven gas flow, ton/h Real Output false
Pi3 Input coke oven gas pressure, at Real Input false
Ti3 Input coke oven gas temperature, K Real Input false 0
Si3 Input coke oven gas pipe cutset, m2 Real Input false
Fi4 Input air flow, ton/h Real Output false
Pi4 Input air pressure, at Real Input false
Ti4 Input air temperature, K Real Input false 20
Si4 Input air pipe cutset, m2 Real Input false
Fo Output smoke gas flow, ton/h Real Input false
Po Output smoke gas pressure, at Real Output false
To Output smoke gas temperature, K Real Output false
So Output smoke gas pipe cutset, m2 Real Input false 90
lo Output smoke gas pipe length, m Real Input false
V Burner volume, m3 Real Input false 830
CO Percentage of CO in the flue stack gases, % Real Output false
O2 Percentage of O2 in the flue stack gases, % Real Output false
f_frq Calculation frequency, Hz Real Input false 200

Program

using DAQ.JavaLikeCalc.lib_techApp;
pipeBase(Fi1, Pi1, Ti1, Si1, EVAL_REAL, Po, 293, So, lo, 1.2, 0.95, 0.01, f_frq); Fi1 = max(0, Fi1);
pipeBase(Fi2, Pi2, Ti2, Si2, EVAL_REAL, Po, 293, So, lo, 0.7, 0.95, 0.01, f_frq); Fi2 = max(0, Fi2);
pipeBase(Fi3, Pi3, Ti3, Si3, EVAL_REAL, Po, 293, So, lo, 1.33, 0.95, 0.01, f_frq); Fi3 = max(0, Fi3);
pipeBase(Fi4, Pi4, Ti4, Si4, EVAL_REAL, Po, 293, So, lo, 1.293, 0.95, 0.01, f_frq); Fi4 = max(0, Fi4);

Neobhod_vzd = Fi1 + 10*Fi2 + 4*Fi3;
F_DG = Fi1 + Fi2 + Fi3 + Fi4;
O2 = max(0, min(100,(Fi4-Neobhod_vzd)*100/F_DG));
CO = min(100, (O2<1) ? (1.2*abs(O2)) : 0);
koef = min(1, Fi4/Neobhod_vzd);
Q = koef*(8050*Fi2+3900*Fi3+930*Fi1);
delta_t = Q/(F_DG*1.047);
To = max(0, min(2000,(delta_t+(Ti4-273)+(Ti3-273)*(Fi3/Fi1)+(Ti2-273)*(Fi2/Fi1)+(Ti1-273)*(Fi1/Fi4))+273));

Po = max(0, min(10,Po+0.27*(F_DG-Fo)/(1.2*0.95*(So*lo+V)*f_frq)));

2.9 Network: load (net)

Loading with constant pressure on the network. Contains a parameter for connection the noise.

Parameters

Identifier Parameter Type Mode Hidden Default
Fi Input flow, ton/h Real Output false 10
Pi Input pressure, at Real Input false 1
Po Output pressure setpoint, at Real Input false 1
So Output pipe cutset, m2 Real Input false 0.1
Kpr Coefficient of the compressibility [0...1] Real Input false 0.95
Noise Input flow's noise Real Input false 1
Q0 Norm density of the environment, kg/m3 Real Input false 1
f_frq Calculation frequency, Hz Real Input true 200

Program

DAQ.JavaLikeCalc.lib_techApp.pipeBase(Fi, Pi, 293, So, EVAL_REAL, Po, 293, So, 10, Q0, Kpr, 0.01, f_frq);

2.10 Source: pressure (src_press)

Source of the constant pressure. Contains a parameter for connection the noise.

Parameters

Identifier Parameter Type Mode Hidden Default
Pi Input pressure setpoint, at Real Input false 10
Fo Output flow, ton/h Real Input false 0
Po Output pressure, at Real Output false 1
So Output pipe cutset, m2 Real Input false 0.1
lo Output pipe length, m Real Input false 100
Noise Input flow's noise Real Input false 1
Q0 Norm density of the environment, kg/m3 Real Input false 1
Kpr Coefficient of the compressibility [0...1] Real Input false 0.95
f_frq Calculation frequency, Hz Real Input true 200
Fit Input flow, lagged Real Output true 0

Program

DAQ.JavaLikeCalc.lib_techApp.pipeBase(Fit, Pi*Noise, 293, So, Fo, Po, 293, So, lo, Q0, Kpr, 0.01, f_frq);

2.11 Air cooler (cooler)

Model of the air cooler for gas flow.

Parameters

Identifier Parameter Type Mode Hidden Default
Fi Input flow, ton/h Real Output false 0
Pi Input pressure, at Real Input false 1
Ti Input temperature, K Real Input false 273
Si Cooler's pipes cutset, m2 Real Input false 0.05
li Full cooler's pipes length, m Real Input false 10
Fo Output flow, ton/h Real Input false 0
Po Output pressure, at Real Output false 1
To Output temperature, K Real Output false 273
So Output pipe cutset, m2 Real Input false 0.2
lo Output pipe length, m Real Input false 10
Tair Cooling air temperature, К Real Input false 283
Wc Cooler performance Real Input false 200
Q0 Norm density of the environment, kg/m3 Real Input false 1
Ct Heat capacity of the environment Real Input false 100
Rt Heat resistance Real Input false 1
f_frq Calculation frequency, Hz Real Input true 200

Program

DAQ.JavaLikeCalc.lib_techApp.pipeBase(Fi, Pi, 293, Si, Fo, Po, 293, So, lo, Q0, 0.95, 0.01, f_frq);
Qr = Q0 + Q0*0.95*(Pi-1);
To += (Fi*(Ti-To)+Wc*(Tair-To)/Rt)/(Ct*(Si*li+So*lo)*Qr*f_frq);

2.12 Gas compressor (compressor)

Model of the gas compressor. Implements the surge effect. The surge counts from the dynamic-gas curve, and next there counts the surge margin coefficient.

Parameters

Identifier Parameter Type Mode Hidden Default
Fi Input flow, ton/h Real Output false 0
Pi Input pressure, at Real Input false 1
Ti Input temperature, K Real Input false 273
Fo Output flow, ton/h Real Input false 0
Po Output pressure, at Real Output false 1
To Output temperature, K Real Output false 273
So Output pipe cutset, m2 Real Input false 0.2
lo Output pipe length, m Real Input false 2
Kmrg Surge protect margin coefficient Real Output false 0.1
N Turnovers, 1000 x turn/min Real Input false 0
V Capacity, m3 Real Input false 7
Kpmp Surge coefficient, surge point Real Input false 0.066
Kslp Slope coefficient of the surge curve Real Input false 0.08
Q0 Norm density of the environment, kg/m3 Real Input false 1
Kpr Coefficient of the compressibility [0...1] Real Input false 0.95
Ct Heat capacity of the environment Real Input false 100
Riz Heat resistance of the isolation Real Input false 100
Fwind Air speed Real Input false 1
Twind Air temperature, K Real Input false 273
f_frq Calculation frequency, Hz Real Input true 200
Fit Input flow, lagged Real Output true 0

Program

Pmax = max(Pi, Po);
Pmin = min(Pi, Po);
Qr = Q0 + Q0*Kpr*(Pi-1);
Qrf = Q0 + Q0*Kpr*(Pmax-1);
Ftmp = (N > 0.1) ? (1-10*(Po-Pi)/(Qr*(pow(N,3)+0.1)*Kpmp)) : 1;
Kmrg = 1-Ftmp;  //The margin coefficient
Fi = V*N*Qr*sign(Ftmp)*pow(abs(Ftmp),Kslp)+
     0.3*(4*So*Qrf/(0.01*lo*1.7724+4*Qrf))*sign(Pi-Po)*pow(Qrf*(Pmax-max(Pmax*0.528,Pmin)),0.5);
Fit -= (Fit-Fi)/max(1,(lo*f_frq)/max(1e-4,abs(Fi/(Qrf*So))));
Po = max(0, min(100,Po+0.27*(Fi-Fo)/(Q0*Kpr*So*lo*f_frq)));

To += (abs(Fi)*(Ti*pow(Po/Pi,0.3)-To)+(Fwind+1)*(Twind-To)/Riz)/(Ct*(V+So*lo)*Qr*f_frq);

2.13 Source: flow (src_flow)

Source of the constant flow. Contains a parameter for connection the noise.

Parameters

Identifier Parameter Type Mode Hidden Default
Fi Input flow setpoint, ton/h Real Input false 10
Fo Output flow, ton/h Real Input false 10
Po Output pressure, at Real Output false 1
So Output pipe cutset, m2 Real Input false 0.1
lo Output pipe length, m Real Input false 100
Noise Input flow's noise Real Input false 1
Q0 Norm density of the environment, kg/m3 Real Input false 1
Kpr Coefficient of the compressibility [0...1] Real Input false 0.95
f_frq Calculation frequency, Hz Real Input true 100

Program

Po = max(0, min(100,Po+0.27*(Noise*Fi-Fo)/(Q0*Kpr*So*lo*f_frq)));

2.14 Pipe-base (pipeBase)

Implementation of the basic foundations of the pipe model:

  • flow in the pipe, taking into account: the speed, pressure difference, resistance due to friction and the critical flow;
  • calculation of the pressure;
  • accounting for the environment density and degree of the compressibility for both gases and liquids.

Parameters

Identifier Parameter Type Mode Hidden Default
Fi Input flow, ton/h Real Output false 0
Pi Input pressure, at Real Input false 1
Ti Input temperature, K Real Input false 293
Si Input cutset, m2 Real Input false 0.2
Fo Output flow, ton/h Real Input false 0
Po Output pressure, at Real Output false 1
To Output temperature, K Real Output false 293
So Output cutset, m2 Real Input false 0.2
lo Output length, m Real Input false 10
Q0 Norm density of the environment, kg/m3 Real Input false 1
Kpr Coefficient of the compressibility [0...1] Real Input false 0.98
Ktr Coefficient of friction Real Input false 0.01
f_frq Calculation frequency, Hz Real Input false 100

Program

Pmax = max(Pi, Po);
Pmin = min(Pi, Po);
Qr = Q0 + Q0*Kpr*(Pmax-1);
Fit = 630*(4*Si*So*Qr/(Ktr*lo*1.7724*Si+4*So*Qr))*sign(Pi-Po)*pow(Qr*(Pmax-max(Pmax*0.528,Pmin)),0.5);
Fi -= (Fi-Fit)/max(1,(lo*f_frq)/max(1,abs(Fit/(Qr*So))));
if(!Fo.isEVal()) Po = max(0, min(100,Po+0.27*(Fi-Fo)/(Q0*Kpr*So*lo*f_frq)));

2.15 Pipe 1->1 (pipe1_1)

Model of the pipe by the scheme "1 -> 1".

Parameters

Identifier Parameter Type Mode Hidden Default
Fi Input flow, ton/h Real Output false 0
Pi Input pressure, at Real Input false 1
Fo Output flow, ton/h Real Input false 0
Po Output pressure, at Real Output false 1
So Output cutset, m2 Real Input false 0.2
lo Output length, m Real Input false 10
Q0 Norm density of the environment, kg/m3 Real Input false 1
Kpr Coefficient of the compressibility [0...1] Real Input false 0.95
f_frq Calculation frequency, Hz Real Input true 200
Pti Pti Real Output true 1
Fto Fto Real Output true 0
Pt1 Pt1 Real Output true 1
Ft1 Ft1 Real Output true 0

Program

DAQ.JavaLikeCalc.lib_techApp.pipeBase(Fi, Pi, 293, So, Ft1, Pti, 293, So, 0.33*lo, Q0, Kpr, 0.01, f_frq);
DAQ.JavaLikeCalc.lib_techApp.pipeBase(Ft1, Pti, 293, So, Fto, Pt1, 293, So, 0.33*lo, Q0, Kpr, 0.01, f_frq);
DAQ.JavaLikeCalc.lib_techApp.pipeBase(Fto, Pt1, 293, So, Fo, Po, 293, So, 0.33*lo, Q0, Kpr, 0.01, f_frq);

2.16 Pipe 2->1 (pipe2_1)

Model of the pipe by the scheme "2 -> 1".

Parameters

Identifier Parameter Type Mode Hidden Default
Fi1 Input 1 flow, ton/h Real Output false 0
Pi1 Input 1 pressure, at Real Input false 1
Ti1 Input 1 temperature, K Real Input false 273
Si1 Input 1 cutset, m2 Real Input false 0.2
Fi2 Input 2 flow, ton/h Real Output false 0
Pi2 Input 2 pressure, at Real Input false 1
Ti2 Input 2 temperature, K Real Input false 273
Si2 Input 2 cutset, m2 Real Input false 0.2
Fo Output flow, ton/h Real Input false 0
Po Output pressure, at Real Output false 1
To Output temperature, K Real Output false 273
So Output cutset, m2 Real Input false 0.2
lo Output length, m Real Input false 10
Q0 Norm density of the environment, kg/m3 Real Input false 1
Kpr Coefficient of the compressibility [0...1] Real Input false 0.95
Ct Heat capacity of the environment Real Input false 20
Riz Heat resistance of the isolation Real Input false 20
Fwind Air speed Real Input false 1
Twind Air temperature, К Real Input false 273
f_frq Calculation frequency, Hz Real Input true 100

Program

DAQ.JavaLikeCalc.lib_techApp.pipeBase(Fi1, Pi1, 293, Si1, EVAL_REAL, Po, 293, So, lo, Q0, Kpr, 0.01, f_frq);
DAQ.JavaLikeCalc.lib_techApp.pipeBase(Fi2, Pi2, 293, Si2, EVAL_REAL, Po, 293, So, lo, Q0, Kpr, 0.01, f_frq);
Po = max(0, min(100,Po+0.27*(Fi1+Fi2-Fo)/(Q0*Kpr*So*lo*f_frq)));
To = max(0, To+(Fi1*(Ti1-To)+Fi2*(Ti2-To)+(Fwind+1)*(Twind-To)/Riz)/(Ct*So*lo*Q0*f_frq));

2.17 Pipe 3->1 (pipe3_1)

Model of the pipe by the scheme "3 -> 1".

Parameters

Identifier Parameter Type Mode Hidden Default
Fi1 Input 1 flow, ton/h Real Output false 0
Pi1 Input 1 pressure, at Real Input false 1
Ti1 Input 1 temperature, K Real Input false 273
Si1 Input 1 cutset, m2 Real Input false 0.2
Fi2 Input 2 flow, ton/h Real Output false 0
Pi2 Input 2 pressure, at Real Input false 1
Ti2 Input 2 temperature, K Real Input false 273
Si2 Input 2 cutset, m2 Real Input false 0.2
Fi3 Input 3 flow, ton/h Real Output false 0
Pi3 Input 3 pressure, at Real Input false 1
Ti3 Input 3 temperature, K Real Input false 273
Si3 Input 3 cutset, m2 Real Input false 0.2
Fo Output flow, ton/h Real Input false 0
Po Output pressure, at Real Output false 1
To Output temperature, K Real Output false 273
So Output cutset, m2 Real Input false 0.2
lo Output length, m Real Input false 10
Q0 Norm density of the environment, kg/m3 Real Input false 1
Kpr Coefficient of the compressibility [0...1] Real Input false 0.95
Ct Heat capacity of the environment Real Input false 20
Riz Heat resistance of the isolation Real Input false 20
Fwind Air speed Real Input false 1
Twind Air temperature, К Real Input false 273
f_frq Calculation frequency, Hz Real Input true 100

Program

DAQ.JavaLikeCalc.lib_techApp.pipeBase(Fi1, Pi1, 293, Si1, EVAL_REAL, Po, 293, So, lo, Q0, Kpr, 0.01, f_frq);
DAQ.JavaLikeCalc.lib_techApp.pipeBase(Fi2, Pi2, 293, Si2, EVAL_REAL, Po, 293, So, lo, Q0, Kpr, 0.01, f_frq);
DAQ.JavaLikeCalc.lib_techApp.pipeBase(Fi3, Pi3, 293, Si3, EVAL_REAL, Po, 293, So, lo, Q0, Kpr, 0.01, f_frq);
Po = max(0, min(100,Po+0.27*(Fi1+Fi2+Fi3-Fo)/(Q0*Kpr*So*lo*f_frq)));
To = max(0, To+(Fi1*(Ti1-To)+Fi2*(Ti2-To)+Fi3*(Ti3-To)+(Fwind+1)*(Twind-To)/Riz)/(Ct*So*lo*Q0*f_frq));

2.18 Pipe 1->2 (pipe1_2)

Model of the pipe by the scheme "1 -> 2".

Parameters

Identifier Parameter Type Mode Hidden Default
Fi Input flow, ton/h Real Output false 0
Pi Input pressure, at Real Input false 1
Fo1 Output 1 flow, ton/h Real Input false 0
Po1 Output 1 pressure, at Real Output false 1
So1 Output 1 cutset, m2 Real Input false 0.2
lo1 Output 1 length, m Real Input false 10
Fo2 Output 2 flow, ton/h Real Input false 0
Po2 Output 2 pressure, at Real Output false 1
So2 Output 2 cutset, m2 Real Input false 0.2
lo2 Output 2 length, m Real Input false 10
Q0 Norm density of the environment, kg/m3 Real Input false 1
Kpr Coefficient of the compressibility [0...1] Real Input false 0.95
f_frq Calculation frequency, Hz Real Input true 100
F1tmp Temporary flow 1 Real Output true 0
F2tmp Temporary flow 2 Real Output true 0
Pot1 Temporary pressure 1 Real Output true 1
Pot2 Temporary pressure 2 Real Output true 1

Program

DAQ.JavaLikeCalc.lib_techApp.pipeBase(F1tmp, Pi, 293, So1, Fo1, Po1, 293, So1, lo1, Q0, Kpr, 0.01, f_frq);
DAQ.JavaLikeCalc.lib_techApp.pipeBase(F2tmp, Pi, 293, So2, Fo2, Po2, 293, So2, lo2, Q0, Kpr, 0.01, f_frq);
Fi = F1tmp + F2tmp;

2.19 Pipe 1->3 (pipe1_3)

Model of the pipe by the scheme "1 -> 3".

Parameters

Identifier Parameter Type Mode Hidden Default
Fi Input flow, ton/h Real Output false 0
Pi Input pressure, at Real Input false 1
Fo1 Output 1 flow, ton/h Real Input false 0
Po1 Output 1 pressure, at Real Output false 1
So1 Output 1 cutset, m2 Real Input false 0.2
lo1 Output 1 length, m Real Input false 10
Fo2 Output 2 flow, ton/h Real Input false 0
Po2 Output 2 pressure, at Real Output false 1
So2 Output 2 cutset, m2 Real Input false 0.2
lo2 Output 2 length, m Real Input false 10
Fo3 Output 3 flow, ton/h Real Input false 0
Po3 Output 3 pressure, at Real Output false 1
So3 Output 3 cutset, m2 Real Input false 0.2
lo3 Output 3 length, m Real Input false 10
Q0 Norm density of the environment, kg/m3 Real Input false 1
Kpr Coefficient of the compressibility [0...1] Real Input false 0.95
f_frq Calculation frequency, Hz Real Input true 100
F1tmp Temporary flow 1 Real Output true 0
F2tmp Temporary flow 2 Real Output true 0
F3tmp Temporary flow 3 Real Output true 0
Pot1 Temporary pressure 1 Real Output true 1
Pot2 Temporary pressure 2 Real Output true 1
Pot3 Temporary pressure 3 Real Output true 1

Program

DAQ.JavaLikeCalc.lib_techApp.pipeBase(F1tmp, Pi, 293, So1, Fo1, Po1, 293, So1, lo1, Q0, Kpr, 0.01, f_frq);
DAQ.JavaLikeCalc.lib_techApp.pipeBase(F2tmp, Pi, 293, So2, Fo2, Po2, 293, So2, lo2, Q0, Kpr, 0.01, f_frq);
DAQ.JavaLikeCalc.lib_techApp.pipeBase(F3tmp, Pi, 293, So3, Fo3, Po3, 293, So3, lo3, Q0, Kpr, 0.01, f_frq);
Fi = F1tmp + F2tmp + F3tmp;

2.20 Pipe 1->4 (pipe1_4)

Model of the pipe by the scheme "1 -> 4".

Parameters

Identifier Parameter Type Mode Hidden Default
Fi Input flow, ton/h Real Output false 0
Pi Input pressure, at Real Input false 1
Fo1 Output 1 flow, ton/h Real Input false 0
Po1 Output 1 pressure, at Real Output false 1
So1 Output 1 cutset, m2 Real Input false 0.2
lo1 Output 1 length, m Real Input false 10
Fo2 Output 2 flow, ton/h Real Input false 0
Po2 Output 2 pressure, at Real Output false 1
So2 Output 2 cutset, m2 Real Input false 0.2
lo2 Output 2 length, m Real Input false 10
Fo3 Output 3 flow, ton/h Real Input false 0
Po3 Output 3 pressure, at Real Output false 1
So3 Output 3 cutset, m2 Real Input false 0.2
lo3 Output 3 length, m Real Input false 10
Fo4 Output 4 flow, ton/h Real Input false 0
Po4 Output 4 pressure, at Real Output false 1
So4 Output 4 cutset, m2 Real Input false 0.2
lo4 Output 4 length, m Real Input false 10
Q0 Norm density of the environment, kg/m3 Real Input false 1
Kpr Coefficient of the compressibility [0...1] Real Input false 0.95
f_frq Calculation frequency, Hz Real Input true 100
F1tmp Temporary flow 1 Real Output true 0
F2tmp Temporary flow 2 Real Output true 0
F3tmp Temporary flow 3 Real Output true 0
F4tmp Temporary flow 4 Real Output true 0
Pot1 Temporary pressure 1 Real Output true 1
Pot2 Temporary pressure 2 Real Output true 1
Pot3 Temporary pressure 3 Real Output true 1
Pot4 Temporary pressure 4 Real Output true 1

Program

DAQ.JavaLikeCalc.lib_techApp.pipeBase(F1tmp, Pi, 293, So1, Fo1, Po1, 293, So1, lo1, Q0, Kpr, 0.01, f_frq);
DAQ.JavaLikeCalc.lib_techApp.pipeBase(F2tmp, Pi, 293, So2, Fo2, Po2, 293, So2, lo2, Q0, Kpr, 0.01, f_frq);
DAQ.JavaLikeCalc.lib_techApp.pipeBase(F3tmp, Pi, 293, So3, Fo3, Po3, 293, So3, lo3, Q0, Kpr, 0.01, f_frq);
DAQ.JavaLikeCalc.lib_techApp.pipeBase(F4tmp, Pi, 293, So4, Fo4, Po4, 293, So4, lo4, Q0, Kpr, 0.01, f_frq);
Fi = F1tmp + F2tmp + F3tmp + F4tmp;

2.21 Valve: processing mechanism (valveMech)

Model of the valve processing mechanism. Includes the going and estrangement time.

Parameters

Identifier Parameter Type Mode Hidden Default
pos Position, % Real Output false 0
pos_sensor Position by the sensor, % Real Output false 0
com Command Real Input false 0
st_open State "Opened" Boolean Output false 0
st_close State "Closed" Boolean Output false 1
t_full Going time, seconds Real Input false 3
t_up Estrangement time, seconds Real Input false 1
t_sensor Sensor lag time, seconds Real Input false 1
f_frq Calculation frequency, Hz Real Input true 100
tmp_up Estrangement count Real Output false 0
lst_com Last command Real Output false 0

Program

if((pos >= 99 && com >= 99) || (pos <= 1 && com <= 1)) { 
  tmp_up = t_up;
  if(pos >= 99) { pos = 100; st_open = true; }
  else { pos = 0; st_close = true; }
}
else if(tmp_up > 0) tmp_up -= 1/f_frq;
else {
  st_open = st_close = false;
  lst_com += (com-lst_com)/(0.5*t_full*f_frq);
  pos += (lst_com-pos)/(0.5*t_full*f_frq);
}
pos_sensor += (pos-pos_sensor)/(t_sensor*f_frq);

2.22 Diaphragm (diaphragm)

Diaphragm model.

Parameters

Identifier Parameter Type Mode Hidden Default
Fi Input flow, ton/h Real Output false 0
Pi Input pressure, at Real Input false 1
Fo Output flow, ton/h Real Input false 0
Po Output pressure, at Real Output false 1
dP Pressure differential, kPa Real Output false 0
Sdf Diaphragm cutset, m2 Real Input false 0.1
So Output pipe cutset, m2 Real Input false 0.2
lo Output pipe length, m Real Input false 10
Q0 Norm density of the environment, kg/m3 Real Input false 1
Kpr Coefficient of the compressibility [0...1] Real Input false 0.95
f_frq Calculation frequency, Hz Real Input true 100

Program

DAQ.JavaLikeCalc.lib_techApp.pipeBase(Fi, Pi, 293, Sdf, Fo, Po, 293, So, lo, Q0, Kpr, 0.01, f_frq);
dP -= (dP-100*(Pi-Po))/f_frq;

2.23 Heat exchanger (heatExch)

Model of the heat exchanger, calculating the heat exchange of the two streams.

Parameters

Identifier Parameter Type Mode Hidden Default
Fi1 Input 1 flow, ton/h Real Input false 20
Pi1 Input 1 pressure, at Real Input false 1
Ti1 Input 1 temperature, K Real Input false 20
Si1 Input 1 cutset, m2 Real Input false 1
li1 Input 1 length, m Real Input false 10
Q0i1 Input 1 norm density, kg/m3 Real Input false 1
Kpr1 Input 1 coefficient of the compressibility [0...1] Real Input false 0.9
Ci1 Input 1 heat capacity Real Input false 1
Fi2 Input 2 flow, ton/h Real Input false 20
Pi2 Input 2 pressure, at Real Input false 1
Ti2 Input 2 temperature, K Real Input false 40
Si2 Input 2 cutset, m2 Real Input false 1
li2 Input 2 length, m Real Input false 10
Q0i2 Input 2 norm density, kg/m3 Real Input false 1
Kpr2 Input 2 coefficient of the compressibility [0...1] Real Input false 0.9
Ci2 Input 2 heat capacity Real Input false 1
ki Heat transfer coefficient Real Input false 0.9
Fo1 Output 1 flow, ton/h Real Input false 0
Po1 Output 1 pressure, at Real Output false 1
To1 Output 1 temperature, K Real Output false 273
So1 Output 1 cutset, m2 Real Output false 1
lo1 Output 1 length, m Real Output false 10
Fo2 Output 2 flow, ton/h Real Input false 0
Po2 Output 2 pressure, at Real Output false 1
To2 Output 2 temperature, K Real Output false 273
So2 Output 2 cutset, m2 Real Output false 1
lo2 Output 2 length, m Real Output false 10
f_frq Calculation frequency, Hz Real Input false 200

Program

DAQ.JavaLikeCalc.lib_techApp.pipeBase(Fi1, Pi1, Ti1, Si1, Fo1, Po1, 293, So1, lo1, Q0i1, Kpr1, 0.01, f_frq);
DAQ.JavaLikeCalc.lib_techApp.pipeBase(Fi2, Pi2, Ti2, Si2, Fo2, Po2, 293, So2, lo2, Q0i2, Kpr2, 0.01, f_frq);

To1 = max(0, min(1e4,(Fi1*Ti1*Ci1+ki*Fi2*Ti2*Ci2)/(Fi1*Ci1+ki*Fi2*Ci2)));
To2 = max(0, min(1e4,(ki*Fi1*Ti1*Ci1+Fi2*Ti2*Ci2)/(ki*Fi1*Ci1+Fi2*Ci2)));