modelica - Non-fatal iteration errors during initialization -


the modelica fluid library attempts have useful attribute of being able initialize either temperature or enthalpy. however, in simulation log several errors show bit mysterious.

the logged errors don't seem impact simulation should not appearing because:

  1. the values passed temperature_phx should valid
  2. use_t_start = true "else" option causing errors should not run

below code reproduces error when run "runme" along option not produce error. representative error @ bottom.

any insight how solve issue appreciated.

model initialvaluessimplified    outer modelica.fluid.system system "system wide properties";    replaceable package medium =       modelica.media.water.standardwater "medium in component";    parameter medium.absolutepressure p_a_start=system.p_start       "pressure @ port a";    parameter boolean use_t_start=true "use t_start if true, otherwise h_start";    // creates error log   parameter medium.temperature t_a_start=     if use_t_start        system.t_start     else        medium.temperature_phx(p_a_start,h_a_start,x_start)       "temperature @ port a";    // no error log   // parameter medium.temperature t_a_start=   //   if use_t_start    //     system.t_start   //   else    //     system.t_start   //     "temperature @ port a";    parameter modelica.media.interfaces.types.massfraction x_start[medium.nx]=       medium.x_default "mass fractions m_i/m";    parameter medium.specificenthalpy h_a_start=     if use_t_start        medium.specificenthalpy_ptx(p_a_start,t_a_start,x_start)     else        1e5 "specific enthalpy @ port a";   end initialvaluessimplified; 

code run snippet:

model runme    initialvaluessimplified initialvaluessimplified;   inner modelica.fluid.system system;  end runme; 

error code sample:

log-file of program ./dymosim (generated: mon sep 12 17:15:19 2016)  dymosim started ... "dsin.txt" loading (dymosim input file) t >= 273.15 following error detected @ time: 0 if97 medium function g1: temperature (= 86.3 k) lower 273.15 k! stack of functions is: modelica.media.water.if97_utilities.baseif97.basic.g1 modelica.media.water.if97_utilities.waterbaseprop_pt modelica.media.water.if97_utilities.h_props_pt( initialvaluessimplified.p_a_start,  initialvaluessimplified.t_a_start,  modelica.media.water.if97_utilities.waterbaseprop_pt(initialvaluessimplified.p_a_start, initialvaluessimplified.t_a_start, 0)) non-linear solver attempt handle problem. 

the problem combination:

parameter real t_start=if use_t system.t_start else foo(3,h_start); parameter real h_start=if use_t bar(4,t_start) else 2; 

isn't handled symbolically 2 different cases (use_t , not use_t), since lead combinatorial explosion. instead seen non-linear equation - , h_start computed, doesn't influence resulting t_start.

if don't intend change these parameters make them final , in first equation replace h_start suitable default. otherwise solution give better start-value t_a_start:

parameter real t_start(start=300)=if use_t system.t_start else foo(3,h_start); 

note problem isn't lack of start-value, default start-value (500k) far off, solver over-compensates , goes 86k before converging on 293.15k. (the non-linear solver improved avoid over-compensating much.)


Comments

Popular posts from this blog

javascript - Thinglink image not visible until browser resize -

firebird - Error "invalid transaction handle (expecting explicit transaction start)" executing script from Delphi -

mongodb - How to keep track of users making Stripe Payments -