Costa (Complete and supplement performance tables) is a Python package whose purpose is to fill incomplete performance maps using correction curves. It is meant to create variable capacity air-to-air heat pumps performance maps that can be used by the Type 3254 in TRNSYS.
With Costa, the whole process of extending and formatting performance maps becomes quite straightforward, see basic usage.
- Performance map manipulation using pandas DataFrames
- Extend performance maps using custom correction curves
- Automatic normalization
- Rated values adjustments
- Write performance maps in the format required by the Type 3254
- Plot slices of the performance map
- Use basic functionalities with a user interface
Install Costa with pip
by running
$ pip install costa
Import the package and load the (incomplete) performance map into a DataFrame
import costa
hpm = costa.build_heating_permap("heating-performance-map.dat")
Specify the entries of the variable you want to extend, e.g. the frequency
# Add entries 0.1, 0.2, ..., 1.0
hpm.pm.entries['freq'] = np.arange(1, 1.1, 0.1)
Specify the operating mode (required to use the appropriate corrections)
hpm.pm.mode = 'heating'
Fill the missing performance values for the specified frequencies
hpm_full = hpm.pm.fill()
Note:
The Type 3254
uses normalized performance maps.
Normalization can be carried out with the normalize
method,
or directly through the fill
method using the rated values
of any two quantities amongst capacity
, power
and COP
.
For example, with a rated capacity of 4.69 W and a rated power
of 1.01 W,
rated_values = pd.DataFrame({'capacity': [4.69], 'power': [1.01]})
hpm_full = hpm.pm.fill(norm=rated_values)
Extend the operating frequency range to [0,1]
hpm_full.pm.ranges['freq'] = [0, 1]
And finally write the full performance map
hpm_full.pm.write("permap-heating.dat")
Now the generated file permap-heating.dat
should be compatible
with the Type 3254.
If you are having problems, please open an issue in the issue tracker and submit a minimal working example to highlight what is not working.