Swh

Wrapper for SAM Simulation Core model: cmod_swh.cpp

Creating an Instance

There are three methods to create a new instance of a PySAM module. Using default populates the newclass’ attributes with default values specific to a config. Each technology-financialconfiguration corresponds to a SAM GUI configuration. Using new creates an instance with empty attributes. The wrap function allows compatibility with PySSC, for details, refer to PySSC.

Swh model description

Solar water heating model for residential and commercial building applications

PySAM.Swh.default(config) → Swh

Use financial model-specific default attributes config options:

  • “SolarWaterHeatingCommercial”
  • “SolarWaterHeatingLCOECalculator”
  • “SolarWaterHeatingNone”
  • “SolarWaterHeatingResidential”
PySAM.Swh.new() → Swh
PySAM.Swh.wrap(ssc_data_t) → Swh

Use existing PySSC data

Warning

Do not call PySSC.data_free on the ssc_data_t provided to wrap

Functions

class PySAM.Swh.Swh

This class contains all the variable information for running a simulation. Variables are grouped together in the subclasses as properties. If property assignments are the wrong type, an error is thrown.

assign(dict) → None

Assign attributes from nested dictionary, except for Outputs

nested_dict = { 'Weather': { var: val, ...}, ...}

execute(int verbosity) → None

Execute simulation with verbosity level 0 (default) or 1

export() → dict

Export attributes into nested dictionary

Weather Group

class PySAM.Swh.Swh.Weather
assign() → None

Assign attributes from dictionary

Weather_vals = { var: val, ...}

export() → dict

Export attributes into dictionary

solar_resource_file

str: local weather file path

Constraints: LOCAL_FILE

Required: True

SWH Group

class PySAM.Swh.Swh.SWH
assign() → None

Assign attributes from dictionary

SWH_vals = { var: val, ...}

export() → dict

Export attributes into dictionary

FRUL

float: FRUL

Required: True

FRta

float: FRta

Required: True

T_room

float: Temperature around solar tank [C]

Constraints: POSITIVE

Required: True

T_set

float: Set temperature [C]

Constraints: POSITIVE

Required: True

T_tank_max

float: Max temperature in solar tank [C]

Constraints: POSITIVE

Required: True

U_tank

float: Solar tank heat loss coefficient [W/m2K]

Constraints: POSITIVE

Required: True

V_tank

float: Solar tank volume [m3]

Constraints: POSITIVE

Required: True

albedo

float: Ground reflectance factor [0..1]

Constraints: FACTOR

Required: True

area_coll

float: Single collector area [m2]

Constraints: POSITIVE

Required: True

azimuth

float: Collector azimuth [deg]

Options: 90=E,180=S

Constraints: MIN=0,MAX=360

Required: True

custom_mains

sequence: Custom mains [C]

Constraints: LENGTH=8760

Required: True

custom_set

sequence: Custom set points [C]

Constraints: LENGTH=8760

Required: True

fluid

float: Working fluid in system

Info: Water,Glycol

Constraints: INTEGER,MIN=0,MAX=1

Required: True

hx_eff

float: Heat exchanger effectiveness [0..1]

Constraints: POSITIVE

Required: True

iam

float: Incidence angle modifier

Required: True

irrad_mode

float: Irradiance input mode [0/1/2]

Info: Beam+Diff,Global+Beam,Global+Diff

Constraints: INTEGER,MIN=0,MAX=2

Required: set to 0 if not provided.

mdot

float: Total system mass flow rate [kg/s]

Constraints: POSITIVE

Required: True

ncoll

float: Number of collectors

Constraints: POSITIVE,INTEGER

Required: True

pipe_diam

float: Pipe diameter [m]

Constraints: POSITIVE

Required: True

pipe_insul

float: Pipe insulation thickness [m]

Constraints: POSITIVE

Required: True

pipe_k

float: Pipe insulation conductivity [W/m2.C]

Constraints: POSITIVE

Required: True

pipe_length

float: Length of piping in system [m]

Constraints: POSITIVE

Required: True

pump_eff

float: Pumping efficiency [%]

Constraints: PERCENT

Required: True

pump_power

float: Pump power [W]

Constraints: POSITIVE

Required: True

scaled_draw

sequence: Hot water draw [kg/hr]

Constraints: LENGTH=8760

Required: True

shading_azal

sequence[sequence]: Azimuth x altitude beam shading loss [%]

Required: False

shading_diff

float: Diffuse shading loss [%]

Required: False

shading_mxh

sequence[sequence]: Month x Hour beam shading loss [%]

Required: False

shading_timestep

sequence[sequence]: Time step beam shading loss [%]

Required: False

sky_model

float: Tilted surface irradiance model [0/1/2]

Info: Isotropic,HDKR,Perez

Constraints: INTEGER,MIN=0,MAX=2

Required: set to 1 if not provided.

system_capacity

float: Nameplate capacity [kW]

Required: True

tank_h2d_ratio

float: Solar tank height to diameter ratio

Constraints: POSITIVE

Required: True

test_flow

float: Flow rate used in collector test [kg/s]

Constraints: POSITIVE

Required: True

test_fluid

float: Fluid used in collector test

Info: Water,Glycol

Constraints: INTEGER,MIN=0,MAX=1

Required: True

tilt

float: Collector tilt [deg]

Constraints: MIN=0,MAX=90

Required: True

use_custom_mains

float: Use custom mains [%]

Constraints: INTEGER,MIN=0,MAX=1

Required: True

use_custom_set

float: Use custom set points [%]

Constraints: INTEGER,MIN=0,MAX=1

Required: True

AdjustmentFactors Group

class PySAM.Swh.Swh.AdjustmentFactors
assign() → None

Assign attributes from dictionary

export() → Dict

Export attributes into dictionary

constant

type: float

dc_constant

DC Constant loss adjustment [%]

dc_hourly

DC Hourly Adjustment Factors [%]

dc_periods

DC Period-based Adjustment Factors [%]

hourly

AC Hourly Adjustment Factors [%]

periods

AC Period-based Adjustment Factors [%]

sf_constant

DC Constant loss adjustment [%]

sf_hourly

DC Hourly Adjustment Factors [%]

sf_periods

DC Period-based Adjustment Factors [%]

Outputs Group

class PySAM.Swh.Swh.Outputs
assign() → None

Assign attributes from dictionary

Outputs_vals = { var: val, ...}

export() → dict

Export attributes into dictionary

I_incident

sequence: Irradiance - Incident [W/m2]

I_transmitted

sequence: Irradiance - Transmitted [W/m2]

P_pump

sequence: P pump [kW]

Q_aux

sequence: Q auxiliary [kW]

Q_auxonly

sequence: Q auxiliary only [kW]

Q_deliv

sequence: Q delivered [kW]

Q_loss

sequence: Q loss [kW]

Q_transmitted

sequence: Q transmitted [kW]

Q_useful

sequence: Q useful [kW]

T_amb

sequence: T ambient [C]

T_cold

sequence: T cold [C]

T_deliv

sequence: T delivered [C]

T_hot

sequence: T hot [C]

T_mains

sequence: T mains [C]

T_tank

sequence: T tank [C]

V_cold

sequence: V cold [m3]

V_hot

sequence: V hot [m3]

annual_Q_aux

float: Q auxiliary [kWh]

annual_Q_auxonly

float: Q auxiliary only [kWh]

annual_Q_deliv

float: Q delivered [kWh]

annual_energy

float: System energy [kWh]

beam

sequence: Irradiance - Beam [W/m2]

capacity_factor

float: Capacity factor [%]

diffuse

sequence: Irradiance - Diffuse [W/m2]

draw

sequence: Hot water draw [kg/hr]

gen

sequence: System power generated [kW]

kwh_per_kw

float: First year kWh/kW [kWh/kW]

mode

sequence: Operation mode

monthly_Q_aux

sequence: Q auxiliary [kWh]

monthly_Q_auxonly

sequence: Q auxiliary only [kWh]

monthly_Q_deliv

sequence: Q delivered [kWh]

monthly_energy

sequence: System energy [kWh]

shading_loss

sequence: Shading losses [%]

solar_fraction

float: Solar fraction

ts_shift_hours

float: Time offset for interpreting time series outputs [hours]