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鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use Ubuntu 20 and fix CHP model #611
Changes from all commits
c9274c4
dfd0484
70fc8bc
e0fe8fb
ba6caac
031316f
ddeb985
ab209ed
fdbd9b5
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
FROM openmodelica/openmodelica:v1.22.1-gui | ||
FROM ubuntu:focal | ||
|
||
# These libraries help compile and simulate separately. | ||
# libgfortran4 is needed to load FMU for FMUZoneAdapterZones1.mo | ||
RUN apt update && apt --no-install-recommends install -y \ | ||
vim \ | ||
|
@@ -9,6 +10,22 @@ RUN apt update && apt --no-install-recommends install -y \ | |
cmake \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
|
||
# Duplicating code from OM Dockerfile: https://github.com/OpenModelica/OpenModelicaDockerImages/blob/v1.22.1/Dockerfile | ||
# This allows us to use a different Ubuntu version than the OM Dockerfile | ||
# tests/GMT_Lib/test_gmt_lib_des.py fails with jammy, works with focal. | ||
ARG VERSION=1.22.1 | ||
|
||
RUN export DEBIAN_FRONTEND="noninteractive" && echo "VERSION: $VERSION" && test ! -z "$VERSION" && apt update && apt upgrade -qy && apt dist-upgrade -qy \ | ||
&& apt install -qy gnupg wget ca-certificates apt-transport-https \ | ||
&& echo "deb https://build.openmodelica.org/omc/builds/linux/releases/$VERSION/ `cat /etc/lsb-release | grep CODENAME | cut -d= -f2` release" > /etc/apt/sources.list.d/openmodelica.list \ | ||
&& wget -q https://build.openmodelica.org/apt/openmodelica.asc \ | ||
&& apt-key add openmodelica.asc \ | ||
&& rm openmodelica.asc \ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 馃憤 |
||
&& apt update && apt upgrade && apt dist-upgrade \ | ||
&& apt install --no-install-recommends -qy omc \ | ||
&& apt clean \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
|
||
# Install MSL 4.0 | ||
RUN echo \ | ||
"updatePackageIndex(); getErrorString(); installPackage(Modelica, \"4.0.0\", exactMatch=false); getErrorString();" >> /tmp/installMSL.mos && \ | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -35,7 +35,6 @@ | |
class GmtLibDesTest(unittest.TestCase): | ||
|
||
@pytest.mark.simulation | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. sweet, so this works now? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. By using Ubuntu 20, yes! |
||
@pytest.mark.skip('Invalid root in initialization. Skipping until LBNL helps') | ||
def test_5G_des_waste_heat_and_ghx(self): | ||
# -- Setup | ||
package_output_dir = PARENT_DIR / 'output' | ||
|
@@ -102,7 +101,6 @@ def test_5G_des_waste_heat_and_ghx_dymola(self): | |
assert success is True | ||
|
||
@pytest.mark.simulation | ||
@pytest.mark.skip('Invalid root in initialization. Skipping until LBNL helps') | ||
def test_5G_des_waste_heat_and_ghx_variable(self): | ||
# -- Setup | ||
package_output_dir = PARENT_DIR / 'output' | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -87,13 +87,12 @@ def test_build_chp_system(self): | |
assert (root_path / 'DistrictEnergySystem.mo').exists() | ||
|
||
@pytest.mark.simulation | ||
@pytest.mark.skip('Connector types are incompatible. HeatingPlantwithCHP:242') | ||
def test_simulate_chp_system(self): | ||
self.run_and_assert_in_docker( | ||
f'{self.district._scaffold.project_name}.Districts.DistrictEnergySystem', | ||
file_to_load=self.district._scaffold.package_path, | ||
run_path=self.district._scaffold.project_path, | ||
start_time=17280000, # Day 200 (in seconds) (Run in summer to keep chiller happy) | ||
stop_time=17366400, # For 1 day duration (in seconds) | ||
step_size=3600 # (in seconds) | ||
start_time=0, # Day 0 (in seconds) | ||
stop_time=9999, # For 2.78 hours (in seconds) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Jiazhen is investigating initial values to determine why this simulation fails if it runs for more than 10,000 seconds There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. cool cool |
||
step_size=300 # (in seconds) | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not sure I like
_new
as an identifier, but I guess we needed something.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
mmm, yeah, good point. I think Jiazhen made that model, so we can change it in a future PR.