MassimoCimmino / pygfunction

An open-source toolbox for the evaluation of thermal response factors (g-functions) of geothermal borehole fields.
BSD 3-Clause "New" or "Revised" License
46 stars 20 forks source link

g-Functions for variable fluid mass flow rate and reversible flow direction #215

Closed fuma01 closed 1 month ago

fuma01 commented 2 years ago

I have more a question, which may result in an enhancment: Is it already possible to simulate a borefield with given heat extraction rate and different network flow values per time step?

my script is based on the example: https://pygfunction.readthedocs.io/en/stable/examples/fluid_temperature_multiple_boreholes.html#simulation-of-fluid-temperatures-in-a-field-of-multiple-boreholes

until now I used constant network flow, and the algorithm works really well eg: _m_flow_network_w = 0.35 N1_w N2w

(milesteps of the script): _LoadAgg_w = gt.load_aggregation.ClaessonJaved(dt, tmax) boreField_w = gt.boreholes.rectangle_field(N1_w, N2_w, B, B, H_w, D, r_b) network_w = gt.networks.Network(boreField_w, UTubes_w, m_flow_network=m_flow_network_w, cp_f=cp_fluid) gFunc_w = gt.gfunction.gFunction(network_w, alpha, time=time_req, boundary_condition='MIFT', options=options) LoadAgg_w.initialize(gFunc_w.gFunc/(2pik_s)) for i, (t) in enumerate(time): LoadAgg_w.next_time_step(t) Tf_in_w[i] = network_w.get_network_inlet_temperature(P_tot_w[i], Tb_w[i], m_flow_network_w, cpfluid, nSegments=1)

Now, I want to implement 3 different mass flow rates (e.g. 0.1, 0.25 and 0.5 kg/s per borehole), depending on actual power value (P_tot_w). The output should be inlet and outlet temperature of the field. as the gfunctions itself and hence the initialization of the Load Aggregation is dependent on the network flow, I think it do not work properly only changing the flow value in "_get_network_inlettemperature"... is there already a possibility to use several network flow steps? thank you

MassimoCimmino commented 2 years ago

Hello @fuma01.

We found in an earlier study that g-functions are not strongly dependent on mass flow rate (as long as it is above a threshold value) [1]. For parallel-connected boreholes, the variation is often negligible [2]. This means that the same g-function (at nominal mass flow rate) can be used for a simulation with variable mass flow rate.

One way to verify is to evaluate and compare g-functions at your mininum an maximum mass flow rates up to a time equal to the maximum simulation time. If there is no significant difference, then all you need is to use the variable mass flow rate when calling network.get_<> class methods.

It is also possible to consider different g-functions with different mass flow rates using a non-stationary combination [3]. This is not supported by pygfunction and would need to be adapted to time-marching simulations before it can be implemented.


[1] Cimmino, M. (2019). Semi-Analytical Method for g-Function Calculation of bore fields with series-and parallel-connected boreholes. Science and Technology for the Built Environment, 25(8), 1007-1022. [2] Cimmino, M. (2015). The effects of borehole thermal resistances and fluid flow rate on the g-functions of geothermal bore fields. International Journal of Heat and Mass Transfer, 91, 1119-1127. [3] Beaudry, G., Pasquier, P., & Marcotte, D. (2021). A fast convolution-based method to simulate time-varying flow rates in closed-loop and standing column well ground heat exchangers. Renewable Energy, 174, 55-72.

fuma01 commented 2 years ago

Dear Massimo,

Thank you for the quick response! Indeed the g-function is not very sensitiv to flow values, at least if the field stays in turbulent mode (< 0.6 % in my simulation) but a bit more in low flow mode (up to 10 % difference) I testet it with three flow rates (0.1, 0.3 and 0.5 kg/s), which represents my target range and plottet the g-function and the difference to 0.5 kg/s, related to Eskilson time: GFUNConFLOW I use hourly time steps up to 20 years. rectangular borefield 7x9 with 150 m length and 5 m spacing

now I am thinking about, if the error will be significant when using variable mass flow rate just at"network.get_" method, as suggested? also, I am wondering, that the computation time needs 5 times longer with switching flow rates @ network.get.

regards from Vienna, Martin

MassimoCimmino commented 2 years ago

Accuracy

The accuracy of your simulation will depend on your simulation objectives and how often the flow rate is 0.1 kg/s.

A difference in g-functions at low ln(t/ts) translates to an error in borehole wall temperature variations in the short-term (i.e. how quickly the temperature varies following a heat pulse). The variation of fluid temperatures is a combination of two factors: (1) the temperature variation at the borehole wall, and (2) the effective borehole thermal resistance. The second also varies with mass flow and is captured by the Network class.

If you are simulating for heat pump energy use, then an error in temperature affects the performance of the heat pump. If you are simulating to size the field in peak conditions then I figure the peak coincides with the maximum mass flow rate. The magnitude of these impacts strongly depend on your simulation case.

Here, I would suggest running and comparing simulations using g-functions evaluated with the 0.1 and 0.5 kg/s mass flow rates. This would give an estimation of the expected magnitude of the errors caused by using only one g-function.

Factor in that g-functions do not capture short-term effects (i.e. the heat capacity of the grout and the travel time of the fluid). This is a limitation of steady-state resistance models such as the one implemented in the Network class.

Calculation time

When the mass flow rate changes, the Network class re-evaluates all borehole coefficients. the class only remembers coefficients for the latest mass flow rate.

At the moment, this is done to all boreholes individually even if all borehole are geometrically identical.

fuma01 commented 2 years ago

in my current investigation, I have 5 heat pumps parallel to one (or two) BHE fields. Input is the heating/cooling power demand of the building and solar module. Then the field size is adapted, that the fluid temperatures are in specified range. The output is the electric power of the heat pumps (calculated with characteristic curve) in proportion to solar and BHE power and relation to field size. In dependence of the requested power load the needed number of heat pumps are activated. In current simulation the mass flow rate is set constant, hence the delta T is varying. The idea was to set a variably flow rate and get more or less constant delta T, which will also affect input temperature of the heat pump and hence the COP (or the needed electric power).

now, I understand, that the mass flow rate is implementet in the g-function, which is calculated in advance. By switching laminar/turbulent flow mode, this will probably not be neclectable. As a workaround, I will make two simulations at minimum and maximum constant flow rate, to see the efffects. The increase of calculation time by changing flow rate later in network class, is too high for me...

I think, it would be exciting if an implementation of "different g-functions with different mass flow rates using a non-stationary combination [3]" in pygfunction would be implemented in future releases!

MassimoCimmino commented 5 months ago

I developed g-functions for the simulation of bore fields with variable mass flow rate and reversible flow direction. This makes it possible to simulate borehole thermal energy storage systems using g-functions. The solution is presented in a paper now available online [1].

The are several tasks to complete for the implementation into pygfunction:


[1] Cimmino, M. g-Functions for fields of series- and parallel-connected boreholes with variable fluid mass flow rate and reversible flow direction. Renewable Energy. [In Press.] May 15, 2024. https://doi.org/10.1016/j.renene.2024.120661

fuma01 commented 5 months ago

Dear Massimo, This is great work! Thanks for the implementation! I'm looking forward to studying the paper and using the new functions! Best regards

MassimoCimmino commented 2 months ago

The following scripts reproduce the results from the paper (after 566f3fe)