General Information
The capability consists of two parts:
- Mapping of the component types used in the engineering model to suitable Modelica classes.
For more information, see About Mapping of the Engineering Model Objects.
- Generation of a Modelica model and Modelica component classes in Dymola Behavior Modeling from the engineering model and
components, using this mapping.
You can define your own Modelica classes and use them for mapping. An
example is to define Modelica piping classes with heat ports to allow fluid or
thermal study of the generated Modelica model.
You can only create the mapping by a command, but you can perform the
model generation either by a command or by Engineering Knowledge Language (EKL)
scripting methods.
When you have generated the mapping, the command Generate from Engineering
Model enables you to generate a Modelica behavior (model) of the
engineering model and the included components. The Modelica code is automatically
generated, and can then be adapted for simulation, or further extended with other
Modelica components. You can also select to generate Modelica code for only a
subsystem of the engineering model to, for example, study a certain pipe or HVAC
structure.
You can also perform the model generation by Engineering Knowledge Language (EKL) scripting
methods. The scripting methods are:
GenerateBehaviorModelFromPiping for generation from an
engineering model
GenerateBehaviorModelFromSinglePipingObject for generation
from a single engineering model object
Notes:
Concerning the scripting:
- You cannot generate a Modelica representation of an engineering submodel
containing more than one piping or HVAC object by scripting.
- There is always a diagram (with the default layout algorithm) generated
when using scripting.
To generate a submodel containing more than one engineering model object or
to generate a diagram with another layout algorithm, or no diagram at all, use
the command instead of scripting.
Overview of Generated Modelica Representation
As a result of the Modelica model generation, the following are created under the
selected target package, if you select the model name of the generated model to be
TwoTanks, and depending on if you display hidden classes in
the Package Browser or not. Displaying hidden classes is required
when you want to build models without using the generated main model. This is for more
advanced users.
Note:
TwoTanks is a 3D piping example, but a 3D HVAC model or a schematic
P&ID model looks the same.
Overview with Protected Classes Hidden
This is the overview seen by most users.
- A package TwoTanks inserted in a class
InternalGenerated. This package contains the
following classes generated from one 3D piping model:
- A base class TwoTanks that is the
generated main model, with mapped components from the 3D piping
model, and connections between these components. The base class
is represented by the icon .
- Under that base class, a subpackage
Medium containing the medium defined
for the model.
- A top-level class TwoTanks that extends from the
TwoTanks model in the
InternalGenerated package. This top-level
model is the model you should work in when you, for example, extend the
model or replace components. This top-level model is represented by the
same icon as the base class and it is opened by
default when generating the model.
Modelica Representation of Engineering Model Components
Engineering model components representations are required for the generation of a
Modelica representation of a 3D model.
These representations are stored in the CATIAPiping library. This
library is based on the Modelica Standard library. A default mapping,
MSLDefaultMapping is automatically loaded if not
already defined. The library also contains components to handle Thermal System
classes; it provides a complete mapping for thermal systems as well. The
MSLDefaultMapping mapping table is used for 3D piping
mapping, for mapping of HVAC or schematic P&ID models, other default mapping
tables are available.
For engineering model component representation, the CATIAPiping
library provides a complete mapping, using the
EquivalentPipe representation. You can also define a
customized pipe or HVAC duct representation by extending the
Prototype Modelica model.
(CATIAPiping.Pipes.BaseClasses.Prototype). When thermal systems are involved,
the EquivalentPipe_TSXXX representation is used (XXX
represents liquid, gas, or mixture states).
Overview with Protected Classes Displayed, For Advanced Users
If you want to build new models using the generated components instead of working
with the generated main model, you must display these protected components in
the Package Browser to be able to use them. The same is
valid if you want to reuse data coming from the physical model in other models.
These topics are for advanced users.
To display protected classes in the Package Browser, clear
Hide protected classes from
, in the Editor tab.
The same overview as above is displayed in the Package Browser, with the
addition of a number of subpackages generated from the engineering model
components. These subpackages are located in the
InternalGenerated package, in the
TwoTanks class, and they are:
Subpackage |
Containing the following Modelica
components generated from 3D Piping Model components
|
Pipe_Package
|
"Pipes" |
Part_Package
|
"Parts" (valves, nozzles, and other parts
that fit the network) |
Equipment_Package
|
"Equipment" |
You can use components from these packages to build new models. Note:
If you only
want to use the components, you can use the option to not generate the
diagram of the piping model.
If you expand a component in any of the subpackages above, a record
Data may appear. This record contains the parameter
names and values coming from the physical model for that component, if
any. Note:
If any data coming from the physical model is in the form of a
numerical value and not an actual name of a physical attribute, then this
data is not included in the Data record.
To reuse data coming from the physical model in a new model, instantiate, from
the corresponding generated component, the data record
by, for example, dragging it from the Package Browser to
the diagram of the new model. To connect to the record, you can, from the
parameter field in the parameter dialog of the component you want to use the
data in, right-click and select , and select variable.
Note:
The Modelica path of the instantiated record contains the name of the class
that corresponds to a physical element.
Naming Rules
The name of the components (valves, tanks) is generated from the instance name in the physical
product model. The description of the components is the occurrence path from the
physical product model. To comply to Modelica name rules, special characters in
names are replaced, and prefixes may be included to ensure unique entities.
Generated Diagram Layer and 3D Representation
The diagram layer is generated from the topology of the engineering model design. The 3D
components by default have a picture representation generated from 3D screenshots
("thumbnails") of the 3D shapes. Note:
If the mapping of a component is undefined,
that is, the component has been generated without being mapped to any Modelica
class, this component is represented by an empty class represented by the
following icon, to indicate that this error must be corrected, by for example
replacing this class or correcting the mapping:
You can select from four ways to generate (or not generate) the diagram layer:
- Force-based: This is the default algorithm for 3D piping and HVAC
models.
- Projection: 3D data, including the 3D view point, is
used by this algorithm.
- From Schematics: This selection is used in two cases:
- If the engineering model is a schematic P&ID model, this is the default
algorithm.
- If the engineering model is a 3D piping or HVAC model, and this
model is associated to some P&ID schematics, this algorithm can
be selected to reuse the diagram layout from P&ID for the
Modelica diagram layer, if possible. (The association means that
there must be implement links between each Logical component and its
corresponding Physical occurrence.)
- No Diagram: This option can be used if you only want
to use the generated components to build your own model. See Overview with Protected Classes Displayed, For Advanced Users.
The pictures are stored as resources of the generated Modelica model.
Note:
You can select to not use the generated thumbnail images for the icons in the
diagram, but use the 2D diagram icons instead.
Generated Icon Layer
The icon layer of the generated Modelica model has a different extent value from the diagram
layer. Also, a screenshot of the physical product containing the originating
engineering model is used for the image of the icon layer.
For subclasses generated from the pipes, the icon layer includes a picture of the engineering
model component.
Model Documentation
The generated base model includes annotations with some information about the origin
model. That information is available from the documentation editor.
Modifying the Mapping from a Selected Class in the Generated Model
To improve the generated model, you sometimes need to modify the mapping definition of a
generated class. To do so, you can, while working in the generated model, open the
mapping definition dialog Engineering Modelica Mapping Editor,
and then, in the Package Browser, select the generated class.
When you do that, the line in the Equipment and Parts list
corresponding to the class of the component is highlighted as well, and you can edit
that line to modify the mapping of the class.
Handling Replaceable Components
The generated Modelica components are all replaceable. You can replace a component
with a more specialized version.
To do so, you must create a dedicated Modelica class extending the class that is
currently used.
To make the replacement easier, you can select to generate replaceable components
when you map with a Modelica class.
Reusing Generated Components and Data from the Physical Model
You can reuse generated components as well as data from the physical model, in new
models. For more information, see Overview with Protected Classes Displayed, For Advanced Users.
Links and Relations from the Engineering Model to Its Modelica Representation
You can see the relationships between the generated Modelica representation and the original
engineering model using the command Links and Relations from
the Diagram section of the action bar in the Dymola Behavior Modeling
app. For more information about this command, see
Assembly Design UserĀ“s Guide: Links and Relations. Note:
The links are not
bidirectional. You cannot see these links from the Piping & Tubing 3D Design
app, the HVAC 3D Design
app, or the Functional & Logical Design
app.
Updating a Modelica Model Corresponding to a Modified Engineering Model
When the engineering model is modified, you can update the corresponding generated model using
any of the following commands: For more information, see Updating, from the Physical or Logical Model, a Generated Modelica Model of a Kinematic Mechanism or an Engineering Model.
Retrieving the 3D Piping or HVAC Model from the Generated Modelica Model
You can retrieve the physical model from the generated Modelica model. For more
information, see Retrieving the Kinematic Mechanism, the 3D Piping Model, or the 3D HVAC Model.
Building a Simulation Model
The generated Modelica representation of the engineering model is a base for building a
simulation model. You can build a simulation model from the main generated model, or
you can use the generated component classes to build a new model. The latter is for
more advanced users, see Overview with Protected Classes Displayed, For Advanced Users.
Creating a Simulation Model from the Generated Main Model
To be able to simulate the generated main model, you must in most
cases do some completion of it. You can also include 3D representation and
animation.
Completing the Model
You must yourself complete the generated main model to be able to
simulate it. This is done by, for example:
- Adding missing components required
- Fix any missing connections, for example, connecting free extremities of pipes to tank
components.
- Supply required parameter and initial values.
Note:
Instead of connecting the free extremities of pipes to components, you do the following:
- Add connectors and connect the free pipe extremities to
them.
- Instantiate the model in another class to create a simulation
model by connecting to those connectors.
Animation and 3D Representation
You can animate the fluid flow in the pipes when you simulate the main model in Dymola Behavior Modeling in two ways, as fluid flow or as particle
flow. The flow animation is "moving stripes", the particle flow animation is
spherical particles flowing in the pipes.
For any fluid flow animation to work, the library
CATIAPiping must be available in the database.
You select fluid flow or particle flow the following way:
- To animate fluid flow, make sure that a row
Animation is present as a
Rigid Pipe type/subtype in the mapping
editor, with the class
CATIAPiping.Visualizers.CurvedPipeAnimation .
- To animate fluid flow as particles, make sure that a row
Animation is present as a
Rigid Pipe type/subtype in the mapping
editor, with the class
CATIAPiping.Visualizers.CurvedPipeParticleAnimation .
Note:
No port and no parameters are required for these usages.
To also see the 3D representation of tanks and other components,
the animation must be performed in, for example,
Functional & Logical Design,
with the Physical data attached to the editor.
Creating a Simulation Model from the Generated Component
Classes
You can instantiate components of the generated Modelica component classes (pipes, tanks,
valves, and other components) in a new class and connect them to build a new
model. In such cases, you only retrieve geometrical information from the
engineering model components, and the main generated model is not used at all.
Licenses
To be able to generate a Modelica representation of an engineering model, you must
always have the Dymola Behavior Modeling
app. You must also have the following apps
depending on the engineering model to generate from:
|