MSL 热电容器可以用于模拟流体对流吗?

发布于 2025-01-16 14:15:49 字数 7611 浏览 6 评论 0原文

我正在建设一个管网。在此模型中,一些管道通过壁与大量流体交换热量。流体的质量和壁的外部通过对流交换热量,我可以估计传热系数。为了对这种流体质量进行建模,我想使用 MSL 中的 HeatCapitor,因为可以为我的模型估计其热容量。

以下是该模型的直观表示:

在此处输入图像描述

该模型是平衡的,编译后我收到此错误消息: 输入图片这里的描述

这是我使用的代码:

model Ciruit_hyd_bas_avec_echanges_22_03

replaceable package Medium = Modelica.Media.Water.StandardWater constrainedby Modelica.Media.Interfaces.PartialMedium;

replaceable model HeatTransfer_1 = Modelica.Fluid.Pipes.BaseClasses.HeatTransfer.LocalPipeFlowHeatTransfer;


  Modelica.Fluid.Sources.Boundary_pT inlet(redeclare package Medium = Medium, T = 311.15, nPorts = 1, p = 4.4e5)  annotation(
    Placement(visible = true, transformation(origin = {-86, 0}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
  Modelica.Fluid.Pipes.DynamicPipe secondary_1(redeclare package Medium = Medium, diameter = 13e-3, energyDynamics = Modelica.Fluid.Types.Dynamics.SteadyStateInitial, length = 15, massDynamics = Modelica.Fluid.Types.Dynamics.SteadyStateInitial, momentumDynamics = Modelica.Fluid.Types.Dynamics.SteadyStateInitial, nNodes = 10, roughness = 3.2e-06, use_HeatTransfer = true)  annotation(
    Placement(visible = true, transformation(origin = {14, 76}, extent = {{-10, 10}, {10, -10}}, rotation = 0)));
  Modelica.Fluid.Pipes.DynamicPipe secondary_2(redeclare package Medium = Medium, redeclare final model HeatTransfer = HeatTransfer_1, diameter = 13e-3, energyDynamics = Modelica.Fluid.Types.Dynamics.SteadyStateInitial, length = 15, massDynamics = Modelica.Fluid.Types.Dynamics.SteadyStateInitial, momentumDynamics = Modelica.Fluid.Types.Dynamics.SteadyStateInitial, nNodes = 10, roughness = 3.2e-06, use_HeatTransfer = true)  annotation(
    Placement(visible = true, transformation(origin = {12, -82}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
  Modelica.Fluid.Pipes.DynamicPipe pipe2(redeclare package Medium = Medium, redeclare final model HeatTransfer = HeatTransfer_1, T_start = 311.15, diameter = 38e-3, energyDynamics = Modelica.Fluid.Types.Dynamics.SteadyStateInitial, length = 1, massDynamics = Modelica.Fluid.Types.Dynamics.SteadyStateInitial, momentumDynamics = Modelica.Fluid.Types.Dynamics.SteadyStateInitial, p_a_start = 4.4e5, roughness = 3.2e-06)  annotation(
    Placement(visible = true, transformation(origin = {-56, 0}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
  inner Modelica.Fluid.System system annotation(
    Placement(visible = true, transformation(origin = {-88, 88}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
  Modelica.Fluid.Examples.HeatExchanger.BaseClasses.WallConstProps wallConstProps(area_h = 0.89535390627, c_wall = 510, energyDynamics = Modelica.Fluid.Types.Dynamics.SteadyStateInitial, k_wall = 60.5, n = 10, rho_wall = 7850, s = 6e-3)  annotation(
    Placement(visible = true, transformation(origin = {12, -56}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
  Modelica.Fluid.Examples.HeatExchanger.BaseClasses.WallConstProps wallConstProps1(area_h = 0.89535390627, c_wall = 510, energyDynamics = Modelica.Fluid.Types.Dynamics.SteadyStateInitial, k_wall = 60.5, n = 10, rho_wall = 7850, s = 6e-3) annotation(
    Placement(visible = true, transformation(origin = {12, 50}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
  Modelica.Fluid.Pipes.DynamicPipe pipe3(redeclare package Medium = Medium, diameter = 38e-3, energyDynamics = Modelica.Fluid.Types.Dynamics.SteadyStateInitial, length = 1, massDynamics = Modelica.Fluid.Types.Dynamics.SteadyStateInitial, momentumDynamics = Modelica.Fluid.Types.Dynamics.SteadyStateInitial, roughness = 3.2e-06)  annotation(
    Placement(visible = true, transformation(origin = {124, 0}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
  Modelica.Thermal.HeatTransfer.Components.HeatCapacitor heatCapacitor[10](each C = 418, each T(start = 328.15))  annotation(
    Placement(visible = true, transformation(origin = {76, 0}, extent = {{-10, -10}, {10, 10}}, rotation = -90)));
  Modelica.Fluid.Sources.MassFlowSource_T outlet(redeclare package Medium = Medium, T = 311.15, m_flow = -2.5, nPorts = 1)  annotation(
    Placement(visible = true, transformation(origin = {150, 0}, extent = {{10, -10}, {-10, 10}}, rotation = 0)));
  Modelica.Thermal.HeatTransfer.Components.Convection convection[10] annotation(
    Placement(visible = true, transformation(origin = {12, -30}, extent = {{-10, -10}, {10, 10}}, rotation = 90)));
  Modelica.Thermal.HeatTransfer.Components.Convection convection2[10] annotation(
    Placement(visible = true, transformation(origin = {12, 20}, extent = {{-10, 10}, {10, -10}}, rotation = -90)));
  Modelica.Blocks.Sources.Constant const[10](each k = 60)  annotation(
    Placement(visible = true, transformation(origin = {-58, 20}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
  Modelica.Blocks.Sources.Constant const1[10](each k = 60) annotation(
    Placement(visible = true, transformation(origin = {-56, -30}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
equation
  connect(inlet.ports[1], pipe2.port_a) annotation(
    Line(points = {{-76, 0}, {-66, 0}}, color = {0, 127, 255}));
  connect(pipe2.port_b, secondary_1.port_a) annotation(
    Line(points = {{-46, 0}, {-22, 0}, {-22, 76}, {4, 76}}, color = {0, 127, 255}));
  connect(pipe2.port_b, secondary_2.port_a) annotation(
    Line(points = {{-46, 0}, {-22, 0}, {-22, -82}, {2, -82}}, color = {0, 127, 255}));
  connect(secondary_1.port_b, pipe3.port_a) annotation(
    Line(points = {{24, 76}, {114, 76}, {114, 0}}, color = {0, 127, 255}));
  connect(secondary_2.port_b, pipe3.port_a) annotation(
    Line(points = {{22, -82}, {114, -82}, {114, 0}}, color = {0, 127, 255}));
  connect(pipe3.port_b, outlet.ports[1]) annotation(
    Line(points = {{134, 0}, {140, 0}}, color = {0, 127, 255}));
  connect(secondary_1.heatPorts, wallConstProps1.heatPort_a) annotation(
    Line(points = {{14, 72}, {10, 72}, {10, 56}, {12, 56}}, color = {127, 0, 0}, thickness = 0.5));
  connect(wallConstProps1.heatPort_b, convection2.solid) annotation(
    Line(points = {{12, 46}, {12, 46}, {12, 30}, {12, 30}}, color = {191, 0, 0}, thickness = 0.5));
  connect(const.y, convection2.Gc) annotation(
    Line(points = {{-47, 20}, {2, 20}}, color = {0, 0, 127}, thickness = 0.5));
  connect(const1.y, convection.Gc) annotation(
    Line(points = {{-44, -30}, {0, -30}, {0, -30}, {2, -30}}, color = {0, 0, 127}, thickness = 0.5));
  connect(convection.solid, wallConstProps.heatPort_a) annotation(
    Line(points = {{12, -40}, {12, -40}, {12, -50}, {12, -50}}, color = {191, 0, 0}, thickness = 0.5));
  connect(wallConstProps.heatPort_b, secondary_2.heatPorts) annotation(
    Line(points = {{12, -60}, {12, -60}, {12, -78}, {12, -78}}, color = {191, 0, 0}, thickness = 0.5));
  connect(convection2.fluid, heatCapacitor.port) annotation(
    Line(points = {{12, 10}, {66, 10}, {66, 0}, {66, 0}}, color = {191, 0, 0}, thickness = 0.5));
  connect(convection.fluid, heatCapacitor.port) annotation(
    Line(points = {{12, -20}, {66, -20}, {66, 0}, {66, 0}}, color = {191, 0, 0}, thickness = 0.5));
  annotation(
    uses(Modelica(version = "3.2.3")),
    Diagram(coordinateSystem(extent = {{-100, -100}, {175, 100}})),
    Icon(coordinateSystem(extent = {{-100, -100}, {175, 100}})),
    version = "");
end Ciruit_hyd_bas_avec_echanges_22_03;

所以我想知道是否可以使用Heatcapacitor来模拟对流流体的质量,或者错误是否出在我的模型中?

I'm building a pipe network. In this model some of the pipes exchange heat through a wall with a mass of fluid. The mass of fluid and the outside of the wall exchange heat by convection and I can estimate the heat transfer coefficient. In order to model this mass of fluid I want to use the HeatCapitor from the MSL as it is possible to estimate its heat capacity for my model.

Here is a visual representation of this model:

enter image description here

The model is balanced, and after the compilation I get this error message :
enter image description here

Here is the code I use :

model Ciruit_hyd_bas_avec_echanges_22_03

replaceable package Medium = Modelica.Media.Water.StandardWater constrainedby Modelica.Media.Interfaces.PartialMedium;

replaceable model HeatTransfer_1 = Modelica.Fluid.Pipes.BaseClasses.HeatTransfer.LocalPipeFlowHeatTransfer;


  Modelica.Fluid.Sources.Boundary_pT inlet(redeclare package Medium = Medium, T = 311.15, nPorts = 1, p = 4.4e5)  annotation(
    Placement(visible = true, transformation(origin = {-86, 0}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
  Modelica.Fluid.Pipes.DynamicPipe secondary_1(redeclare package Medium = Medium, diameter = 13e-3, energyDynamics = Modelica.Fluid.Types.Dynamics.SteadyStateInitial, length = 15, massDynamics = Modelica.Fluid.Types.Dynamics.SteadyStateInitial, momentumDynamics = Modelica.Fluid.Types.Dynamics.SteadyStateInitial, nNodes = 10, roughness = 3.2e-06, use_HeatTransfer = true)  annotation(
    Placement(visible = true, transformation(origin = {14, 76}, extent = {{-10, 10}, {10, -10}}, rotation = 0)));
  Modelica.Fluid.Pipes.DynamicPipe secondary_2(redeclare package Medium = Medium, redeclare final model HeatTransfer = HeatTransfer_1, diameter = 13e-3, energyDynamics = Modelica.Fluid.Types.Dynamics.SteadyStateInitial, length = 15, massDynamics = Modelica.Fluid.Types.Dynamics.SteadyStateInitial, momentumDynamics = Modelica.Fluid.Types.Dynamics.SteadyStateInitial, nNodes = 10, roughness = 3.2e-06, use_HeatTransfer = true)  annotation(
    Placement(visible = true, transformation(origin = {12, -82}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
  Modelica.Fluid.Pipes.DynamicPipe pipe2(redeclare package Medium = Medium, redeclare final model HeatTransfer = HeatTransfer_1, T_start = 311.15, diameter = 38e-3, energyDynamics = Modelica.Fluid.Types.Dynamics.SteadyStateInitial, length = 1, massDynamics = Modelica.Fluid.Types.Dynamics.SteadyStateInitial, momentumDynamics = Modelica.Fluid.Types.Dynamics.SteadyStateInitial, p_a_start = 4.4e5, roughness = 3.2e-06)  annotation(
    Placement(visible = true, transformation(origin = {-56, 0}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
  inner Modelica.Fluid.System system annotation(
    Placement(visible = true, transformation(origin = {-88, 88}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
  Modelica.Fluid.Examples.HeatExchanger.BaseClasses.WallConstProps wallConstProps(area_h = 0.89535390627, c_wall = 510, energyDynamics = Modelica.Fluid.Types.Dynamics.SteadyStateInitial, k_wall = 60.5, n = 10, rho_wall = 7850, s = 6e-3)  annotation(
    Placement(visible = true, transformation(origin = {12, -56}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
  Modelica.Fluid.Examples.HeatExchanger.BaseClasses.WallConstProps wallConstProps1(area_h = 0.89535390627, c_wall = 510, energyDynamics = Modelica.Fluid.Types.Dynamics.SteadyStateInitial, k_wall = 60.5, n = 10, rho_wall = 7850, s = 6e-3) annotation(
    Placement(visible = true, transformation(origin = {12, 50}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
  Modelica.Fluid.Pipes.DynamicPipe pipe3(redeclare package Medium = Medium, diameter = 38e-3, energyDynamics = Modelica.Fluid.Types.Dynamics.SteadyStateInitial, length = 1, massDynamics = Modelica.Fluid.Types.Dynamics.SteadyStateInitial, momentumDynamics = Modelica.Fluid.Types.Dynamics.SteadyStateInitial, roughness = 3.2e-06)  annotation(
    Placement(visible = true, transformation(origin = {124, 0}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
  Modelica.Thermal.HeatTransfer.Components.HeatCapacitor heatCapacitor[10](each C = 418, each T(start = 328.15))  annotation(
    Placement(visible = true, transformation(origin = {76, 0}, extent = {{-10, -10}, {10, 10}}, rotation = -90)));
  Modelica.Fluid.Sources.MassFlowSource_T outlet(redeclare package Medium = Medium, T = 311.15, m_flow = -2.5, nPorts = 1)  annotation(
    Placement(visible = true, transformation(origin = {150, 0}, extent = {{10, -10}, {-10, 10}}, rotation = 0)));
  Modelica.Thermal.HeatTransfer.Components.Convection convection[10] annotation(
    Placement(visible = true, transformation(origin = {12, -30}, extent = {{-10, -10}, {10, 10}}, rotation = 90)));
  Modelica.Thermal.HeatTransfer.Components.Convection convection2[10] annotation(
    Placement(visible = true, transformation(origin = {12, 20}, extent = {{-10, 10}, {10, -10}}, rotation = -90)));
  Modelica.Blocks.Sources.Constant const[10](each k = 60)  annotation(
    Placement(visible = true, transformation(origin = {-58, 20}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
  Modelica.Blocks.Sources.Constant const1[10](each k = 60) annotation(
    Placement(visible = true, transformation(origin = {-56, -30}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
equation
  connect(inlet.ports[1], pipe2.port_a) annotation(
    Line(points = {{-76, 0}, {-66, 0}}, color = {0, 127, 255}));
  connect(pipe2.port_b, secondary_1.port_a) annotation(
    Line(points = {{-46, 0}, {-22, 0}, {-22, 76}, {4, 76}}, color = {0, 127, 255}));
  connect(pipe2.port_b, secondary_2.port_a) annotation(
    Line(points = {{-46, 0}, {-22, 0}, {-22, -82}, {2, -82}}, color = {0, 127, 255}));
  connect(secondary_1.port_b, pipe3.port_a) annotation(
    Line(points = {{24, 76}, {114, 76}, {114, 0}}, color = {0, 127, 255}));
  connect(secondary_2.port_b, pipe3.port_a) annotation(
    Line(points = {{22, -82}, {114, -82}, {114, 0}}, color = {0, 127, 255}));
  connect(pipe3.port_b, outlet.ports[1]) annotation(
    Line(points = {{134, 0}, {140, 0}}, color = {0, 127, 255}));
  connect(secondary_1.heatPorts, wallConstProps1.heatPort_a) annotation(
    Line(points = {{14, 72}, {10, 72}, {10, 56}, {12, 56}}, color = {127, 0, 0}, thickness = 0.5));
  connect(wallConstProps1.heatPort_b, convection2.solid) annotation(
    Line(points = {{12, 46}, {12, 46}, {12, 30}, {12, 30}}, color = {191, 0, 0}, thickness = 0.5));
  connect(const.y, convection2.Gc) annotation(
    Line(points = {{-47, 20}, {2, 20}}, color = {0, 0, 127}, thickness = 0.5));
  connect(const1.y, convection.Gc) annotation(
    Line(points = {{-44, -30}, {0, -30}, {0, -30}, {2, -30}}, color = {0, 0, 127}, thickness = 0.5));
  connect(convection.solid, wallConstProps.heatPort_a) annotation(
    Line(points = {{12, -40}, {12, -40}, {12, -50}, {12, -50}}, color = {191, 0, 0}, thickness = 0.5));
  connect(wallConstProps.heatPort_b, secondary_2.heatPorts) annotation(
    Line(points = {{12, -60}, {12, -60}, {12, -78}, {12, -78}}, color = {191, 0, 0}, thickness = 0.5));
  connect(convection2.fluid, heatCapacitor.port) annotation(
    Line(points = {{12, 10}, {66, 10}, {66, 0}, {66, 0}}, color = {191, 0, 0}, thickness = 0.5));
  connect(convection.fluid, heatCapacitor.port) annotation(
    Line(points = {{12, -20}, {66, -20}, {66, 0}, {66, 0}}, color = {191, 0, 0}, thickness = 0.5));
  annotation(
    uses(Modelica(version = "3.2.3")),
    Diagram(coordinateSystem(extent = {{-100, -100}, {175, 100}})),
    Icon(coordinateSystem(extent = {{-100, -100}, {175, 100}})),
    version = "");
end Ciruit_hyd_bas_avec_echanges_22_03;

So I wonder if it's possible to use the Heatcapacitor to model the mass of a fluid for convection or if the error is in my model?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文