Closed Mathadon closed 10 months ago
I tested IDEAS.Examples.Tutorial.Example5
with sim(interZonalAirFlowType=IDEAS.BoundaryConditions.Types.InterZonalAirFlow.TwoPorts)
and that seems to compile.
The simulation however results in
Integration started at T = 10000000 using integration method LSODAR
(Multi-step solver for stiff and non-stiff ODE's with root finder (lsodar of ODEPACK))
Integration terminated before reaching "StopTime" at T = 1.03e+07
...
... Error message from dymosim
ERROR: The simulation of IDEAS.Examples.Tutorial.Example5 FAILED
However with dassl:
Integration terminated successfully at T = 11000000
CPU-time for integration : 2.09 seconds
CPU-time for one grid interval : 0.418 milliseconds
CPU-time for initialization : 0.0396 seconds
Number of result points : 5002
Number of grid points : 5001
Number of accepted steps : 8251
Number of f-evaluations (dynamics) : 18407
Number of crossing function evaluations : 13251
Number of Jacobian-evaluations : 1512
Number of model time events : 0
Number of input time events : 0
Number of state events : 0
Number of step events : 0
Minimum integration stepsize : 0.0214
Maximum integration stepsize : 810
Maximum integration order : 5
Calling terminal section
... "dsfinal.txt" creating (final states)
SUCCESSFUL simulation of IDEAS.Examples.Tutorial.Example5
Example9:
Integration started at T = 10000000 using integration method LSODAR
(Multi-step solver for stiff and non-stiff ODE's with root finder (lsodar of ODEPACK))
Error: The following error was detected at time: 10008200
Pressure (= -2.85222e+06 Pa) of medium "IDEAS.Media.Air" is negative
(Temperature = 293.305 K)
Failed condition: noEvent(rectangularZoneTemplate1.port_b.p >= 0.0)
Solver will attempt to handle this problem.
Error: The following error was detected at time: 10008050
Pressure (= -325089 Pa) of medium "IDEAS.Media.Air" is negative
(Temperature = 293.298 K)
Failed condition: noEvent(rectangularZoneTemplate1.port_b.p >= 0.0)
Solver will attempt to handle this problem.
Error: The following error was detected at time: 10011800
Pressure (= -2.07699e+07 Pa) of medium "IDEAS.Media.Air" is negative
(Temperature = 293.502 K)
Failed condition: noEvent(rectangularZoneTemplate1.port_b.p >= 0.0)
Solver will attempt to handle this problem.
Error: The following error was detected at time: 10011650
Pressure (= -798532 Pa) of medium "IDEAS.Media.Air" is negative
(Temperature = 293.431 K)
Failed condition: noEvent(rectangularZoneTemplate1.port_b.p >= 0.0)
Solver will attempt to handle this problem.
Error: The following error was detected at time: 10011612.5
Pressure (= -478971 Pa) of medium "IDEAS.Media.Air" is negative
(Temperature = 293.429 K)
Failed condition: noEvent(rectangularZoneTemplate1.port_b.p >= 0.0)
Solver will attempt to handle this problem.
Error: The following error was detected at time: 10015250
Pressure (= -519918 Pa) of medium "IDEAS.Media.Air" is negative
(Temperature = 293.458 K)
Failed condition: noEvent(rectangularZoneTemplate1.port_b.p >= 0.0)
Integration terminated before reaching "StopTime" at T = 1e+07
@kldjonge were it these kinds of errors that you experienced? For what model did you have problems?
CVode solves example 9 with steady state fans. So it seems to be an integrator issue.
I will check in detail soon, but most of the time I just got: “the model is singular”
This model:
model StructureExt_2Port "Extended the structure but with 2-port option ON"
extends IDEAS.Examples.PPD12.Structure(sim(interZonalAirFlowType=IDEAS.BoundaryConditions.Types.InterZonalAirFlow.TwoPorts,
n50=3));
end StructureExt_2Port;
Gives this:
And I also often het this error for other models when the two-port flow is activated, typically when a big cavity is in place.
I tested
IDEAS.Examples.Tutorial.Example5
withsim(interZonalAirFlowType=IDEAS.BoundaryConditions.Types.InterZonalAirFlow.TwoPorts)
and that seems to compile.The simulation however results in
Integration started at T = 10000000 using integration method LSODAR (Multi-step solver for stiff and non-stiff ODE's with root finder (lsodar of ODEPACK)) Integration terminated before reaching "StopTime" at T = 1.03e+07 ... ... Error message from dymosim ERROR: The simulation of IDEAS.Examples.Tutorial.Example5 FAILED
However with dassl:
Integration terminated successfully at T = 11000000 CPU-time for integration : 2.09 seconds CPU-time for one grid interval : 0.418 milliseconds CPU-time for initialization : 0.0396 seconds Number of result points : 5002 Number of grid points : 5001 Number of accepted steps : 8251 Number of f-evaluations (dynamics) : 18407 Number of crossing function evaluations : 13251 Number of Jacobian-evaluations : 1512 Number of model time events : 0 Number of input time events : 0 Number of state events : 0 Number of step events : 0 Minimum integration stepsize : 0.0214 Maximum integration stepsize : 810 Maximum integration order : 5 Calling terminal section ... "dsfinal.txt" creating (final states) SUCCESSFUL simulation of IDEAS.Examples.Tutorial.Example5
Example9:
Integration started at T = 10000000 using integration method LSODAR (Multi-step solver for stiff and non-stiff ODE's with root finder (lsodar of ODEPACK)) Error: The following error was detected at time: 10008200 Pressure (= -2.85222e+06 Pa) of medium "IDEAS.Media.Air" is negative (Temperature = 293.305 K) Failed condition: noEvent(rectangularZoneTemplate1.port_b.p >= 0.0) Solver will attempt to handle this problem. Error: The following error was detected at time: 10008050 Pressure (= -325089 Pa) of medium "IDEAS.Media.Air" is negative (Temperature = 293.298 K) Failed condition: noEvent(rectangularZoneTemplate1.port_b.p >= 0.0) Solver will attempt to handle this problem. Error: The following error was detected at time: 10011800 Pressure (= -2.07699e+07 Pa) of medium "IDEAS.Media.Air" is negative (Temperature = 293.502 K) Failed condition: noEvent(rectangularZoneTemplate1.port_b.p >= 0.0) Solver will attempt to handle this problem. Error: The following error was detected at time: 10011650 Pressure (= -798532 Pa) of medium "IDEAS.Media.Air" is negative (Temperature = 293.431 K) Failed condition: noEvent(rectangularZoneTemplate1.port_b.p >= 0.0) Solver will attempt to handle this problem. Error: The following error was detected at time: 10011612.5 Pressure (= -478971 Pa) of medium "IDEAS.Media.Air" is negative (Temperature = 293.429 K) Failed condition: noEvent(rectangularZoneTemplate1.port_b.p >= 0.0) Solver will attempt to handle this problem. Error: The following error was detected at time: 10015250 Pressure (= -519918 Pa) of medium "IDEAS.Media.Air" is negative (Temperature = 293.458 K) Failed condition: noEvent(rectangularZoneTemplate1.port_b.p >= 0.0) Integration terminated before reaching "StopTime" at T = 1e+07
@kldjonge were it these kinds of errors that you experienced? For what model did you have problems?
@Mathadon, for example 5 and 9, did you add a large opening in the internal wall before testing it?
@kldjonge cd1d89e seems to fix Example5
when using TwoPort
and hasCavityC=true
in OpenModelica. Can you verify that this solves the problem?
@Mathadon, Example5 runs indeed. But it doesn't solve the problems across the board: IDEAS.Examples.PPD12.StructureExt_2Port is stil singular.
@kldjonge I have reviewed the model and couldn't find the problem yet. It is singular with and without cavities in the wall when using TwoPort
. I ruled out a few possible causes but didn't figure it out yet.
OM reports the following error (only) when using TwoPorts
:
Internal error NFConnection.split got unbalanced connection connect(cei3.propsBus_b, stairWay.proBusCei[1]):
lhs: {cei3.propsBus_b.v50, cei3.propsBus_b.use_port_2, cei3.propsBus_b.use_port_1, cei3.propsBus_b.use_custom_q50, cei3.propsBus_b.use_custom_n50, cei3.propsBus_b.surfRad.Q_flow, cei3.propsBus_b.surfRad.T, cei3.propsBus_b.surfCon.Q_flow, cei3.propsBus_b.surfCon.T, cei3.propsBus_b.q50_zone, cei3.propsBus_b.port_2.h_outflow, cei3.propsBus_b.port_2.m_flow, cei3.propsBus_b.port_2.p, cei3.propsBus_b.port_1.h_outflow, cei3.propsBus_b.port_1.m_flow, cei3.propsBus_b.port_1.p, cei3.propsBus_b.outputAngles, cei3.propsBus_b.numIncAndAziInBus, cei3.propsBus_b.inc, cei3.propsBus_b.iSolDir.Q_flow, cei3.propsBus_b.iSolDir.T, cei3.propsBus_b.iSolDif.Q_flow, cei3.propsBus_b.iSolDif.T, cei3.propsBus_b.epsSw, cei3.propsBus_b.epsLw, cei3.propsBus_b.azi, cei3.propsBus_b.area, cei3.propsBus_b.Qgai.Q_flow, cei3.propsBus_b.Qgai.T, cei3.propsBus_b.QTra_design, cei3.propsBus_b.E.E, cei3.propsBus_b.E.Etot}
rhs: {stairWay.proBusCei[1].v50, stairWay.proBusCei[1].use_port_2, stairWay.proBusCei[1].use_port_1, stairWay.proBusCei[1].use_custom_q50, stairWay.proBusCei[1].use_custom_n50, stairWay.proBusCei[1].surfRad.Q_flow, stairWay.proBusCei[1].surfRad.T, stairWay.proBusCei[1].surfCon.Q_flow, stairWay.proBusCei[1].surfCon.T, stairWay.proBusCei[1].q50_zone, stairWay.proBusCei[1].port_2.h_outflow, stairWay.proBusCei[1].port_2.Xi_outflow[1], stairWay.proBusCei[1].port_2.m_flow, stairWay.proBusCei[1].port_2.p, stairWay.proBusCei[1].port_1.h_outflow, stairWay.proBusCei[1].port_1.Xi_outflow[1], stairWay.proBusCei[1].port_1.m_flow, stairWay.proBusCei[1].port_1.p, stairWay.proBusCei[1].outputAngles, stairWay.proBusCei[1].numIncAndAziInBus, stairWay.proBusCei[1].inc, stairWay.proBusCei[1].iSolDir.Q_flow, stairWay.proBusCei[1].iSolDir.T, stairWay.proBusCei[1].iSolDif.Q_flow, stairWay.proBusCei[1].iSolDif.T, stairWay.proBusCei[1].epsSw, stairWay.proBusCei[1].epsLw, stairWay.proBusCei[1].azi, stairWay.proBusCei[1].area, stairWay.proBusCei[1].Qgai.Q_flow, stairWay.proBusCei[1].Qgai.T, stairWay.proBusCei[1].QTra_design, stairWay.proBusCei[1].E.E, stairWay.proBusCei[1].E.Etot}
It seems that the Xi connections are missing. Possibly the used media are inconsistent. It's not clear to me why this would not result in a problem when using OnePort
, nor why the translation does not report an unequal number of equations and variables.
Edit: I could not find incorrect Media and it seems like the equations for Xi
are set correctly.
propsBus_b
correctly has final use_port_2=sim.interZonalAirFlowType == IDEAS.BoundaryConditions.Types.InterZonalAirFlow.TwoPorts
and redeclare final package Medium = Medium
.
Some information I got from claytex:
What could be occurring in your case is that one variable is being set twice (has two equations that define it) and another variable is not being set at all. Unfortunately it is not easy to figure out the problem in Dymola unless this is occurring in the Bus connectors as the debugging for that is well logged (I will ask the developers to improve the debugging information to assist the user more in this case)
Spotted some issues:
As I don't have write acces to this branch so my adaptation will be here: https://github.com/kldjonge/IDEAS/tree/StackEffectAirflow
On first glance, things (heights of density columns ect.) seem to work as intended.
@jelgerjansen can we discuss on how to proceed with this PR?
@jelgerjansen I'd like to refactor this code a bit. Can you check whether all unit tests pass before that I start changing things?
@Mathadon
Yup
Merging the master branch into this branch did not lead to conflicts. I will now run the UnitTests per package to check the differences
IDEAS.Buildings.Components
IDEAS.Buildings.Components.Examples.WallUnitTest
has now 41 states instead of 37.IDEAS.Buildings.Components.Examples.RectangularZoneTemplate.mo
IDEAS.Buildings.Components.Examples.RectangularZoneTemplateOnePort.mo
IDEAS.Buildings.Components.Examples.RectangularZoneTemplateTwoPort.mo
IDEAS.Buildings.Examples
IDEAS.Examples.TwinHouses
IDEAS.Examples.PPD12
IDEAS.Examples.Tutorial
Example9
and Example10
had to be increased (the default 300 seconds was not enough). This seems strange at first sight, since the reference results are identical (so the stack airflow effect is not playing a role here)@Mathadon @kldjonge I just pushed the latest reference results to this branch. I reported all differences above. The most significant changes are in the PPD12 model. This can be due to the stack airflow effect, but I also noticed some minor changes in the building envelope model itself.
@jelgerjansen, If I recall correctly I made changes to accommodate the airflows indeed. Most notably the opening in the floor (internal wall) to represent the staircase. The verification model in CONTAM is almost ready, so then the final debugging/verification data will be available.
I must correct myself, I don't believe the changes I mentioned are allready in this branch. I've send you an e-mail @jelgerjansen.
Based upon discussion:
@Mathadon @kldjonge I ran IDEAS.Examples.TwinHouses.BuildingO5_Exp1_1Port.mo
again. The results are already better, but still errors compared to the CONTAM model in the order of 1e-2. Could this be due to the default wind pressure computation?
Furthermore, the newly add unit test for BuildingO5_Exp1_2Port
throws an error due to the absence of resDoor
(which is needed to calculate comparison_W40
): in this wall, useDooOpe
is true, due to which useResDoor
is false (see InternalWall
model implementation)
Ah, now I remember something else: the 1 port door configuration contains a medium column, which I have removed in my pull request. This indeed seems wrong and was not included in the contam reference results either. So it should probably be removed before rerunning the reference results. @kldjonge ?
True. For this branch/unit test it should not be included. (We can discuss maybe adding density columns in a later stage just for the larger openings, but not for now)
@Mathadon @kldjonge could you explicitly tell me what I should remove in which models? Then I can rerun the unit tests after applying the changes (and such that we can hopefully move on to the other PRs after that ;) )
@jelgerjansen, apparently having branches/pull request with exactly the same name causes issues. At least in the tool I use, I can't load this pull request so being very specific is hard. If I recall correctly, the column we are talking about is in the internal wall component and was added between the door component and the connectors.
@Mathadon @kldjonge removing the density columns between the door, i.e. going from this: to this: gives the same results as plotted here: https://github.com/open-ideas/IDEAS/pull/1296#issuecomment-1710181734...
Removing the density columns therefore didn't affect any of the reference results...
Thank you @kldjonge, this indeed fixes the problem; the reference results are now exactly the same as those of the master branch:
@Mathadon can you comment on the specific implementation of Cs
as noted by Klaas above?
Furthermore, before pushing the new changes, I would like to know what to do with the unit test for IDEAS.Examples.TwinHouses.Building05_Exp1_2Port
, which threw an error (see https://github.com/open-ideas/IDEAS/pull/1296#issuecomment-1710181734)
@jelgerjansen no, I'm not too familiar with that model.
With respect to the error, I'd remove the offending variables in the .mos file for now :)
Due to the change in calculation of Cs
, all previously changed reference results are also different of course. Give me some time to reset the reference results again to the 'original' ones, such that we can compare again with those instead of the reference results with the 'wrong' Cs
values.
okay, sounds like a good extra check!
Running the unit tests using the updated Cs
calculation and comparing to the 'original' reference results leads to lower deviations between the new and old reference results. An overview of the changes can be found below:
I think we can therefore continue and merge these changes in #1322?
The reference results of TwinHouses are, in contrast to the first unit test that I ran, not changed.
I think we can move on to the next branch indeed. Great!
The changes of this PR are included in #1327. Further development of the stack airflow effect will take place in that PR.
For #1244