QSD-Group / QSDsan

Quantitative Sustainable Design (QSD) of sanitation and resource recovery systems.
https://qsdsan.com
Other
30 stars 14 forks source link

Questions about OilHeatExchanger/HydronicHeatExchanger #60

Closed yalinli2 closed 2 years ago

yalinli2 commented 2 years ago

Based on the description, the OilHeatExchanger should something to burn to generate the heat, the stream is currently not included in the unit.

yalinli2 commented 2 years ago

Are power_delivery_orc and pipe_heat_loss used anywhere? https://github.com/QSD-Group/QSDsan/blob/e9fdbf1e6ed25685ce31093f5a58eced6c5eabc7/qsdsan/sanunits/_oil_heat_exchanger.py#L94

Similarly, heat_output_water and heat_loss_water_pipe? https://github.com/QSD-Group/QSDsan/blob/e9fdbf1e6ed25685ce31093f5a58eced6c5eabc7/qsdsan/sanunits/_hydronic_heat_exchanger.py#L100

yalinli2 commented 2 years ago

How come there's 4/200 of an HX and 2.834/2.7 of a pump? https://github.com/QSD-Group/QSDsan/blob/e9fdbf1e6ed25685ce31093f5a58eced6c5eabc7/qsdsan/sanunits/_oil_heat_exchanger.py#L103 https://github.com/QSD-Group/QSDsan/blob/e9fdbf1e6ed25685ce31093f5a58eced6c5eabc7/qsdsan/sanunits/_oil_heat_exchanger.py#L104

Similarly for Pump here: https://github.com/QSD-Group/QSDsan/blob/e9fdbf1e6ed25685ce31093f5a58eced6c5eabc7/qsdsan/sanunits/_hydronic_heat_exchanger.py#L114

If adjusting cost based on flow rate, the cost decorator should be used

yalinli2 commented 2 years ago

The _run method of HydronicHeatExchanger does not include simulation of streams (and OilHeatExchanger does not set the phase of hot_gas_in), if effluents and influents are the same (or have the same mass flow), then something like hot_gas_out.copy_like(hot_gas_in) should be included

yalinli2 commented 2 years ago

For DryerFromHHX (as well as OilHeatExchanger and HydronicHeaExchanger)

lsrowles commented 2 years ago

Based on the description, the OilHeatExchanger should something to burn to generate the heat, the stream is currently not included in the unit.

The OHX leverages heat produced in the carbonizer base. It does not generate the heat.

lsrowles commented 2 years ago

Are power_delivery_orc and pipe_heat_loss used anywhere?

https://github.com/QSD-Group/QSDsan/blob/e9fdbf1e6ed25685ce31093f5a58eced6c5eabc7/qsdsan/sanunits/_oil_heat_exchanger.py#L94

Similarly, heat_output_water and heat_loss_water_pipe?

https://github.com/QSD-Group/QSDsan/blob/e9fdbf1e6ed25685ce31093f5a58eced6c5eabc7/qsdsan/sanunits/_hydronic_heat_exchanger.py#L100

You are correct that these values are not used. These calculations are intended to be used for future research on the heat balance of the system and are not used in the current analysis.

lsrowles commented 2 years ago

The _run method of HydronicHeatExchanger does not include simulation of streams (and OilHeatExchanger does not set the phase of hot_gas_in), if effluents and influents are the same (or have the same mass flow), then something like hot_gas_out.copy_like(hot_gas_in) should be included

You are correct. Added on my end. Thanks!

lsrowles commented 2 years ago

How come there's 4/200 of an HX and 2.834/2.7 of a pump?

https://github.com/QSD-Group/QSDsan/blob/e9fdbf1e6ed25685ce31093f5a58eced6c5eabc7/qsdsan/sanunits/_oil_heat_exchanger.py#L103

https://github.com/QSD-Group/QSDsan/blob/e9fdbf1e6ed25685ce31093f5a58eced6c5eabc7/qsdsan/sanunits/_oil_heat_exchanger.py#L104

Similarly for Pump here:

https://github.com/QSD-Group/QSDsan/blob/e9fdbf1e6ed25685ce31093f5a58eced6c5eabc7/qsdsan/sanunits/_hydronic_heat_exchanger.py#L114

If adjusting cost based on flow rate, the cost decorator should be used

These assumptions were made to scale the size equipment based on availability of data for the LCA. Should a comment be added to example these assumptions?

lsrowles commented 2 years ago

Calculations pertaining to the heat balance were added to be leveraged for future research.

breakpoint() for moisture content was added as a check when code was under development and can be removed.

CO2/CH4 to C and NH4 to N were updated on my end. Thanks!

Carbon balance was done based on COD to be consistent between units. C calculations that are commented out can be removed here.

For DryerFromHHX (as well as OilHeatExchanger and HydronicHeaExchanger)

Calculations pertaining to the heat balance were added to be leveraged for future research.

breakpoint() for moisture content was added as a check when code was under development and can be removed.

CO2/CH4 to C and NH4 to N were updated on my end. Thanks!

Carbon balance was done based on COD to be consistent between units. C calculations that are commented out can be removed here.

yalinli2 commented 2 years ago

A note has been added in the documentation of this class to reflect this

The OHX leverages heat produced in the carbonizer base. It does not generate the heat.

yalinli2 commented 2 years ago

Left notes at these places (they are currently commented out to avoid unnecessary calculations)

You are correct that these values are not used. These calculations are intended to be used for future research on the heat balance of the system and are not used in the current analysis.

yalinli2 commented 2 years ago

Also updated in the units used in the gates branch

You are correct. Added on my end. Thanks!

yalinli2 commented 2 years ago

I've left notes on the documentation of these classes on this, on the gates branch

These assumptions were made to scale the size equipment based on availability of data for the LCA. Should a comment be added to example these assumptions?

yalinli2 commented 2 years ago

I added a Warnings section in the documentation of these classes to note people that energy balance is not performed (since this is typically expected for a heat exchanger).

For HHXdryer, I also let it issue a warning (during simulation) when the calculated heat_needed_to_dry_35 exceeds heat_supplied (and turns out it exceeds a lot of times), @lsrowles just want to make sure you are aware of this

Calculations pertaining to the heat balance were added to be leveraged for future research.

yalinli2 commented 2 years ago

I've removed this in the gates branch

breakpoint() for moisture content was added as a check when code was under development and can be removed.

yalinli2 commented 2 years ago

I changed the following line https://github.com/QSD-Group/QSDsan/blob/e9fdbf1e6ed25685ce31093f5a58eced6c5eabc7/qsdsan/sanunits/_dryer_from_hhx.py#L129

to (note the inclusion of methane) waste_out._COD = (waste_in.COD*waste_in.F_vol - (drying_CO2_to_air/44*12+drying_CH4_to_air/16*12) / self.carbon_COD_ratio)

And

https://github.com/QSD-Group/QSDsan/blob/e9fdbf1e6ed25685ce31093f5a58eced6c5eabc7/qsdsan/sanunits/_dryer_from_hhx.py#L134

to waste_out.imass['N'] -= drying_NH3_to_air / 17 * 14

With notes that 44/12/16/17/14 are molecular weights of CO2/C/CH4/NH3/N

@lsrowles let me know if this doesn't look correct to you, especially concerning the methane thing

CO2/CH4 to C and NH4 to N were updated on my end. Thanks!

yalinli2 commented 2 years ago

Sounds great, I think this also explains the question you had when we were discussing about this issue, I've removed these legacy comments in the gates branch

Carbon balance was done based on COD to be consistent between units. C calculations that are commented out can be removed here.

lsrowles commented 2 years ago

I added a Warnings section in the documentation of these classes to note people that energy balance is not performed (since this is typically expected for a heat exchanger).

For HHXdryer, I also let it issue a warning (during simulation) when the calculated heat_needed_to_dry_35 exceeds heat_supplied (and turns out it exceeds a lot of times), @lsrowles just want to make sure you are aware of this

Calculations pertaining to the heat balance were added to be leveraged for future research.

The calculations for heat_supplied are not accurate because the area_surface here is just an assumed valued. It is a hypothetical surface area. I added these calculations for future research on the system to leverage. Would you fix the reference in _dryer_from_hhx.tsv for area_surface to be assumed, please? Thanks!

yalinli2 commented 2 years ago

OK I've fixed it in de0ac1a686e5b2010e68f6e89b034c68694843d0!

Would you fix the reference in _dryer_from_hhx.tsv for area_surface to be assumed, please?

yalinli2 commented 2 years ago

There's a minor bug in the fixes below and it's been fixed in 39e447954981b5b75af80e9e04f6c6de75e9926d, all problems in this issue have been fixed

I changed the following line

https://github.com/QSD-Group/QSDsan/blob/e9fdbf1e6ed25685ce31093f5a58eced6c5eabc7/qsdsan/sanunits/_dryer_from_hhx.py#L129

to (note the inclusion of methane) waste_out._COD = (waste_in.COD*waste_in.F_vol - (drying_CO2_to_air/44*12+drying_CH4_to_air/16*12) / self.carbon_COD_ratio)

And

https://github.com/QSD-Group/QSDsan/blob/e9fdbf1e6ed25685ce31093f5a58eced6c5eabc7/qsdsan/sanunits/_dryer_from_hhx.py#L134

to waste_out.imass['N'] -= drying_NH3_to_air / 17 * 14

With notes that 44/12/16/17/14 are molecular weights of CO2/C/CH4/NH3/N

@lsrowles let me know if this doesn't look correct to you, especially concerning the methane thing

CO2/CH4 to C and NH4 to N were updated on my end. Thanks!