Load Aggregation Module

class pygfunction.load_aggregation.ClaessonJaved(dt, tmax, nSources=1, cells_per_level=5, **kwargs)

Bases: _LoadAggregation

Load aggregation algorithm of Claesson and Javed [1].

References

Attributes:
dtfloat

Simulation time step (in seconds).

tmaxfloat

Maximum simulation time (in seconds).

nSourcesint, optional

Number of heat sources with independent load histories. Default is 1.

cells_per_levelint, optional

Number of load aggregation cells per level of aggregation. Cell widths double every cells_per_level cells. Default is 5.

get_thermal_response_factor_increment()

Returns an array of the dimensional thermal response factors.

Returns:
dgarray

Array of dimensional thermal response factor increments used for temporal superposition (\(g(t_{i+1})/(2 \pi k_s) - g(t_{i})/(2 \pi k_s)\)), in correspondance with the intialized values of the thermal response factors in initialize(). The output size of the array is (nSources, nSources, Nt) if nSources>1. If nSources=1, then the method returns a 1d array.

get_times_for_simulation()

Returns a vector of time values at which the thermal response factors are required.

Returns:
time_reqarray

Time values at which the thermal response factors are required (in seconds).

initialize(g_d)

Initialize the thermal aggregation scheme.

Creates a matrix of thermal response factor increments for later use in temporal superposition.

Parameters:
g_darray

Matrix of dimensional thermal response factors for temporal superposition (\(g/(2 \pi k_s)\)). The expected size is (nSources, nSources, Nt), where Nt is the number of time values at which the thermal response factors are required. The time values are returned by get_times_for_simulation(). If nSources=1, g_d can be 1 dimensional.

next_time_step(time)

Shifts aggregated loads by one time step.

Parameters:
timefloat

Current value of time (in seconds).

set_current_load(q_b)

Set the load at the current time step.

Parameters:
q_bfloat or array

Current value of heat extraction rates per unit borehole length (in watts per meter).

temporal_superposition()

Returns the borehole wall temperature variations at the current time step from the temporal superposition of past loads.

Returns:
deltaTarray

Values of borehole wall temperature drops at the current time step (in degC).

Note

pygfunction assumes positive values for heat extraction and for borehole wall temperature drops. The borehole wall temperature are thus given by : \(T_b = T_g - \Delta T_b\).

class pygfunction.load_aggregation.Liu(dt, tmax, nSources=1, N1=24, N2=5, N3=73, W1=12, W2=3, W3=40)

Bases: _LoadAggregation

Hierarchical load aggregation algorithm of Liu [2].

References

Attributes:
dtfloat

Simulation time step (in seconds).

tmaxfloat

Maximum simulation time (in seconds).

nSourcesint, optional

Number of heat sources with independent load histories. Default is 1.

N1int, optional

Size (number of time steps) of small load aggregation cell. Default is 24.

N2int, optional

Size (number of small cells) of medium load aggregation cell. Default is 5.

N3int, optional

Size (number of medium cells) of large load aggregation cell. Default is 73.

W1int, optional

Waiting period (number of time steps) for the creation of a small load aggregation cell. Default is 12.

W2int, optional

Waiting period (number of small cells) for the creation of a medium load aggregation cell. Default is 3.

W3int, optional

Waiting period (number of medium cells) for the creation of a large load aggregation cell. Default is 40.

get_times_for_simulation()

Returns a vector of time values at which the thermal response factors are required.

Returns:
time_reqarray

Time values at which the thermal response factors are required (in seconds).

initialize(g_d)

Initialize the load aggregation scheme.

Creates a matrix of thermal response factor for later use in temporal superposition.

Parameters:
g_darray

Matrix of dimensional thermal response factors for temporal superposition (\(g/(2 \pi k_s)\)). The expected size is (nSources, nSources, Nt), where Nt is the number of time values at which the thermal response factors are required. The time values are returned by get_times_for_simulation(). If nSources=1, g_d can be 1 dimensional.

next_time_step(time)

Shifts aggregated loads by one time step.

Parameters:
timefloat

Current value of time (in seconds).

set_current_load(q_b)

Set the load at the current time step.

Parameters:
q_barray

Current value of heat extraction rates per unit borehole length (in watts per meter).

temporal_superposition()

Returns the borehole wall temperature variations at the current time step from the temporal superposition of past loads.

Returns:
deltaTarray

Values of borehole wall temperature drops at the current time step (in degC).

Note

pygfunction assumes positive values for heat extraction and for borehole wall temperature drops. The borehole wall temperature are thus given by : \(T_b = T_g - \Delta T_b\).

class pygfunction.load_aggregation.MLAA(dt, tmax, nSources=1, N0=12, N1=48, N2=168, N3=360, **kwargs)

Bases: _LoadAggregation

Multiple load aggregation algorithm (MLAA) of Bernier et al. [3].

References

Attributes:
dtfloat

Simulation time step (in seconds).

tmaxfloat

Maximum simulation time (in seconds).

nSourcesint, optional

Number of heat sources with independent load histories. Default is 1.

N0int, optional

Number of non-aggregated loads. Default is 12.

N1int, optional

Number of time steps in first aggregation cell. Default is 48.

N2int, optional

Number of time steps in second aggregation cell. Default is 168.

N3int, optional

Number of time steps in third aggregation cell. Default is 360.

get_times_for_simulation()

Returns a vector of time values at which the thermal response factors are required.

Returns:
time_reqarray

Time values at which the thermal response factors are required (in seconds).

initialize(g_d)

Initialize the load aggregation scheme.

Creates a matrix of thermal response factor for later use in temporal superposition.

Parameters:
g_darray

Matrix of dimensional thermal response factors for temporal superposition (\(g/(2 \pi k_s)\)). The expected size is (nSources, nSources, Nt), where Nt is the number of time values at which the thermal response factors are required. The time values are returned by get_times_for_simulation(). If nSources=1, g_d can be 1 dimensional.

next_time_step(time)

Shifts aggregated loads by one time step.

Parameters:
timefloat

Current value of time (in seconds).

set_current_load(q_b)

Set the load at the current time step.

Parameters:
q_barray

Current value of heat extraction rates per unit borehole length (in watts per meter).

temporal_superposition()

Returns the borehole wall temperature variations at the current time step from the temporal superposition of past loads.

Returns:
deltaTarray

Values of borehole wall temperature drops at the current time step (in degC).

Note

pygfunction assumes positive values for heat extraction and for borehole wall temperature drops. The borehole wall temperature are thus given by : \(T_b = T_g - \Delta T_b\).