Skip to content

Latest code

Hansley Narasiah requested to merge new-14_07_2023 into main
  1. modified solair/cost.py to be modularised (line 199-231 is meant to replace lines 234-335) and to output the cost components, then optimization.py was also modified accordingly (lines 92-137) to be able to receive this extended list of outputs. These two files were also modified to be able to print reference cost values, if required (Commented code left in place that allows this). As part of this change, full breakdown of costs can now be directly output and received in optimization.py
  2. in solair/cost.py, the variable tube.constants_t.n_sub_heat_exchangers was being used in the cost calculation. I've commented this bit out and included tube.constants_t.n_bundles instead as we are considering multiple bundles as per Ehsan (2018)  for a 25 MW plant which has a total number of tubes per bundle = 190, but no sub heat exchangers variable in the code for the simulation. Also, because tube.constants_t.n_bundles is also being used in the calculation of mass flow rates, etc. Also, Khatoon does not even mention the number of bundles which indicates he's somehow using 360 finned tubes for 10 MW while Ehsan is using 9310 finned tubes for 25MW - this seems very odd, so i'm thinking it might be just an accidental omission. I'm thinking that he might be using 10 bundles but didn't mention this as this would make it 3600 finned tubes which kind of makes more sense in terms of ratios: 25MW/10MW approx. = 9310/3600.
  3. in solair/utils.py, the value of the variable epsilon has been changed from 0.045 to 1.048e-5. I got this value from both Khatoon (2021) and Ehsan (2018): back-calculate the epsilon value using the reference value of z = 5.24e-4 from both papers and the inner tube diameter of 0.020m
  4. in solair/constants.py, the variable self.LCOE_fanpower_cents: value changed from 0.05 to 5 because in the lifetime costs calculation, the value is being divided by 100 in the calculate_fan_operation_cost function (line 213 in solair/cost.py). This means that in previous cost estimates, the fan operation costs were underestimated by a factor of 100.
  5. in solair/constants.py, the input variable t_air_out was changed to delta_t_air_out due to it being used to represent a change, rather than an absolute temperature (this follows from line 109)
  6. in solair/design.py, in the calculate_htc_a function, the calculation of the variable k_a, is changed from being fixed at a constant value of 0.025 W / (m K) to being variable by using the CoolProp PropSI function.
  7. in solair/design.py, in the calculate_htc_s function, the value of variable rho_pc is changed from being a constant 800 to being calculated by using the pseudo-critical point (t_pcp) using PropSI. I did this because there was no explicit formulae for the calculation of this variable which I assumed was because it could only be because it had to be straight forward and this was the only way to get something that made sense.
  8. in solair/design.py, in the calculate_cross_section_air function, I commented out the " * 2 " as this was doubling the cross section area of air. There was a comment left in the code to address this. Left my explanation and reasoning in comments in the code for future reference. (line 82-86)
  9. The reference value used for fin_thickness is changed from 7.5e-4 to 5e-4 because in Khatoon (2021) that was the value used and in Ehsan (2018), tapered fins were used and the average was also 5e-4.
  10. Added comments and reference to equations and functions where appropriate to identify sources of equations
  11. in the analysis.ipynb, I made added code to reflect changes above and added visualisations
  12. modified optimization.py, modified CSP class definition to automatically calculate an upper bound for the variable delta_t_air_out. Also applied a changeable efficiency factor, hx_typical_efficiency. This ensures designs that have HX efficiencies less than a custom level. Currently set at 0.6 (confirmed this with Bernd). The lower bounds have also been set for appropriate design (values obtained from Bernd) except for the one which deals with the ratio tube_transverse_pitch/fin_out_diameter. This has been set to the same value as that from the reference design.
  13.  changed the formula for the calculation of fin material amount in the function calculate_fin_cost_per_length in solair/cost.py to include the missing material (shown in red). See image below for illustration and code correction: image.pngimage.png
  14. changed optimisation_multi.py, so that multiple runs can be performed for each ambient temperature. also, now, it's possible to switch between fixed and variable delta_t_air_out directly from here using a boolean. This also includes a more streamlined code that enables the optimisation for the top DNI locations to be performed. For all of these, the appropriately named files are saved and data prepared for analysis.ipynb. The idea is that now, all the graphs are produced by running all current experiments from optimisation_multi.py and then running all the cells in analysis.ipynb.
  15.  Found an inconsistency between Khatoon (2021) equation (6) and Ehsan: Design and comparison of direct and indirect cooling system for 25 MW ... equations (B7 and B8). From a physical point of view the Ehsan equations make more sense. This deals with the fin_in_diameter and tube_out_diameter being different in the code and Khatoon (2021) seems to be using those interchangeably and has missed out a term mentioned by Ehsan. I changed the function calculate_surface_area_air in solair/design.py to match the Ehsan papers... Note that the Ehsan paper I'm referring to here is NOT the same as the one attached in the previous email.

Experiments with code:

  • in Khatoon (2021) equation (7) and the corresponding equation in Ehsan (2018), there's a discrepancy in the equation for htc_a. Another equation that I wasn't sure about was for calculating the friction coefficient of sCO2 (this equation are written in the same way in both of these papers - see Khatoon (2021) equation 16) and it has to do with the 'natural log' term in that equation and whether the term is meant to be, i.e. locations of brackets not made explicit in these papers (ln (...))^16 or whether ln ((...)^16). In the original code, the equations in green and blue were used but i tried to run the optimisation with the 4 possible because I thought it was a bit odd that the length of the tubes for the reference design was coming out at 13m while Khatoon (2021) was using 3 SHX each of 9m length for a total of 27m while Ehsan was using 6m length tubes with no SHX. The first set of equations (yellow and green) relate to sCO2 while the 2nd set of equations (blue and purple) relate to air.
  • The results of running these 4 variations are as follows:
Experiments
1 -Original 2 3 4 Ehsan(2018)
sCO2 eqs blue blue purple purple

-

Air eqs green yellow yellow green

-

At tube start delta p_co2

0.18

0.18

2.55

-

0.138

At tube start - row 4 T_air out 36 65 65

-

55
Tube length 13 3 3

-

6
Run Y Y Y

Error (lmtd function in solair/utils.py)

  • So, I have left these equations as they were in the original code for now as I didn't know how to resolve this length issue. Please let me know if you have any ideas/advice.

Merge request reports