- Index
- » Usage and Applications
- » OpenModelica Usage and Applications
- » Buildings.Fluid.Actuators.Valves.Thre...
Buildings.Fluid.Actuators.Valves.ThreeWayLinear Simulation Error
Buildings.Fluid.Actuators.Valves.ThreeWayLinear Simulation Error
Hello,
Using Buildings 7.0 and Modelica 3.2.3 libraries, I could not simulate the model Examples.ThreeWayValve. After some investigations, it appeared to me that the BaseClasses.ValveParameters are not being transferred into the res1.TwoWayValve and res3.TwoWayValve components. The TwoWayValve Class extends the PartialTwoWayValveKv class, which requires a Kv value that wasn't provided by the ThreeWayValve class.
To make it work, I duplicated the Buildings.Fluid.Actuators.Valves.ThreeWayLinear class and introduced the declarations
m_flow_nominal=m_flow_nominal, CvData = Buildings.Fluid.Types.CvTypes.Kv, Kv=Kv
as follows:
Code:
model ThreeWayLinear "Three way valve with linear characteristics"
extends Buildings.Fluid.Actuators.BaseClasses.PartialThreeWayValve(
redeclare Buildings.Fluid.Actuators.Valves.TwoWayLinear res1(
m_flow_nominal=m_flow_nominal, CvData = Buildings.Fluid.Types.CvTypes.Kv, Kv=Kv, final l = l[1]),
redeclare Buildings.Fluid.Actuators.Valves.TwoWayLinear res3(
m_flow_nominal=m_flow_nominal, CvData = Buildings.Fluid.Types.CvTypes.Kv, Kv=Kv, final l = l[2]));
equation
connect(inv.y, res3.y) annotation(
Line(points = {{-62.6, 46}, {20, 46}, {20, -50}, {12, -50}}, color = {0, 0, 127}));
connect(y_actual, inv.u2) annotation(
Line(points = {{50, 70}, {88, 70}, {88, 34}, {-68, 34}, {-68, 41.2}}, color = {0, 0, 127}));
connect(y_actual, res1.y) annotation(
Line(points = {{50, 70}, {88, 70}, {88, 34}, {-50, 34}, {-50, 12}}, color = {0, 0, 127}));
annotation(
Icon(coordinateSystem(extent = {{-120, -100}, {70, 100}})));
end ThreeWayLinear;
Now I am wondering, if there is a better or cleaner way for debugging this component. Any ideas?
And what would be the process to include this change into the next release of the standard "Buildings" library.
Regards,
Stephan
------------------------------------------------------------------------------------------
Edit, 21.12.2020:
I ended up extending the declarations list even further to:
Code:
extends Buildings.Fluid.Actuators.BaseClasses.PartialThreeWayValve(
redeclare Buildings.Fluid.Actuators.Valves.TwoWayLinear res1(
deltaM = deltaM,
rhoStd = rhoStd,
dp(start = dpValve_nominal / 2),
from_dp = from_dp,
final linearized = linearized[1],
final homotopyInitialization = homotopyInitialization,
final dpFixed_nominal = dpFixed_nominal[1],
final use_inputFilter = false,
final m_flow_nominal = m_flow_nominal,
final CvData = CvData,
final y_start = y_start,
final Kv = Kv,
final l = l[1]),
redeclare Buildings.Fluid.Actuators.Valves.TwoWayLinear res3(
deltaM = deltaM,
rhoStd = rhoStd,
dp(start = dpValve_nominal / 2),
from_dp = from_dp,
final linearized = linearized[2],
final homotopyInitialization = homotopyInitialization,
final dpFixed_nominal = dpFixed_nominal[2],
final use_inputFilter = false,
final m_flow_nominal = m_flow_nominal,
final CvData = CvData,
final y_start = 1 - y_start,
final Kv = Kv / fraK,
final l = l[2]),
final CvData = Buildings.Fluid.Types.CvTypes.Kv);
- Index
- » Usage and Applications
- » OpenModelica Usage and Applications
- » Buildings.Fluid.Actuators.Valves.Thre...