Systems

Systems

Start value problem in der() function of medium – Modelica

    • alimuradpasha
      Subscriber
      I am modeling with Modelica in Ansys Twin builder. I encounter with an initialization error when I compile the code, although I give initialization values. Error is as follows;nIteration variable der(Hochdrucktank.medium.h) is missing start value!nnIteration variable der(Niederdrucktank.medium.h) is missing start value!nnIteration variable der(Swept1.medium.p) is missing start value!nThe code is as follows;nIteration variable der(Swept1.medium.p) is missing start value!nmodel Hochdruckreiniger2n Real dummyStart_V_hochdrucktank(start=0);n Real dummyStart_V_niederdrucktank(start=0);n Real dummyStart_h_sweptvolume(start=0);n Real dummyStart2(start=0);n Real dummyStart3(start=0);n /Component(sn Modelica.Fluid.Machines.SweptVolume Swept1 n pistonCrossArea = 0.0001131,n clearance = 0.000002,n portsData = {Modelica.Fluid.Vessels.BaseClasses.VesselPortsData(diameter=n 0.1),Modelica.Fluid.Vessels.BaseClasses.VesselPortsData(diameter=n 0.1)},n redeclare package Medium = Modelica.Media.Water.StandardWater,n nPorts = 2,n use_portsData = true,n p_start = 100,n use_T_start = true;n inner Modelica.Fluid.System system;n Modelica.Fluid.Vessels.OpenTank Niederdrucktank n redeclare package Medium = Modelica.Media.Water.StandardWater,n nPorts = 1,n height = 40.84,n crossArea = 10,n portsData = {Modelica.Fluid.Vessels.BaseClasses.VesselPortsData(diameter=n 0.1)},n h_start = 100,n V(start = 10));n Modelica.Fluid.Vessels.OpenTank Hochdrucktank n redeclare package Medium = Modelica.Media.Water.StandardWater,n nPorts = 1,n height = 4997,n crossArea = 10,n portsData = {Modelica.Fluid.Vessels.BaseClasses.VesselPortsData(diameter=n 0.1)},n h_start = 100,n V(start = 100));n Modelica.Mechanics.Translational.Sources.Position Posit1 (exact = true);n Modelica.Fluid.Valves.ValveIncompressible Hochdruckventile n dp_nominal = 66.6175,n m_flow_nominal = 0.04873,n rho_nominal = 1019.921,n opening = opening_HP,n redeclare package Medium = Modelica.Media.Water.StandardWater);n Modelica.Fluid.Valves.ValveIncompressible Niederdruckventile n dp_nominal = 65.21,n m_flow_nominal = 0.04873,n rho_nominal = 998.388,n opening = opening_NP,n redeclare package Medium = Modelica.Media.Water.StandardWater);n Modelica.Blocks.Sources.Sine Sine1 (amplitude = 0.000000629669, freqHz = 46.6666, offset = 0.00000313588);equationn T_per=pi/(180*3600*N/60);/Radian n f=((V_max-V_tod)/2)*sin((2*pi*time*T_per)+(V_tod+(V_max-V_tod)/2));n if der(f)>=0 thenn opening_NP=1;n opening_HP=0;n elsen opening_NP=0;n opening_HP=1;n end if;n dummyStart_V_hochdrucktank=der(Hochdrucktank.V);n dummyStart_V_niederdrucktank=der(Niederdrucktank.V);n dummyStart2=der(Hochdrucktank.medium.h);n dummyStart3=der(Niederdrucktank.medium.h);n dummyStart_h_sweptvolume=der(Swept1.medium.p);n /Connection(sn connect(Posit1.flange, Swept1.flange);n connect(Hochdrucktank.ports[1], Hochdruckventile.port_a);n connect(Hochdruckventile.port_b, Swept1.ports[2]);n connect(Niederdrucktank.ports[1], Niederdruckventile.port_a);n connect(Niederdruckventile.port_b, Swept1.ports[1]);n connect(Sine1.y, Posit1.s_ref);nend Hochdruckreiniger2;nDo you know how to solve this problem? Thanks for your helps in advance!n
    • Jose Luis Gonzalez Hernandez
      Ansys Employee
      Inside Twin Builder, you can access Modelica examples for the different libraries, you can view the diagram and Modelica text. Also, as a general rule, it is always a good practice to start building systems from simple to more complex in incremental steps, that can help in identifying problems. n Unfortunately, a full answer to this question is beyond the scope of Ansys employees. Hopefully another member can help you.n
    • dheerajvemula
      Ansys Employee
      Hi, Is the message - Iteration variable der(Hochdrucktank.medium.h) is missing start value! generated as a warning or error ? If it is a warning, you don't have worry about it. The model should compile successfully.n
Viewing 2 reply threads
  • You must be logged in to reply to this topic.