Propagate Class🔗
Description🔗
Connectors may include parameters and/or class declarations. Impact includes a feature to propagate this information automatically to connected components by setting the parameter or class declaration to the same value.
Automatic propagation of classes and integer parameters is especially useful in thermal fluid modeling where media properties are declared as a package in each component. Typically, a component contains a replaceable class declaration and one or more of its connectors contains a matching class declaration. Thus, when the class is redeclared in the component this also affects the connectors.
In Modelon Impact, it is possible to automatically propagate this redeclaration to other connected components that share the same structure.
Example🔗
The example below illustrates the component structure required for this functionality to be available:
package Propagation
package BaseMedium
end BaseMedium;
connector Con
replaceable package Medium = BaseMedium;
end Con;
model A
replaceable package Medium = BaseMedium;
Con c(redeclare package Medium = Medium);
end A;
end Propagation;
As defined in model A, the package Medium can be propagated to other components connected via the connector c. When a class can be propagated, a paint bucket icon appears beside it in the model browser, see below. Clicking the icon will propagate the value to all connected components that have the required structure.
It is also possible to propagate integer parameters in the same way, given the following similar structure:
package ParameterPropagation
connector Con
parameter Integer a;
end Con;
model A
parameter Integer b = 1;
Con c(a=b);
end A;
end ParameterPropagation;
In this case, A.b can be propagated, as shown below:
Tip
It is possible to automate the propagation process by enabling automatic propagation in the settings.
Set Enable automatic propagation to true in the settings tab in order to automatically propagate classes and integer parameters when setting their values or connecting components.
With this setting enabled, when redeclaring a class or setting a parameter that can be propagated, the value will automatically be propagated to connected components. This is equivalent to pressing the paint bucket button when automatic propagation is disabled. Furthermore, when connecting new components, classes and parameters will be propagated to the new component where possible.
Video🔗
Video shows how to propagate a medium to all model components: