# Custom Models in Process Engineering

I'm using Aspen Custom Modeler to create a model to be used in Aspen Plus and Aspen Plus Dynamics, and I'm having trouble figuring out how to code the mass balance, energy balance, etc. I'm essentially coding up a pump, but a pump which takes both flow and inlet pressure as arguments to determine the outlet pressure. My model code is as follows.

Model XePump

In1 as input MainPort;
Out1 as output MainPort;

// Internal
Pdiff             as press_diff               (description:"Pressure difference");
Svar              as fraction                 (1.0,fixed,description:"Operating speed parameter");

Pdiff = 1.0 * In1.P * (0.16169605386 - In1.F) * Svar;
Out1.P = In1.P + Pdiff;
Out1.F = In1.F;

End


The errors I'm getting are in Aspen Plus, the model doesn't have any outlet flow rate, despite explicitly setting it to be equal to the inlet flow rate. Any tips?