aboutsummaryrefslogtreecommitdiffstats
path: root/modelica-parser-lalrpop/examples/modelica_models/heat_tank.mo
blob: dde1ae05090fc411256789c8ab4f534dc2684870 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
model HeatTankT
 parameter Area=1;
 connector TankStream
 Real pressure;
 flow Real volumeFlowRate;
 Real temp;
 end TankStream;
 TankStream Inlet, Outlet;
 Real level;
 Real temp;
equation
 Area*der(level) = Inlet.volumeFlowRate + Outlet.volumeFlowRate;
 Outlet.pressure = Inlet.pressure;
Area*level*der(temp) = Inlet.volumeFlowRate*Inlet.temp +
 Outlet.volumeFlowRate*Outlet.temp;
Outlet.temp = temp;
end HeatTankT;