Archived OpenModelica forums. Posting is disabled.

Alternative forums include GitHub discussions or StackOverflow (make sure to read the Stack Overflow rules; you need to have well-formed questions)


Forgot password? | Forgot username? | Register

Problem of modeling the pressure loss in a straight pipe

Problem of modeling the pressure loss in a straight pipe

Hi,

I am trying to model the pressure loss in a straight pipe in a very simple 2-tanks-1-hose system
Accoding to the tutorial I found at http://simulationresearch.lbl.gov/model … Guide.html
Here is the new up-dated codes:


model test_tank
    model test_tank "Show the treatment of empty tanks"
    extends Modelica.Icons.Example;
    Modelica.Fluid.Vessels.OpenTank tank1(redeclare package Medium = Modelica.Media.Water.ConstantPropertyLiquidWater, nPorts = 1, crossArea = 1, level_start = 1, portsData = {Modelica.Fluid.Vessels.BaseClasses.VesselPortsData(diameter = 0.1)}, height = 1.1) annotation(Placement(transformation(extent = {{-40,20},{0,60}}, rotation = 0)));
    Modelica.Fluid.Pipes.StaticPipe pipe(redeclare package Medium = Modelica.Media.Water.ConstantPropertyLiquidWater, length = 1, diameter = 0.1, height_ab = 0) annotation(Placement(transformation(origin = {-20,-20}, extent = {{-10,-10},{10,10}}, rotation = 270)));
    Modelica.Fluid.Vessels.OpenTank tank2(crossArea = 1, redeclare package Medium = Modelica.Media.Water.ConstantPropertyLiquidWater, nPorts = 1, height = 1.1, portsData = {Modelica.Fluid.Vessels.BaseClasses.VesselPortsData(diameter = 0.1, height = 0.5)}, level_start = 0.0000000001) annotation(Placement(transformation(extent = {{0,-80},{40,-40}}, rotation = 0)));
  inner Modelica.Fluid.System system(energyDynamics = Modelica.Fluid.Types.Dynamics.FixedInitial) annotation(Placement(visible = true, transformation(origin = {55.4281,65.6284}, extent = {{-10,-10},{10,10}}, rotation = 0)));
    Modelica.Fluid.Dissipation.PressureLoss.StraightPipe.dp_overall_IN_con dp_overall_in_con1(K = 0.000025) annotation(Placement(visible = true, transformation(origin = {-79.0698,-3.61757}, extent = {{-10,-10},{10,10}}, rotation = 0)));
    Modelica.Fluid.Dissipation.PressureLoss.StraightPipe.dp_overall_IN_var dp_overall_in_var1(eta = 1.002, rho = 1000) annotation(Placement(visible = true, transformation(origin = {-67.7003,-53.7468}, extent = {{-10,-10},{10,10}}, rotation = 0)));
  //incompressible case PD = f(m_flow)
    Modelica.SIunits.Pressure m_flow = pipe.flowModel.m_flows[1] "Input mass flow rate";
    Modelica.SIunits.MassFlowRate DP "Output pressure drop";

equation
    connect(tank1.ports[1],pipe.port_a) annotation(Line(points = {{-20,20},{-20,5},{-20,-10},{-20,-10}}, color = {0,127,255}, smooth = Smooth.None));
    connect(pipe.port_b,tank2.ports[1]) annotation(Line(points = {{-20,-30},{-20,-60},{0,-60},{0,-80},{20,-80}}, color = {0,127,255}, smooth = Smooth.None));
//incompressible case
    DP = Modelica.Fluid.Dissipation.PressureLoss.StraightPipe.dp_overall_DP(dp_overall_in_con1, dp_overall_in_var1, m_flow);

end test_tank;


Note that the place I reded are the codes for calculating pressure loss in the stright pipe
With the set of codes the model is able to be simulated, and gets the same result as the EmptyTank example for all pre-existing variables, except for the problem that I did not get any number for the pressure loss (DP). According to the codes I should have put in_con1, in_var1, and m_flow as the inputs for pressure loss calculation calling for the dp_overall function. I guess I did not do the inputs correctly so the function gives no result. Is there any one may help me fixing this, or show me a successful example of modeling the pressure loss in a fluid system?
And, if I want to take the eta and rho values from the medium and the roughness value from the pipe to use it in the IN_con and IN_var modules, but not tpying the numbers in by the user, how I should do the codings?


Many thanks,
M.L.M

Edited by: mlmco - May-15-13 21:12:03
There are 0 guests and 0 other users also viewing this topic
You are here: