Skip to content

Commit

Permalink
Removed old code
Browse files Browse the repository at this point in the history
  • Loading branch information
Mahaki Leach committed Dec 2, 2024
1 parent 319e95c commit b5def51
Showing 1 changed file with 3 additions and 19 deletions.
22 changes: 3 additions & 19 deletions property_packages/modular/builder/common_parsers.py
Original file line number Diff line number Diff line change
Expand Up @@ -241,34 +241,18 @@ class state_bounds_parser(BuildBase):
"""
@staticmethod
def serialise(compounds: List[Compound], valid_states: List[States]) -> Dict[str, Any]:

# maximum = min([compound["IdealGasHeatCapacityCp"]["Tmax"] for compound in compounds])
# minimum = max([compound["IdealGasHeatCapacityCp"]["Tmin"] for compound in compounds])

# ub_minimum = min([compound["VaporPressure"]["Tmax"] for compound in compounds])
# ub_maximum = max([compound["VaporPressure"]["Tmax"] for compound in compounds])

# lb_minimum = min([compound["LiquidDensity"]["Tmin"] for compound in compounds])
# lb_maximum = max([compound["LiquidDensity"]["Tmin"] for compound in compounds])

# #raise Exception(f"Min {minimum} Max {maximum}")

# return {
# "flow_mol": (0, 100, 1000, pyunits.mol / pyunits.s),
# "temperature": (minimum, (minimum+maximum)/2, maximum, pyunits.K),
# "pressure": (5e4, 1e5, 1e6, pyunits.Pa),
# }

min_melting_point = min([compound["NormalMeltingPointTemperature"].value for compound in compounds])
min_critical_temperature = min([compound["CriticalTemperature"].value for compound in compounds])

if(min_critical_temperature > 500):
# TODO: Refactor this logic, need a more versatile approach
if (min_critical_temperature > 500):
return {
"flow_mol": (0, 100, 1000, pyunits.mol / pyunits.s),
"temperature": (min_melting_point, 300, 500, pyunits.K),
"pressure": (5e4, 1e5, 1e6, pyunits.Pa),
}
elif(min_critical_temperature > 300):
elif (min_critical_temperature > 300):
return {
"flow_mol": (0, 100, 1000, pyunits.mol / pyunits.s),
"temperature": (min_melting_point, 200, 400, pyunits.K),
Expand Down

0 comments on commit b5def51

Please sign in to comment.