我想通过抽水系统(Pompa)从水源(Pozzetto)中抽水来填充敞开的水箱(bacinella2)。这个问题很简单,但是我无法在openmodelica中实现。
我试图消除泵,直接将两个管道tubo1和tubo2连接起来,并且系统正常工作,这就是为什么我认为错误存在于泵对象中的原因。
model Pompaggio
Modelica.Fluid.Machines.ControlledPump Pompa(
redeclare package Medium = Modelica.Media.Water.StandardWater,
//N_nominal=1500,
use_T_start=true,
T_start=Modelica.SIunits.Conversions.from_degC(40),
m_flow_start=0.1,
control_m_flow=true,
allowFlowReversal=false,
p_a_start=110000,
p_b_start=130000,
p_a_nominal=110000,
p_b_nominal=130000,
m_flow_nominal=0.1
);
Modelica.Fluid.Sources.Boundary_pT Pozzetto(redeclare package Medium = Modelica.Media.Water.StandardWater,
nPorts = 1, T=Modelica.SIunits.Conversions.from_degC(40), p = 101325 );
Modelica.Fluid.Vessels.OpenTank bacinella2(redeclare package Medium = Modelica.Media.Water.StandardWater,
crossArea = 4, height = 100, level(start = 0.01), nPorts = 1,
portsData = {Modelica.Fluid.Vessels.BaseClasses.VesselPortsData(diameter = 0.1)}, use_portsData = true);
Modelica.Fluid.Pipes.StaticPipe tubo1(redeclare package Medium = Modelica.Media.Water.StandardWater,
allowFlowReversal = true, diameter = 0.1, height_ab = 0, isCircular = true, length = 200, nParallel = 1);
Modelica.Fluid.Pipes.StaticPipe tubo2(redeclare package Medium = Modelica.Media.Water.StandardWater,
allowFlowReversal = true, diameter = 0.1, height_ab = 0, isCircular = true, length = 200, nParallel = 1);
equation
connect(Pozzetto.ports[1], tubo1.port_a);
connect(Pompa.port_a, tubo1.port_b);
connect(Pompa.port_b, tubo2.port_a);
//connect( tubo1.port_b, tubo2.port_a);
connect(bacinella2.ports[1], tubo2.port_b);
end Pompaggio;
有人可以帮助我吗?谢谢
答案 0 :(得分:4)
该模型在Dymola中正常工作。它给出了一些警告,导致在OpenModelica中解决问题。该模型实际上有两个“问题”:
bacinella2
的起始值:将值设置为T_start(start=293.15)
,ports(p(start={101422.89174430574})))
可以避免出现介质压力过低的警告。但这实际上并不能解决翻译过程中出现的原始模型问题。stateSelect
中Pompa.medium
的设置。 Dymola输出警告,因为它无法区分,所以将设置从StateSelect.prefer
更改为StateSelect.default
。这是针对Pompa.medium.h
和Pompa.medium.p
完成的。看来OpenModelica无法自动执行此操作,因此手动更改它似乎很有必要。下面的代码是示例的扩展,具有上面提到的两个更改。它已在OpenModelica 1.13.2(64位)中经过测试,并且运行良好。
model Pompaggio_modified
Modelica.Fluid.Machines.ControlledPump Pompa(
redeclare package Medium = Modelica.Media.Water.StandardWater,
medium(h(stateSelect = StateSelect.default), p(stateSelect = StateSelect.default)),
use_T_start=true,
T_start=Modelica.SIunits.Conversions.from_degC(40),
m_flow_start=0.1,
control_m_flow=true,
allowFlowReversal=false,
p_a_start=110000,
p_b_start=130000,
p_a_nominal=110000,
p_b_nominal=130000,
m_flow_nominal=0.1);
//N_nominal=1500,
Modelica.Fluid.Sources.Boundary_pT Pozzetto(redeclare package Medium = Modelica.Media.Water.StandardWater,
nPorts = 1, T=Modelica.SIunits.Conversions.from_degC(40), p = 101325);
Modelica.Fluid.Vessels.OpenTank bacinella2(redeclare package Medium = Modelica.Media.Water.StandardWater,
crossArea = 4, height = 100, level(start = 0.01), nPorts = 1,
portsData = {Modelica.Fluid.Vessels.BaseClasses.VesselPortsData(diameter = 0.1)}, use_portsData = true,
T_start(start=293.15),
ports(p(start={101422.89174430574})));
Modelica.Fluid.Pipes.StaticPipe tubo1(redeclare package Medium = Modelica.Media.Water.StandardWater,
allowFlowReversal = true, diameter = 0.1, height_ab = 0, isCircular = true, length = 200, nParallel = 1);
Modelica.Fluid.Pipes.StaticPipe tubo2(redeclare package Medium = Modelica.Media.Water.StandardWater,
allowFlowReversal = true, diameter = 0.1, height_ab = 0, isCircular = true, length = 200, nParallel = 1);
equation
connect(Pozzetto.ports[1], tubo1.port_a);
connect(Pompa.port_a, tubo1.port_b);
connect(Pompa.port_b, tubo2.port_a);
//connect( tubo1.port_b, tubo2.port_a);
connect(bacinella2.ports[1], tubo2.port_b);
annotation (uses(Modelica(version="3.2.3")));
end Pompaggio_modified;