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

89 add spawn hom with examples #94

Open
wants to merge 19 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
95 changes: 0 additions & 95 deletions BESMod/Examples/HighOrderModel/BES_HOM.mo

This file was deleted.

81 changes: 81 additions & 0 deletions BESMod/Examples/HighOrderModel/BaseClasses.mo
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
within BESMod.Examples.HighOrderModel;
package BaseClasses
partial model PartialBES_HOM
extends BESMod.Systems.BaseClasses.PartialBuildingEnergySystem(
redeclare BESMod.Systems.Electrical.DirectGridConnectionSystem electrical,
redeclare BESMod.Systems.Control.NoControl control,
redeclare BESMod.Systems.Hydraulical.HydraulicSystem hydraulic(
energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial,
redeclare BESMod.Systems.Hydraulical.Generation.HeatPumpAndElectricHeater
generation(
redeclare BESMod.Systems.RecordsCollection.Movers.DefaultMover parPum,
TBiv=parameterStudy.TBiv,
redeclare
BESMod.Systems.Hydraulical.Generation.RecordsCollection.HeatPumps.DefaultHP
parHeaPum,
redeclare model RefrigerantCycleHeatPumpHeating =
AixLib.Fluid.HeatPumps.ModularReversible.RefrigerantCycle.TableData3D
(y_nominal=0.8, redeclare
AixLib.Fluid.HeatPumps.ModularReversible.Data.TableDataSDF.TableData3D.VCLibPy.VCLibVaporInjectionPhaseSeparatorPropane
datTab),
redeclare
BESMod.Systems.Hydraulical.Generation.RecordsCollection.ElectricHeater.DefaultElectricHeater
parEleHea,
redeclare
BESMod.Systems.RecordsCollection.TemperatureSensors.DefaultSensor
parTemSen),
redeclare BESMod.Systems.Hydraulical.Control.MonoenergeticHeatPumpSystem
control(
redeclare
BESMod.Systems.Hydraulical.Control.Components.ThermostaticValveController.ThermostaticValvePIControlled
valCtrl,
redeclare model DHWHysteresis =
BESMod.Systems.Hydraulical.Control.Components.BivalentOnOffControllers.TimeBasedElectricHeater,
redeclare model BuildingHysteresis =
BESMod.Systems.Hydraulical.Control.Components.BivalentOnOffControllers.TimeBasedElectricHeater,
redeclare
BESMod.Systems.Hydraulical.Control.RecordsCollection.BasicHeatPumpPI
parPIDHeaPum),
redeclare
BESMod.Systems.Hydraulical.Distribution.DistributionTwoStorageParallel
distribution(
redeclare
BESMod.Systems.Hydraulical.Distribution.RecordsCollection.SimpleStorage.DefaultStorage
parStoBuf(VPerQ_flow=parameterStudy.VPerQFlow, dTLoadingHC1=0),
redeclare
BESMod.Systems.Hydraulical.Distribution.RecordsCollection.SimpleStorage.DefaultStorage
parStoDHW(dTLoadingHC1=10),
redeclare BESMod.Systems.RecordsCollection.Valves.DefaultThreeWayValve
parThrWayVal),
redeclare BESMod.Systems.Hydraulical.Transfer.IdealValveRadiator transfer(
redeclare
BESMod.Systems.Hydraulical.Transfer.RecordsCollection.RadiatorTransferData
parRad,
redeclare BESMod.Systems.RecordsCollection.Movers.DefaultMover parPum,
redeclare
BESMod.Systems.Hydraulical.Transfer.RecordsCollection.SteelRadiatorStandardPressureLossData
parTra)),
redeclare BESMod.Systems.Demand.DHW.StandardProfiles DHW(
energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial,
redeclare BESMod.Systems.Demand.DHW.RecordsCollection.ProfileM DHWProfile,
redeclare BESMod.Systems.RecordsCollection.Movers.DefaultMover parPum,
redeclare BESMod.Systems.Demand.DHW.TappingProfiles.calcmFlowEquStatic
calcmFlow),
redeclare BESMod.Systems.UserProfiles.AixLibHighOrderProfiles userProfiles(
redeclare AixLib.DataBase.Profiles.Ventilation2perDayMean05perH venPro,
redeclare AixLib.DataBase.Profiles.SetTemperaturesVentilation2perDay
TSetProfile),
redeclare HOMSystem systemParameters,
redeclare DesignOptimization.ParametersToChange parameterStudy,
redeclare final package MediumDHW = AixLib.Media.Water,
redeclare final package MediumZone = AixLib.Media.Air,
redeclare final package MediumHyd = AixLib.Media.Water,
redeclare BESMod.Systems.Ventilation.NoVentilation ventilation);

annotation (experiment(StopTime=172800,
Interval=600,
Tolerance=1e-06),
__Dymola_Commands(file="modelica://BESMod/Resources/Scripts/Dymola/Examples/HighOrderModel/BES_HOM.mos"
"Simulate and plot"));
end PartialBES_HOM;
end BaseClasses;
26 changes: 26 additions & 0 deletions BESMod/Examples/HighOrderModel/HOMAixLib.mo
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
within BESMod.Examples.HighOrderModel;
model HOMAixLib
extends BESMod.Examples.HighOrderModel.BaseClasses.PartialBES_HOM(
redeclare BESMod.Systems.Demand.Building.AixLibHighOrder building(
energyDynamicsWalls=Modelica.Fluid.Types.Dynamics.FixedInitial,
energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial,
useConstVentRate=false,
TimeCorrection=0,
DiffWeatherDataTime=Modelica.Units.Conversions.to_hour(weaDat.timZon),
redeclare AixLib.DataBase.Walls.Collections.OFD.EnEV2009Heavy wallTypes,
redeclare model WindowModel =
AixLib.ThermalZones.HighOrder.Components.WindowsDoors.WindowSimple,
redeclare AixLib.DataBase.WindowsDoors.Simple.WindowSimple_EnEV2009
Type_Win,
redeclare model CorrSolarGainWin =
AixLib.ThermalZones.HighOrder.Components.WindowsDoors.BaseClasses.CorrectionSolarGain.CorGSimple,
redeclare BESMod.Systems.Demand.Building.Components.AixLibHighOrderOFD
HOMBuiEnv));

extends Modelica.Icons.Example;
annotation (experiment(StopTime=172800,
Interval=600,
Tolerance=1e-06),
__Dymola_Commands(file="modelica://BESMod/Resources/Scripts/Dymola/Examples/HighOrderModel/BES_HOM_AixLib.mos"
"Simulate and plot"));
end HOMAixLib;
25 changes: 25 additions & 0 deletions BESMod/Examples/HighOrderModel/HOMSpawn.mo
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
within BESMod.Examples.HighOrderModel;
model HOMSpawn
extends BESMod.Examples.HighOrderModel.BaseClasses.PartialBES_HOM(
redeclare Systems.Demand.Building.SpawnHighOrder building(
useConstVentRate=false, wea_name=systemParameters.filNamWea),
systemParameters(
QBui_flow_nominal={832.063,514.782,366.72,721.233,688.894,864.215,580.23,
233.253,765.68,700.719},
TOda_nominal=261.15,
filNamWea=Modelica.Utilities.Files.loadResource(
"modelica://BESMod/Resources/Spawn/Potsdam_TRY2015_normal.mos")));

extends Modelica.Icons.Example;
annotation (experiment(
StopTime=172800,
Interval=600,
Tolerance=1e-06,
__Dymola_Algorithm="Cvode"),
__Dymola_Commands(file="modelica://BESMod/Resources/Scripts/Dymola/Examples/HighOrderModel/BES_HOM_Spawn.mos"
"Simulate and plot"),
Documentation(info="<html>
<p>This is the Example model with the Spawn model corresponding to the High Order Model (HOM) contained in the AixLib library.</p>
<p>Further information and possible solutions for error messages can be found in the SpawnHighOrder model documentation.</p>
</html>"));
end HOMSpawn;
4 changes: 3 additions & 1 deletion BESMod/Examples/HighOrderModel/package.order
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
BES_HOM
HOMAixLib
HOMSpawn
BaseClasses
HOMSystem
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

simulateModel("BESMod.Examples.HighOrderModel.BES_HOM", stopTime=172800, method="dassl", tolerance=1e-06, resultFile="BES_HOM");
simulateModel("BESMod.Examples.HighOrderModel.HOMAixLib", stopTime=172800, method="dassl", tolerance=1e-06, resultFile="HOMAixLib");

createPlot(id=1, position={75, 70, 1210, 600}, y={"weaDat.weaBus.TDryBul"}, grid=true, subPlot=1, colors={{28,108,200}});
createPlot(id=1, y={"hydraulic.generation.sigBusGen.TGenOutMea"}, grid=true, subPlot=2, colors={{238,46,47}});
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@

simulateModel("BESMod.Examples.HighOrderModel.HOMSpawn", stopTime=172800, method="Cvode", tolerance=1e-06, resultFile="HOMSpawn");
getLastError()
createPlot(id=1, position={75, 70, 1210, 600}, y={"weaDat.weaBus.TDryBul"}, grid=true, subPlot=1, colors={{28,108,200}});
createPlot(id=1, y={"hydraulic.generation.sigBusGen.TGenOutMea"}, grid=true, subPlot=2, colors={{238,46,47}});
createPlot(id=1, y={"hydraulic.control.buiMeaBus.TZoneMea[1]", "hydraulic.control.buiMeaBus.TZoneMea[10]"}, grid=true, subPlot=3, colors={{28,108,200},{238,46,47}});
createPlot(id=1, y={"electricalGrid.PElecGen","electricalGrid.PElecLoa"}, grid=true, subPlot=4, colors={{28,108,200},{238,46,47}});

Loading