1 | package TestOuter
|
---|
2 |
|
---|
3 | partial model PartialFluid
|
---|
4 | constant Real c = 1;
|
---|
5 | partial function fBase
|
---|
6 | input Real u;
|
---|
7 | output Real y;
|
---|
8 | end fBase;
|
---|
9 | end PartialFluid;
|
---|
10 |
|
---|
11 | model MyFluid
|
---|
12 | extends PartialFluid;
|
---|
13 | function f
|
---|
14 | extends fBase;
|
---|
15 | algorithm
|
---|
16 | y := 3*u;
|
---|
17 | end f;
|
---|
18 | end MyFluid;
|
---|
19 |
|
---|
20 | model System
|
---|
21 | replaceable model FluidModel = MyFluid constrainedby PartialFluid;
|
---|
22 | FluidModel fluid;
|
---|
23 | end System;
|
---|
24 |
|
---|
25 | model Component
|
---|
26 | outer System system;
|
---|
27 | Real a = system.fluid.f(3);
|
---|
28 | end Component;
|
---|
29 |
|
---|
30 | model Model
|
---|
31 | Component c;
|
---|
32 | inner System system;
|
---|
33 | end Model;
|
---|
34 |
|
---|
35 | end TestOuter;
|
---|