Advanced Modelica language topics > Coupling Modelica and native Simcenter Amesim submodels
Physical port connections
connections physical ports
physical port connections
We will now present an example where we use what can be called "physical ports" for connecting the Modelica model and the Simcenter Amesim environment. First we need to introduce the required external connector and a suitable annotation. In this, we first define the external connector PinVinIout that has two variables: v and i. The variable v is defined as input and the variable i as output (see the figure Figure 43). In the following model definition of OnePinVinIout, we instantiate this connector using an annotation that indicates to the Modelica compiler that it should generate an Simcenter Amesim submodel with an "elect" port type. This is the Simcenter Amesim electrical port type that is used in the Simcenter Amesim electrical libraries. In the equation section, the current and potential for the Simcenter Amesim connector is set to be equal to the current and potential of the Modelica connector.
The RLC model can now be rewritten using the OnePinVinIout model as shown in the figure below. With this Modelica model we create a new Simcenter Amesim submodel that will in this case have one port.
Figure 41: A Modelica model using "physical" ports for connecting with Simcenter Amesim (SimcenterAmesim.Examples.ElectricalExamples.ElectricalPhysicalPort)
The newly-created submodel can be used together with components from the Electrical Basics library as shown in the figure below. As can be seen in the following external variables pop-up (see figure Figure 43), the port variables of the created submodel have units like classic Simcenter Amesim submodels.
SimcenterAmesim.AMESim.Mechanics.Translational.ForceInputVelOutput,
SimcenterAmesim.AMESim.Thermal.HeatTransfer.OnePort.OnePortTinQout.
Figure 42: Simcenter Amesim sketch of a Modelica-based submodel attached to standard electrical components
Figure 43: External variables for a Modelica-based submodel using physical ports
Modelica imported submodels can be connected to Simcenter Amesim submodels from other modeling domains (hydraulics, pneumatics, thermal, etc.) using the appropriate port type, as listed in the following table:
| Port type | Modeling domain | Simcenter Amesim Libraries |
|---|---|---|
| hflow | Hydraulics | Air-Conditioning Hydraulic Hydraulic Component Design Hydraulic Resistance Thermal Hydraulic Thermal Hydraulic Component Design Thermal Hydraulic Resistance Two-Phase Flow |
| pflow | Pneumatics | Gas Mixtures IFP Engine Moist Air Pneumatic Pneumatic Component Design Thermal Pneumatic Thermal Pneumatic Component Design |
| signal signal | Signal | Generic Cosimulation Signal, Control Simulation |
| rshaft | Rotational Mechanics | Cams and Followers Mechanical Powertrain |
| Tlshaft | Translational Mechanics | Mechanical Vehicle Dynamics |
| meca2D | 2D Mechanics | Planar Mechanical |
| elect | Electrical | Electric Motors and Drives Electrical Basics Electrical Static Conversion |
| electroch | Electrochemical | Electrochemistry |
| thermal | Thermal | Thermal Thermal Hydraulic Thermal Pneumatic |
| magnet | Magnetics | Electro mechanical |
| rope | Translational Mechanics | Mechanical (rope and pulley models) |
| undefined | User-defined | Generic port type for user-defined libraries |
Source: https://docs.sw.siemens.com/en-US/doc/254352342/PL20250521841123434.amesim_collection.Modelica_Platform/Physical_port_connections · retrieved 2026-07-17