﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc
3104	Incorrect handling of parameters with expression-determined fixed attribute	Francesco Casella	Lennart Ochel	"Please run the attached test script on the attached Save Total file, which reproduces {{{ThermoPower.PowerPlants.SteamTurbineGroup.Tests.TestST3LRh_bypass}}}.

There are two equations for {{{steamTurbines.byPassLP.Av}}}: initial equation no. 81

  {{{steamTurbines.byPassLP.Av=2.4027e-005 * steamTurbines.byPassLP.Cv}}}

which is correct, and then later parameter equation 387
  {{{steamTurbines.byPassLP.Av=steamTurbines.byPassLP.wnom * DIVISION(ThermoPower.Water.ValveVap$steamTurbines$byPassLP.FlowChar(steamTurbines.byPassLP.thetanom), sqrt(steamTurbines.byPassLP.rhonom * steamTurbines.byPassLP.dpnom))}}}

which is wrong, overrides the previous value and causes the simulation to crash.

The parameter in question is defined in {{{ThermoPower.Water.BaseClasses.ValveBase}}} as

{{{
    parameter SI.Area Av(
    fixed=if CvData == ThermoPower.Choices.Valve.CvTypes.Av then true else false,
    start=wnom/(sqrt(rhonom*dpnom))*FlowChar(thetanom))
}}}

The parameter {{{steamTurbines.byPassLP.CvData}}} is set to {{{CvTypes.Cv}}}, so it should have {{{fixed = false}}} and the initial equation 
{{{
    Av = 2.4027e-5*Cv;
}}}
should apply.

For some reason, an additional parameter equation that sets the parameter equal to its start value and overrides the correct initial equation is added to the code. This shouldn't happen at all."	defect	closed	critical	1.9.2	Backend	trunk	fixed		andrea.bartolini@… Adrian Pop
