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 by Martin Sjölund, 11 years ago

Milestone: 1.9.01.9.1

Postponed until 1.9.1

comment:2 by Martin Sjölund, 10 years ago

Milestone: 1.9.11.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 by Martin Sjölund, 10 years ago

Milestone: 1.9.21.9.3

Milestone changed to 1.9.3 since 1.9.2 was released.

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

Milestone: 1.9.31.9.4

Moved to new milestone 1.9.4

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

Milestone: 1.9.41.9.5

Milestone pushed to 1.9.5

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

Milestone: 1.9.51.10.0

Milestone renamed

comment:7 by Martin Sjölund, 8 years ago

Milestone: 1.10.01.11.0

Ticket retargeted after milestone closed

comment:8 by Martin Sjölund, 8 years ago

Milestone: 1.11.01.12.0

Milestone moved to 1.12.0 due to 1.11.0 already being released.

comment:9 by Francesco Casella, 7 years ago

Milestone: 1.12.0Future

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 by Francesco Casella, 7 years ago

Resolution: worksforme
Status: newclosed

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 by Francesco Casella, 7 years ago

Milestone: Future1.13.0

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

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 by Martin Sjölund, 6 years ago

@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 by Francesco Casella, 6 years ago

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

Note: See TracTickets for help on using tickets.