警告:该组件被多次声明,无法验证是否与其他同名声明相同 - Modelica
Warning : The component is declared multiple times and can not be verified to be identical to other declaration(s) with the same name - Modelica
我在 Twin builder 上使用 Modelica 建模时收到警告。警告是:组件 m_flow_start 被多次声明,无法验证是否与其他同名声明相同。尽管这个警告对我的模型来说似乎不是那么重要,但我想了解为什么会出现这个警告以及如何避免它。
你知道如何处理这个警告吗?
model Hochdruckreiniger3
//Declaration(s)
Real V_max = 2506e-6;
Real V_tod = 3765e-6;
Real N = 2800;
Real opening_NP;
Real opening_HP;
Real dp_nominal_ND = (0.7*rho_ND*0.01135*0.01135)/(3600/(2*N*N));
Real dp_nominal_HD = (0.7*rho_HD*0.01135*0.01135)/(3600/(2*N*N));
Real rho_ND = 998.388;
Real rho_HD = 1019.921;
Real m_flow_ND = rho_ND*0.000113097*0.01135*N/60;
Real m_flow_HD = rho_HD*0.000113097*0.01135*N/60;
//Component(s)
Modelica.Fluid.Machines.SweptVolume Swept1 (
pistonCrossArea = 0.0001131,
clearance = 0.00000250621,
redeclare package Medium = Modelica.Media.Water.StandardWater,
nPorts = 2,
use_portsData = false,
p_start = 1e5,
use_T_start = true,
T_start = 293.15,
V(start = 0.005),
m(start = 0.005));
inner Modelica.Fluid.System system;
Modelica.Mechanics.Translational.Sources.Position Posit1 (exact = true, useSupport = false);
Modelica.Blocks.Sources.Sine Sine1 (
amplitude = 0.005567,
freqHz = 16.66,
offset = 0.005567,
phase = -Modelica.Constants.pi/4);
Modelica.Fluid.Sources.FixedBoundary boundary (p = 4e5, redeclare package Medium = Modelica.Media.Water.StandardWater, nPorts = 1);
Modelica.Fluid.Pipes.DynamicPipe pipe1 (
length = 0.5,
diameter = 0.03,
redeclare package Medium = Modelica.Media.Water.StandardWater,
modelStructure = Modelica.Fluid.Types.ModelStructure.av_b);
Modelica.Fluid.Valves.ValveIncompressible Niederdruckventile (
dp_nominal = dp_nominal_ND,
m_flow_nominal = m_flow_ND,
rho_nominal = rho_ND,
opening = opening_NP,
redeclare package Medium = Modelica.Media.Water.StandardWater);
Modelica.Fluid.Pipes.DynamicPipe pipe2 (
length = 0.002,
diameter = 0.011,
redeclare package Medium = Modelica.Media.Water.StandardWater,
modelStructure = Modelica.Fluid.Types.ModelStructure.av_b);
Modelica.Fluid.Pipes.DynamicPipe pipe3 (
length = 0.019,
diameter = 0.0055,
redeclare package Medium = Modelica.Media.Water.StandardWater,
modelStructure = Modelica.Fluid.Types.ModelStructure.a_vb);
Modelica.Fluid.Valves.ValveIncompressible Hochdruckventile (
dp_nominal = dp_nominal_HD,
m_flow_nominal = m_flow_HD,
rho_nominal = rho_HD,
opening = opening_HP,
redeclare package Medium = Modelica.Media.Water.StandardWater);
Modelica.Fluid.Pipes.DynamicPipe pipe4 (
length = 0.5,
diameter = 0.03,
redeclare package Medium = Modelica.Media.Water.StandardWater,
modelStructure = Modelica.Fluid.Types.ModelStructure.a_vb);
Modelica.Fluid.Sources.FixedBoundary boundary1 (p = 5e5, redeclare package Medium = Modelica.Media.Water.StandardWater, nPorts = 1);
equation
if der(Sine1.y)>=0 then
opening_NP=1;
opening_HP=0;
else
opening_NP=0;
opening_HP=1;
end if;
//Connection(s)
connect(Posit1.flange, Swept1.flange);
connect(Sine1.y, Posit1.s_ref);
connect(Niederdruckventile.port_b, pipe2.port_a);
connect(pipe2.port_b, Swept1.ports[1]);
connect(boundary.ports[1], pipe1.port_a);
connect(pipe1.port_b, Niederdruckventile.port_a);
connect(Swept1.ports[2], pipe3.port_a);
connect(pipe3.port_b, Hochdruckventile.port_a);
connect(Hochdruckventile.port_b, pipe4.port_a);
connect(pipe4.port_b, boundary1.ports[1]);
end Hochdruckreiniger3;
提前致谢!
我相信你可以忽略它。
据我在 Dymola 内部看到的问题是 Modelica.Fluid.Pipes.BaseClasses.FlowModels.PartialStaggeredFlowModel 继承自 Modelica.Fluid.Interfaces.PartialDistributedFlow,两者都包含 m_flow_start
的定义,在 MSL 3.2.3 中略有不同 -但仅就 parameter-dialog:
而言
parameter Medium.MassFlowRate m_flow_start=system.m_flow_start
"Start value of mass flow rates"
annotation(Dialog(tab="Internal Interface",enable=false,group = "Initialization"));
对比
parameter Medium.MassFlowRate m_flow_start=system.m_flow_start
"Start value of mass flow rates"
annotation(Dialog(tab="Initialization"));
顺便说一句:该模型存在许多缺少参数的问题,应该是:
parameter Real V_max = 2506e-6;
parameter Real V_tod = 3765e-6;
parameter Real N = 2800;
Real opening_NP;
Real opening_HP;
parameter Real dp_nominal_ND = (0.7*rho_ND*0.01135*0.01135)/(3600/(2*N*N));
parameter Real dp_nominal_HD = (0.7*rho_HD*0.01135*0.01135)/(3600/(2*N*N));
parameter Real rho_ND = 998.388;
parameter Real rho_HD = 1019.921;
parameter Real m_flow_ND = rho_ND*0.000113097*0.01135*N/60;
parameter Real m_flow_HD = rho_HD*0.000113097*0.01135*N/60;
我在 Twin builder 上使用 Modelica 建模时收到警告。警告是:组件 m_flow_start 被多次声明,无法验证是否与其他同名声明相同。尽管这个警告对我的模型来说似乎不是那么重要,但我想了解为什么会出现这个警告以及如何避免它。
你知道如何处理这个警告吗?
model Hochdruckreiniger3
//Declaration(s)
Real V_max = 2506e-6;
Real V_tod = 3765e-6;
Real N = 2800;
Real opening_NP;
Real opening_HP;
Real dp_nominal_ND = (0.7*rho_ND*0.01135*0.01135)/(3600/(2*N*N));
Real dp_nominal_HD = (0.7*rho_HD*0.01135*0.01135)/(3600/(2*N*N));
Real rho_ND = 998.388;
Real rho_HD = 1019.921;
Real m_flow_ND = rho_ND*0.000113097*0.01135*N/60;
Real m_flow_HD = rho_HD*0.000113097*0.01135*N/60;
//Component(s)
Modelica.Fluid.Machines.SweptVolume Swept1 (
pistonCrossArea = 0.0001131,
clearance = 0.00000250621,
redeclare package Medium = Modelica.Media.Water.StandardWater,
nPorts = 2,
use_portsData = false,
p_start = 1e5,
use_T_start = true,
T_start = 293.15,
V(start = 0.005),
m(start = 0.005));
inner Modelica.Fluid.System system;
Modelica.Mechanics.Translational.Sources.Position Posit1 (exact = true, useSupport = false);
Modelica.Blocks.Sources.Sine Sine1 (
amplitude = 0.005567,
freqHz = 16.66,
offset = 0.005567,
phase = -Modelica.Constants.pi/4);
Modelica.Fluid.Sources.FixedBoundary boundary (p = 4e5, redeclare package Medium = Modelica.Media.Water.StandardWater, nPorts = 1);
Modelica.Fluid.Pipes.DynamicPipe pipe1 (
length = 0.5,
diameter = 0.03,
redeclare package Medium = Modelica.Media.Water.StandardWater,
modelStructure = Modelica.Fluid.Types.ModelStructure.av_b);
Modelica.Fluid.Valves.ValveIncompressible Niederdruckventile (
dp_nominal = dp_nominal_ND,
m_flow_nominal = m_flow_ND,
rho_nominal = rho_ND,
opening = opening_NP,
redeclare package Medium = Modelica.Media.Water.StandardWater);
Modelica.Fluid.Pipes.DynamicPipe pipe2 (
length = 0.002,
diameter = 0.011,
redeclare package Medium = Modelica.Media.Water.StandardWater,
modelStructure = Modelica.Fluid.Types.ModelStructure.av_b);
Modelica.Fluid.Pipes.DynamicPipe pipe3 (
length = 0.019,
diameter = 0.0055,
redeclare package Medium = Modelica.Media.Water.StandardWater,
modelStructure = Modelica.Fluid.Types.ModelStructure.a_vb);
Modelica.Fluid.Valves.ValveIncompressible Hochdruckventile (
dp_nominal = dp_nominal_HD,
m_flow_nominal = m_flow_HD,
rho_nominal = rho_HD,
opening = opening_HP,
redeclare package Medium = Modelica.Media.Water.StandardWater);
Modelica.Fluid.Pipes.DynamicPipe pipe4 (
length = 0.5,
diameter = 0.03,
redeclare package Medium = Modelica.Media.Water.StandardWater,
modelStructure = Modelica.Fluid.Types.ModelStructure.a_vb);
Modelica.Fluid.Sources.FixedBoundary boundary1 (p = 5e5, redeclare package Medium = Modelica.Media.Water.StandardWater, nPorts = 1);
equation
if der(Sine1.y)>=0 then
opening_NP=1;
opening_HP=0;
else
opening_NP=0;
opening_HP=1;
end if;
//Connection(s)
connect(Posit1.flange, Swept1.flange);
connect(Sine1.y, Posit1.s_ref);
connect(Niederdruckventile.port_b, pipe2.port_a);
connect(pipe2.port_b, Swept1.ports[1]);
connect(boundary.ports[1], pipe1.port_a);
connect(pipe1.port_b, Niederdruckventile.port_a);
connect(Swept1.ports[2], pipe3.port_a);
connect(pipe3.port_b, Hochdruckventile.port_a);
connect(Hochdruckventile.port_b, pipe4.port_a);
connect(pipe4.port_b, boundary1.ports[1]);
end Hochdruckreiniger3;
提前致谢!
我相信你可以忽略它。
据我在 Dymola 内部看到的问题是 Modelica.Fluid.Pipes.BaseClasses.FlowModels.PartialStaggeredFlowModel 继承自 Modelica.Fluid.Interfaces.PartialDistributedFlow,两者都包含 m_flow_start
的定义,在 MSL 3.2.3 中略有不同 -但仅就 parameter-dialog:
parameter Medium.MassFlowRate m_flow_start=system.m_flow_start
"Start value of mass flow rates"
annotation(Dialog(tab="Internal Interface",enable=false,group = "Initialization"));
对比
parameter Medium.MassFlowRate m_flow_start=system.m_flow_start
"Start value of mass flow rates"
annotation(Dialog(tab="Initialization"));
顺便说一句:该模型存在许多缺少参数的问题,应该是:
parameter Real V_max = 2506e-6;
parameter Real V_tod = 3765e-6;
parameter Real N = 2800;
Real opening_NP;
Real opening_HP;
parameter Real dp_nominal_ND = (0.7*rho_ND*0.01135*0.01135)/(3600/(2*N*N));
parameter Real dp_nominal_HD = (0.7*rho_HD*0.01135*0.01135)/(3600/(2*N*N));
parameter Real rho_ND = 998.388;
parameter Real rho_HD = 1019.921;
parameter Real m_flow_ND = rho_ND*0.000113097*0.01135*N/60;
parameter Real m_flow_HD = rho_HD*0.000113097*0.01135*N/60;