Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OCT error when define a single pane window #3026

Closed
JayHuLBL opened this issue May 20, 2022 · 1 comment
Closed

OCT error when define a single pane window #3026

JayHuLBL opened this issue May 20, 2022 · 1 comment
Assignees

Comments

@JayHuLBL
Copy link
Contributor

In class Buildings.HeatTransfer.Windows.BaseClasses.CenterOfGlass, when the number of glass layer nGlaLay is 1, there is no gas layer. So the Buildings.HeatTransfer.Windows.BaseClasses.GasConvection gas[nGlaLay-1] has size 0. In Dymola (version 2022), it will be seems as disabled instance. However, it would trigger error in OCT

Error at line 37, column 15, in file '/home/jianjun/GitFolder/modelica-buildings/Buildings/HeatTransfer/Windows/BaseClasses/CenterOfGlass.mo':
  Array size mismatch in modification of gas, expected size is [0] and size of binding expression is [1]

The parameter glaSys has type Buildings.HeatTransfer.Data.GlazingSystems.Generic, in which the vector gas in default has one element Buildings.HeatTransfer.Data.Gases.Air(x=-1).

Because of this setting, when we define a single pane window as

record Win670 =
    Buildings.HeatTransfer.Data.GlazingSystems.Generic (
    final glass={Buildings.ThermalZones.Detailed.Validation.BESTEST.Data.Glass600()},
    UFra=1.4) "Single pane, clear glass 3.048mm"

It will trigger the OCT error as above.

To Reproduce
Run model Buildings.ThermalZones.Detailed.Validation.BESTEST.Cases6xx.Case670 from branch issue3005_BEST_update (commit 423b95f) with the OCT. It should have error as above.

Possible solution
declare a parameter as

final parameter Boolean have_GasLay = nGlaLay > 1
    "True if it has gas layer";

and make the gas to be conditional:

  Buildings.HeatTransfer.Windows.BaseClasses.GasConvection gas[nGlaLay-1](
    each final A=A,
    final gas=glaSys.gas,
    each final til=til,
    each linearize=linearize,
    each final homotopyInitialization=homotopyInitialization) if have_GasLay
    "Window gas layer"
    annotation (Placement(transformation(extent={{20,10},{40,30}})));
@mwetter
Copy link
Member

mwetter commented May 27, 2022

This is fixed on the master and maint_8.1.x branches

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants