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

Update Spawn to EnergyPlus 24.2.0 #4018

Merged
merged 60 commits into from
Nov 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
60 commits
Select commit Hold shift + click to select a range
836482b
Implemented support for RunPeriod
mwetter Apr 21, 2022
965fe41
Implemented support for RunPeriod
mwetter Apr 21, 2022
7b61856
Implemented support for RunPeriod
mwetter Apr 21, 2022
6331a16
Implemented support for RunPeriod
mwetter Apr 21, 2022
bbb6468
Implemented support for RunPeriod
mwetter Apr 21, 2022
850a10e
Added Linux binary
mwetter Apr 21, 2022
bfc1b12
Add EnergyPlus_24_1_0 resources
kbenne Jun 25, 2024
3682042
Merged master
mwetter Aug 21, 2024
8bae883
Added validation test
mwetter Aug 21, 2024
32a1eab
Added validation test
mwetter Aug 21, 2024
dd2a6f4
Removed comment in annotation
mwetter Aug 21, 2024
18195d0
Introduced sLen
mwetter Aug 21, 2024
0506fcb
Compiled Linux binaries
mwetter Aug 21, 2024
0fc07e9
Revised and expanded documentation
mwetter Aug 22, 2024
cd19b6e
Revised and expanded documentation
mwetter Aug 22, 2024
c0b7065
Added install.py file
mwetter Aug 24, 2024
a806c31
Merge branch 'master' into issue3911_EP_24_1_0
mwetter Aug 24, 2024
cbe8bd1
Merge branch 'issue2926_runPeriod' into issue3911_EP_24_1_0
mwetter Aug 24, 2024
c356729
Updated hash and version for new binaries
mwetter Aug 24, 2024
98565df
Updated .mo files for EnergyPlus 24.1.0, after copying examples from …
mwetter Aug 24, 2024
696af3d
Updated EnergyPlus version
mwetter Aug 24, 2024
d45a9e2
Added mos scripts
mwetter Aug 26, 2024
0172fda
Setup examples
mwetter Aug 26, 2024
fb39b07
Updated C code
mwetter Aug 26, 2024
fd2cb3c
Removed old binary
mwetter Aug 26, 2024
8b084e2
Updated EnergyPlus version
mwetter Aug 26, 2024
bbfdb73
Updated release notes
mwetter Aug 26, 2024
085fbc8
Updated link to figures
mwetter Aug 26, 2024
2b19281
Moved files used for EnergyPlus_9_6_0 and EnergyPlus_24_1_0 testing
mwetter Aug 26, 2024
15e21ed
Changed Spawn version [ci skip]
mwetter Sep 3, 2024
dea9608
Refactored RunPeriod [ci skip]
mwetter Sep 3, 2024
7b37737
Merge branch 'master' into issue2926_runPeriod
mwetter Sep 3, 2024
ad36a65
Compiled dll
mwetter Sep 3, 2024
02b0299
Updated documentation
mwetter Sep 3, 2024
3a92082
Formatted file
mwetter Sep 3, 2024
605f332
Renamed model
mwetter Sep 3, 2024
cecf92e
Updated release notes
mwetter Sep 3, 2024
f7ea3da
Corrected format
mwetter Sep 3, 2024
db4a232
Merged #2926
mwetter Sep 3, 2024
aae5886
Renamed model
mwetter Sep 3, 2024
6dd75b8
Ported changes from #2926
mwetter Sep 3, 2024
7352fd8
Ported changes from #2926
mwetter Sep 3, 2024
7f838d9
Ported changes from #2926
mwetter Sep 3, 2024
c8a408b
Merged master
mwetter Oct 17, 2024
40224a3
Changed E+ version
mwetter Oct 17, 2024
97b256f
Renamed 24_1_0 to 24_2_0 and 24.1.0 to 24.2.0
mwetter Oct 17, 2024
f439f04
Renamed 24_1_0 to 24_2_0 and 24.1.0 to 24.2.0
mwetter Oct 17, 2024
c57ad29
Checked out idf from issue3911_EP_24_2_1
mwetter Oct 17, 2024
112520a
Reverted package.order
mwetter Oct 17, 2024
f3d3e49
Removed old parameter use_inputFilter [ci_skip]
mwetter Oct 25, 2024
fa45515
Compiled Linux binaries
mwetter Oct 25, 2024
05958b9
Updated Spawn to 0.6.0
mwetter Oct 25, 2024
8b232ed
Updated spawn hash
mwetter Oct 28, 2024
6306f9e
Updated spawn hash
mwetter Nov 1, 2024
5580c39
Updated Spawn version [ci skip]
mwetter Nov 7, 2024
f4a5b2a
Updated reference results
mwetter Nov 7, 2024
ff33003
Generated Windows binaries
mwetter Nov 7, 2024
db82f0d
Added Buildings.ThermalZones.EnergyPlus_24_2_0.BaseClasses.Validation…
mwetter Nov 7, 2024
0c597dd
Updated conf.yml for optimica and EnergyPlus 24.2.0
mwetter Nov 7, 2024
174eae0
Merge branch 'master' into issue3911_EP_24_2_0_mw
mwetter Nov 7, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
8 changes: 4 additions & 4 deletions Buildings/DHC/Loads/BaseClasses/BuildingSpawnZ1.mo
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ model BuildingSpawnZ1
"Load side medium";
parameter Integer nZon=1
"Number of thermal zones";
parameter String idfName="modelica://Buildings/Resources/Data/ThermalZones/EnergyPlus_9_6_0/Examples/RefBldgSmallOffice/RefBldgSmallOfficeNew2004_Chicago.idf"
parameter String idfName="modelica://Buildings/Resources/Data/ThermalZones/EnergyPlus_24_2_0/Examples/RefBldgSmallOffice/RefBldgSmallOfficeNew2004_Chicago.idf"
"Name of the IDF file";
parameter String epwName="modelica://Buildings/Resources/weatherdata/USA_IL_Chicago-OHare.Intl.AP.725300_TMY3.epw"
"Name of the weather file";
Expand All @@ -32,13 +32,13 @@ model BuildingSpawnZ1
k=0)
"Latent heat gain"
annotation (Placement(transformation(extent={{-80,-10},{-60,10}})));
Buildings.ThermalZones.EnergyPlus_9_6_0.ThermalZone zon(
Buildings.ThermalZones.EnergyPlus_24_2_0.ThermalZone zon(
redeclare package Medium=Medium2,
zoneName="Core_ZN",
nPorts=2)
"Thermal zone"
annotation (Placement(transformation(extent={{40,-20},{80,20}})));
inner Buildings.ThermalZones.EnergyPlus_9_6_0.Building building(
inner Buildings.ThermalZones.EnergyPlus_24_2_0.Building building(
idfName=Modelica.Utilities.Files.loadResource(
idfName),
epwName=Modelica.Utilities.Files.loadResource(
Expand Down Expand Up @@ -176,5 +176,5 @@ First implementation.
graphics={
Bitmap(
extent={{-108,-100},{92,100}},
fileName="modelica://Buildings/Resources/Images/ThermalZones/EnergyPlus_9_6_0/EnergyPlusLogo.png")}));
fileName="modelica://Buildings/Resources/Images/ThermalZones/EnergyPlus/EnergyPlusLogo.png")}));
end BuildingSpawnZ1;
18 changes: 9 additions & 9 deletions Buildings/DHC/Loads/BaseClasses/BuildingSpawnZ6.mo
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ model BuildingSpawnZ6
nZon) ./ facMulTerUni
"Design cooling heat flow rate (single terminal unit)"
annotation (Dialog(group="Nominal condition"));
parameter String idfName="modelica://Buildings/Resources/Data/ThermalZones/EnergyPlus_9_6_0/Examples/RefBldgSmallOffice/RefBldgSmallOfficeNew2004_Chicago.idf"
parameter String idfName="modelica://Buildings/Resources/Data/ThermalZones/EnergyPlus_24_2_0/Examples/RefBldgSmallOffice/RefBldgSmallOfficeNew2004_Chicago.idf"
"Name of the IDF file";
parameter String epwName="modelica://Buildings/Resources/weatherdata/USA_IL_Chicago-OHare.Intl.AP.725300_TMY3.epw"
"Name of the weather file";
Expand Down Expand Up @@ -62,42 +62,42 @@ model BuildingSpawnZ6
k=0)
"Latent heat gain"
annotation (Placement(transformation(extent={{-60,64},{-40,84}})));
Buildings.ThermalZones.EnergyPlus_9_6_0.ThermalZone znAttic(
Buildings.ThermalZones.EnergyPlus_24_2_0.ThermalZone znAttic(
redeclare package Medium=Medium2,
zoneName="Attic")
"Thermal zone"
annotation (Placement(transformation(extent={{24,84},{64,124}})));
Buildings.ThermalZones.EnergyPlus_9_6_0.ThermalZone znCore_ZN(
Buildings.ThermalZones.EnergyPlus_24_2_0.ThermalZone znCore_ZN(
redeclare package Medium=Medium2,
zoneName="Core_ZN",
nPorts=2)
"Thermal zone"
annotation (Placement(transformation(extent={{24,42},{64,82}})));
Buildings.ThermalZones.EnergyPlus_9_6_0.ThermalZone znPerimeter_ZN_1(
Buildings.ThermalZones.EnergyPlus_24_2_0.ThermalZone znPerimeter_ZN_1(
redeclare package Medium=Medium2,
zoneName="Perimeter_ZN_1",
nPorts=2)
"Thermal zone"
annotation (Placement(transformation(extent={{24,0},{64,40}})));
Buildings.ThermalZones.EnergyPlus_9_6_0.ThermalZone znPerimeter_ZN_2(
Buildings.ThermalZones.EnergyPlus_24_2_0.ThermalZone znPerimeter_ZN_2(
redeclare package Medium=Medium2,
zoneName="Perimeter_ZN_2",
nPorts=2)
"Thermal zone"
annotation (Placement(transformation(extent={{24,-40},{64,0}})));
Buildings.ThermalZones.EnergyPlus_9_6_0.ThermalZone znPerimeter_ZN_3(
Buildings.ThermalZones.EnergyPlus_24_2_0.ThermalZone znPerimeter_ZN_3(
redeclare package Medium=Medium2,
zoneName="Perimeter_ZN_3",
nPorts=2)
"Thermal zone"
annotation (Placement(transformation(extent={{24,-80},{64,-40}})));
Buildings.ThermalZones.EnergyPlus_9_6_0.ThermalZone znPerimeter_ZN_4(
Buildings.ThermalZones.EnergyPlus_24_2_0.ThermalZone znPerimeter_ZN_4(
redeclare package Medium=Medium2,
zoneName="Perimeter_ZN_4",
nPorts=2)
"Thermal zone"
annotation (Placement(transformation(extent={{24,-120},{64,-80}})));
inner Buildings.ThermalZones.EnergyPlus_9_6_0.Building building(
inner Buildings.ThermalZones.EnergyPlus_24_2_0.Building building(
idfName=Modelica.Utilities.Files.loadResource(
idfName),
epwName=Modelica.Utilities.Files.loadResource(
Expand Down Expand Up @@ -280,5 +280,5 @@ First implementation.
graphics={
Bitmap(
extent={{-108,-100},{92,100}},
fileName="modelica://Buildings/Resources/Images/ThermalZones/EnergyPlus_9_6_0/EnergyPlusLogo.png")}));
fileName="modelica://Buildings/Resources/Images/ThermalZones/EnergyPlus/EnergyPlusLogo.png")}));
end BuildingSpawnZ6;
4 changes: 2 additions & 2 deletions Buildings/DHC/Loads/BaseClasses/Examples/CouplingSpawnZ6.mo
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,8 @@ secondary pumps.
<p>
Simulation with Dymola requires minimum version 2020x and setting
<code>Hidden.AvoidDoubleComputation=true</code>, see
<a href=\"modelica://Buildings.ThermalZones.EnergyPlus_9_6_0.UsersGuide\">
Buildings.ThermalZones.EnergyPlus_9_6_0.UsersGuide</a>.
<a href=\"modelica://Buildings.ThermalZones.EnergyPlus_24_2_0.UsersGuide\">
Buildings.ThermalZones.EnergyPlus_24_2_0.UsersGuide</a>.
</p>
</html>",
revisions="<html>
Expand Down
16 changes: 8 additions & 8 deletions Buildings/Examples/VAVReheat/package.mo
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ for office buildings.
<h4>Note</h4>
<p>
The models
<a href=\"modelica://Buildings.ThermalZones.EnergyPlus_9_6_0.Examples.SmallOffice.ASHRAE2006Winter\">
Buildings.ThermalZones.EnergyPlus_9_6_0.Examples.SmallOffice.ASHRAE2006Winter</a>
<a href=\"modelica://Buildings.ThermalZones.EnergyPlus_24_2_0.Examples.SmallOffice.ASHRAE2006Winter\">
Buildings.ThermalZones.EnergyPlus_24_2_0.Examples.SmallOffice.ASHRAE2006Winter</a>
and
<a href=\"modelica://Buildings.ThermalZones.EnergyPlus_9_6_0.Examples.SmallOffice.Guideline36Winter\">
Buildings.ThermalZones.EnergyPlus_9_6_0.Examples.SmallOffice.Guideline36Winter</a>
<a href=\"modelica://Buildings.ThermalZones.EnergyPlus_24_2_0.Examples.SmallOffice.Guideline36Winter\">
Buildings.ThermalZones.EnergyPlus_24_2_0.Examples.SmallOffice.Guideline36Winter</a>
appear to be quite similar to
<a href=\"modelica://Buildings.Examples.VAVReheat.ASHRAE2006\">
Buildings.Examples.VAVReheat.ASHRAE2006</a>
Expand All @@ -25,8 +25,8 @@ Buildings.Examples.VAVReheat.Guideline36</a>,
respectively, because they all have the same HVAC system, control sequences,
and all have five thermal zones.
However, the models in
<a href=\"modelica://Buildings.ThermalZones.EnergyPlus_9_6_0.Examples.SmallOffice\">
Buildings.ThermalZones.EnergyPlus_9_6_0.Examples.SmallOffice</a>
<a href=\"modelica://Buildings.ThermalZones.EnergyPlus_24_2_0.Examples.SmallOffice\">
Buildings.ThermalZones.EnergyPlus_24_2_0.Examples.SmallOffice</a>
are from the
<i>DOE Commercial Reference Building,
Small Office, new construction, ASHRAE 90.1-2004,
Expand All @@ -39,8 +39,8 @@ are from the
Medium Office, new construction, ASHRAE 90.1-2004,
version 1.2_4.0</i>.
Therefore, the dimensions of the thermal zones in
<a href=\"modelica://Buildings.ThermalZones.EnergyPlus_9_6_0.Examples.SmallOffice\">
Buildings.ThermalZones.EnergyPlus_9_6_0.Examples.SmallOffice</a>
<a href=\"modelica://Buildings.ThermalZones.EnergyPlus_24_2_0.Examples.SmallOffice\">
Buildings.ThermalZones.EnergyPlus_24_2_0.Examples.SmallOffice</a>
are considerably smaller than in
<a href=\"modelica://Buildings.Examples.VAVReheat\">
Buildings.Examples.VAVReheat</a>.
Expand Down
155 changes: 155 additions & 0 deletions Buildings/Resources/C-Sources/EnergyPlus_24_2_0_Wrapper.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,155 @@
#ifndef Spawn_declared
#define Spawn_declared

#include "EnergyPlus_24_2_0_Wrapper.h"

/* *********************************************************
Wrapper functions that connect to the library which
generates and loads the EnergyPlus fmu.

Note that ModelicaMessage, ModelicaError,
ModelicaFormatMessage and ModelicaFormatError are passed
as function pointers. These functions are provided by,
and may differ among, the Modelica environments.
Using function pointers allows the library to load the
correct version provided by the Modelica simulation
environment that compiles the Modelica model.
********************************************************* */

/* Custom implementation of ModelicaFormatMessage that prints to stdout
#define my_printf(...) MyModelicaFormatMessage(__VA_ARGS__)
void my_printf(const char *fmt, ...) {
va_list args;
va_start(args, fmt);
vprintf(fmt, args);
va_end(args);
fflush(stdout);
}
*/

void* allocate_Modelica_EnergyPlus_24_2_0(
const int objectType,
double startTime,
const char* modelicaNameBuilding,
const char* modelicaNameThermalZone,
const char* spawnExe,
const char* idfVersion,
const char* idfName,
const char* epwName,
int runPeriod_dayOfWeekForStartDay,
int runPeriod_applyWeekEndHolidayRule,
int runPeriod_use_weatherFileDaylightSavingPeriod,
int runPeriod_use_weatherFileHolidaysAndSpecialDays,
int runPeriod_use_weatherFileRainIndicators,
int runPeriod_use_weatherFileSnowIndicators,
double relativeSurfaceTolerance,
const char* epName,
int usePrecompiledFMU,
const char* fmuName,
const char* buildingsRootFileLocation,
const int logLevel,
const int printUnit,
const char* jsonName,
const char* jsonKeysValues,
const char** parOutNames,
const size_t nParOut,
const char** parOutUnits,
const size_t nParOutUni,
const char** inpNames,
const size_t nInp,
const char** inpUnits,
const size_t nInpUni,
const char** outNames,
const size_t nOut,
const char** outUnits,
const size_t nOutUni,
const int* derivatives_structure,
size_t k,
size_t n,
const double* derivatives_delta,
const size_t nDer){


runPeriod runPer;
runPer.dayOfWeekForStartDay = runPeriod_dayOfWeekForStartDay;
runPer.applyWeekEndHolidayRule = runPeriod_applyWeekEndHolidayRule;
runPer.use_weatherFileDaylightSavingPeriod = runPeriod_use_weatherFileDaylightSavingPeriod;
runPer.use_weatherFileHolidaysAndSpecialDays = runPeriod_use_weatherFileHolidaysAndSpecialDays;
runPer.use_weatherFileRainIndicators = runPeriod_use_weatherFileRainIndicators;
runPer.use_weatherFileSnowIndicators = runPeriod_use_weatherFileSnowIndicators;


return allocate_Spawn_EnergyPlus_24_2_0(
objectType,
startTime,
modelicaNameBuilding,
modelicaNameThermalZone,
spawnExe,
idfVersion,
idfName,
epwName,
&runPer,
relativeSurfaceTolerance,
epName,
usePrecompiledFMU,
fmuName,
buildingsRootFileLocation,
logLevel,
printUnit,
jsonName,
jsonKeysValues,
parOutNames,
nParOut,
parOutUnits,
nParOutUni,
inpNames,
nInp,
inpUnits,
nInpUni,
outNames,
nOut,
outUnits,
nOutUni,
derivatives_structure,
k, /* k = 2 in Modelica */
n,
derivatives_delta,
nDer,
ModelicaMessage,
ModelicaError,
ModelicaFormatMessage,
ModelicaFormatError);
}

void initialize_Modelica_EnergyPlus_24_2_0(
void* object,
double isSynchronized,
int *nObj){
initialize_Spawn_EnergyPlus_24_2_0(object, nObj);
}

void getParameters_Modelica_EnergyPlus_24_2_0(
void* object,
double isSynchronized,
double *parOut){
getParameters_Spawn_EnergyPlus_24_2_0(object, parOut);
}

void exchange_Modelica_EnergyPlus_24_2_0(
void* object,
const double* u,
double dummy,
double* y){

exchange_Spawn_EnergyPlus_24_2_0(
object,
0, /* Argument initialCall is hard-coded to false, and can be removed when binaries need to be recompiled. */
u,
y);
}

void free_Modelica_EnergyPlus_24_2_0(void* object){
free_Spawn_EnergyPlus_24_2_0(object);
}

#endif
96 changes: 96 additions & 0 deletions Buildings/Resources/C-Sources/EnergyPlus_24_2_0_Wrapper.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
#ifndef EnergyPlus_24_2_0_Wrapper_h
#define EnergyPlus_24_2_0_Wrapper_h

#include <stdint.h>


/* Check for 64 bit */
/* Windows */
#if _WIN32 || _WIN64
#if _WIN64
#define ENVIRONMENT64
#else
#define ENVIRONMENT32
#endif
#endif

/* gcc */
#if __GNUC__
#if __x86_64__ || __ppc64__
#define ENVIRONMENT64
#else
#define ENVIRONMENT32
#endif
#endif

#ifndef ENVIRONMENT64
#error Modelica Spawn coupling is only supported for Windows and Linux 64 bit. Your operating system is not 64 bit.
#endif

#include "ModelicaUtilities.h"

typedef struct {
int dayOfWeekForStartDay; /* Day of week from Buildings.ThermalZones.EnergyPlus_24_2_0.Types.WeekDays */
int applyWeekEndHolidayRule;
int use_weatherFileDaylightSavingPeriod;
int use_weatherFileHolidaysAndSpecialDays;
int use_weatherFileRainIndicators;
int use_weatherFileSnowIndicators;
} runPeriod;

/* ********************************************************* */
/* Thermal zone */
extern void* allocate_Spawn_EnergyPlus_24_2_0(
const int objectType,
double startTime,
const char* modelicaNameBuilding,
const char* modelicaNameThermalZone,
const char* spawnExe,
const char* idfVersion,
const char* idfName,
const char* epwName,
const runPeriod* runPer,
double relativeSurfaceTolerance,
const char* epName,
int usePrecompiledFMU,
const char* fmuName,
const char* buildingsRootFileLocation,
const int logLevel,
const int printUnit,
const char* jsonName,
const char* jsonKeysValues,
const char** parOutNames,
const size_t nParOut,
const char** parOutUnits,
const size_t nParOutUni,
const char** inpNames,
const size_t nInp,
const char** inpUnits,
const size_t nInpUni,
const char** outNames,
const size_t nOut,
const char** outUnits,
const size_t nOutUni,
const int* derivatives_structure,
const size_t k,
const size_t n,
const double* derivatives_delta,
const size_t nDer,
void (*SpawnMessage)(const char *string),
void (*SpawnError)(const char *string),
void (*SpawnFormatMessage)(const char *string, ...),
void (*SpawnFormatError)(const char *string, ...));

extern void initialize_Spawn_EnergyPlus_24_2_0(void* object, int *nObj);

extern void getParameters_Spawn_EnergyPlus_24_2_0(void* object, double *parOut);

extern void exchange_Spawn_EnergyPlus_24_2_0(
void* object,
int initialCall,
const double* u,
double* y);

extern void free_Spawn_EnergyPlus_24_2_0(void* object);

#endif
Loading
Loading