Swh

Wrapper for SAM Simulation Core model: cmod_swh.cpp

Input Consistency Warning

As described in Possible Problems, some input parameters are interdependent but the equations that enforce consistency are not available in this PySAM module. Therefore, the onus is on the PySAM user to check that interdependencies are correctly handled. The variables which may require additional logic include:

  • FRUL
  • FRta
  • area_coll
  • ncoll
  • system_capacity

Provided for each of these inputs is a list of other inputs that are potentially interdependent.

Creating an Instance

Refer to the Initializing a Model page for details on the different ways to create an instance of a PySAM class.

Swh model description

Solar water heating model for residential and commercial building applications

PySAM.Swh.default(config) → Swh

Use default attributes config options:

  • “SolarWaterHeatingCommercial”
  • “SolarWaterHeatingLCOECalculator”
  • “SolarWaterHeatingNone”
  • “SolarWaterHeatingResidential”
PySAM.Swh.from_existing(data, optional config) → Swh

Share underlying data with an existing PySAM class. If config provided, default attributes are loaded otherwise.

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 = { 'Solar Resource': { var: val, ...}, ...}

execute(int verbosity) → None

Execute simulation with verbosity level 0 (default) or 1

export() → dict

Export attributes into nested dictionary

replace(dict) → None

Replace attributes from nested dictionary, except for Outputs. Unassigns all values in each Group then assigns from the input dict.

nested_dict = { 'Solar Resource': { var: val, ...}, ...}

unassign(name) → None

Unassign a value in any of the variable groups.

value(name, optional value) → Union[None, float, dict, sequence, str]

Get or set by name a value in any of the variable groups.

SolarResource Group

class PySAM.Swh.Swh.SolarResource
assign(dict) → None

Assign attributes from dictionary, overwriting but not removing values

SolarResource_vals = { var: val, ...}

export() → dict

Export attributes into dictionary

replace(dict) → None

Replace attributes from dictionary, unassigning values not present in input dict

SolarResource_vals = { var: val, ...}

solar_resource_data

Weather data

Info: dn,df,tdry,wspd,lat,lon,tz

Required: False

Type:dict
solar_resource_file

local weather file path

Constraints: LOCAL_FILE

Required: False

Type:str

SWH Group

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

Assign attributes from dictionary, overwriting but not removing values

SWH_vals = { var: val, ...}

export() → dict

Export attributes into dictionary

replace(dict) → None

Replace attributes from dictionary, unassigning values not present in input dict

SWH_vals = { var: val, ...}

FRUL

FRUL

Required: True

Changes to this variable may require updating the values of the following:
  • system_capacity
Type:float
FRta

FRta

Required: True

Changes to this variable may require updating the values of the following:
  • system_capacity
Type:float
T_room

Temperature around solar tank [C]

Constraints: POSITIVE

Required: True

Type:float
T_set

Set temperature [C]

Constraints: POSITIVE

Required: True

Type:float
T_tank_max

Max temperature in solar tank [C]

Constraints: POSITIVE

Required: True

Type:float
U_tank

Solar tank heat loss coefficient [W/m2K]

Constraints: POSITIVE

Required: True

Type:float
V_tank

Solar tank volume [m3]

Constraints: POSITIVE

Required: True

Type:float
albedo

Ground reflectance factor [0..1]

Constraints: FACTOR

Required: True

Type:float
area_coll

Single collector area [m2]

Constraints: POSITIVE

Required: True

Changes to this variable may require updating the values of the following:
  • system_capacity
Type:float
azimuth

Collector azimuth [deg]

Options: 90=E,180=S

Constraints: MIN=0,MAX=360

Required: True

Type:float
custom_mains

Custom mains [C]

Constraints: LENGTH=8760

Required: True

Type:sequence
custom_set

Custom set points [C]

Constraints: LENGTH=8760

Required: True

Type:sequence
fluid

Working fluid in system

Info: Water,Glycol

Constraints: INTEGER,MIN=0,MAX=1

Required: True

Type:float
hx_eff

Heat exchanger effectiveness [0..1]

Constraints: POSITIVE

Required: True

Type:float
iam

Incidence angle modifier

Required: True

Type:float
irrad_mode

Irradiance input mode [0/1/2]

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

Constraints: INTEGER,MIN=0,MAX=2

Required: If not provided, assumed to be 0

Type:float
load

Electricity load (year 1) [kW]

Type:sequence
load_escalation

Annual load escalation [%/year]

Required: If not provided, assumed to be 0

Type:sequence
mdot

Total system mass flow rate [kg/s]

Constraints: POSITIVE

Required: True

Type:float
ncoll

Number of collectors

Constraints: POSITIVE,INTEGER

Required: True

Changes to this variable may require updating the values of the following:
  • system_capacity
Type:float
pipe_diam

Pipe diameter [m]

Constraints: POSITIVE

Required: True

Type:float
pipe_insul

Pipe insulation thickness [m]

Constraints: POSITIVE

Required: True

Type:float
pipe_k

Pipe insulation conductivity [W/m-C]

Constraints: POSITIVE

Required: True

Type:float
pipe_length

Length of piping in system [m]

Constraints: POSITIVE

Required: True

Type:float
pump_eff

Pumping efficiency [%]

Constraints: PERCENT

Required: True

Type:float
pump_power

Pump power [W]

Constraints: POSITIVE

Required: True

Type:float
scaled_draw

Hot water draw [kg/hr]

Constraints: LENGTH=8760

Required: True

Type:sequence
shading_azal

Azimuth x altitude beam shading loss [%]

Required: False

Type:sequence[sequence]
shading_diff

Diffuse shading loss [%]

Required: False

Type:float
shading_mxh

Month x Hour beam shading loss [%]

Required: False

Type:sequence[sequence]
shading_timestep

Time step beam shading loss [%]

Required: False

Type:sequence[sequence]
sky_model

Tilted surface irradiance model [0/1/2]

Info: Isotropic,HDKR,Perez

Constraints: INTEGER,MIN=0,MAX=2

Required: If not provided, assumed to be 1

Type:float
system_capacity

Nameplate capacity [kW]

Required: True

This variable may need to be updated if the values of the following have changed:
  • FRUL
  • FRta
  • area_coll
  • ncoll
Type:float
tank_h2d_ratio

Solar tank height to diameter ratio

Constraints: POSITIVE

Required: True

Type:float
test_flow

Flow rate used in collector test [kg/s]

Constraints: POSITIVE

Required: True

Type:float
test_fluid

Fluid used in collector test

Info: Water,Glycol

Constraints: INTEGER,MIN=0,MAX=1

Required: True

Type:float
tilt

Collector tilt [deg]

Constraints: MIN=0,MAX=90

Required: True

Type:float
use_custom_mains

Use custom mains [%]

Constraints: INTEGER,MIN=0,MAX=1

Required: True

Type:float
use_custom_set

Use custom set points [%]

Constraints: INTEGER,MIN=0,MAX=1

Required: True

Type:float

AdjustmentFactors Group

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

Assign attributes from dictionary

export() → Dict

Export attributes into dictionary

constant

float

Type:type
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(dict) → None

Assign attributes from dictionary, overwriting but not removing values

Outputs_vals = { var: val, ...}

export() → dict

Export attributes into dictionary

replace(dict) → None

Replace attributes from dictionary, unassigning values not present in input dict

Outputs_vals = { var: val, ...}

I_incident

Irradiance - Incident [W/m2]

Type:sequence
I_transmitted

Irradiance - Transmitted [W/m2]

Type:sequence
P_pump

P pump [kW]

Type:sequence
Q_aux

Q auxiliary [kW]

Type:sequence
Q_auxonly

Q auxiliary only [kW]

Type:sequence
Q_deliv

Q delivered [kW]

Type:sequence
Q_loss

Q loss [kW]

Type:sequence
Q_transmitted

Q transmitted [kW]

Type:sequence
Q_useful

Q useful [kW]

Type:sequence
T_amb

T ambient [C]

Type:sequence
T_cold

T cold [C]

Type:sequence
T_deliv

T delivered [C]

Type:sequence
T_hot

T hot [C]

Type:sequence
T_mains

T mains [C]

Type:sequence
T_tank

T tank [C]

Type:sequence
V_cold

V cold [m3]

Type:sequence
V_hot

V hot [m3]

Type:sequence
annual_Q_aux

Q auxiliary [kWh]

Type:float
annual_Q_auxonly

Q auxiliary only [kWh]

Type:float
annual_Q_deliv

Q delivered [kWh]

Type:float
annual_energy

System energy [kWh]

Type:float
annual_energy_distribution_time

Annual energy production as function of time [kW]

Type:sequence[sequence]
beam

Irradiance - Beam [W/m2]

Type:sequence
capacity_factor

Capacity factor [%]

Type:float
diffuse

Irradiance - Diffuse [W/m2]

Type:sequence
draw

Hot water draw [kg/hr]

Type:sequence
gen

System power generated [kW]

Type:sequence
kwh_per_kw

First year kWh/kW [kWh/kW]

Type:float
mode

Operation mode

Type:sequence
monthly_Q_aux

Q auxiliary [kWh]

Type:sequence
monthly_Q_auxonly

Q auxiliary only [kWh]

Type:sequence
monthly_Q_deliv

Q delivered [kWh]

Type:sequence
monthly_energy

System energy [kWh]

Type:sequence
shading_loss

Shading losses [%]

Type:sequence
solar_fraction

Solar fraction

Type:float
ts_shift_hours

Time offset for interpreting time series outputs [hours]

Type:float