Table Of Contents

Previous topic

Technical Manual

This Page

Application Programming Interface

einstein.modules.profiles – Operation time of processes

synopsis:Running time profiles for processes
author:David Baehrens <david.baehrens@energyxperts.net>
exception modules.schedules.profiles.ProfileNotFoundError

Bases: exceptions.Exception

No profile found with given name.

exception modules.schedules.profiles.ProfileWithoutIntervalsError

Bases: exceptions.Exception

Profile has no running time intervals.

modules.schedules.profiles.WEEKDAYS = ('monday', 'tuesday', 'wednesday', 'thursday', 'friday', 'saturday', 'sunday')

Weekday names in order.

class modules.schedules.profiles.WeeklyProfile(name, intervals=None, weekday=None, id=None)

Bases: object

Daily intervals of running time during one week on selected weekdays.

Parameters:
  • name (String) – Unique name used for identification
  • intervals (List of 3-tuples (start time, stop time, scale integer)) – Initial daily intervals, default: empty
  • weekday (Dictionary {<names from einstein.modules.profiles.WEEKDAYS> : <Booleans>}) – Initial selection of weekdays, default: all False
  • id (Integer) – The database id of the profile.
Returns:

Weekly profile instance

Return type:

einstein.modules.profiles.WeeklyProfile

addInterval(start, stop, scale)

Add an running time interval to profile instance.

Parameters:
  • start (time) – start time (inclusive)
  • stop (time) – stop time (inclusive)
  • scale (Integer) – percentage of operation relative to nominal load
Returns:

nothing

calculateGlobals()
checkIfEditAllowed()
clearIntervals()

Remove all running time intervals from profile instance.

Returns:nothing
copy()
deleteFromDB()

Remove profile from data base.

Returns:nothing
Raises einstein.modules.profiles.ProfileNotFoundError:
 No profile with our name found in data base.
loadFromDB(id=None)

Retrieve daily intervals and selected weekdays from data base.

Returns:

nothing

Raises:
  • einstein.modules.profiles.ProfileNotFoundError – No profile with our name found in data base.
  • einstein.modules.profiles.ProfileWithoutIntervalsError – Profile with our name has no intervals in data base.
saveToDB()

Store profile to data base.

Returns:nothing
setAllWeekdays(val)
modules.schedules.profiles.getAllProfilesFromDB()

Convenience function to get all known profiles at once.

modules.schedules.profiles.processExists(processId)
modules.schedules.profiles.weekdayShort = ('Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun')

Weekday short names in order.

einstein.modules.schedules – Detailed schedules of periodic operation

synopsis:Periodic yearly load profiles of process operation
author:Hans Schweiger <hans.schweiger@energyxperts.net>
author:David Baehrens <david.baehrens@energyxperts.net>
class modules.schedules.schedules.Schedule(name)

class that defines EINSTEIN schedules

Parameters:
  • self.holidays – list of tuples of holiday (start,stop) periods (both inclusive, period across the end of the year is supported).
  • fav – hourly scale factor

Specific parameters for simplified schedules built as follows

f(t) = fmonth x fweek x fholiday

Parameters:
  • self.weekly – list of tuples (start,stop) that describe the weekly profile (on/off)
  • self.monthly – list of 12 monthly scale factors
  • self.daily – intermediate list for daily profile, used for building self.weekly
NHolidays
build_bs()

builds the yearly basic schedule for a simple schedule

build_fav()
calc_fav(time)
calc_weekly()

calculates a weekly fav-vector that then is extended to a year

input: self.weekly output: fweek

f(time)
isHoliday(day)
normalize()
saveToDB()

save function for generic schedule if periodSchedule saves that one, else delete the periodSchedule if exists

setDefault()

Based on the basic schedule parameters (basic Q) assign a detailed default schedule

setPars(subType, NDays, HPerDay, NBatch, HBatch, holidays, periodSchedule=None, component='operation')
setParsDetailed()

functions for setpars specific for detailed schedules

zero()

sets the schedule to zero without calculations

class modules.schedules.schedules.Schedules

Bases: object

calculateEquipmentSchedules()

Generate the Schedules of the equipments.

calculatePlantSchedule()
calculateProcessSchedules()

Calculate the Schedules of the processes.

calculateWHEESchedules()

Generate the Schedules of the electrical equipment w. waste heat

create()
modules.schedules.schedules.TOLERANCE_GAP = 0.5

Minimum time between consecutive cycles after random tolerance shift (hours)

modules.schedules.schedules.getFavFromBS(bs)

Otains a fav-vector from a basic schedule

modules.schedules.schedules.globalsFromFav(fav, threshold=1e-09)

calculates the global values from a fav-vector

einstein.modules.upgrade – Version upgrades

synopsis:Management of EINSTEIN version upgrades
author:David Baehrens <david.baehrens@energyxperts.net>
modules.upgrade.addDPSTminValues(projectIds=None)

Add a variable for the before fixed parameters delta process/supply temperature.

If no project IDs are given all projects are updated.

Parameters:projectIds – list of ProjectIDs
modules.upgrade.addExternalSupply(projectIds=None)

Add a variable for the before fixed parameters delta process/supply temperature.

If no project IDs are given all projects are updated.

Parameters:projectIds – list of ProjectIDs
modules.upgrade.addIndoorTemperatures(projectIds=None)

Add the target temperatures for building heating and cooling as derived from the temperatures of the supply.

If no project IDs are given all projects are updated.

Parameters:projectIds – list of ProjectIDs
modules.upgrade.assumeSoundEconomicData(projectIds=None)

Assume that the econmic data of old projects is fine as is. Otherwise all variable costs in old projects would be removed as the equipment would seem to have changed since the last TCA calculations.

If no project IDs are given all projects are updated.

Parameters:projectIds – list of ProjectIDs
modules.upgrade.changeSTCollectortype(projectIds=None)

Replace the type “Concentrating collector” with “Parabolic trough collector” in the dbsolarthermal table.

Parameters:projectIds – is ignored as it does not touch projects
modules.upgrade.cleanUpHXConnections(psIds)

Writes columns source_id and pID establishing the correct links formerly defined redundantly by entry of objectNames in table heat_exchanger and by pinchStreamName

modules.upgrade.connectTCADataToAlternatives(projectIds=None)

All TCA data sets now keep track of their project id and alternative number. Set these values for all old TCA data sets.

If no project IDs are given all projects are updated.

Parameters:projectIds – list of ProjectIDs
modules.upgrade.correctCOPex_HP(projectIds)

Correct COPex in projects created with older versions in order to compensate for the change of HPTDROP from 5 to 7 K in Version 3.0

modules.upgrade.correctRawStreamData(projectIds=None)

In some cases QdotProc_c data have been assigned to 0.0 in old projects although it was not really a user input befor V2.9.00

modules.upgrade.createProcessesForBuildings(projectIds=None)

Create processes that represent the heating, cooling and domestic hot water demand of a building.

Parameters:projectIds – list of ProjectIDs
modules.upgrade.getAllBuildings(projectIds)
modules.upgrade.getAllEquipment(projectIds)
modules.upgrade.getAllProcesses(projectIds)
modules.upgrade.lastUpgrade(version)
modules.upgrade.moveEconomicDataToCGeneralData(projectIds=None)

Move some economic parameters from the questionnaire to the cgeneraldata table, as they may be changed by the consistency check and questionnaire contains only data that is user input.

If no project IDs are given all projects are updated.

Parameters:projectIds – list of ProjectIDs
modules.upgrade.portProcessIOtoStreams(projectIds=None)

Map the inflow and outflow properties of the processes of a project to corresponding streams.

If the process has in VInFlowDay, mInFlow, vInFlowCycle an explicit 0 then no inflow stream is created. If the process has in VoutFlow, mOutFlow, vOutFlowNom an explicit 0 then no outflow stream is created. In the other cases the values of the new streams are taken from the process.

Parameters:projectIds (List) – a list of projectIds of projects to be converted.
modules.upgrade.resetHeatSourceLT(projectIds=None)

The type of the HeatSourceLT column has changed, all old values were ignored anyway, so reset them for imported projects.

An update of the complete database is not needed as this is part of the database schema changes. If projectIds is None nothing is done.

Parameters:projectIds – list of ProjectIDs
modules.upgrade.shiftTemperatureReCooling(projectIds=None)

Shift the parameter TemperatureReCooling for air and water cooled compression chillers, as the simulation code has changed to a different reference point.

If no project IDs are given all projects are updated.

Parameters:projectIds – list of ProjectIDs
modules.upgrade.updateChillerData(projectIds=None)

Adapt chiller data for versions 2.1 and before in order to reflect the changes in the chiller module:

HCGTEfficiency -> copy into HCGTEffReal, if applies with partload correction.

Parameters:projectIds – list of ProjectIDs
modules.upgrade.updateSolarThermalDB(projectIds=None)

Replace default data with more precise default data.

If a projectId is given, nothing is done. This function is only sensible for updates of the whole database.

modules.upgrade.upgradeDetailedSchedules(projectIds=None)

Parameter upgrades for compatibility with detailed schedules

modules.upgrade.upgradeEINSTEIN(targetVersion='2.9.90', sourceVersion=None, projectIds=None)

Perform all defined upgrades to reach the specified version of EINSTEIN

modules.upgrade.upgradeHXConnections(projectIds)

Writes columns source_id and pID establishing the correct links formerly defined redundantly by entry of objectNames in table heat_exchanger and by pinchStreamName

modules.upgrade.upgradeProjectData(projectIds=None)

Updates the key project data creation date -> remains None last modification date -> set to current date

Parameters:projectIds – list of ProjectIDs
modules.upgrade.upgradeTimeSchedules(projectIds=None)

Adapt chiller data for versions 2.1 and before in order to reflect the changes in the chiller module:

HCGTEfficiency -> copy into HCGTEffReal, if applies with partload correction.

Parameters:projectIds – list of ProjectIDs
modules.upgrade.upgradeWaterCooledChillerData(projectIds=None)

Updates the key project data creation date -> remains None last modification date -> set to current date

Parameters:projectIds – list of ProjectIDs