Once the load flow solution is found, the UCM initializes from this solution into an EMT simulation. The User Coded Model (UCM) is a HYPERSIM utility allowing users to create their own templates that can not otherwise be built using existing templates. UCM is coded by users, in C, according to HYPERSIM rules.
UCM allows you to build models of power and control components. The advantage of using the UCM is that the power portion is solved simultaneously with other power components of the network. The admittance of the UCM is added to the admittance of the whole network and all the node voltages are solved together in the same calculation step. This gives greater numerical stability than if the power UCM were represented as controlled sources involving a computation time. Because the power UCM is solved with other power elements, users must follow the same procedure as used in the HYPERSIM algorithm to resolve node voltages.
Model Type for Power Flow Solution
To implement the power flow solution in the User Coded Model (UCM) of HYPERSIM, the UCM form was updated to take into account the model type (Admittance or Generation) in the Model description section of the form to indicate to HYPERSIM whether the UCM is participating or not in the power flow solution.
The added variable is UCM_LOADFLOW_TYPE and can have the following values:
Default | If not included in Section 1, the UCM does not participate in the power flow solution. |
---|---|
Admittance | Model UCM participates in power flow solution as being considered as a load. |
Generation | Model UCM participates in the power flow solution as a generator. |
Figure 1 shows the code in Section 1 for the UCM Linear Impedance Model RL. Note that in this case the variable UCM_LOADFLOW_TYPE is equal to Admittance.
Function of the Admittance Calculation (Section 8.3.3)
The Load Flow admittance calculation function allows the UCM to be considered by the power flow solution.
The figure below shows the code in Section 8.3.3 for the UCM Linear Impedance Model RL. Note that the actual (ucmYlfReal) and imaginary (ucmYlfImag) values of the UCM must be defined separately in the nodal admittance matrix.
Function of Updating Historical Values (Section 8.3.4)
The Load Flow Historical Values Update Function allows the voltage history values and currents associated with the UCM model to initialize from the power flow solution.
The figure below shows the code in Section 8.3.4 for the UCM Linear Impedance Model RL. Note that the ucmVlfHist and ucmIlfHist variables correspond to the voltage and current histories respectively.
Function of Model Parameter Update (Section 8.3.5)
The Load Flow Model Parameters Update Function allows the voltage and angle values for Generation-type UCMs to be updated with the initial values of the power flow solution.
The figure below shows the code in Section 8.3.5 for a UCM model of voltage source with internal impedance. Note that the variables ucmVintReal and ucmVintImag correspond to the initial values of voltage calculated from the power flow solution.