Message Boards Message Boards

0
|
27488 Views
|
2 Replies
|
2 Total Likes
View groups...
Share
Share this post:
GROUPS:

How do I see the equations for a component in SystemModeler?

Posted 12 years ago
Let's say I want to see the equations for the Convection component in the Thermal library. How do I do that?
POSTED BY: Johan Rhodin
2 Replies
Posted 10 years ago

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;
POSTED BY: Mohamed Mahmoud
Posted 12 years ago
This can be done by finding the component in the Class Browser and looking at it in the Text View:
Navigate to Modelica -> Thermal -> HeatTransfer -> Components and double-click on Convection.
Then go to Modelica Text View by pressing Cmd+3 (OS X) / Ctrl+3 (Windows) or by clicking the Modelica Text View icon.

The equations are listed under equation:
  dT=solid.T - fluid.T;
  solid.Q_flow=Q_flow;
  fluid.Q_flow=-Q_flow;
  Q_flow=Gc*dT;
POSTED BY: Johan Rhodin
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract