This model evaluates the fluid temperatures using the multipole method of Claesson and Hellstrom (2011).
J. Claesson and G. Hellstrom. Multipole method to calculate borehole thermal resistances in a borehole heat exchanger. HVAC&R Research, 17(6): 895-911, 2011.
function multipoleFluidTemperature extends Modelica.Icons.Function; input Integer nPip "Number of pipes"; input Integer J "Number of multipoles"; input Modelica.SIunits.Position xPip[nPip] "x-Coordinates of pipes"; input Modelica.SIunits.Position yPip[nPip] "y-Coordinates of pipes"; input Real QPip_flow[nPip](unit = "W/m") "Heat flow in pipes"; input Modelica.SIunits.Temperature TBor "Average borehole wall temperature"; input Modelica.SIunits.Radius rBor "Borehole radius"; input Modelica.SIunits.Radius rPip[nPip] "Outter radius of pipes"; input Modelica.SIunits.ThermalConductivity kFil "Thermal conductivity of grouting material"; input Modelica.SIunits.ThermalConductivity kSoi "Thermal conductivity of soil material"; input Real RFluPip[nPip](unit = "(m.K)/W") "Fluid to pipe wall thermal resistances"; input Real eps = 1.0e-5 "Iteration relative accuracy"; input Integer it_max = 100 "Maximum number of iterations"; output Modelica.SIunits.Temperature TFlu[nPip] "Fluid temperature in pipes"; end multipoleFluidTemperature;