AmesimKnowledge

Coupling Modelica models with native Simcenter Amesim models

Reviewing the models

The model of interest can be found in the Simcenter Amesim Demos. Search for "solenoid", and locate the Modelica demo shown in the figure below. To begin, store a local copy of this model.

Figure 54: The heterogeneous fuel injection demo model from Help

While the Help demo page gives a more complete description of this model, a brief review is warranted here. The solenoid injector system includes three main subsystems:

  • Hydraulics: a hydraulic circuit that models how the fuel flows through the various chambers of the injector.

  • Power electronics: a Modelica power electronics circuit that models how a set of three ideal switches allow current to flow through a set of diodes and capacitors to provide power to a linear transducer.

  • Controller: a statechart controller that takes a high level input command (open solenoid, hold, close solenoid, etc.) and converts it into the low level commands (open / close switch) for the three switches in the power electronics subsystem.

The left portion of this model is the main fuel injection system. It uses components from the Simcenter Amesim "Hydraulics", "Hydraulic Component Design" and "Mechanical" libraries to model the fuel flowing through the injector. At the top of this system is a linear transducer model from the "Electro Mechanical" library. When current is sent into the transducer, it pushes down on the control valve. This opens a passage for the fuel to flow from the common rail, down through the control piston and needle, then out the nozzle into the engine cylinder. Through the use of Hydraulic Component Design submodels, this captures the dynamics of the fluid flowing through the various components, including leakages.

In the homogeneous solenoid injector model, the controller and power electronics are contained in a single Electro Mechanical library submodel (EMCD012). In the heterogeneous system model used here, the behavior is separated into separate controller and power electronics subsystems. The controller is modeled with a statechart, and the power electronics circuit is modeled with Modelica. These are all coupled to the hydraulics subsystem through the transducer.

Let's explore these subsystems in more detail. To begin, right-click on the statechart and select Launch Statechart environment' to see its contents (figure Figure 55).

Figure 55: Statechart controller for the solenoid injector

The statechart takes a supervisory controller input command that requests the control valve to open, hold steady or close. The statechart also looks at the current flowing through the power electronics device. With these pieces of information, the statechart issues a low level controller command to open or close each of the 3 switches found in the power electronics circuit. This is done like a pulse width modulation (PWM) type of control, whereby the switches are rapidly opened and closed to achieve the desired mean value for the current.

The power electronics circuit itself is modeled using Modelica. Right-click on the Modelica component and select Edit to open the model shown in figure Figure 56.

Figure 56: Modelica model of the power electronics circuit

The power electronics circuit consists of three ideal switches (cap, bat and inj), two ideal diodes, a small capacitor and a constant 14 V voltage source. This is modeled using components from the Modelica Standard Library's Electrical Analog library. Separate open / close commands are sent to each of the three switches. These signals come from Simcenter Amesim, therefore three AMERealInput blocks from the SimcenterAmesim.AMESim.Blocks package are used. Including these adapters in the Modelica model allows to create three signal ports for the associated submodel in Simcenter Amesim by connecting via equations (line 50 to 52 in the modelica demo code), thereby allowing the signal values to be passed from Simcenter Amesim into the Modelica model. In a similar way, two VoutIin adapters from the SimcenterAmesim.AMESim.Electrical package are used to create two electrical ports for the associated submodel in Simcenter Amesim. This allows the voltage value to be passed from Modelica to Simcenter Amesim (Vout from the Modelica adapter's point of view) and the current value to be passed from Simcenter Amesim to Modelica (Iin from the Modelica adapter's point of view). The assigned causality can be confirmed by viewing the external variables of the Modelica component from the Simcenter Amesim GUI (figure Figure 57).

Figure 57: External variables of the Modelica component

The reader is referred to the Modelica Reference manual for more information about how to properly couple Simcenter Amesim and Modelica models through external connectors and adapter models.

Source: https://docs.sw.siemens.com/en-US/doc/254352342/PL20250521841123434.amesim_collection.Modelica_Platform/xid1197541 · retrieved 2026-07-17