Opened 11 years ago

Closed 7 years ago

Last modified 6 years ago

#2323 closed defect (worksforme)

Error: "variable [...] not constant"

Reported by: anonymous Owned by: somebody
Priority: normal Milestone: 1.13.0
Component: Frontend Version: trunk
Keywords: Cc:

Description

When trying to validate the example model ThermoPower.Examples.RankineCycle.Simulators.ClosedLoop from the ThermoPower library in OpenModelica the following error message is generated:

"Error: Variable Choices.System.Dynamics in package ThermoPower.System is not constant.

Dynamics is of type enumeration and should be constant.

Change History (14)

comment:1 Changed 11 years ago by sjoelund.se

  • Milestone changed from 1.9.0 to 1.9.1

Postponed until 1.9.1

comment:2 Changed 10 years ago by sjoelund.se

  • Milestone changed from 1.9.1 to 1.9.2

This ticket was not closed for 1.9.1, which has now been released. It was batch modified for milestone 1.9.2 (but maybe an empty milestone was more appropriate; feel free to change it).

comment:3 Changed 10 years ago by sjoelund.se

  • Milestone changed from 1.9.2 to 1.9.3

Milestone changed to 1.9.3 since 1.9.2 was released.

comment:4 Changed 9 years ago by sjoelund.se

  • Milestone changed from 1.9.3 to 1.9.4

Moved to new milestone 1.9.4

comment:5 Changed 9 years ago by sjoelund.se

  • Milestone changed from 1.9.4 to 1.9.5

Milestone pushed to 1.9.5

comment:6 Changed 9 years ago by sjoelund.se

  • Milestone changed from 1.9.5 to 1.10.0

Milestone renamed

comment:7 Changed 8 years ago by sjoelund.se

  • Milestone changed from 1.10.0 to 1.11.0

Ticket retargeted after milestone closed

comment:8 Changed 8 years ago by sjoelund.se

  • Milestone changed from 1.11.0 to 1.12.0

Milestone moved to 1.12.0 due to 1.11.0 already being released.

comment:9 Changed 7 years ago by casella

  • Milestone changed from 1.12.0 to Future

The milestone of this ticket has been reassigned to "Future".

If you think the issue is still valid and relevant for you, please select milestone 1.13.0 for back-end, code generation and run-time issues, or 2.0.0 for front-end issues.

If you are aware that the problem is no longer present, please select the milestone corresponding to the version of OMC you used to check that, and set the status to "worksforme".

In both cases, a short informative comment would be welcome.

comment:10 Changed 7 years ago by casella

  • Resolution set to worksforme
  • Status changed from new to closed

As of v1.13.0-dev.234+g1a074b074, simulation code is generated without problems. The simulation fails for numerical reasons, but that's beyond the scope of this ticket.

comment:11 Changed 7 years ago by casella

  • Milestone changed from Future to 1.13.0

comment:12 Changed 6 years ago by kieran.fung@…

I literally have the exact same scenario with a Rankine Power Cycle that I built myself replicating the Rankine Example off of the ThermoPower Library.

I have an error associated with the pump I am using. I've tried re-modeling this Power Cycle many times, simplifying it further and further in hopes of reaching a successful simulation but it seems that this error for me is always associated with the water pump.

The error is:
[2] 12:46:39 Translation Error
Variable Pump.q_single0 in package ThermoPower.Water.Pump is not constant.

I've tried to allow the program to calculate this parameter on its own via the embedded equation within the cell which pulls values from other assigned parameters. Also, since this value needs to be "constant" I made sure that all of the other parameters being used in this equation are staying constant, which they are. No luck.

I've also tried using dummy values for this flow rate in hopes that an assigned numerical value will over ride the error of constant. No luck.

Finally, I've tried going into the Text View of the model and located the Pump associated with this error. Once there, I've tried editing the code ...
ThermoPower.Water.Pump Pump(

Np0 = 1,
V = 10,
dp0 = 0,
hstart = 1e5,
n0 = 150,
n_const = 150,
q_single(fixed = true, start = 10),
w0 = 50,
w_single(fixed = false),
wstart = 50)

Where I would then change fixed = true. This was unsuccessful as well.

This was posted a while ago but hoping someone out there has ran into this issue as well and has a solution!

Thanks!

comment:13 Changed 6 years ago by sjoelund.se

@kieran.fung I would suggest opening a new ticket and attach (or email us) the model so we could make fixes. You could also try the new instantiation module (-d=newInst) as it has several improvements over the current frontend especially for Fluid/Media type models (and has around 90% coverage of the current frontend in the general case).

comment:14 Changed 6 years ago by casella

@sjoelund.se, he already did, it's #5341. I'll have a look at it ASAP.

Note: See TracTickets for help on using tickets.