如何在Modelica中设置冷却回路模拟的温度起始值?



我目前正在OpenModelica中模拟冷却电路。我想给模拟一个温度的起始值。为此,我将介质模型插入电路中,并使用"初始方程"指定初始值。温度规格只适用于启动。由于电路是封闭的,下一个回路的温度应该通过电路中的热流计算出来。不幸的是,代码没有像预期的那样工作。有谁知道我怎么能给媒体一个开始值,而不需要任何进一步的输入之后?

model Glysantin_FC_G20 "properties of Glysantin FC G20"
// Parameter
parameter SpecificHeatCapacity cp = 3560;
parameter Density rho = 1042;
parameter Temperature T = 338.15;

Interfaces.FluidPort_a inflow annotation(...);
Interfaces.FluidPort_b outflow annotation(...);
initial equation
outflow.T = T;
outflow.m_flow = -inflow.m_flow;
outflow.V_flow = -inflow.V_flow;
inflow.p = outflow.p;

equation
outflow.T = inflow.T;
outflow.m_flow = -inflow.m_flow;
outflow.V_flow = -inflow.V_flow;
inflow.p = outflow.p;

annotation(...);
end Glysantin_FC_G20;

如果没有完整的模型和错误消息,很难完全回答这个问题。然而,初始方程是与常规方程结合在一起的,所以它们不应该被重复,只给出:

initial equation
outflow.T = T;

或者您可以删除所有初始方程并将其写成:

Interfaces.FluidPort_b outflow(T(start=T),fixed=true) annotation(...);

或者甚至可能没有固定的=true

最新更新