a (simple) cooling system - openaltarica.fr openaltarica platform - examp… · iv. build the model...

23
OpenAltaRica - Example A (Simple) Cooling System © Copyright IRT SystemX 2015-2018 (v2.1) 1

Upload: others

Post on 29-Sep-2020

0 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: A (Simple) Cooling System - openaltarica.fr OpenAltaRica Platform - Examp… · iv. Build the model of the Cooling System by instantiating these classes, creating ad-hoc parts (into

OpenAltaRica - Example

A (Simple) Cooling System

© Copyright IRT SystemX 2015-2018 (v2.1) 1

Page 2: A (Simple) Cooling System - openaltarica.fr OpenAltaRica Platform - Examp… · iv. Build the model of the Cooling System by instantiating these classes, creating ad-hoc parts (into

OpenAltaRica - ExampleA (Simple) Cooling System

© Copyright IRT SystemX 2015-2018 (v2.1) 2

Tank TK

ReactorPump P

Pump P

Line2

Line1

Valve VO

Valve VO

Valve VI

Valve VI

WHAT Cool a reactor

HOW Move cooling liquid from a Tank to the considered Reactor by means of two redundant lines

Page 3: A (Simple) Cooling System - openaltarica.fr OpenAltaRica Platform - Examp… · iv. Build the model of the Cooling System by instantiating these classes, creating ad-hoc parts (into

OpenAltaRica - ExampleA (Simple) Cooling System

© Copyright IRT SystemX 2015-2018 (v2.1) 3

A. To design your model

Page 4: A (Simple) Cooling System - openaltarica.fr OpenAltaRica Platform - Examp… · iv. Build the model of the Cooling System by instantiating these classes, creating ad-hoc parts (into

OpenAltaRica - ExampleA (Simple) Cooling System

© Copyright IRT SystemX 2015-2018 (v2.1) 4

A. To design your model1. Create a new project into the AltaRicaWizard:

a. ‘File’->‘New File or Project’->’New Project’;

b. ‘SimpleCoolingSystem’ -> ‘OK’.

Page 5: A (Simple) Cooling System - openaltarica.fr OpenAltaRica Platform - Examp… · iv. Build the model of the Cooling System by instantiating these classes, creating ad-hoc parts (into

OpenAltaRica - ExampleA (Simple) Cooling System

© Copyright IRT SystemX 2015-2018 (v2.1) 5

A. To design your model2. Create a new AltaRica 3.0 model:

a. Right-click on the project ‘SimpleCoolingSystem’;

b. ‘Add new file to “SimpleCoolingSystem”’;

c. You can create a new folder (e.g. ‘ARModels’);

d. ‘SimpleCoolingSystem.alt’ -> ‘Save’.

Page 6: A (Simple) Cooling System - openaltarica.fr OpenAltaRica Platform - Examp… · iv. Build the model of the Cooling System by instantiating these classes, creating ad-hoc parts (into

OpenAltaRica - ExampleA (Simple) Cooling System

© Copyright IRT SystemX 2015-2018 (v2.1) 6

A. To design your model3. Design your AltaRica 3.0 model.

a. Different kinds of components/parts

Generic: Valve, Pump, (Tank, Reactor)

=> use classes.

Ad-Hoc: (Tank, Reactor), Line1, Line2, the system

=> use blocks.

b. All actuator components are repairable

=> the same internal behavior.

c. Processi. Define the internal repairable behavior into a

generic element ‘class’;

ii. Define actuator components by including this

internal repairable behavior into specific elements

‘class’;

iii. Define other generic components into specific

element ‘class’;

iv. Build the model of the Cooling System by

instantiating these classes, creating ad-hoc parts

(into specific elements “block”) and linking them.

Page 7: A (Simple) Cooling System - openaltarica.fr OpenAltaRica Platform - Examp… · iv. Build the model of the Cooling System by instantiating these classes, creating ad-hoc parts (into

OpenAltaRica - ExampleA (Simple) Cooling System

© Copyright IRT SystemX 2015-2018 (v2.1) 7

i. Define the internal repairable behavior into a generic element

‘class’;

ii. Define actuator components by including this internal repairable

behavior into specific elements ‘class’;

iii. Define other generic components into a specific element ‘class’;

iv. Build the model of the Cooling System by instantiating these

classes, creating ad-hoc parts (into specific elements “block”)

and linking them.

class RepairableComponent

Boolean vsWorking (init = true);

parameter Real pLambda = 1.0e-5;

parameter Real pMu = 1.0e-2;

event evFailure (delay = exponential(pLambda));

event evRepair (delay = exponential(pMu));

transition

evFailure: vsWorking -> vsWorking := false;

evRepair: not vsWorking -> vsWorking := true;

end

Page 8: A (Simple) Cooling System - openaltarica.fr OpenAltaRica Platform - Examp… · iv. Build the model of the Cooling System by instantiating these classes, creating ad-hoc parts (into

OpenAltaRica - ExampleA (Simple) Cooling System

© Copyright IRT SystemX 2015-2018 (v2.1) 8

i. Define the internal repairable behavior into a generic element

‘class’;

ii. Define actuator components by including this internal repairable

behavior into specific elements ‘class’;

iii. Define other generic components into a specific element ‘class’;

iv. Build the model of the Cooling System by instantiating these

classes, creating ad-hoc parts (into specific elements “block”)

and linking them.

class Pump

extends RepairableComponent;

Boolean vfInFlow, vfOutFlow (reset = false);

assertion

vfOutFlow := if vsWorking then vfInFlow else false;

end

class Valve

extends RepairableComponent (pLambda = 1.0e-4);

Boolean vfLeftFlow, vfRightFlow (reset = false);

assertion

if vsWorking then vfLeftFlow :=: vfRightFlow;

end

Page 9: A (Simple) Cooling System - openaltarica.fr OpenAltaRica Platform - Examp… · iv. Build the model of the Cooling System by instantiating these classes, creating ad-hoc parts (into

OpenAltaRica - ExampleA (Simple) Cooling System

© Copyright IRT SystemX 2015-2018 (v2.1) 9

class Pump

extends RepairableComponent;

Boolean vfInFlow, vfOutFlow (reset = false);

assertion

vfOutFlow := if vsWorking then vfInFlow else false;

end

class Valve

extends RepairableComponent (pLambda = 1.0e-4);

Boolean vfLeftFlow, vfRightFlow (reset = false);

assertion

if vsWorking then vfLeftFlow :=: vfRightFlow;

end

Inheritance of the class ‘RepairableComponent’• A keyword (‘extends’);

• The name of an inherited class (‘RepairableComponent’);

• (optional) redefinition of values.

Page 10: A (Simple) Cooling System - openaltarica.fr OpenAltaRica Platform - Examp… · iv. Build the model of the Cooling System by instantiating these classes, creating ad-hoc parts (into

OpenAltaRica - ExampleA (Simple) Cooling System

© Copyright IRT SystemX 2015-2018 (v2.1) 10

class Pump

extends RepairableComponent;

Boolean vfInFlow, vfOutFlow (reset = false);

assertion

vfOutFlow := if vsWorking then vfInFlow else false;

end

class Valve

extends RepairableComponent (pLambda = 1.0e-4);

Boolean vfLeftFlow, vfRightFlow (reset = false);

assertion

if vsWorking then vfLeftFlow :=: vfRightFlow;

end

Acausal connection ‘:=:’

between two flow variables

REM: for only data-flow models (components, parts, etc.) do not use the acausal connection

Page 11: A (Simple) Cooling System - openaltarica.fr OpenAltaRica Platform - Examp… · iv. Build the model of the Cooling System by instantiating these classes, creating ad-hoc parts (into

OpenAltaRica - ExampleA (Simple) Cooling System

© Copyright IRT SystemX 2015-2018 (v2.1) 11

i. Define the internal repairable behavior into a generic element

‘class’;

ii. Define actuator components by including this internal repairable

behavior into specific elements ‘class’;

iii. Define other generic components into specific elements ‘class’;

iv. Build the model of the Cooling System by instantiating these

classes, creating ad-hoc parts (into specific elements “block”)

and linking them.

class Tank

Boolean vsIsEmpty (init = false);

Boolean vfOutFlow (reset = true);

event evGetEmpty;

transition

evGetEmpty: not vsIsEmpty -> vsIsEmpty := true;

assertion

vfOutFlow := not vsIsEmpty;

end

Page 12: A (Simple) Cooling System - openaltarica.fr OpenAltaRica Platform - Examp… · iv. Build the model of the Cooling System by instantiating these classes, creating ad-hoc parts (into

OpenAltaRica - ExampleA (Simple) Cooling System

© Copyright IRT SystemX 2015-2018 (v2.1) 12

i. Define the internal repairable behavior into a generic element

‘class’;

ii. Define actuator components by including this internal repairable

behavior into specific elements ‘class’;

iii. Define other generic components into specific elements ‘class’;

iv. Build the model of the Cooling System by instantiating these

classes, creating ad-hoc parts (into specific elements “block”)

and linking them.

class Tank

Boolean vsIsEmpty (init = false);

Boolean vfOutFlow (reset = true);

event evGetEmpty;

transition

evGetEmpty: not vsIsEmpty -> vsIsEmpty := true;

assertion

vfOutFlow := not vsIsEmpty;

end

No delay associated to this event.

If no defined at instantiation, set to Constant(1.0).

Page 13: A (Simple) Cooling System - openaltarica.fr OpenAltaRica Platform - Examp… · iv. Build the model of the Cooling System by instantiating these classes, creating ad-hoc parts (into

OpenAltaRica - ExampleA (Simple) Cooling System

© Copyright IRT SystemX 2015-2018 (v2.1) 13

i. Define the internal repairable behavior into a generic element

‘class’;

ii. Define actuator components by including this internal repairable

behavior into specific elements ‘class’;

iii. Define other generic components into specific elements ‘class’;

iv. Build the model of the Cooling System by instantiating these

classes, creating ad-hoc parts (into specific elements “block”)

and linking them.

blocks: Reactor, Line1, Line2, the Cooling System.

classes: Valve, Pump, Tank.

Page 14: A (Simple) Cooling System - openaltarica.fr OpenAltaRica Platform - Examp… · iv. Build the model of the Cooling System by instantiating these classes, creating ad-hoc parts (into

OpenAltaRica - ExampleA (Simple) Cooling System

© Copyright IRT SystemX 2015-2018 (v2.1) 14

block Line1

Valve VI, VO;

Pump P;

assertion

P.vfInFlow := VI.vfRightFlow;

VO.vfLeftFlow := P.vfOutFlow;

end

Lines (Line1 & Line2)

A set of components providing

cooling liquid to the reactor.

block Line2

Valve VI, VO;

Pump P;

assertion

P.vfInFlow := VI.vfRightFlow;

VO.vfLeftFlow := P.vfOutFlow;

end

Page 15: A (Simple) Cooling System - openaltarica.fr OpenAltaRica Platform - Examp… · iv. Build the model of the Cooling System by instantiating these classes, creating ad-hoc parts (into

OpenAltaRica - ExampleA (Simple) Cooling System

© Copyright IRT SystemX 2015-2018 (v2.1) 15

block Line1

Valve VI, VO;

Pump P;

assertion

P.vfInFlow := VI.vfRightFlow;

VO.vfLeftFlow := P.vfOutFlow;

end

block Line2

Valve VI, VO;

Pump P;

assertion

P.vfInFlow := VI.vfRightFlow;

VO.vfLeftFlow := P.vfOutFlow;

end

Lines (Line1 & Line2)

A set of components providing

cooling liquid to the reactor.

Declaration

of the blocks

Page 16: A (Simple) Cooling System - openaltarica.fr OpenAltaRica Platform - Examp… · iv. Build the model of the Cooling System by instantiating these classes, creating ad-hoc parts (into

OpenAltaRica - ExampleA (Simple) Cooling System

© Copyright IRT SystemX 2015-2018 (v2.1) 16

block Line1

Valve VI, VO;

Pump P;

assertion

P.vfInFlow := VI.vfRightFlow;

VO.vfLeftFlow := P.vfOutFlow;

end

block Line2

Valve VI, VO;

Pump P;

assertion

P.vfInFlow := VI.vfRightFlow;

VO.vfLeftFlow := P.vfOutFlow;

end

Lines (Line1 & Line2)

A set of components providing

cooling liquid to the reactor.

Declaration of

internal elementsvalves and pumps.

Page 17: A (Simple) Cooling System - openaltarica.fr OpenAltaRica Platform - Examp… · iv. Build the model of the Cooling System by instantiating these classes, creating ad-hoc parts (into

OpenAltaRica - ExampleA (Simple) Cooling System

© Copyright IRT SystemX 2015-2018 (v2.1) 17

block Line1

Valve VI, VO;

Pump P;

assertion

P.vfInFlow := VI.vfRightFlow;

VO.vfLeftFlow := P.vfOutFlow;

end

block Line2

Valve VI, VO;

Pump P;

assertion

P.vfInFlow := VI.vfRightFlow;

VO.vfLeftFlow := P.vfOutFlow;

end

Lines (Line1 & Line2)

A set of components providing

cooling liquid to the reactor.

Define the behaviorLinking elements between them

Page 18: A (Simple) Cooling System - openaltarica.fr OpenAltaRica Platform - Examp… · iv. Build the model of the Cooling System by instantiating these classes, creating ad-hoc parts (into

OpenAltaRica - ExampleA (Simple) Cooling System

© Copyright IRT SystemX 2015-2018 (v2.1) 18

Lines (Line1 & Line2)

A set of components providing

cooling liquid to the reactor.

The tank ?Shared by the two lines

block Line1

Valve VI, VO;

Pump P;

assertion

P.vfInFlow := VI.vfRightFlow;

VO.vfLeftFlow := P.vfOutFlow;

end

block Line2

Valve VI, VO;

Pump P;

assertion

P.vfInFlow := VI.vfRightFlow;

VO.vfLeftFlow := P.vfOutFlow;

end

Page 19: A (Simple) Cooling System - openaltarica.fr OpenAltaRica Platform - Examp… · iv. Build the model of the Cooling System by instantiating these classes, creating ad-hoc parts (into

OpenAltaRica - ExampleA (Simple) Cooling System

© Copyright IRT SystemX 2015-2018 (v2.1) 19

block Line1

embeds main.TK as t;

Valve VI, VO;

Pump P;

assertion

VI.vfLeftFlow := t.vfOutFlow;

P.vfInFlow := VI.vfRightFlow;

VO.vfLeftFlow := P.vfOutFlow;

end

block Line2

embeds main.TK as t;

Valve VI, VO;

Pump P;

assertion

VI.vfLeftFlow := t.vfOutFlow;

P.vfInFlow := VI.vfRightFlow;

VO.vfLeftFlow := P.vfOutFlow;

end

Lines (Line1 & Line2)

A set of components providing

cooling liquid to the reactor.

The tank ?Shared by the two lines

1. Define the tank outside the two lines;

2. Aggregate it into the two lines.

Tank TK (evGetEmpty.delay = Dirac(0.0));

Page 20: A (Simple) Cooling System - openaltarica.fr OpenAltaRica Platform - Examp… · iv. Build the model of the Cooling System by instantiating these classes, creating ad-hoc parts (into

OpenAltaRica - ExampleA (Simple) Cooling System

© Copyright IRT SystemX 2015-2018 (v2.1) 20

block Line1

embeds main.TK as t;

Valve VI, VO;

Pump P;

assertion

VI.vfLeftFlow := t.vfOutFlow;

P.vfInFlow := VI.vfRightFlow;

VO.vfLeftFlow := P.vfOutFlow;

end

block Line2

embeds main.TK as t;

Valve VI, VO;

Pump P;

assertion

VI.vfLeftFlow := t.vfOutFlow;

P.vfInFlow := VI.vfRightFlow;

VO.vfLeftFlow := P.vfOutFlow;

end

block CoolingSystem

Tank TK (evGetEmpty.delay = Dirac(0.0));

assertion

Reactor.vfInFlow := Line1.VO.vfRightFlow

or Line2.VO.vfRightFlow;

end

block Reactor

Boolean vfInFlow (reset = false);

end

Page 21: A (Simple) Cooling System - openaltarica.fr OpenAltaRica Platform - Examp… · iv. Build the model of the Cooling System by instantiating these classes, creating ad-hoc parts (into

OpenAltaRica - ExampleA (Simple) Cooling System

© Copyright IRT SystemX 2015-2018 (v2.1) 21

block Line1

embeds main.TK as t;

Valve VI, VO;

Pump P;

assertion

VI.vfLeftFlow := t.vfOutFlow;

P.vfInFlow := VI.vfRightFlow;

VO.vfLeftFlow := P.vfOutFlow;

end

block Line2

embeds main.TK as t;

Valve VI, VO;

Pump P;

assertion

VI.vfLeftFlow := t.vfOutFlow;

P.vfInFlow := VI.vfRightFlow;

VO.vfLeftFlow := P.vfOutFlow;

end

block CoolingSystem

Tank TK (evGetEmpty.delay = Dirac(0.0));

observer Boolean oCooledReactor = Reactor.vfInFlow;

assertion

Reactor.vfInFlow := Line1.VO.vfRightFlow

or Line2.VO.vfRightFlow;

end

block Reactor

Boolean vfInFlow (reset = false);

end

Add an observer to the input of the tank.

Page 22: A (Simple) Cooling System - openaltarica.fr OpenAltaRica Platform - Examp… · iv. Build the model of the Cooling System by instantiating these classes, creating ad-hoc parts (into

OpenAltaRica - ExampleA (Simple) Cooling System

© Copyright IRT SystemX 2015-2018 (v2.1) 22

block Line1

. . .

end

block Line2

. . .

end

block CoolingSystem

Tank TK (evGetEmpty.delay = Dirac(0.0));

observer Boolean oCooledReactor = Reactor.vfInFlow;

parameter Real pPumpsCCF = 1.0e-6;

event evPumpsCCF (delay = exponential(pPumpsCCF));

transition

evPumpsCCF: !Line1.P.evFailure & !Line2.P.evFailure;

assertion

Reactor.vfInFlow := Line1.VO.vfRightFlow

or Line2.VO.vfRightFlow;

end

block Reactor

Boolean vfInFlow (reset = false);

end

Define a common-cause failure on the two pumps.

Page 23: A (Simple) Cooling System - openaltarica.fr OpenAltaRica Platform - Examp… · iv. Build the model of the Cooling System by instantiating these classes, creating ad-hoc parts (into

© Copyright IRT SystemX 2015-2018 (v2.1) 23

CONTACTS

The OpenAltaRica project

www.openaltarica.fr

[email protected]