Found an issue with the book? Report it on Github.

공간적으로 분산된 열 전달(Spatially Distributed Heat Transfer)

공간적으로 분산된 열 전달(Spatially Distributed Heat Transfer)

재사용 가능한 하위 시스템을 만드는 약간 변형된 다음 예제를 소개합니다. 이 섹션에서는 이 장의 이전 예제에서와 같이 재사용 가능한 하위 시스템 모델을 만드는 방법을 보여줄 뿐만 아니라 해당 하위 시스템 모델은 해당 배열의 크기를 사용할 수 있는 **구성 요소**인스턴스의 배열을 사용하여 결과의 공간 해상도를 제어하는 것을 보여주겠습니다.이는 앞에서 '1차원 열전달'에서 제시한 종류의 모델과 유사합니다.

수평 시스템(Flat System)

평소와 같이 아래와 같은 평면 시스템 레벨 모델부터 시작하겠습니다.

Flat version of our heat transfer system

이 모델은 특정 공간 사이에 열 전도체가 있는 열 커패시턴스 모음으로 구성하며, 실제로 열용량은 금속 파이프의 세그먼트를 나타낼 수 있습니다.축 방향 전도는 막대의 길이를 따라 축 방향으로 열 전도를 나타낼 수 있고, 방사형 전도는 플라스틱과 같은 일부 절연 재료를 통해 손실된 열로 표현할 수 있습니다.이 예에서는 3개의 열 용량 모델과 5개의 열 전도체가 있습니다.왼쪽에는 열이 시스템에 적용되고 오른쪽에는 온도 센서가 맨 오른쪽 열용량의 온도 변화를 측정합니다.따라서 예제에서는 한쪽 끝에 열을 가하고 다른 쪽 끝에서 온도 증가를 모니터링합니다.

모델리카에서 구현될 때 모델은 다음과 같습니다.

within ModelicaByExample.Subsystems.HeatTransfer.Examples;
model FlatRod "Modeling a heat transfer in a rod in a without subsystems"
  Modelica.Thermal.HeatTransfer.Sources.PrescribedHeatFlow heating
    "Heating actuator"
    annotation ...
  Modelica.Blocks.Sources.Step bc(height=10, startTime=0.5) "Heat profile"
    annotation ...
  Modelica.Thermal.HeatTransfer.Components.HeatCapacitor C1(C=0.1, T(fixed=true))
    annotation ...
  Modelica.Thermal.HeatTransfer.Components.ThermalConductor G1(G=1.2)
    annotation ...
  Modelica.Thermal.HeatTransfer.Components.HeatCapacitor C2(C=0.1, T(fixed=true))
    annotation ...
  Modelica.Thermal.HeatTransfer.Components.ThermalConductor G2(G=1.2)
    annotation ...
  Modelica.Thermal.HeatTransfer.Components.HeatCapacitor C3(C=0.1, T(fixed=true))
    annotation ...
  Modelica.Thermal.HeatTransfer.Sensors.TemperatureSensor sensor
    annotation ...
  Modelica.Thermal.HeatTransfer.Components.ThermalConductor wall1(G=0.9)
    annotation ...
  Modelica.Thermal.HeatTransfer.Sources.FixedTemperature ambient(T=293.15)
    "Ambient temperature" annotation ...
  Modelica.Thermal.HeatTransfer.Components.ThermalConductor wall2(G=0.9)
    annotation ...
  Modelica.Thermal.HeatTransfer.Components.ThermalConductor wall3(G=0.9)
    annotation ...
equation
  connect(bc.y, heating.Q_flow) annotation ...
  connect(C1.port, G1.port_a) annotation ...
  connect(C2.port, G2.port_a) annotation ...
  connect(G2.port_b, C3.port) annotation ...
  connect(G1.port_b, C2.port) annotation ...
  connect(heating.port, C1.port) annotation ...
  connect(wall1.port_b, C1.port) annotation ...
  connect(wall1.port_a, ambient.port) annotation ...
  connect(wall2.port_a, ambient.port) annotation ...
  connect(wall3.port_a, ambient.port) annotation ...
  connect(wall3.port_b, C3.port) annotation ...
  connect(sensor.port, C3.port) annotation ...
  connect(C2.port, wall2.port_b) annotation ...
end FlatRod;

이 시스템을 시뮬레이션하면 다음 선도에서 가장 오른쪽 열 용량의 온도 응답을 볼 수 있습니다.

/static/_images/FR.svg

세그먼트 로드 서브시스템(Segmented Rod Subsystem)

플랫 시스템 모델에는 3개의 열용량과 5개의 컨덕턴스가 있습니다. 이 구성은 3개의 동일한 세그먼트로 분할된 막대와 각 세그먼트와 일부 주변 조건 사이뿐만 아니라 해당 세그먼트 사이에서 발생하는 컨덕턴스를 나타냅니다.이론적으로 로드를 각 세그먼트와 주변 조건 사이의 N-1 전도 경로와 N-1 전도 경로가 있는 동일한 세그먼트로 로드를 나눌 수 있습니다.

특정 구성은 N=3 이지만, N이 파라미터인 서브시스템 모델을 만들 수 있습니다. 즉, N개의 동일한 세그먼트로 나누어지는 하위 시스템 모델을 만들 수 있습니다.

대신, 구성 요소 배열을 사용하여 이 정전 용량 및 컨덕턴스 모음을 나타냅니다. 결과 Rod 모델은 모델리카에서 다음과 같이 작성할 수 있습니다.

within ModelicaByExample.Subsystems.HeatTransfer.Components;
model Rod "Modeling discretized rod"
  import HTC=Modelica.Thermal.HeatTransfer.Components;

  parameter Integer n(start=2,min=2) "Number of rod segments";
  parameter Modelica.SIunits.Temperature T0 "Initial rod temperature";
  Modelica.Thermal.HeatTransfer.Interfaces.HeatPort_a port_a
    "Thermal connector to ambient"
    annotation ...
  Modelica.Thermal.HeatTransfer.Interfaces.HeatPort_b port_b
    "Thermal connector for rod end 'b'"
    annotation ...
  parameter Modelica.SIunits.HeatCapacity C
    "Total heat capacity of element (= cp*m)";
  parameter Modelica.SIunits.ThermalConductance G_wall
    "Thermal conductivity of wall";
  parameter Modelica.SIunits.ThermalConductance G_rod
    "Thermal conductivity of rod";
  Modelica.Thermal.HeatTransfer.Interfaces.HeatPort_a ambient
    "Thermal connector to ambient"
    annotation ...
protected
  HTC.HeatCapacitor capacitance[n](each final C=C/n, each T(start=T0, fixed=true))
    annotation ...
  HTC.ThermalConductor wall[n](each final G=G_wall/n)
    annotation ...
  HTC.ThermalConductor rod_conduction[n-1](each final G=G_rod*(n-1))
    annotation ...
equation
  for i in 1:n loop
    connect(capacitance[i].port, wall[i].port_b) "Capacitance to walls";
    connect(wall[i].port_a, ambient) "Walls to ambient";
  end for;
  for i in 1:n-1 loop
    connect(capacitance[i].port, rod_conduction[i].port_a)
      "Capacitance to next conduction";
    connect(capacitance[i+1].port, rod_conduction[i].port_b)
      "Capacitance to prev conduction";
  end for;
  connect(capacitance[1].port, port_a) "First capacitance to rod end";
  connect(capacitance[n].port, port_b) "Last capacitance to (other) rod end";
end Rod;

이 모델에 대해 주목해야 할 몇 가지 흥미로운 사항이 있습니다. 먼저 로드가 분할될 세그먼트 수는 n 파라미터로 표시됩니다.

  parameter Integer n(start=2,min=2) "Number of rod segments";

다음 선언에서 파라미터 n 을 사용하여 로드의 커패시턴스 및 컨덕턴스 요소 수를 지정합니다.

  HTC.HeatCapacitor capacitance[n](each final C=C/n, each T(start=T0, fixed=true))
    annotation ...
  HTC.ThermalConductor wall[n](each final G=G_wall/n)
    annotation ...
  HTC.ThermalConductor rod_conduction[n-1](each final G=G_rod*(n-1))
    annotation ...

구성 요소 배열의 모든 구성 요소, 를 들어 G=G_rod/n 에 수정을 적용하려는 경우 each 한정자를 사용할 수 있습니다.``each`` 한정자에 대해 설명하고 이 장 뒷부분의 하위 수정 섹션에서 구성 요소 배열에 수정 사항을 적용하는 방법에 대해 설명하겠습니다.

이제 구성 요소 배열을 선언했으므로 수식 섹션에서 for 루프를 사용하여 커패시턴스와 컨덕턴스를 함께 연결할 수 있습니다.

  for i in 1:n loop
    connect(capacitance[i].port, wall[i].port_b) "Capacitance to walls";
    connect(wall[i].port_a, ambient) "Walls to ambient";
  end for;
  for i in 1:n-1 loop
    connect(capacitance[i].port, rod_conduction[i].port_a)
      "Capacitance to next conduction";
    connect(capacitance[i+1].port, rod_conduction[i].port_b)
      "Capacitance to prev conduction";
  end for;

로드를 다른 모델에 연결할 수 있도록 로드의 끝을 외부 커넥터에 연결해야 합니다

  connect(capacitance[1].port, port_a) "First capacitance to rod end";
  connect(capacitance[n].port, port_b) "Last capacitance to (other) rod end";

이러한 방식으로 균등하게 분할된 임의의 수의 세그먼트로 분할된 로드 모델을 생성할 수 있습니다.

공간 해상도(Spatial Resolution)

이제 파라미터화된 Rod 모델이 있으므로 막대의 세그먼트 수가 보는 응답에 어떤 영향을 미치는지 확인할 수 있습니다.궁극적으로 봐야 할 것은 세그먼트의 수가 커질수록(또는 세그먼트의 크기가 작아질수록) 하나의 해로 수렴해야 한다는 것입니다.

n=3 인 모델을 먼저 다루어 보겠습니다.

within ModelicaByExample.Subsystems.HeatTransfer.Examples;
model ThreeSegmentRod "Modeling a heat transfer using 3 segment rod subsystem"
  Modelica.Thermal.HeatTransfer.Sources.PrescribedHeatFlow heating
    "Heating actuator"
    annotation ...
  Modelica.Blocks.Sources.Step bc(height=10, startTime=0.5) "Heat profile"
    annotation ...
  Modelica.Thermal.HeatTransfer.Sensors.TemperatureSensor sensor
    annotation ...
  Modelica.Thermal.HeatTransfer.Sources.FixedTemperature ambient(T=293.15)
    "Ambient temperature" annotation ...
  Components.Rod rod(n=3, C=0.3, G_wall=2.7, T0=293.15, G_rod=1.2)
    annotation ...
equation
  connect(bc.y, heating.Q_flow) annotation ...
  connect(heating.port, rod.port_a) annotation ...
  connect(rod.ambient, ambient.port) annotation ...
  connect(rod.port_b, sensor.port) annotation ...
end ThreeSegmentRod;

그런 다음 이 모델을 확장하여 더 많은 세그먼트가 있는 추가 모델을 생성할 수 있습니다.예를 들면 다음과 같습니다.

within ModelicaByExample.Subsystems.HeatTransfer.Examples;
model SixSegmentRod "Rod divided into 6 pieces"
  extends ThreeSegmentRod(rod(n=6));
end SixSegmentRod;
within ModelicaByExample.Subsystems.HeatTransfer.Examples;
model TenSegmentRod
  extends SixSegmentRod(rod(n=10));
end TenSegmentRod;
within ModelicaByExample.Subsystems.HeatTransfer.Examples;
model OneHundredSegmentRod "Rod divided into 100 pieces"
  extends ThreeSegmentRod(rod(n=100));
end OneHundredSegmentRod;
within ModelicaByExample.Subsystems.HeatTransfer.Examples;
model TwoHundredSegmentRod
  extends OneHundredSegmentRod(rod(n=200));
end TwoHundredSegmentRod;

이 모든 경우를 시뮬레이션하면 n 이 커질수록 일반적인 해로 수렴하는 것처럼 보이고, 많은 수의 불필요한 구성 요소를 해석하지 않는 합리적인 해가 n=10 인 것처럼 보입니다.

/static/_images/SegC.svg

결론(Conclusion)

이 섹션에서 컴포넌트 배열과 이들을 함께 연결하는 for 루프를 사용하여 임의 크기의 어셈블리를 빌드하는 방법을 살펴보았습니다.