bramvdh91 / modelica-ibpsa

Modelica libraries that are used and/or developed within IEA EBC Annex 60
0 stars 0 forks source link

Add generic network example #69

Closed marcusfuchs closed 7 years ago

marcusfuchs commented 7 years ago

This adds the 25-building generic Aachen network. It may be necessary to also add a few component models.

marcusfuchs commented 7 years ago

I added the Aachen Use Case to Annex60.Experimental.Pipe.Examples.UseCaseAachen.AachenGeneric on the pipe_issue69_AachenUseCase branch.

@bramvdh91 @GersHub Could you have a look at this network and tell me if there is something we should change about the model?

On a side note: I get a lot of errors when loading the current version of bramvdh91/issue264_pipe in Dymola:

Warning: The package.order is incomplete, since the class ComparisonDpDh in file/directory D:/Repos/modelica-annex60/Annex60/Fluid/FixedResistances/Examples/ComparisonDpDh.mo is missing.
Error: D:/Repos/modelica-annex60/Annex60/Fluid/FixedResistances/Validation/PressureDropsParallel.mo line 20 column 1 (previous token on line 19), syntax error at "<" missing { modifier-prefix(="final", "redeclare", etc) identifier  "." }
Error: D:/Repos/modelica-annex60/Annex60/Fluid/FixedResistances/Validation/PressureDropsParallel.mo line 32 column 1, syntax error at "==" missing { modifier-prefix(="final", "redeclare", etc) identifier  "." }
Error: Local redefinition of sou1
File: D:/Repos/modelica-annex60/Annex60/Fluid/FixedResistances/Validation/PressureDropsParallel.mo, line 36
Location of previous declaration:
File: D:/Repos/modelica-annex60/Annex60/Fluid/FixedResistances/Validation/PressureDropsParallel.mo, line 23
Error: D:/Repos/modelica-annex60/Annex60/Fluid/FixedResistances/Validation/PressureDropsParallel.mo line 46 column 1, syntax error at ">" missing { modifier-prefix(="final", "redeclare", etc) identifier  "." }
Error: Local redefinition of sou1
File: D:/Repos/modelica-annex60/Annex60/Fluid/FixedResistances/Validation/PressureDropsParallel.mo, line 36
Location of previous declaration:
File: D:/Repos/modelica-annex60/Annex60/Fluid/FixedResistances/Validation/PressureDropsParallel.mo, line 23
Error: Local redefinition of sin1
File: D:/Repos/modelica-annex60/Annex60/Fluid/FixedResistances/Validation/PressureDropsParallel.mo, line 44
Location of previous declaration:
File: D:/Repos/modelica-annex60/Annex60/Fluid/FixedResistances/Validation/PressureDropsParallel.mo, line 29
Error: D:/Repos/modelica-annex60/Annex60/Fluid/FixedResistances/Validation/PressureDropsParallel.mo line 101 column 1, syntax error at "<" missing { "end" "external"   }
Error: Local redefinition of sou1
File: D:/Repos/modelica-annex60/Annex60/Fluid/FixedResistances/Validation/PressureDropsParallel.mo, line 36
Location of previous declaration:
File: D:/Repos/modelica-annex60/Annex60/Fluid/FixedResistances/Validation/PressureDropsParallel.mo, line 23
Error: Local redefinition of sin1
File: D:/Repos/modelica-annex60/Annex60/Fluid/FixedResistances/Validation/PressureDropsParallel.mo, line 44
Location of previous declaration:
File: D:/Repos/modelica-annex60/Annex60/Fluid/FixedResistances/Validation/PressureDropsParallel.mo, line 29
Warning: Name FixedResistancesParallel at end does not match class name PressureDropsParallel
File: D:/Repos/modelica-annex60/Annex60/Fluid/FixedResistances/Validation/PressureDropsParallel.mo, line 2
Error: D:/Repos/modelica-annex60/Annex60/Fluid/FixedResistances/Validation/PressureDropsParallel.mo line 106 column 1, syntax error at "==" missing EndOfFile
bramvdh91 commented 7 years ago

@marcusfuchs @GersHub Sorry for all the errors, I pulled the master branch of the original repository, apparently not all issues were solved yet... I will look into this now! Thanks for committing the network!

Edit: I don't get any similar errors, but the validation models don't compile in my local version either. I'll let you know when I've solved this

bramvdh91 commented 7 years ago

@marcusfuchs @GersHub The example looks really good! It's running now, although translating (?) takes ages, it seems. The simulation finishes around 13s on my laptop.

Here are the translation statistics:

Statistics

Original Model
Number of components: 1865
Variables: 27260
Constants: 820 (820 scalars)
Parameters: 12293 (28873 scalars)
Unknowns: 14147 (11003 scalars)
Differentiated variables: 314 scalars
Equations: 10899
Nontrivial: 8959

Translated Model
Constants: 31429 scalars
Free parameters: 1 scalars
Parameter depending: 173 scalars
Outputs: 2 scalars
Continuous time states: 266 scalars
Time-varying variables: 3497 scalars
Alias variables: 5596 scalars
Assumed default initial conditions: 192
Number of mixed real/discrete systems of equations: 0
Sizes of linear systems of equations: { }
Sizes after manipulation of the linear systems: { }
Sizes of nonlinear systems of equations: {12, 12, 12, 18, 12, 18, 12, 12, 18, 18, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1}
Sizes after manipulation of the nonlinear systems: {2, 2, 2, 3, 2, 3, 2, 2, 3, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}
Number of numerical Jacobians: 10

Initialization problem
Sizes of nonlinear systems of equations: {6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1}
Sizes after manipulation of the nonlinear systems: {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1}
Number of numerical Jacobians: 48

Still a lot of non-linear systems, in other words :)

I've quickly tested what happens if I split the current pipe volume into an inlet and outlet part, resulting in the following statistics:

Statistics

Original Model
Number of components: 2345
Variables: 33452
Constants: 1204 (1204 scalars)
Parameters: 14597 (30937 scalars)
Unknowns: 17651 (13355 scalars)
Differentiated variables: 410 scalars
Equations: 13443
Nontrivial: 10639

Translated Model
Constants: 34509 scalars
Free parameters: 1 scalars
Parameter depending: 173 scalars
Outputs: 2 scalars
Continuous time states: 314 scalars
Time-varying variables: 3960 scalars
Alias variables: 6853 scalars
Assumed default initial conditions: 240
Number of mixed real/discrete systems of equations: 0
Sizes of linear systems of equations: { }
Sizes after manipulation of the linear systems: { }
Sizes of nonlinear systems of equations: {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1}
Sizes after manipulation of the nonlinear systems: {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}
Number of numerical Jacobians: 0

Initialization problem
Sizes of nonlinear systems of equations: {6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1}
Sizes after manipulation of the nonlinear systems: {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1}
Number of numerical Jacobians: 48
bramvdh91 commented 7 years ago

I have changed all pipes and connections in the example to vectorized equivalents (on the branch for issue #20), see 788ef781c70c955b35244911b6a759fe7e8cf19a. All numeric jacobians are avoided, as well as non-linear systems. On my machine, the case runs in under 2 seconds. However, checking and translating takes about 1:40 min.

bramvdh91 commented 7 years ago

@marcusfuchs @GersHub I've done a quick test with MSL pipes to check the checking/translation and compilation time, and I end up around the same time. I had to assume 20 elements per pipe (which is on average a good estimation) because Dymola will not accept a variable number of elements (I used ceiling(length) for the number of elements, with no success).

bramvdh91 commented 7 years ago

@GersHub I just pushed the MSL version to the pipe_issue69_AachenUseCase branch.

bramvdh91 commented 7 years ago

I think this can be closed after merging.