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

Heat flow

Heat flow

Hi!

I'm trying to build a system that show how much my flow will heat up. I've built the model below. The issue is that over 10s it heats to 25C, this is the same if I change the flow rate. It looks like it's just heating the water and not taking flow in to account. Any one know what I'm doing wrong?

Code:


model test
replaceable package Medium = Modelica.Media.Water.ConstantPropertyLiquidWater
    constrainedby Modelica.Media.Interfaces.PartialMedium;
  inner Modelica.Fluid.System system(T_ambient = 288.15)  annotation(
    Placement(visible = true, transformation(origin = {-82, 88}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
  Modelica.Fluid.Sources.FixedBoundary boundary(redeclare package Medium = Medium, T = Modelica.SIunits.Conversions.from_degC(15), nPorts = 1, p = Modelica.SIunits.Conversions.from_bar(3), use_T = true, use_p = true)  annotation(
    Placement(visible = true, transformation(origin = {-76, -2}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
  Modelica.Fluid.Sources.FixedBoundary boundary1(redeclare package Medium = Medium, nPorts = 1, p = Modelica.SIunits.Conversions.from_bar(1))  annotation(
    Placement(visible = true, transformation(origin = {76, -2}, extent = {{-10, -10}, {10, 10}}, rotation = 180)));
  Modelica.Fluid.Valves.ValveLinear valveLinear(redeclare package Medium = Medium, dp_nominal = 200000, m_flow_nominal = 0.166667)  annotation(
    Placement(visible = true, transformation(origin = {26, -4}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
   Modelica.Fluid.Pipes.DynamicPipe heater(
    redeclare package Medium = Medium,
    redeclare model HeatTransfer =
        Modelica.Fluid.Pipes.BaseClasses.HeatTransfer.IdealFlowHeatTransfer,
    redeclare model FlowModel =
        Modelica.Fluid.Pipes.BaseClasses.FlowModels.DetailedPipeFlow,
    diameter= 0.5,
    length= 1,
    modelStructure=Modelica.Fluid.Types.ModelStructure.a_v_b,
    nNodes=1,
    use_HeatTransfer=true, use_T_start = false)
    annotation (Placement(visible = true, transformation(extent = {{-38, -12}, {-18, 8}}, rotation = 0)));
  Modelica.Blocks.Sources.Constant const(k = 1)  annotation(
    Placement(visible = true, transformation(origin = {6, 26}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
  Modelica.Thermal.HeatTransfer.Sources.FixedHeatFlow fixedHeatFlow(Q_flow = 400000, T_ref = 288.15, alpha = 0)  annotation(
    Placement(visible = true, transformation(origin = {-46, 22}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
equation
  connect(const.y, valveLinear.opening) annotation(
    Line(points = {{17, 26}, {26, 26}, {26, 4}}, color = {0, 0, 127}));
  connect(valveLinear.port_b, boundary1.ports[1]) annotation(
    Line(points = {{36, -4}, {66, -4}, {66, -2}, {66, -2}}, color = {0, 127, 255}));
  connect(boundary.ports[1], heater.port_a) annotation(
    Line(points = {{-66, -2}, {-38, -2}, {-38, -2}, {-38, -2}}, color = {0, 127, 255}));
  connect(heater.port_b, valveLinear.port_a) annotation(
    Line(points = {{-18, -2}, {16, -2}, {16, -4}, {16, -4}, {16, -4}}, color = {0, 127, 255}));
  connect(fixedHeatFlow.port, heater.heatPorts[1]) annotation(
    Line(points = {{-36, 22}, {-28, 22}, {-28, 2}, {-28, 2}}, color = {191, 0, 0}));
  annotation(
    uses(Modelica(version = "3.2.2")));
end test;

Re: Heat flow

I've tried switching to StandardWater but I cant complie the model with this. Seems like a bug since I can't run the example HeatingSystem either

penModelica 1.14.0

Edited by: victor - Dec-05-19 19:59:33

Re: Heat flow

Potential fix comming on monday - https://trac.openmodelica.org/OpenModel … 735#ticket

There are 0 guests and 0 other users also viewing this topic
You are here: