def __init__(self): # print "init start hh" pycd3.Node.__init__(self) self.inport = pycd3.Flow() self.outport = pycd3.Flow() self.currentOutdoorDemand = pycd3.Flow() self.gardensize = pycd3.Flow() self.average = pycd3.Double(7) self.deviation = pycd3.Double(2) self.tap_flow_rate = pycd3.Double(18) self.smart_watering_time = pycd3.String("[18,6]") self.watering_method = pycd3.String('Smart_Watering') self.onoff = pycd3.String("Off") self.addInPort("Gardensize", self.gardensize) self.addInPort("Outdoor_Demand_In", self.inport) self.addOutPort("Outdoor_Demand_Out", self.outport) self.addOutPort("Check_Storage", self.currentOutdoorDemand) self.addParameter( "Watering_Method_(Normal_Watering_or_Smart_Watering)", self.watering_method) self.addParameter("Smart_Watering_Start_Time_End_Time_[hh,hh]", self.smart_watering_time) self.addParameter("Maximal_Watering_Flow_Rate_[l/min]", self.tap_flow_rate) self.addParameter("Average_Watering_Frequency_[d]", self.average) self.addParameter("Deviation_of_Frequency_[d]", self.deviation) self.addParameter("Switch_(On_or_Off)", self.onoff) ''' self.smart_watering_time: 0h not valid, has got to 24 h, start time smaller 24! ''' print '\n' + self.onoff
def __init__(self): pycd3.Node.__init__(self) self.rain = pycd3.Flow() self.evapo = pycd3.Flow() self.infiltr = pycd3.Flow() self.actuell_infiltr = pycd3.Flow() self.runoff = pycd3.Flow() #dir (self.inf) print "init node" self.addInPort("rain", self.rain) self.addInPort("evapo", self.evapo) self.addOutPort("infiltr", self.infiltr) self.addOutPort("actuell_infiltr", self.actuell_infiltr) self.addOutPort("runoff", self.runoff) self.initial_cap = pycd3.Double(0.9) self.addParameter("initial_cap[m/h]", self.initial_cap) self.final_cap = pycd3.Double(0.29) self.addParameter("final_cap[m/h]", self.final_cap) self.decay_constant = pycd3.Double(2.0) self.addParameter("decay_constant[1/min]", self.decay_constant) self.time = -1.0
def __init__(self): pycd3.Node.__init__(self) self.groundw_in = pycd3.Flow() #self.groundw_evapo = pycd3.Flow() self.outdoor_use = pycd3.Flow() #self.pF_Value = pycd3.Double() self.check_storage = pycd3.Flow() #dir (self.inf) print "init node" self.addInPort("groundw_in", self.groundw_in) #self.addInPort("groundw_evapo", self.groundw_evapo) #self.addOutPort("pF-Value", self.pF_Value) self.addOutPort("outdoor_use", self.outdoor_use) self.addOutPort("check_storage", self.check_storage) self.area_property = pycd3.Double(1.0) self.addParameter("area_property", self.area_property) self.evapotr = pycd3.Double(0.00002113) self.addParameter("evapotr [m/(6 min)]", self.evapotr) #self.water_content = pycd3.Double(0.4) #self.addParameter("initial_w_content", self.water_content) #self.soil_type = pycd3.String() #self.addParameter("soil_type", self.soil_type) self.current_Volume = 0.0
def __init__(self): pycd3.Node.__init__(self) self.black_w = pycd3.Flow() self.grey_w = pycd3.Flow() self.pot_w = pycd3.Flow() self.nonpot_w = pycd3.Flow() self.outdoor_use = pycd3.Flow() #dir (self.inf) print "init node" self.addOutPort("black_w", self.black_w) self.addOutPort("grey_w", self.grey_w) self.addOutPort("pot_w", self.pot_w) self.addOutPort("nonpot_w", self.nonpot_w) self.addInPort("outdoor_use", self.outdoor_use) self.toilet = pycd3.Double(0.0000002257) self.addParameter("toilet [m³/s]", self.toilet) self.tab = pycd3.Double(0.000000243) self.addParameter("tab [m³/s]", self.tab) self.shower = pycd3.Double(0.0000004626) self.addParameter("shower [m³/s]", self.shower) self.washing_machine = pycd3.Double(0.0000008185) self.addParameter("washing_machine [m³/s]", self.washing_machine) self.dishwasher = pycd3.Double(0.0000000926) self.addParameter("dishwasher [m³/s]", self.dishwasher)
def __init__(self): pycd3.Node.__init__(self) self.rain = pycd3.Flow() self.runoff = pycd3.Flow() self.inflow = pycd3.Flow() #dir (self.inf) print "init node" self.addInPort("rain", self.rain) self.addInPort("inflow", self.inflow) self.addOutPort("runoff", self.runoff) #Catchment area + fraction info of pervious and impervious parts self.area_width = pycd3.Double(10) self.addParameter("area_width [m]", self.area_width) self.area_length = pycd3.Double(100) self.addParameter("area_length [m]", self.area_length) self.perv_area = pycd3.Double(0.4) self.addParameter("perv_area [-]", self.perv_area) self.imp_area_stormwater = pycd3.Double(0.4) self.addParameter("imp_area_stormwater [-]", self.imp_area_stormwater) self.imp_area_raintank = pycd3.Double(1) self.addParameter("imp_area_raintank [-]", self.imp_area_raintank) #number of subareas for flowconcentration self.amount_subareas = pycd3.Double(1) self.addParameter("amount_subareas [-]", self.amount_subareas) #Muskingum parameters K flowtime for entire catchment self.muskingum_veloc = pycd3.Double(0.4) self.addParameter("muskingum_vel [m/s]", self.muskingum_veloc) self.muskingum_X = pycd3.Double(0.07) self.addParameter("muskingum_X [-]", self.muskingum_X)
def __init__(self): # print "init start hh" pycd3.Node.__init__(self) self.inport = pycd3.Flow() self.outport = pycd3.Flow() self.currentOutdoorDemand = pycd3.Flow() self.average = pycd3.Double(7) self.deviation = pycd3.Double(2) self.tap_flow_rate = pycd3.Double(18) self.smart_watering_time = pycd3.String("[18,6]") self.watering_method = pycd3.String('Smart_Watering') self.addInPort("Outdoor_Demand_In", self.inport) self.addOutPort("Outdoor_Demand_Out", self.outport) self.addOutPort("Check_Storage", self.currentOutdoorDemand) self.addParameter( "Watering_Method_(Normal_Watering_or_Smart_Watering)", self.watering_method) self.addParameter("Smart_Watering_Start_Time_End_Time_[hh,hh]", self.smart_watering_time) self.addParameter("Maximal_Watering_Flow_Rate_[l/min]", self.tap_flow_rate) self.addParameter("Average_Watering_Frequency_[d]", self.average) self.addParameter("Deviation_of_Frequency_[d]", self.deviation) '''
def __init__(self): pycd3.Node.__init__(self) self.inport = pycd3.Flow() self.discharged_V = pycd3.Flow() #dir (self.inf) # print "init node" self.addInPort("Runoff", self.inport) self.addOutPort("Discharged_Volume", self.discharged_V)
def __init__(self): pycd3.Node.__init__(self) self.black_w = pycd3.Flow() self.discharged_V = pycd3.Flow() #dir (self.inf) # print "init node" self.addInPort("Blackwater", self.black_w) self.addOutPort("Discharged_Volume", self.discharged_V)
def __init__(self): pycd3.Node.__init__(self) self.black_w = pycd3.Flow() self.discharged_V = pycd3.Flow() #dir (self.inf) print "init node" self.addInPort("black_w", self.black_w) self.addOutPort("discharged_V", self.discharged_V) self.current_V=0.0
def __init__(self): pycd3.Node.__init__(self) self.pot_w = pycd3.Flow() self.nonpot_w = pycd3.Flow() self.demand = pycd3.Flow() #dir (self.inf) # print "init node" self.addInPort("Potable_Water_Demand", self.pot_w) self.addInPort("Non_Potable_Water_Demand", self.nonpot_w) self.addOutPort("Demand", self.demand)
def __init__(self): pycd3.Node.__init__(self) self.rain_w_overflow = pycd3.Flow() self.runoff = pycd3.Flow() self.discharged_V = pycd3.Flow() #dir (self.inf) print "init node" self.addInPort("overflow", self.rain_w_overflow) self.addInPort("runoff", self.runoff) self.addOutPort("discharged_V", self.discharged_V) self.current_V = 0.0
def __init__(self): pycd3.Node.__init__(self) self.Flow1 = pycd3.Flow() self.Flow1 = pycd3.Flow() self.Flow1 = pycd3.Flow() # Inport and Outports print "init node" self.addOutPort("out", self.out)
def __init__(self): pycd3.Node.__init__(self) self.pot_w = pycd3.Flow() self.nonpot_w = pycd3.Flow() self.demand = pycd3.Flow() #dir (self.inf) print "init node" self.addInPort("pot_w", self.pot_w) self.addInPort("nonpot_w", self.nonpot_w) self.addOutPort("demand", self.demand) self.current_V = 0.0
def __init__(self): pycd3.Node.__init__(self) self.input = pycd3.Flow() self.output = pycd3.Flow() # print "init node" self.addInPort("Inport", self.input) self.addOutPort("Outport", self.output) self.zenith = pycd3.Double(13) self.addParameter("Sun_Zenith_[0-23h]", self.zenith) self.sundown = pycd3.Double(20.5) self.addParameter("Sundown_[0-23h]", self.sundown)
def __init__(self): pycd3.Node.__init__(self) self.inflow = pycd3.Flow() self.Infiltration = pycd3.Flow() # self.Watering = pycd3.Flow() self.porepressure = pycd3.Flow() self.storagecheck = pycd3.Flow() self.evapotranspiration = pycd3.Flow() self.outdoordemand = pycd3.Flow() self.outdoordemand_check = pycd3.Flow() self.actualevapo = pycd3.Flow() self.exfiltration = pycd3.Flow() self.addInPort("Evapotranspiration", self.evapotranspiration) self.addOutPort("Actual_Evapotranspiration", self.actualevapo) self.addOutPort("Outdoordemand", self.outdoordemand) self.addOutPort("Outdoordemand_Check", self.outdoordemand_check) self.addInPort("Infiltration", self.Infiltration) # self.addInPort("Garden_Watering", self.Watering) self.addInPort("Underground_Inflow", self.inflow) self.addOutPort("Check_Pore_Pressure", self.porepressure) self.addOutPort("Soilstorage_Check", self.storagecheck) self.addOutPort("Exfiltration", self.exfiltration) self.total_area = pycd3.Double(1000) self.addParameter("Total_Area_[m^2]", self.total_area) self.total_perv_area = pycd3.Double(40.0) self.addParameter("Total_Pervious_Area_[m^2]", self.total_perv_area) self.soildepth = pycd3.Double(1) self.addParameter("Depth_Of_Soil_[m]", self.soildepth) self.Residualwatercontent = pycd3.Double(0.01) self.addParameter("Residual_Water_Content_[-]", self.Residualwatercontent) self.Saturationwatercontent = pycd3.Double(0.4) self.addParameter("Saturation_Water_Content_[-]", self.Saturationwatercontent) self.alpha = pycd3.Double(0.08) self.addParameter("Van_Genuchten_Parameter_Alpha_[cm^-1]", self.alpha) self.n = pycd3.Double(1.3) self.addParameter("Van_Genuchten_Parameter_n_[-]", self.n) self.initialwatercontent = pycd3.Double(0.25) self.addParameter("Initial_Water_Content_[-]", self.initialwatercontent) self.seepagerate = pycd3.Double(0.22) self.addParameter( "Hydraulic_Conductivity_(Saturated_Conditions)_[m/d]", self.seepagerate) self.fieldcapacitiy = pycd3.Double(-100.0) self.addParameter("Field_Capacity_[cm_Water_Column]", self.fieldcapacitiy) #factor for calibrating outdoordemand self.outdoor_demand_coefficient = pycd3.Double(0.8) self.addParameter( "Outdoor_Demand_Actual_Evapotranspiration_Ratio_(OutD/ActualEvapotr)_[-]", self.outdoor_demand_coefficient)
def __init__(self): pycd3.Node.__init__(self) self.input = pycd3.Flow() self.output = pycd3.Flow() # print "init node" self.addInPort("Inport", self.input) self.addOutPort("Outport", self.output) ##Potenzielle Evapotranspiration berechnen oder eingeben, kommunikation mit Soilstorage self.zenith = pycd3.Double(13) self.addParameter("Sun_Zenith_[0-23h]", self.zenith) self.sundown = pycd3.Double(20.5) self.addParameter("Sundown_[0-23h]", self.sundown)
def __init__(self): pycd3.Node.__init__(self) self.flow = pycd3.Flow() self.addInPort('in', self.flow) self.addOutPort('out', self.flow) self.x = 10 self.addParameters()
def __init__(self): pycd3.Node.__init__(self) f = pycd3.Flow() pycd3.test_flow(f) #self.addInPort("in", f) # fout = pycd3.Flow() #self.addOutPort("out", f) print "ende __init__"
def __init__(self): pycd3.Node.__init__(self) self.collected_w = pycd3.Flow() self.non_pot_in = pycd3.Flow() self.non_pot_out = pycd3.Flow() self.overflow = pycd3.Flow() self.check_storage = pycd3.Flow() #dir (self.inf) print "init node" self.addInPort("collected_w", self.collected_w) self.addInPort("non_pot_in", self.non_pot_in) self.addOutPort("overflow", self.overflow) self.addOutPort("non_pot_out", self.non_pot_out) self.addOutPort("check_storage", self.check_storage) self.storage_v = pycd3.Double(20.0) self.addParameter("storage_v", self.storage_v) self.current_volume = 0.0
def __init__(self): pycd3.Node.__init__(self) self.collected_w = pycd3.Flow() self.non_pot_in = pycd3.Flow() self.Additional_Demand = pycd3.Flow() self.overflow = pycd3.Flow() self.check_storage = pycd3.Flow() #dir (self.inf) # print "init node" self.addInPort("Collected_Water", self.collected_w) self.addInPort("Non_Potable_Demand", self.non_pot_in) self.addOutPort("Overflow", self.overflow) self.addOutPort("Additional_Demand", self.Additional_Demand) self.addOutPort("Current_Volume", self.check_storage) self.storage_v = pycd3.Double(20.0) self.addParameter("Storage_Volume_[m^3]", self.storage_v) self.current_volume = 0.0 self.rest = 0.0 self.rest2 = 0.0
def __init__(self): pycd3.Node.__init__(self) self.rain = pycd3.Flow() self.collected_w = pycd3.Flow() self.runoff_w = pycd3.Flow() self.groundw_in = pycd3.Flow() #dir (self.inf) print "init node" self.addInPort("rain", self.rain) self.addOutPort("col_w", self.collected_w) self.addOutPort("runoff", self.runoff_w) self.addOutPort("groundw_in", self.groundw_in) self.perv_area = pycd3.Double(0.4) self.addParameter("perv_area", self.perv_area) self.imp_floor = pycd3.Double(0.4) self.addParameter("imp_floor", self.imp_floor) self.roof_area = pycd3.Double(0.2) self.addParameter("roof_area", self.roof_area) self.area_property = pycd3.Double(1) self.addParameter("area_property", self.area_property)
def __init__(self): pycd3.Node.__init__(self) self.inflow = pycd3.String("") self.out = pycd3.Flow() # print "init node" self.addParameter("", self.inflow) self.addOutPort("Outport", self.out) self.growing_t = 0.0 self.row_to_get = 0 self.interp_counter = 0 self.remember_line = 0.0 self.decimals = 0.0 self.rest = 0.0 self.sum_decimals = 0.0
def __init__(self): pycd3.Node.__init__(self) self.inflow = pycd3.String("") self.decision = pycd3.String("H") self.out = pycd3.Flow() # print "init node" self.addParameter("", self.inflow) self.addParameter("Type_H_for_height_[mm]_or_F_for_flow_[l/h]", self.decision) self.addOutPort("Outport", self.out) self.growing_t = 0.0 self.row_to_get = 0 self.interp_counter = 0 self.remember_line = 0.0 self.decimals = 0.0 self.rest = 0.0 self.sum_decimals = 0.0
def __init__(self): pycd3.Node.__init__(self) self.stormwaterin = pycd3.Flow() self.stormwaterout = pycd3.Flow() self.check_storage = pycd3.Flow() self.Additional_Demand = pycd3.Flow() self.wastewater = pycd3.Flow() self.overflow = pycd3.Flow() #dir (self.inf) # print "init node" self.addInPort("Stormwater_In", self.stormwaterin) self.addInPort("Stormwater_Out", self.stormwaterout) self.addOutPort("Current_Volume", self.check_storage) self.addOutPort("Additional_Demand", self.Additional_Demand) self.addOutPort("Wastewater", self.wastewater) self.addOutPort("Overflow", self.overflow) self.myyield = pycd3.Double(0.9) self.addParameter("Yield_of_Treatment [-]", self.myyield) self.storage_volume = pycd3.Double(100) self.addParameter("Storage_Volume_[m^3]", self.storage_volume) self.current_volume = 0.0 self.rest = 0.0 self.rest2 = 0.0
def __init__(self): pycd3.Node.__init__(self) self.rain = pycd3.Flow() self.collected_w = pycd3.Flow() self.runoff = pycd3.Flow() self.perv_runoff = pycd3.Flow() self.imperv_runoff = pycd3.Flow() self.evapo = pycd3.Flow() self.possible_infiltr = pycd3.Flow() self.actual_infiltr = pycd3.Flow() self.outdoor_use = pycd3.Flow() self.inflow = pycd3.Flow() self.outdoor_use_check = pycd3.Flow() self.effective_evapotranspiration = pycd3.Flow() self.previous_storage = pycd3.Flow() self.groundwater_infiltration = pycd3.Flow() # self.total_effective_rain / 1000. * self.area_property, # self.total_actual_infiltr + self.total_collected_w + self.total_runoff, # "infiltration:", self.total_actual_infiltr, # "collected:", self.total_collected_w, # "outdoor:", self.total_outdoor_use, # "runoff:", self.total_runoff, # "storage:", self.current_perv_storage_level / self.perv_soil_storage_capacity, # "evapo:", self.total_evapotranspiration, # "groundwater:", self.total_groundwater #dir (self.inf) # print "init node" self.addInPort("Rain", self.rain) self.addInPort("Evapotranspiration", self.evapo) self.addInPort("Inflow", self.inflow) self.addOutPort("Possible_Infiltration", self.possible_infiltr) self.addOutPort("Actual_Infiltration", self.actual_infiltr) self.addOutPort("Runoff", self.runoff) self.addOutPort("Collected_Water", self.collected_w) self.addOutPort("Outdoor_Demand", self.outdoor_use) self.addOutPort("Outdoor_Demand_Check", self.outdoor_use_check) self.addOutPort("effective_evapotranspiration", self.effective_evapotranspiration) self.addOutPort("previous_storage", self.previous_storage) self.addOutPort("groundwater_infiltration", self.groundwater_infiltration) self.addOutPort("pervious_runoff", self.perv_runoff) self.addOutPort("impervious_runoff", self.imperv_runoff) #Catchment with Routing or without self.select_model = pycd3.String("without") self.addParameter("Catchment_with_or_without_Routing_(with_or_without)", self.select_model) #Catchment area + fraction info of pervious and impervious parts self.area_property = pycd3.Double(1000) self.addParameter("Catchment_Area_[m^2]", self.area_property) self.perv_area = pycd3.Double(0.4) self.addParameter("Fraktion_of_Pervious_Area_pA_[-]", self.perv_area) self.imp_area_stormwater = pycd3.Double(0.4) self.addParameter("Fraktion_of_Impervious_Area_to_Stormwater_Drain_iASD_[-]", self.imp_area_stormwater) self.imp_area_raintank = pycd3.Double(0.2) self.addParameter("Fraktion_of_Impervious_Area_to_Reservoir_iAR_[-]", self.imp_area_raintank) # https://help.innovyze.com/display/xps/Infiltration #default values for gras (Wikipedia) self.Horton_initial_cap = pycd3.Double(0.09) self.addParameter("Initial_Infiltration_Capacity_[m/h]", self.Horton_initial_cap) self.Horton_final_cap = pycd3.Double(0.001) self.addParameter("Final_Infiltration_Capacity_[m/h]", self.Horton_final_cap) self.Horton_decay_constant = pycd3.Double(0.06) self.addParameter("Decay_Constant_[1/min]", self.Horton_decay_constant) # Storage in m self.perv_soil_storage_capacity = pycd3.Double(0.030) self.addParameter("Soil Storage Capacity in m", self.perv_soil_storage_capacity) self.daily_recharge_rate = pycd3.Double(0.25) # in % self.addParameter("Daily Recharge Rate", self.daily_recharge_rate) # E-Water https://wiki.ewater.org.au/display/MD6/Appendix+A%3A+Rainfall-Runoff+Modelling self.transpiration_capacity = pycd3.Double(0.007) self.addParameter("Transpire Capacity", self.transpiration_capacity) #default values for suburbs (scrip Prof. Krebs) self.depression_loss = pycd3.Double(0.0015) self.addParameter("Depression_Loss_[m]", self.depression_loss) #default values for (scrip Prof. Krebs) self.initial_loss = pycd3.Double(0.004) self.addParameter("Wetting_Loss_[m]", self.initial_loss) #number of subareas for flowconcentration self.amount_subareas = pycd3.Double(1) self.addParameter("Number_of_Subareas_[-]", self.amount_subareas) #factor for calibrating outdoordemand self.outdoor_demand_coefficient = pycd3.Double(0.5) self.addParameter("Outdoor_Demand_Weighing_Factor_[-]", self.outdoor_demand_coefficient) #Muskingum parameters K flowtime for entire catchment #divided by surface Area self.rain_runtime_coll = pycd3.Double(400) self.addParameter("Runoff_Runtime_iAR_[s]", self.rain_runtime_coll) self.muskingum_coll_X = pycd3.Double(0.04) self.addParameter("Weighting_Coefficient_iAR_[-]", self.muskingum_coll_X) self.rain_runtime_runoff = pycd3.Double(500) self.addParameter("Runoff_Runtime_iASD_[s]", self.rain_runtime_runoff) self.muskingum_runoff_X = pycd3.Double(0.05) self.addParameter("Weighting_Coefficient_iASD_[-]", self.muskingum_runoff_X) self.rain_runtime_runoff_perv = pycd3.Double(700) self.addParameter("Runoff_Runtime_pA_[s]", self.rain_runtime_runoff_perv) self.muskingum_runoff_perv_X = pycd3.Double(0.06) self.addParameter("Weighting_Coefficient_pA_[-]", self.muskingum_runoff_perv_X) #storage and time values self.current_effective_rain_height = 0.0 self.rain_storage_imp = 0.0 self.continuous_rain_time = 0.0 self.continuous_rain_time_2 = 0.0 self.rain_storage_perv = 0.0 self.rain_storage_imp_before = 0.0 #variable to check Horten model (has got to be 1 for a real simulation) self.k=1 #storage for Muskingum inflows self.collected_w_raw = 0.0 self.runoff_raw = 0.0 self.runoff_perv_raw=0.0
def __init__(self): pycd3.Node.__init__(self) self.outflow = pycd3.Flow() self.numberof_in_ports = pycd3.Integer(2) self.addParameter("Number_of_Inports", self.numberof_in_ports)
def __init__(self): # print "init start hh" pycd3.Node.__init__(self) self.black_w = pycd3.Flow() self.grey_w = pycd3.Flow() self.pot_w = pycd3.Flow() self.nonpot_w = pycd3.Flow() self.outdoor_demand = pycd3.Flow() self.bath_tub = pycd3.Flow() self.shower = pycd3.Flow() self.toilet = pycd3.Flow() self.kitchen_tap = pycd3.Flow() self.handbasin_tap = pycd3.Flow() self.washing_machine = pycd3.Flow() self.dishwasher = pycd3.Flow() self.evapcooler = pycd3.Flow() #self.decision = pycd3.String("") self.addOutPort("Blackwater", self.black_w) self.addOutPort("Greywater", self.grey_w) self.addOutPort("Potable_Demand", self.pot_w) self.addOutPort("Non_Potable_Demand", self.nonpot_w) self.addInPort("Outdoor_Demand", self.outdoor_demand) self.addInPort("Bathtub", self.bath_tub) self.addInPort("Shower", self.shower) self.addInPort("Toilet", self.toilet) self.addInPort("Kitchen_Tap", self.kitchen_tap) self.addInPort("Handbasin_Tap", self.handbasin_tap) self.addInPort("Washing_Machine", self.washing_machine) self.addInPort("Dishwasher", self.dishwasher) self.addInPort("Evapcooler", self.evapcooler)
def __init__(self): pycd3.Node.__init__(self) self.inflow = pycd3.Flow() self.numberof_out_ports = pycd3.Integer(2) self.addParameter("Number_of_Outports", self.numberof_out_ports)
def __init__(self): pycd3.Node.__init__(self) # in flows self.rain = pycd3.Flow() self.evapo = pycd3.Flow() self.irrigation = pycd3.Flow() # out flows self.roof_runoff = pycd3.Flow() self.impervious_runoff = pycd3.Flow() self.pervious_runoff = pycd3.Flow() self.saturation_runoff = pycd3.Flow() self.actual_infiltration = pycd3.Flow() self.groundwater_infiltration = pycd3.Flow() self.pervious_evapotranspiration = pycd3.Flow() self.impervious_evapotranspiration = pycd3.Flow() self.irrigation_required = pycd3.Flow() self.poss_infiltration = pycd3.Flow() self.pervious_level = pycd3.Flow() self.Perv_Rainstorage = pycd3.Flow() self.soil_moisture = pycd3.Flow() # in ports self.addInPort("Rain", self.rain) self.addInPort("Evapotranspiration", self.evapo) self.addInPort("irrigation", self.irrigation) # out ports self.addOutPort("roof_runoff", self.roof_runoff) self.addOutPort("impervious_runoff", self.impervious_runoff) self.addOutPort( "pervious_runoff", self.pervious_runoff ) #infiltration excess and saturation runoff combined into one outport #self.addOutPort("saturation_runoff", self.saturation_runoff) self.addOutPort('possible_infiltration', self.poss_infiltration) self.addOutPort("actual_infiltration", self.actual_infiltration) self.addOutPort("groundwater_infiltration", self.groundwater_infiltration) self.addOutPort("pervious_evapotranspiration", self.pervious_evapotranspiration) self.addOutPort('impervious_evapotranspiration', self.impervious_evapotranspiration) self.addOutPort( "outdoor_demand", self.irrigation_required) # not sure about this one just yet self.addOutPort('pervious_storage', self.pervious_level) self.addOutPort('Perv_Rainstorage', self.Perv_Rainstorage) self.addOutPort('soil_moisture', self.soil_moisture) # parameters to be set by dynamind self.area_property = pycd3.Double(1000) self.addParameter("Catchment_Area_[m^2]", self.area_property) self.perv_area = pycd3.Double(0.4) self.addParameter("Fraktion_of_Pervious_Area_pA_[-]", self.perv_area) self.imp_area_stormwater = pycd3.Double(0.4) self.addParameter( "Fraktion_of_Impervious_Area_to_Stormwater_Drain_iASD_[-]", self.imp_area_stormwater) self.imp_area_raintank = pycd3.Double(0.2) self.addParameter("Fraktion_of_Impervious_Area_to_Reservoir_iAR_[-]", self.imp_area_raintank) self.Horton_initial_cap = pycd3.Double(0.09) self.addParameter("Initial_Infiltration_Capacity_[m/h]", self.Horton_initial_cap) self.Horton_final_cap = pycd3.Double(0.001) self.addParameter("Final_Infiltration_Capacity_[m/h]", self.Horton_final_cap) self.Horton_decay_constant = pycd3.Double(0.06) self.addParameter("Decay_Constant_[1/min]", self.Horton_decay_constant) self.perv_soil_storage_capacity = pycd3.Double(0.030) self.addParameter("Soil Storage Capacity [m]", self.perv_soil_storage_capacity) self.daily_recharge_rate = pycd3.Double(0.25) # in % self.addParameter("Daily Recharge Rate", self.daily_recharge_rate) self.transpiration_capacity = pycd3.Double(0.007) self.addParameter("Transpire Capacity", self.transpiration_capacity) self.initial_loss = pycd3.Double(0.004) self.addParameter("Wetting_Loss_[m]", self.initial_loss) # new parameters to be set by dynamind self.initial_perv_storage_level = pycd3.Double(0.3) self.addParameter("Initial_Pervious_Storage_Level_[m]", self.initial_perv_storage_level) self.wilting_point = pycd3.Double(0.09) self.addParameter("Wilting_Point_[%]", self.wilting_point) self.field_capacity = pycd3.Double(0.22) self.addParameter("Field_Capacity_[%]", self.field_capacity) self.saturation = pycd3.Double(0.4) self.addParameter("Saturation_[%]", self.saturation) # this allows automatic watering of the system to a particular level specified in the code self.automatic_irrigation = False
def _create_const_flow(self, value: float) -> cd3.Flow: f = cd3.Flow() f[0] = value return f