Archived OpenModelica forums. Posting is disabled.

Alternative forums include GitHub discussions or StackOverflow (make sure to read the Stack Overflow rules; you need to have well-formed questions)


Forgot password? | Forgot username? | Register

OMEdit claims a variable is not constant

OMEdit claims a variable is not constant

I've been trying to model a Rankine Power Cycle on Modelica for a while now and keep running into a error that always stems from the use of a water pump imported from the ThermoPower Library.

I receive the error:

Code:

 [14] 11:52:20 Translation Error Variable Pump.q_single0 in package ThermoPower.Water.Pump is not constant. 

But it makes no sense because I directly input a value for the flow rate q_single on the "component parameters" interface before instantiating.

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 ...

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 switch fixed = true. This did not work as well.

I feel like I have tried all options at my disposal as a 1 month user of OpenModelica but none of these solutions satisfies what the program actually wants. I am also curious as to why this code error is always associated with pump models.

Please let me know what you think of the situation, I'm open to all ideas! I've attached the .mo file below for anyone curious. Thanks!
Rankine-HRSG.mo


Edited by: KFung - Feb-15-19 19:50:52
Attachments:
There are 0 guests and 0 other users also viewing this topic
You are here: