หมายเหตุ: คำถามนี้อ้างอิงถึง PrescribedSpeedPump.mo ซึ่งอยู่ที่ ThermoPower.Examples.RankineCycle.Models.PrescribedSpeedPump
ฉันกำลังพยายาม เรียบง่าย โมเดลปั๊ม เนื่องจากทุกรุ่นที่ฉันสร้างโดยใช้ปั๊มนี้มักจะให้ข้อความแสดงข้อผิดพลาดเดียวกันเสมอ:
[1] 16:02:01 ข้อผิดพลาดในการแปล [ThermoPower.PowerPlants: 2071:95-2071:108]: ไม่พบตัวแปร q_nom ในขอบเขต ThermoPower.PowerPlants.HRSG.Components
[2] 16:02:01 ข้อผิดพลาดในการแปล [ThermoPower.PowerPlants: 2076:84-2076:132]: ค่าคงที่หรือพารามิเตอร์ที่ขึ้นอยู่กับวงจรที่พบในขอบเขต : {q_nom}, {head_nom} (ละเว้นด้วย -d=ignoreCycles)
จากการตรวจสอบ PrescribedSpeedPump นี้ ประกอบด้วยสองคลาส: A "FluidMedium" และ "flowCharacteristic" มันคือฟังก์ชัน - "FlowCharacteristic" ที่ทำให้เกิดข้อผิดพลาด
เหตุใดฉันจึงสับสน: ข้อผิดพลาดแจ้งว่าไม่พบตัวแปร q_nom ภายในเส้นทางของ ThermoPower.PowerPlants.HRSG.Components ตามที่กล่าวไว้ก่อนหน้านี้ ฉันบอกว่าสิ่งนี้อยู่ภายในแพ็คเกจตัวอย่างของ ThermoPower Library
อีกเหตุผลหนึ่งที่ฉันสับสนเกี่ยวกับสถานการณ์นี้คือ ฉันสามารถป้อนค่าพารามิเตอร์สำหรับทั้ง q_nom และ head_nom ได้ด้วยตนเอง พวกเขาได้รับค่าจำลองเป็น {1,2,3} สำหรับทั้งคู่ ถึงกระนั้น ตัวแปร "ไม่พบ"
ในที่สุด ฉันได้ลองแก้ไขฟังก์ชัน "flowCharacteristic" ด้วยตนเองแล้วลองตรวจสอบโมเดลของฉัน ยังคงมีข้อผิดพลาดเดียวกันปรากฏขึ้น ฉันไม่รู้วิธีแก้ปัญหาข้อผิดพลาดนี้จริงๆ ณ จุดนี้และได้ลองสิ่งที่ฉันคิดได้แล้ว
หากคุณมีข้อมูลเชิงลึกหรือข้อเสนอแนะใด ๆ โปรดอย่าลังเลที่จะแสดงความคิดเห็นด้านล่าง! ขอขอบคุณที่อ่านมาจนถึงตอนนี้ ฉันขอขอบคุณที่สละเวลาและความพยายามในการช่วยเหลือผู้อื่นในชุมชนนี้ ด้านล่างนี้ฉันได้คัดลอกโค้ดไปยังโมเดลปั๊มของฉันแล้ว
รหัสอัปเดตแล้ว:
model Pump_Verified
function flowCharacteristic =
ThermoPower.Functions.PumpCharacteristics.quadraticFlow (
q_nom = q_nom, head_nom = head_nom);
ThermoPower.PowerPlants.HRSG.Components.PrescribedSpeedPump
prescribedSpeedPump1(
redeclare package WaterMedium = ThermoPower.Water.StandardWater,
Np0 = 1,
V = 20,
head_nom = {1, 2, 3},
hstart = 451024,
n0 = 1200,
nominalFlow = 142.512,
nominalInletPressure=132000,
nominalOutletPressure=8581000,
q_nom = {1, 2, 3},
rho0=1000)
annotation (
Placement(visible = true, transformation(origin = {2, 0}, extent = {{-10,
-10}, {10, 10}}, rotation = 0)));
ThermoPower.Examples.RankineCycle.Models.PrescribedPressureCondenser
Condenser(
Vtot = 50,
p = 132000) annotation (
Placement(visible = true, transformation(origin = {-50, 40}, extent =
{{-10,
-10}, {10, 10}}, rotation = 0)));
ThermoPower.PowerPlants.SteamTurbineGroup.Components.StateReader_water
stateReader_water1 annotation (
Placement(visible = true, transformation(origin = {-50, 70}, extent =
{{-10,
-10}, {10, 10}}, rotation = -90)));
ThermoPower.PowerPlants.SteamTurbineGroup.Components.StateReader_water
stateReader_water2 annotation (
Placement(visible = true, transformation(origin = {-50, 10}, extent =
{{-10,
-10}, {10, 10}}, rotation = -90)));
ThermoPower.Water.SourceMassFlow SourceSteamFlow(
T = 380.561 - 273,
h = 931235,
p0 = 1.32e5,
w0 = 142.512) annotation (
Placement(visible = true, transformation(origin = {-72, 84}, extent =
{{-10,
-10}, {10, 10}}, rotation = 0)));
ThermoPower.Water.SinkMassFlow SinkWaterFlow annotation (
Placement(visible = true, transformation(origin = {52, 0}, extent = {{-10,
-10}, {10, 10}}, rotation = 0)));
inner ThermoPower.System system annotation (
Placement(visible = true, transformation(origin = {90, 88}, extent =
{{-10,
-10}, {10, 10}}, rotation = 0)));
ThermoPower.Water.SensP sensP_Inlet annotation(
Placement(visible = true, transformation(origin = {-32, 4}, extent =
{{-10, -10}, {10, 10}}, rotation = 0)));
ThermoPower.Water.SensP sensP_Outlet annotation(
Placement(visible = true, transformation(origin = {26, 4}, extent = {{-10,
-10}, {10, 10}}, rotation = 0)));
Modelica.Blocks.Sources.Constant const(k = 1200) annotation(
Placement(visible = true, transformation(origin = {-10, 66}, extent =
{{-10, -10}, {10, 10}}, rotation = 0)));
equation
connect(const.y, prescribedSpeedPump1.pumpSpeed_rpm) annotation(
Line(points = {{2, 66}, {10, 66}, {10, 30}, {-18, 30}, {-18, 6}, {-6, 6},
{-6, 6}}, color = {0, 0, 127}));
connect(sensP_Outlet.flange, SinkWaterFlow.flange) annotation(
Line(points = {{26, 0}, {42, 0}, {42, 0}, {42, 0}}, color = {0, 0, 255}));
connect(prescribedSpeedPump1.outlet, sensP_Outlet.flange) annotation(
Line(points = {{12, 0}, {26, 0}, {26, 0}, {26, 0}}, color = {0, 0, 255}));
connect(sensP_Inlet.flange, prescribedSpeedPump1.inlet) annotation(
Line(points = {{-32, 0}, {-8, 0}, {-8, 0}, {-8, 0}}, color = {0, 0,
255}));
connect(stateReader_water2.outlet, sensP_Inlet.flange) annotation(
Line(points = {{-50, 4}, {-50, 4}, {-50, 0}, {-32, 0}, {-32, 0}}, color =
{0, 0, 255}));
connect(Condenser.waterOut, stateReader_water2.inlet) annotation(
Line(points = {{-50, 30}, {-50, 16}}, color = {0, 0, 255}));
connect(stateReader_water1.outlet, Condenser.steamIn) annotation(
Line(points = {{-50, 64}, {-50, 50}}, color = {0, 0, 255}));
connect(SourceSteamFlow.flange, stateReader_water1.inlet) annotation(
Line(points = {{-62, 84}, {-50, 84}, {-50, 76}, {-50, 76}, {-50, 76}},
color = {0, 0, 255}));
annotation (
uses(ThermoPower(version = "3.1"), Modelica(version="3.2.2")));
end Pump_Verified;