ibpsa / project1-boptest

Building Optimization Performance Tests
Other
105 stars 69 forks source link

Can we use new library when we develop a new case #488

Closed cosmos0x57 closed 7 months ago

cosmos0x57 commented 1 year ago

hello, I am trying to develop a new case under the guidance of the _BOPTEST_Tutorial1developer, but there is a warning and many errors occurred when I try to compile the fmu file, they seems that I use some new classes in my case. if I don't want to change the classes,is there any way to solve the problem?

HEAD is now at 903a06999f Corrected info section File 'tworoompackage/package.mo' is part of library at 'tworoompackage', using library instead. Error at line 4, column 3, in file 'tworoompackage/TWOROOM0909.mo': Cannot find class declaration for TSMobileAC Error at line 6, column 21, in file 'tworoompackage/TWOROOM0909.mo': Cannot find class declaration for WallMaterial Error at line 7, column 5, in file 'tworoompackage/TWOROOM0909.mo': Cannot find component declaration for initVLEFluid_a Error at line 8, column 5, in file 'tworoompackage/TWOROOM0909.mo': Cannot find component declaration for initVLEFluid_b Error at line 9, column 21, in file 'tworoompackage/TWOROOM0909.mo': Cannot find class declaration for PressureDropModel_a Error at line 12, column 21, in file 'tworoompackage/TWOROOM0909.mo': Cannot find class declaration for PressureDropModel_b Error at line 15, column 5, in file 'tworoompackage/TWOROOM0909.mo': Cannot find component declaration for pressureStateID_a Error at line 16, column 5, in file 'tworoompackage/TWOROOM0909.mo': Cannot find component declaration for pressureStateID_b Error at line 17, column 21, in file 'tworoompackage/TWOROOM0909.mo': Cannot find class declaration for WallHeatConductionModel Error at line 19, column 21, in file 'tworoompackage/TWOROOM0909.mo': Cannot find class declaration for HeatTransferModel_b Error at line 21, column 21, in file 'tworoompackage/TWOROOM0909.mo': Cannot find class declaration for HeatTransferModel_a Error at line 23, column 5, in file 'tworoompackage/TWOROOM0909.mo': Cannot find component declaration for hInitialVLEFluid_a_Cell1 Error at line 24, column 5, in file 'tworoompackage/TWOROOM0909.mo': Cannot find component declaration for hInitialVLEFluid_a_CellN Error at line 25, column 5, in file 'tworoompackage/TWOROOM0909.mo': Cannot find component declaration for nCells Error at line 26, column 5, in file 'tworoompackage/TWOROOM0909.mo': Cannot find component declaration for hInitialVLEFluid_b_Cell1 Error at line 27, column 5, in file 'tworoompackage/TWOROOM0909.mo': Cannot find component declaration for hInitialVLEFluid_b_CellN Error at line 28, column 5, in file 'tworoompackage/TWOROOM0909.mo': Cannot find component declaration for pressureDropInitialVLEFluid_a Error at line 29, column 5, in file 'tworoompackage/TWOROOM0909.mo': Cannot find component declaration for alphaAInitialVLEFluid_a Error at line 30, column 5, in file 'tworoompackage/TWOROOM0909.mo': Cannot find component declaration for pressureDropInitialVLEFluid_b Error at line 31, column 5, in file 'tworoompackage/TWOROOM0909.mo': Cannot find component declaration for alphaAInitialVLEFluid_b Error at line 36, column 9, in file 'tworoompackage/TWOROOM0909.mo': Cannot find class declaration for ThermalSystems Error at line 37, column 49, in file 'tworoompackage/TWOROOM0909.mo': Cannot find component declaration for gasType1 Error at line 38, column 56, in file 'tworoompackage/TWOROOM0909.mo': Cannot find component declaration for liquidType1 Error at line 39, column 51, in file 'tworoompackage/TWOROOM0909.mo': Cannot find component declaration for vleFluidType1 Error at line 42, column 3, in file 'tworoompackage/TWOROOM0909.mo': Cannot find class declaration for ThermalSystems Error at line 43, column 22, in file 'tworoompackage/TWOROOM0909.mo': Cannot find component declaration for pressureStateID Error at line 43, column 41, in file 'tworoompackage/TWOROOM0909.mo': Cannot find component declaration for pInitial Error at line 45, column 3, in file 'tworoompackage/TWOROOM0909.mo': Cannot find class declaration for ThermalSystems Error at line 46, column 7, in file 'tworoompackage/TWOROOM0909.mo': Cannot find component declaration for stateViewerIndex Error at line 50, column 3, in file 'tworoompackage/TWOROOM0909.mo': Cannot find class declaration for ThermalSystems

dhblum commented 1 year ago

Are your new classes part of a library that is not IBPSA, Buildings, or IDEAS? Those are the three libraries in the compilation environment set up in the docker the tutorial uses. It is defined here: https://github.com/ibpsa/project1-boptest/blob/master/testing/Dockerfile. If you are using another dependent library for your model package, then it needs to be loaded somehow into the compilation environment and added to the MODELICAPATH environment variable.

davebiagioni commented 1 year ago

@dhblum I'd like to ask a related question (hopefully an OK place to do so), as I'm also interested in developing a new use case. Looking at the Dockerfile you linked above, it appears that JModelica is a hard dependency for compiling a new FMU. I see some open issues around this, in particular this one: https://github.com/ibpsa/project1-boptest/issues/422. But it seems that, at the moment, JModelica is still required? Am I missing any examples or documentation? Thanks!

dhblum commented 1 year ago

@davebiagioni At the moment we still use JModelica for unit testing of our existing test cases. As described in #422, eventually we want to move to OpenModelica as an open-source compiler for the test cases. One piece in that process is to ensure that all of our existing test cases can be compiled into FMUs with OpenModelica and those FMUs can be simulated by pyfmi. The other piece in that process will be to update the workflow of compiling BOPTEST test case FMUs to use OpenModelica as compiler instead of JModelica (basically, replace the Dockerfile you reference with one using OpenModelica). That second piece has not started, though I expect to soon, so there are no documentation/examples for that integration right now. In general, I anticipate the process of generating a BOPTEST test case described in the design documentation here and in the developer tutorial here won't change, except to switch out the actual FMU compilation from JModelica to OpenModelica. Hope that helps answer your question.

davebiagioni commented 1 year ago

Yes, @dhblum, that helps a lot in terms of context. I appreciate the effort to support OpenModelica. Thanks!

dhblum commented 7 months ago

Closing as stale.