Opened 9 years ago

Closed 9 years ago

Last modified 8 years ago

#3716 closed defect (fixed)

Wrong handling of two-dimensional arrays inside arrays of models

Reported by: casella Owned by: lochel
Priority: high Milestone: 1.9.4
Component: Backend Version: v1.9.4-dev-nightly
Keywords: Cc: antonio.froio@…

Description

Consider the attached test case. The model TestArrays.TubeArray instantiates an array of Tube models. Each Tube models contains a Flow1DFV model, which in turn contains a two dimensional array dddX.

The following error is generated:

Error: Model is structurally singular, error found sorting equations 

If dumpSimCode is switched on, the following variables show up:

56: tube[1].flow1DFV1.dddX[1,1,1] = 0.0;
60: tube[1].flow1DFV1.dddX[1,2,1] = 0.0;
64: tube[1].flow1DFV1.dddX[1,3,1] = 0.0;
68: tube[1].flow1DFV1.dddX[1,4,1] = 0.0;
130: tube[2].flow1DFV1.dddX[2,1,1] = 0.0;
134: tube[2].flow1DFV1.dddX[2,2,1] = 0.0;
138: tube[2].flow1DFV1.dddX[2,3,1] = 0.0;
142: tube[2].flow1DFV1.dddX[2,4,1] = 0.0;

The array dddX should be two-dimensional, not three-dimensional, and these equations should instead look like this:

56: tube[1].flow1DFV1.dddX[1,1] = 0.0;
60: tube[1].flow1DFV1.dddX[2,1] = 0.0;
64: tube[1].flow1DFV1.dddX[3,1] = 0.0;
68: tube[1].flow1DFV1.dddX[4,1] = 0.0;
130: tube[2].flow1DFV1.dddX[1,1] = 0.0;
134: tube[2].flow1DFV1.dddX[2,1] = 0.0;
138: tube[2].flow1DFV1.dddX[3,1] = 0.0;
142: tube[2].flow1DFV1.dddX[4,1] = 0.0;

I guess this gives a hint why the matching fails.

Attachments (1)

TestArrays.zip (359.7 KB) - added by casella 9 years ago.

Download all attachments as: .zip

Change History (9)

Changed 9 years ago by casella

comment:1 Changed 9 years ago by lochel

This seems to be an issue in pre-optimization module inlineArrayEqn. Unfortunately, it cannot just get disabled, since other modules depend on this one.

comment:2 Changed 9 years ago by lochel

  • Status changed from new to accepted

I think I've a fix for this issue. However, I will ask for feedback before merging it.

comment:3 Changed 9 years ago by lochel

  • Resolution set to fixed
  • Status changed from accepted to closed

This is fixed. However, the model is still not working due to #3305.

comment:4 follow-up: Changed 9 years ago by casella

  • Resolution fixed deleted
  • Status changed from closed to reopened

Please close this once the problem is actually solved.

comment:5 in reply to: ↑ 4 Changed 9 years ago by lochel

Replying to casella:

Please close this once the problem is actually solved.

Well, actually this issue is already solved. Also #3305 is now solved. However, the attached test case does still not simulate:

Simulation execution failed for model: TestArrays.TubeArray
assert            | debug   | Solving non-linear system 1370 failed at time=0.
|                 | |       | For more information please use -lv LOG_NLS.
assert            | info    | simulation terminated by an assertion at initialization

Francesco, can you have a look for the new failure?

comment:6 Changed 9 years ago by casella

  • Resolution set to fixed
  • Status changed from reopened to closed

This is a different story, we can take care of that. Thanks for the quick fix!

comment:7 Changed 8 years ago by sjoelund.se

  • Milestone changed from 1.9.4 to 1.9.4-1.9.x

Milestone renamed

comment:8 Changed 8 years ago by sjoelund.se

  • Milestone changed from 1.9.4-1.9.x to 1.9.4

Milestone renamed

Note: See TracTickets for help on using tickets.