I made one component and the validation shows that it has 3 equations and 2 variables. But the equation section only has 2 equations. Do you have any idea how can I find the third one ?
It is a mass flow source component and here is the code:
connector FluidPort "Interface for quasi one-dimensional fluid flow in a piping network (incompressible or compressible, one or more phases, one or more substances)"
flow Hydraulics.Media.Interfaces.Types.MassFlowRate m_flow "Mass flow rate from the connection point into the component";
Hydraulics.Media.Interfaces.Types.AbsolutePressure p "Thermodynamic pressure in the connection point";
annotation(Icon(coordinateSystem(extent={{-100.0,-100.0},{100.0,100.0}}, preserveAspectRatio=true, initialScale=0.1, grid={10,10}), graphics={Ellipse(visible=true, fillColor={255,255,255}, lineThickness=2, extent={{-100.0,-100.0},{100.0,100.0}})}));
end FluidPort;
partial model PartialSource "A base class for constant mass flow rate sources"
Hydraulics.Interfaces.FluidPort port annotation(Placement(transformation(extent={{115.5,-10.5},{94.5,10.5}}, rotation=0, origin={-5.5,-0.5}), iconTransformation(extent={{110.0,-10.0},{90.0,10.0}}, origin={0.0,0.0}, rotation=0), visible=true));
annotation(Diagram(coordinateSystem(preserveAspectRatio=false, extent={{-100.0,-100.0},{100.0,100.0}}, grid={1,1}, initialScale=0.1), graphics={Ellipse(visible=true, origin={99.5,-0.5}, fillColor={0,255,255}, fillPattern=FillPattern.Solid, extent={{-13.5,-14.5385},{13.5,14.5385}})}), Icon(coordinateSystem(preserveAspectRatio=true, extent={{-100.0,-100.0},{100.0,100.0}}, grid={1,1}, initialScale=0.1), graphics={Polygon(visible=showDesignFlowDirection, lineColor={0,128,255}, fillColor={0,128,255}, fillPattern=FillPattern.Solid, points={{20.0,-70.0},{60.0,-85.0},{20.0,-100.0},{20.0,-70.0}}),Line(visible=showDesignFlowDirection, points={{55.0,-85.0},{-60.0,-85.0}}, color={0,128,255}),Text(visible=true, lineColor={0,0,255}, extent={{-149.0,-154.0},{151.0,-114.0}}, textString="%name", fontName="Arial")}));
end PartialSource;
model ConstantMassFlow "A constant mass flow rate supply"
extends Hydraulics.Interfaces.PartialSource;
parameter Hydraulics.SIunits.MassFlowRate q "Constant Mass Flow Rate (kg/s)";
parameter Hydraulics.SIunits.Pressure p "Fluid Pressure (Pa)";
equation
port.m_flow=q;
port.p=p;
annotation(Icon(coordinateSystem(extent={{-100.0,-100.0},{100.0,100.0}}, preserveAspectRatio=true, initialScale=0.1, grid={5,5}), graphics={Rectangle(visible=true, fillColor={0,127,255}, fillPattern=FillPattern.HorizontalCylinder, extent={{35.0,-45.0},{100.0,45.0}}),Ellipse(visible=true, lineColor={0,0,255}, fillColor={255,255,255}, fillPattern=FillPattern.Solid, extent={{-100.0,-80.0},{60.0,80.0}}),Polygon(visible=true, lineColor={0,0,255}, fillColor={0,0,255}, fillPattern=FillPattern.Solid, points={{-60.0,70.0},{60.0,0.0},{-60.0,-68.0},{-60.0,70.0}}),Text(visible=true, lineColor={255,0,0}, extent={{-54.0,-30.0},{16.0,32.0}}, textString="m", fontName="Arial"),Ellipse(visible=true, origin={5.0,0.0}, lineColor={255,0,0}, fillColor={255,0,0}, fillPattern=FillPattern.Solid, extent={{-26.0,22.0},{-18.0,30.0}})}), Diagram(coordinateSystem(extent={{-100.0,-100.0},{100.0,100.0}}, preserveAspectRatio=true, initialScale=0.1, grid={5,5}), graphics={Rectangle(visible=true, fillColor={0,127,255}, fillPattern=FillPattern.HorizontalCylinder, extent={{35.0,-45.0},{100.0,45.0}}),Ellipse(visible=true, lineColor={0,0,255}, fillColor={255,255,255}, fillPattern=FillPattern.Solid, extent={{-100.0,-80.0},{60.0,80.0}}),Polygon(visible=true, lineColor={0,0,255}, fillColor={0,0,255}, fillPattern=FillPattern.Solid, points={{-60.0,70.0},{60.0,0.0},{-60.0,-68.0},{-60.0,70.0}}),Text(visible=true, lineColor={255,0,0}, extent={{-54.0,-30.0},{16.0,32.0}}, textString="m", fontName="Arial"),Ellipse(visible=true, origin={5.0,0.0}, lineColor={255,0,0}, fillColor={255,0,0}, fillPattern=FillPattern.Solid, extent={{-26.0,22.0},{-18.0,30.0}})}));
end ConstantMassFlow;