aboutsummaryrefslogtreecommitdiffstats
path: root/modelica-parser-lalrpop/examples/modelica_models/heat_tank.mo
blob: 320c3f573f5a95439092ecef261d416c1dd3fdcd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
model HeatTankT
    parameter Real 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;