Opened 6 years ago

Closed 5 years ago

#5213 closed defect (fixed)

Backend can't handle nested record assignment

Reported by: Per Östlund Owned by: Mahder Alemseged Gebremedhin
Priority: high Milestone: 1.16.0
Component: Backend Version: v1.13.0-dev-nightly
Keywords: Cc: matthis.thorade@…

Description

Many HelmHoltzMedia models (such as HelmholtzMedia.Examples.MediaTestModels.ButaneTestModel_dT) currently fail with error messages such as (using -d=newInst, the old frontend can't handle the models):

Warning: SimCodeUtil.makeSES_SIMPLE_ASSIGN failed for:
  Medium.ThermodynamicState(
    fixedMassFlowRate.medium.sat.liq.phase,
    fixedMassFlowRate.medium.sat.liq.T,
    fixedMassFlowRate.medium.sat.liq.p,
    fixedMassFlowRate.medium.sat.liq.d,
    fixedMassFlowRate.medium.sat.liq.u,
    fixedMassFlowRate.medium.sat.liq.h,
    fixedMassFlowRate.medium.sat.liq.s) =
  $TMP_Medium_SaturationProperties74.liq

This seems to be due to the flattened equation:

fixedMassFlowRate.medium.sat =
  HelmholtzMedia.Examples.MediaTestModels.ButaneTestModel_dT.Medium.setSat_p(fixedMassFlowRate.medium.p);

that the backend expands to:

Medium.SaturationProperties(
  fixedMassFlowRate.medium.sat.psat,
  fixedMassFlowRate.medium.sat.Tsat,
  Medium.ThermodynamicState(
    fixedMassFlowRate.medium.sat.liq.phase,
    fixedMassFlowRate.medium.sat.liq.T,
    fixedMassFlowRate.medium.sat.liq.p,
    fixedMassFlowRate.medium.sat.liq.d,
    fixedMassFlowRate.medium.sat.liq.u,
    fixedMassFlowRate.medium.sat.liq.h,
    fixedMassFlowRate.medium.sat.liq.s),
  Medium.ThermodynamicState(
    fixedMassFlowRate.medium.sat.vap.phase,
    fixedMassFlowRate.medium.sat.vap.T,
    fixedMassFlowRate.medium.sat.vap.p,
    fixedMassFlowRate.medium.sat.vap.d,
    fixedMassFlowRate.medium.sat.vap.u,
    fixedMassFlowRate.medium.sat.vap.h,
    fixedMassFlowRate.medium.sat.vap.s)) =
HelmholtzMedia.Examples.MediaTestModels.ButaneTestModel_dT.Medium.setSat_p(volume.medium.p)

But it seems like the case for Record() = f() in SimCodeUtil.createSingleComplexEqnCode2 can't handle the nested records and calls makeSES_SIMPLE_ASSIGN with a record as the lhs causing it to fail.

Change History (4)

comment:1 by Matthis Thorade <matthis.thorade@…>, 6 years ago

Cc: matthis.thorade@… added

comment:2 by matthis.thorade@…, 5 years ago

comment:3 by Francesco Casella, 5 years ago

Milestone: Future1.16.0
Owner: changed from Lennart Ochel to Mahder Alemseged Gebremedhin
Status: newassigned

I guess we can close this ticket.

Regarding the initialization issues, you may want to wait until #5770 is fixed.

comment:4 by Francesco Casella, 5 years ago

Resolution: fixed
Status: assignedclosed
Note: See TracTickets for help on using tickets.