xixihaha1995 / urban_climate_and_who

0 stars 0 forks source link

Annual simulation #19

Closed xixihaha1995 closed 1 year ago

xixihaha1995 commented 2 years ago
VCWG: Progress [%] 26.47
VCWG: Progress [%] 26.47
Exception in thread Thread-1 (run_vcwg):
Traceback (most recent call last):
  File "C:\ProgramData\Miniconda3\envs\urban_climate_and_who\lib\threading.py", line 1009, in _bootstrap_inner
    self.run()
  File "C:\ProgramData\Miniconda3\envs\urban_climate_and_who\lib\threading.py", line 946, in run
    self._target(*self._args, **self._kwargs)
  File "C:\Users\wulic\Documents\GitHub\urban_climate_and_who\_1_Main_Run_EP22_VCWG2.py", line 52, in run_vcwg
    VCWG.run()
  File "C:\Users\wulic\Documents\GitHub\urban_climate_and_who\_1_ep_vcwg\VCWG_Hydrology.py", line 783, in run
    self.Simulate()
  File "C:\Users\wulic\Documents\GitHub\urban_climate_and_who\_1_ep_vcwg\VCWG_Hydrology.py", line 619, in Simulate
    self.BEM[i].building.BEMCalc(canTemp,canHum,self.BEM[i],MeteoData,ParCalculation,self.simTime,self.Geometry_m,
  File "C:\Users\wulic\Documents\GitHub\urban_climate_and_who\_1_ep_vcwg\BuildingEnergy.py", line 484, in BEMCalc
    _Tdb, _w, _phi, _h, _Tdp, _v = psychrometrics(self.indoorTemp, self.indoorHum, MeteoData.Pre)
  File "C:\Users\wulic\Documents\GitHub\urban_climate_and_who\_1_ep_vcwg\psychrometrics.py", line 71, in psychrometrics
    alpha = log(_pw)
ValueError: math domain error
original oat C :31.73832663515941, set to 31.837335701484108
original orh ratio :0.011792823112476704, set to 0.011607076032291289
Handler ver1.1, 07 21 11 05 00, sensWaste (Currently only HVAC Rejection):475.0937106984626 watts/ unit footprint area
Exception in thread Thread-2 (run_vcwg):
Traceback (most recent call last):
  File "C:\ProgramData\Miniconda3\envs\urban_climate_and_who\lib\threading.py", line 1009, in _bootstrap_inner
    self.run()
  File "C:\ProgramData\Miniconda3\envs\urban_climate_and_who\lib\threading.py", line 946, in run
    self._target(*self._args, **self._kwargs)
  File "C:\Users\wulic\Documents\GitHub\urban_climate_and_who\_1_ep_vcwg\_1_ep_time_step_handlers.py", line 56, in run_vcwg
    VCWG.run()
  File "C:\Users\wulic\Documents\GitHub\urban_climate_and_who\_1_ep_vcwg\VCWG_Hydrology.py", line 787, in run
    self.Simulate()
  File "C:\Users\wulic\Documents\GitHub\urban_climate_and_who\_1_ep_vcwg\VCWG_Hydrology.py", line 518, in Simulate
    self.EBRural.EBSolver_Rural(MeteoData,self.RSMParam,self.Rural.Text,SunPosition,self.simTime,ParCalculation,self.RSM,self.ParThermalGround)
  File "C:\Users\wulic\Documents\GitHub\urban_climate_and_who\_1_ep_vcwg\EB_Rural.py", line 158, in EBSolver_Rural
    lat = self.Penman_Monteith(MeteoData.Tatm-273.15,MeteoData.Pre,SWR_Rural.SWRabsRural,LWR_Rural.LWRabsRural,
  File "C:\Users\wulic\Documents\GitHub\urban_climate_and_who\_1_ep_vcwg\EB_Rural.py", line 278, in Penman_Monteith
    Td = psychrometrics(T+273.15,q_atm,Pre)[0]
  File "C:\Users\wulic\Documents\GitHub\urban_climate_and_who\_1_ep_vcwg\psychrometrics.py", line 71, in psychrometrics
    alpha = log(_pw)
ValueError: math domain error

How to save results in case error happens?

  1. timeout
  2. thread.daemon = True
def ep():
  global counter, called_vcwg_bool
  while True:
    if not sem0.acquire(timeout= 5):
      print("EP says: too long to wait!")
      sys.exit()
    if not called_vcwg_bool:
      print("EP says: calling vcwg")
      vcwg_thread = threading.Thread(target = vcwg)
      vcwg_thread.daemon = True
      vcwg_thread.start()
      called_vcwg_bool = True
    counter += 4
    print(f'EP counts: {counter}')
    sem1.release()
xixihaha1995 commented 2 years ago