Mapping Engineering Model Objects and Parameters to Modelica Libraries

You can map engineering model objects and the related parameters to Modelica libraries.

For general information, see About Generating a Modelica Representation of an Engineering Model.

This task shows you how to:


Before you begin: The following apply:
  • Make sure that you have access to the following apps:
    • For the mapping of 3D Piping, both the Dymola Behavior Modeling app and the Piping & Tubing 3D Design app.
    • For the mapping of 3D HVAC, both the Dymola Behavior Modeling app and the HVAC 3D Design app.
    • For mapping of schematic P&ID, both the Dymola Behavior Modeling app and the Functional & Logical Design app.
  • Make sure that you have access to all the Modelica libraries you need to map to.
    Note: Common libraries used for mapping are the Modelica Standard Library and the CATIAPiping library.

Select Workflow

You can work in two ways:

  • Create the mapping, described in the first subtask below, and then work with the mapping table, tab by tab, like described in the following subtasks below.
  • Create the mapping, described in the first subtask below, but then do the following:
    1. Depending on how the engineering model types are saved, apply the command Init from selection or the command Init from data setup.
    2. Assign main equipment and parts.
    3. Only for schematic P&ID models: work with filtering.
    4. Apply the command Clean from selection.
This is a less direct but more iterative approach. For more information about the steps, see relevant sections below.

Create a Mapping Table

  1. From the top bar, search the model to map in the following way, depending on the model:
    • If the model contains a physical product, you can search for that physical product. For example, you can search for a physical product with the name Piping_Product by typing prd:*Piping_* in the Search field and click Search .
    • If the model contains only a logical part, that is the case for some schematic P&ID models, you can search for the logical part. For example, you can search for a logical part with the name My_P_ID_Model by typing log:*My_P_ID_Model* in the Search field and click Search .

    For more information about searching, see 3DEXPERIENCE Native Apps: Native Apps Top Bar.

    The Search Results panel appears.
  2. To open the model, right-click it in the Search Results panel and select Open With > Smart Open in RFLP .
    The model is opened in authoring mode.
    Notes:
    • For a 3D piping product, if the product is not opened in Piping & Tubing 3D Design, open that app from the Compass.
    • For a 3D HVAC product, if the product is not opened in HVAC 3D Design, open that app from the Compass.
  3. If not already opened, open Dymola Behavior Modeling in a new tab. See Enter by the Compass.
  4. In Dymola Behavior Modeling, open the libraries you need for the mapping.

    Note: Common examples of libraries used for mapping are the Modelica Standard Library and the CATIAPiping library.

    For more information about opening libraries, see Open with Search.

  5. In Dymola Behavior Modeling, open the Modelica library where you have stored your mapping tables.

    Notes:
    • If you have stored mapping tables in several Modelica libraries, you must open all the libraries that have mapping tables that you want to edit.
    • If this is the first time you create a mapping table, you have to create a Modelica library to store the new mapping in. For more information about creating a Modelica library, see Create a Modelica Library.
    • You must yourself keep track of the libraries where you have stored the mapping tables. You cannot see this in the system.

  6. To open the mapping editor, from the Behavior Tools section of the action bar, click Engineering Generator Mapping Edition .
    The Engineering Modelica Mapping Editor appears. The mapping table that appears is the table previously used. The table name is displayed in the Current Mapping list.
  7. Optional: To select another existing mapping table to edit than the table previously used, do any of the following:
    • Select a mapping from the Current Mapping list.
      Notes: The following mapping tables are available:
      • Three templates; if you want to use any of them, select the template. See the next step on how to make a new mapping table from the selected template. The templates are:
        • For 3D piping: MSLDefaultMapping
        • For 3D HVAC: MSLDefaultMappingHVAC
        • For schematic P&ID: MSLDefaultMappingLogPiping
      • The mapping tables you have saved in Modelica libraries that are open in session are available.
      • If you have mapping tables saved in the database in older versions than 3DEXPERIENCE R2022x GA, they are available as well. You can edit and save them, but you cannot create new mapping templates in the database.
    • Select to use an external mapping table by clicking Import. See Importing and Exporting Modelica Mapping Files for details.

    Tip: It might be useful to use the command Export to save the current mapping table to be able to retrieve it later by the command Import without saving it in a Modelica library. See Importing and Exporting Modelica Mapping Files on how to do this.

  8. Optional: To create a new mapping table, starting from scratch, from a template, or starting from the displayed mapping, do the following:
    1. Make sure that the Modelica library where you want to store the mapping table is open.
    2. Open the mapping table you want to start from, see previous step.
    3. Click New Mapping.
    4. Change the name to the name you want.

      The proposed name is New1 etc., depending on how many new mapping tables you have created before.

    5. If you want to create a copy of the currently selected mapping table, activate Copy current mapping.

      By default this option is cleared, meaning that the created mapping table has the content of the original default mapping.

    6. Select a Modelica library to store the new mapping in.

      By default, the active library is selected.

    7. Click OK to create the new mapping table.
  9. Optional: In the Mapping Description field, enter a description.

    The description only consists of one line of text.

    Tip: You can specify how the mapping was constructed or the goal of the simulation.

  10. To save the mapping table, click OK.
    The mapping table is saved as a resource in the selected Modelica library, in a folder Resources\DBMMapping.
    Important: Be careful not to change a mapping table you want to keep. See Step 8 to save the mapping table under a new name.

    To test the mapping, you can try to generate a Modelica representation of an engineering model. See Generating a Modelica Model from an Engineering Model.

Only for Schematic P&ID Models: Working Model Selection and Filtering

For schematic P&ID models, you can select working model and also filter what components to include in the mapping for the model generation.

Important:
  • This feature is only available for schematic P&ID models.
  • The filtering creates a starting point for the mapping. The following sections still apply.
For more about filtering, and the filtering rules, see Schematic P&ID Filtering Rules.
Note: Filtering is optional, in some cases you can select to map the whole schematics.

Before you begin: To be able to generate the mapping table, make sure that you have opened the relevant libraries to map to in the Package Browser.
  1. Click the Filter Model tab.
  2. To select a working model, click Select, and from the engineering model containing the schematic P&ID, from the tree, click a logical schematic view.

    Note: To be able to select another working model, you must first remove the selected working model by clicking Remove.

  3. Click Show to display the schematic view of the selected model.
  4. To include all objects of the model in the mapping, select Include All items of working model.

    This is the default selection.

  5. To filter objects to include in the mapping, do the following:
    • To activate an include mode, click Include.

      You can now select components to include by clicking them or dragging traps.

      Included objects are marked blue on the schematic diagram, black on the filter editor list.

    • To activate a remove mode, click Remove.

      You can now remove selected components by clicking them or dragging traps. You can also select them from the filter editor list.

    • To activate a by-pass mode, click Bypass.

      You can now select components to bypass by clicking them or dragging traps.

      Note: To include a by-passed object, use the include node described above.

      By-passed objects are marked orange on the schematic view and the filter editor list.

    • To activate a by-pass mode working on lines, click Select Line.

      You can now select lines to bypass by clicking them.

      Notes:
      • The idea of by-passing lines is for you to be able to quickly select a minimum number of components for the first model generation to start with, and then later to refine the selection by including or removing components.
      • If a component in the selected line is already included, the status of that component is not changed.
      • For more information about by-passing lines, see Schematic P&ID Filtering Rules.

    Tip: You can, in the filter editor list:
    • Select or multiselect components, they are then highlighted in the schematics view. You can then, for example, remove them from the list by clicking Remove.
    • Sort any column by clicking the header of the column.
    The following is the result:
    • For included components, corresponding object types are automatically added as "Equipment and Parts" in the mapping, if not already present. These object types can be further edited.
    • By-passed components are defined to be generated as Modelica connections.

Manage Fluid Model System, Medium, and Route Definition

Before you begin: To be able to edit the mapping table, make sure that you have opened the relevant libraries to map to in the Package Browser.
  1. Click the Modelica Default Classes tab.
  2. If required, to change the fluid model system component, edit Inner High Level.

    Tip: You can drag a class from the Package Browser to the field to change the class.

  3. To add a medium, click, in the Medium definition section, Add Usage.

    Tip: You can also drag the class you want to use for the media, from the Package Browser into an empty part of the pane.

    A new medium is added in the end of the list.
  4. To remove a medium, select it and click Remove.

    Note: If you click Remove without any media selected, the last media in the list is removed.

  5. To edit a medium, do the following:
    • To edit the Component Name, double-click the corresponding field and change the name.
    • To edit the Modelica Class, drag a class from the Package Browser into the corresponding field.
    • To specify that the medium redeclares a package, activate Package for the medium.
      Note: By default, this option is activated for the first medium present, and cleared for any added medium.
  6. To edit a pipe/duct type, or the tapping management, in the Route definition section, do the following:
    • If required, to change the class in any of the text fields, drag, from the Package Browser, the wanted class into the text field.

      The class is inserted, and the Mapping of Pipes or Tapping Management dialog box appears, respectively.

    • To edit the present class in any of the text fields, click, after the text field, Edit.

      The Mapping of Pipes or Tapping Management dialog box is opened, respectively.

  7. In the Usage dialog box, select a Modelica class to map the usage to in the Modelica class field.

    Tip: To enter a name, you can copy and paste from the classes in the Package Browser.

    The corresponding list of ports and parameters appears in the Parameter Mapping panes.
  8. In the Parameter Mapping panes, you can:
    • Edit, add, or remove ports.
      Note: A maximum of three ports can be defined.
    • Edit, add, or remove parameters.
    • Add parameters corresponding to Knowledgeware parameters on the 3D design side.
    • Select how to map source parameters (physical parameters of the engineering model) to target Modelica parameters (parameters of the corresponding Modelica class), by selecting from lists.
      Notes:
      • The target Modelica parameter can be <null>, which means that the parameter is not converted into Modelica.
      • To remove several ports or parameters, you can multiselect ports or parameters and then click Remove.
      • For syntax and rules for mapping ports, see Mapping Rules.
  9. Click OK to validate your changes and close the Usage dialog box.
  10. To save the mapping table, click OK. For more information, see Creating a Mapping section, Step 10.

Manage Equipment and Parts

  1. To edit the equipment and parts, click the Equipment and Parts tab.
  2. To initialize the mapping depending on how the engineering model types are saved in the engineering model, do one the following actions:
    • If you have saved the engineering model types in Data Setup, click Init from data setup.
      Note: Data relative to, for example, type of fluid, pressure, and temperature is also extracted and proposed as values for the corresponding Modelica parameters.
    • Otherwise, do the following:
      1. Open the model as described in the Creating a Mapping section, Step 2.
      2. Click Init from selection.
      3. In the tree, select the engineering model to be used.
        Note: For schematic P&ID models, you don´t have to select model. The working model with current selection is automatically used.
      4. Optional: If some types or references in the current mapping are not in the selection, you can click Clean from Selection, and then, in the tree, select the model again, to keep only entries that are relevant for the selection.
        Note: For schematic P&ID models, you don´t have to select model. The working model with current selection is automatically used.

    The types and subtypes are retrieved from either the model or general data setup, depending on command, and added to the mapping definition.

    The text (undefined) may appear in the Modelica Class column:

    • Gray text means that a default Modelica class is present to be used when generating the model. To see what Modelica class is the default, look at the line for the same type and subtype with reference default.
    • Red text indicates that no Modelica class is specified, and no default Modelica class is present to be used when generating the model.
      Important: Each line indicated with red (undefined) results in an undefined component when generating the model. Complete the mapping of such lines to have a good resulting model. As an alternative, you can replace such components in the generated model.

  3. You can do some editing directly in the list of equipment and parts:
    • You can drag a class from the Package Browser to the Modelica Class field of a line. This action also opens the dialog box for editing the "target" line. For editing of this dialog box, see below.
    • You can click a line and then copy the line by Ctrl+C, and then click another line and use Ctrl+V to paste it into that line.

      The content of the mapping, that is, mapped classes or connect, replaceable status, and ports and parameter mapping, is pasted. If some ports or parameters are present in the copied line mapping, but not in the pasted line mapping, only the existing ports/parameter mappings are kept. A tooltip appears to explain the "partial copy", specifying what is not copied.

    • You can drag a line on top of another line. The result is the same as above, but this action also opens the dialog box for editing the "target" line. For editing in this dialog box, see below.
    • To select all lines, for example to be able to remove them, you can click one line and then press Ctrl+A.
  4. To add an equipment or a part, click Add.

    Important: Normally the Init from selection command or the Init from data setup command you provided in the previous substep creates all the required equipment items and parts so you very seldom need to use the Add command. The description below is however applicable to editing present items as well.

  5. In the New Map dialog box, do the following:

    Note: In some cases, if you want to edit an editable text, you must double-click it.

    1. In the Kind list, select if the item is Equipment or Part.

      Note: By default, Equipment is selected.

    2. In the Type field, enter the type.
    3. In the Subtype field, enter the subtype.
    4. In the Reference list, select the reference.

      Notes:
      • By default, the default option is selected.
      • If you set a mapping to a reference, that overrides the corresponding mapping on a Type/Subtype pair (if the reference mapping is valid).

    5. Regarding the Modelica representation of the item, you can select one of the following options:
    OptionsDescription
    Map with Modelica Class To map the equipment or the part with a given Modelica class, declared in the Modelica class field. The corresponding list of ports and parameters appears in the Parameter Mapping panes. Selecting this alternative, you can also select to make the generated class easily replaceable.
    1. To specify the Modelica class to map to, drag, from the Package Browser, the class into the Modelica class field.
    2. If required, to make the generated components from this class replaceable, activate Replaceable.
    Create Modelica Connection To ignore the equipment or the part with a maximum of two connections and replace it by a Modelica connection.

    Notes:
    • Some piping and HVAC parts are ignored automatically according to their piping type. You can define a mapping between a 3D piping model and the Modelica classes by using, depending on how the engineering model types are saved, the Init from selection command or the Init from data setup command. When you do that, the Piping_Flange and the Piping_Gasket piping types are ignored. For a 3D HVAC model, the HVAC Flange and the HVAC Gasket HVAC types are ignored.
    • If you have activated Replaceable for an equipment or part, the generated components from this class are indicated as replaceable by framing. For the control of framing, and working with replaceable components, see Working with Replaceable Components.

    For the Piping_Elbow types, the elements are automatically merged with a pipe. The angle and bend radius definitions are automatically extracted and merged with the surrounding pipes to generate a single Modelica element.

  6. In the Parameter Mapping panes of the New Map dialog box, you can:
    • Edit, add, or remove ports.
      Notes:
      • A maximum of three ports can be defined.
      • The Source Port column in prefilled with the physical ports from the class to map to, ordered by name, if they exist.
      • If a port is added to the physical product, you can update the mapping port list with this port the following way:
        1. Open the model as described in the Creating a Mapping section, Step 2.
        2. Click Update physical parameter list .

        This updates all parameter lists in the mapping editor for this reference.

    • Edit, add, or remove parameters.
    • Add parameters corresponding to Knowledgeware parameters in the physical product.
      Notes: To update the Knowledge parameters from the physical product:
      1. Open the model as described in the Creating a Mapping section, Step 2.
      2. Click Update physical parameter list .

      This updates all parameter lists in the mapping editor for this reference.

    • Select how to map source parameters (physical parameters of the engineering model) to target Modelica parameters (the parameters of the corresponding Modelica class), by selecting from lists.
      Notes:
      • The target Modelica parameter can be <null>, which means that the parameter is not converted into Modelica.
      • For schematic P&ID models, with implement links from logical objects to physical objects, you can select additional parameters of these physical objects to map as source parameters. Such parameters can be physical data parameters, inherited parameters, customized parameters, and Knowledgeware parameters. All these parameters have the prefix Physical_ in the source parameter list.
        Important: You must initialize the mapping to be able select such parameters, see Step 2 above.
        Notes:
        • If a physical parameter has been added or removed, you must initialize the model again to retrieve the new parameters of the object.
        • If a logical object is not linked to a physical object with an implement link, no physical parameters can be retrieved for that logical object.
      • To remove several ports or parameters, you can multiselect ports or parameters and then click Remove.
      • For syntax and rules for mapping ports, see Mapping Rules.
    • Enter numerical values as source parameters.
      Notes:
      • Unit is automatically added if you do not specify it.

        For more information about unit handling, see Managing Display Units and Units.

      • You can also enter the unit directly, using the usual 3DEXPERIENCE abbreviations.
      • The numerical values are presented in display units, but they are always stored in SI units in the mapping.
  7. When finished editing, click OK to close the New Map dialog box.
  8. To edit an item, select it and click Edit.

    Notes:
    • You can also double-click the line.
    • You must always edit the types and subtypes that are the result of Step 2 above, to add Modelica classes and parameters.

    In the Equipment Part dialog box, you can do the same editing here as above (the dialog boxes are the same except the names).
    Important: A physical object is usually mapped to a number of references. The best way to work in such a case is to edit the "default" reference to include all the items (ports and parameters) that are common for all the references, then to edit each reference, starting by giving the command Initialize with default values. This command copies the default items to the specific reference. Then specific features of that reference can be edited. If references do not need specific mapping, it is sufficient to only edit the "default", this is then used for references not defined.
    Note: The lines that belong to the mapping of one type/subtype are indicated by the same background color.
  9. When finished editing, click OK to close the Equipment Part dialog box.
  10. If you want to remove an item, select it and click Remove.

    Note: If you remove a line with the keyword default, all lines of that group (indicated by the background color) are removed.

  11. To save the mapping table, click OK. For more information, see Creating a Mapping section, Step 10.