Class: URBANopt::RNM::Transformers

Inherits:
Object
  • Object
show all
Defined in:
lib/urbanopt/rnm/transformer_opendss.rb

Overview

creating the Transformers class with required parameters by the OpenDSS catalog

Instance Method Summary collapse

Instance Method Details

#create(trafo) ⇒ Object



9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# File 'lib/urbanopt/rnm/transformer_opendss.rb', line 9

def create(trafo)
  hash = {}
  hash[:nameclass] = trafo['Name']
  if trafo.include? 'Installed Power(MVA)'
    hash[:kva] = (trafo['Installed Power(MVA)'].to_i * 1000).to_i # converting to kVA
  else # trafo.include? "kVA"
    hash[:kva] = trafo['Installed Power(kVA)']
  end
  hash[:resistance] = trafo['Low-voltage-side short-circuit resistance (ohms)'].to_f.round(2)
  hash[:reactance] = trafo['Reactance (p.u. transf)'].to_f.round(2)
  hash[:phases] = trafo['Nphases']
  hash[:Centertap] = trafo['Centertap']
  hash[:high_voltage] = trafo['Primary Voltage (kV)']
  hash[:low_voltage] = trafo['Secondary Voltage (kV)']
  hash[:connection] = trafo['connection']
  return hash
end