@@ -627,6 +627,8 @@ def to_dict(self, **kwargs):
627627 "liquid" : self .liquid ,
628628 "gas" : self .gas ,
629629 "discretize" : self .discretize ,
630+ "temperature" : self .temperature ,
631+ "pressure" : self .pressure ,
630632 }
631633 if kwargs .get ("include_outputs" , False ):
632634 data .update (
@@ -674,6 +676,8 @@ def __init__(
674676 liquid_mass_flow_rate_out ,
675677 gas_mass_flow_rate_out ,
676678 discretize = 100 ,
679+ temperature = None ,
680+ pressure = None ,
677681 ):
678682 """Initializes the MassFlowRateBasedTank class.
679683
@@ -733,8 +737,26 @@ def __init__(
733737 this parameter may be set to None. Otherwise, an uniform
734738 discretization will be applied based on the discretize value.
735739 The default is 100.
740+ temperature : int, float, callable, string, array, Function
741+ Temperature inside the tank as a function of time in K. If a callable
742+ is given, it must be a function of time in seconds. An array of points
743+ can also be given as a list or a string with the path to a .csv file
744+ with two columns, the first one being the time in seconds and the
745+ second one being the temperature in K. The default is None. This
746+ parameter is only required if fluid (``liquid`` or ``gas`` parameters)
747+ densities are functions of temperature.
748+ pressure : int, float, callable, string, array, Function
749+ Pressure inside the tank as a function of time in Pa. If a callable
750+ is given, it must be a function of time in seconds. An array of points
751+ can also be given as a list or a string with the path to a .csv file
752+ with two columns, the first one being the time in seconds and the
753+ second one being the pressure in Pa. The default is None. This
754+ parameter is only required if fluid (``liquid`` or ``gas`` parameters)
755+ densities are functions of pressure.
736756 """
737- super ().__init__ (name , geometry , flux_time , liquid , gas , discretize )
757+ super ().__init__ (
758+ name , geometry , flux_time , liquid , gas , discretize , temperature , pressure
759+ )
738760 self .initial_liquid_mass = initial_liquid_mass
739761 self .initial_gas_mass = initial_gas_mass
740762
@@ -1032,6 +1054,8 @@ def from_dict(cls, data):
10321054 liquid_mass_flow_rate_out = data ["liquid_mass_flow_rate_out" ],
10331055 gas_mass_flow_rate_out = data ["gas_mass_flow_rate_out" ],
10341056 discretize = data ["discretize" ],
1057+ temperature = data .get ("temperature" ),
1058+ pressure = data .get ("pressure" ),
10351059 )
10361060
10371061
@@ -1056,6 +1080,8 @@ def __init__(
10561080 gas ,
10571081 ullage ,
10581082 discretize = 100 ,
1083+ temperature = None ,
1084+ pressure = None ,
10591085 ):
10601086 """
10611087 Parameters
@@ -1089,8 +1115,26 @@ def __init__(
10891115 an uniform discretization will be applied based on the discretize
10901116 value.
10911117 The default is 100.
1118+ temperature : int, float, callable, string, array, Function
1119+ Temperature inside the tank as a function of time in K. If a callable
1120+ is given, it must be a function of time in seconds. An array of points
1121+ can also be given as a list or a string with the path to a .csv file
1122+ with two columns, the first one being the time in seconds and the
1123+ second one being the temperature in K. The default is None. This
1124+ parameter is only required if fluid (``liquid`` or ``gas`` parameters)
1125+ densities are functions of temperature.
1126+ pressure : int, float, callable, string, array, Function
1127+ Pressure inside the tank as a function of time in Pa. If a callable
1128+ is given, it must be a function of time in seconds. An array of points
1129+ can also be given as a list or a string with the path to a .csv file
1130+ with two columns, the first one being the time in seconds and the
1131+ second one being the pressure in Pa. The default is None. This
1132+ parameter is only required if fluid (``liquid`` or ``gas`` parameters)
1133+ densities are functions of pressure.
10921134 """
1093- super ().__init__ (name , geometry , flux_time , liquid , gas , discretize )
1135+ super ().__init__ (
1136+ name , geometry , flux_time , liquid , gas , discretize , temperature , pressure
1137+ )
10941138
10951139 # Define ullage
10961140 self .ullage = Function (ullage , "Time (s)" , "Volume (m³)" , "linear" )
@@ -1248,6 +1292,8 @@ def from_dict(cls, data):
12481292 gas = data ["gas" ],
12491293 ullage = data ["ullage" ],
12501294 discretize = data ["discretize" ],
1295+ temperature = data .get ("temperature" ),
1296+ pressure = data .get ("pressure" ),
12511297 )
12521298
12531299
@@ -1272,6 +1318,8 @@ def __init__(
12721318 gas ,
12731319 liquid_height ,
12741320 discretize = 100 ,
1321+ temperature = None ,
1322+ pressure = None ,
12751323 ):
12761324 """
12771325 Parameters
@@ -1305,8 +1353,26 @@ def __init__(
13051353 Otherwise, an uniform discretization will be applied based on the
13061354 discretize value.
13071355 The default is 100.
1356+ temperature : int, float, callable, string, array, Function
1357+ Temperature inside the tank as a function of time in K. If a callable
1358+ is given, it must be a function of time in seconds. An array of points
1359+ can also be given as a list or a string with the path to a .csv file
1360+ with two columns, the first one being the time in seconds and the
1361+ second one being the temperature in K. The default is None. This
1362+ parameter is only required if fluid (``liquid`` or ``gas`` parameters)
1363+ densities are functions of temperature.
1364+ pressure : int, float, callable, string, array, Function
1365+ Pressure inside the tank as a function of time in Pa. If a callable
1366+ is given, it must be a function of time in seconds. An array of points
1367+ can also be given as a list or a string with the path to a .csv file
1368+ with two columns, the first one being the time in seconds and the
1369+ second one being the pressure in Pa. The default is None. This
1370+ parameter is only required if fluid (``liquid`` or ``gas`` parameters)
1371+ densities are functions of pressure.
13081372 """
1309- super ().__init__ (name , geometry , flux_time , liquid , gas , discretize )
1373+ super ().__init__ (
1374+ name , geometry , flux_time , liquid , gas , discretize , temperature , pressure
1375+ )
13101376
13111377 # Define liquid level function
13121378 self .liquid_level = Function (liquid_height , "Time (s)" , "height (m)" , "linear" )
@@ -1478,6 +1544,8 @@ def from_dict(cls, data):
14781544 gas = data ["gas" ],
14791545 liquid_height = data ["liquid_height" ],
14801546 discretize = data ["discretize" ],
1547+ temperature = data .get ("temperature" ),
1548+ pressure = data .get ("pressure" ),
14811549 )
14821550
14831551
@@ -1501,6 +1569,8 @@ def __init__(
15011569 liquid_mass ,
15021570 gas_mass ,
15031571 discretize = 100 ,
1572+ temperature = None ,
1573+ pressure = None ,
15041574 ):
15051575 """
15061576 Parameters
@@ -1539,8 +1609,26 @@ def __init__(
15391609 may be set to None. Otherwise, an uniform discretization will be
15401610 applied based on the discretize value.
15411611 The default is 100.
1612+ temperature : int, float, callable, string, array, Function
1613+ Temperature inside the tank as a function of time in K. If a callable
1614+ is given, it must be a function of time in seconds. An array of points
1615+ can also be given as a list or a string with the path to a .csv file
1616+ with two columns, the first one being the time in seconds and the
1617+ second one being the temperature in K. The default is None. This
1618+ parameter is only required if fluid (``liquid`` or ``gas`` parameters)
1619+ densities are functions of temperature.
1620+ pressure : int, float, callable, string, array, Function
1621+ Pressure inside the tank as a function of time in Pa. If a callable
1622+ is given, it must be a function of time in seconds. An array of points
1623+ can also be given as a list or a string with the path to a .csv file
1624+ with two columns, the first one being the time in seconds and the
1625+ second one being the pressure in Pa. The default is None. This
1626+ parameter is only required if fluid (``liquid`` or ``gas`` parameters)
1627+ densities are functions of pressure.
15421628 """
1543- super ().__init__ (name , geometry , flux_time , liquid , gas , discretize )
1629+ super ().__init__ (
1630+ name , geometry , flux_time , liquid , gas , discretize , temperature , pressure
1631+ )
15441632
15451633 # Define fluid masses
15461634 self .liquid_mass = Function (liquid_mass , "Time (s)" , "Mass (kg)" , "linear" )
@@ -1745,4 +1833,6 @@ def from_dict(cls, data):
17451833 liquid_mass = data ["liquid_mass" ],
17461834 gas_mass = data ["gas_mass" ],
17471835 discretize = data ["discretize" ],
1836+ temperature = data .get ("temperature" ),
1837+ pressure = data .get ("pressure" ),
17481838 )
0 commit comments