Opened 10 years ago

Closed 9 years ago

Last modified 9 years ago

#2901 closed defect (fixed)

wrong initial conditions obtained in initial equation section

Reported by: Michael Wetter Owned by: Lennart Ochel
Priority: normal Milestone: 1.9.4
Component: Backend Version: trunk
Keywords: Cc:

Description

The attached plot shows results from the model
Buildings.HeatTransfer.Examples.ConductorSteadyStateTransient
with the assertEquality block configured so that its parameter startTime is 864000 and hence the block does not stop the simulation.

The figure shows on top the results from Dymola and on the bottom the result from the nightly built of OpenModelica and the trunk of https://github.com/lbl-srg/modelica-buildings (sha=42288ed91ac7ec992846335505403fe808fcfa86)

The section

initial equation 
  // The initialization is only done for materials that store energy.
    if not material.steadyState then
      if steadyStateInitial then
        if material.phasechange then
          der(u) = zeros(nSta);
        else
          der(T) = zeros(nSta);
        end if;
      else
        for i in 1:nSta loop
          T[i] = T_a_start+(T_b_start-T_a_start) * UA *
            sum(1/(if (k==1 or k==nSta+1) then UAnSta2 else UAnSta) for k in 1:i);
        end for;
      end if;
    end if;

seems to be processed incorrectly in OpenModelica. OpenModelica obtains the correct values T_a_start=T_b_start=293.15, but then computes wrong initial values for T. The expected result is that T[:]=293.15 at t=0.

Attachments (1)

ConductorSteadyStateTransient.png (37.0 KB ) - added by Michael Wetter 10 years ago.
Results of Dymola (top) and OpenModelica (bottom)

Download all attachments as: .zip

Change History (6)

by Michael Wetter, 10 years ago

Results of Dymola (top) and OpenModelica (bottom)

comment:1 by Lennart Ochel, 10 years ago

Component: UnknownBackend
Owner: changed from somebody to Lennart Ochel
Status: newassigned

comment:2 by Lennart Ochel, 9 years ago

Resolution: fixed
Status: assignedclosed

comment:3 by Lennart Ochel, 9 years ago

Milestone: Future1.9.4

comment:4 by Martin Sjölund, 9 years ago

Milestone: 1.9.41.9.4-1.9.x

Milestone renamed

comment:5 by Martin Sjölund, 9 years ago

Milestone: 1.9.4-1.9.x1.9.4

Milestone renamed

Note: See TracTickets for help on using tickets.