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 config-specific 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
-
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
() → None¶ Assign attributes from dictionary
SolarResource_vals = { var: val, ...}
-
export
() → dict¶ Export attributes into dictionary
-
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
() → None¶ Assign attributes from dictionary
SWH_vals = { var: val, ...}
-
export
() → dict¶ Export attributes into dictionary
-
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
-
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
() → None¶ Assign attributes from dictionary
Outputs_vals = { var: val, ...}
-
export
() → dict¶ Export attributes into dictionary
-
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
-
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
-