Buildings.Electrical.AC.OnePhase.Sources

Package with sources models for one phase AC systems

Information

This package contains models of AC sources.

Extends from Modelica.Icons.SourcesPackage (Icon for packages containing sources).

Package Content

Name Description
Buildings.Electrical.AC.OnePhase.Sources.FixedVoltage FixedVoltage Fixed single phase AC voltage source
Buildings.Electrical.AC.OnePhase.Sources.Generator Generator Model of a generator
Buildings.Electrical.AC.OnePhase.Sources.Grid Grid Electrical grid
Buildings.Electrical.AC.OnePhase.Sources.PVSimple PVSimple Simple PV model
Buildings.Electrical.AC.OnePhase.Sources.PVSimpleOriented PVSimpleOriented Simple PV model with orientation
Buildings.Electrical.AC.OnePhase.Sources.WindTurbine WindTurbine Simple wind turbine model
Buildings.Electrical.AC.OnePhase.Sources.Examples Examples Package with example models

Buildings.Electrical.AC.OnePhase.Sources.FixedVoltage Buildings.Electrical.AC.OnePhase.Sources.FixedVoltage

Fixed single phase AC voltage source

Buildings.Electrical.AC.OnePhase.Sources.FixedVoltage

Information

This is a constant voltage source. The complex voltage is specified by the RMS voltage and the phase shift.

Extends from Buildings.Electrical.Interfaces.Source (Partial model of a generic source.).

Parameters

TypeNameDefaultDescription
replaceable package PhaseSystemOnePhasePhase system
Frequencyf Frequency of the source [Hz]
VoltageV RMS voltage of the source [V]
AnglephiSou0Phase shift of the source [rad]
Reference Parameters
BooleanpotentialReferencetrueServe as potential root for the reference angle theta
BooleandefiniteReferencefalseServe as definite root for the reference angle theta

Connectors

TypeNameDescription
replaceable package PhaseSystemPhase system

Modelica definition

model FixedVoltage "Fixed single phase AC voltage source" extends Buildings.Electrical.Interfaces.Source( redeclare package PhaseSystem = PhaseSystems.OnePhase, redeclare replaceable Interfaces.Terminal_p terminal); parameter Modelica.SIunits.Frequency f(start=60) "Frequency of the source"; parameter Modelica.SIunits.Voltage V(start = 110) "RMS voltage of the source"; parameter Modelica.SIunits.Angle phiSou = 0 "Phase shift of the source"; protected Modelica.SIunits.Angle thetaRel "Absolute angle of rotating system as offset to thetaRef"; equation if Connections.isRoot(terminal.theta) then PhaseSystem.thetaRef(terminal.theta) = 2*Modelica.Constants.pi*f*time; end if; thetaRel = PhaseSystem.thetaRel(terminal.theta); terminal.v = PhaseSystem.phaseVoltages(V, thetaRel + phiSou); end FixedVoltage;

Buildings.Electrical.AC.OnePhase.Sources.Generator Buildings.Electrical.AC.OnePhase.Sources.Generator

Model of a generator

Buildings.Electrical.AC.OnePhase.Sources.Generator

Information

Model of a generator that produces real power P with a given phase shift phiGen.

This model must be used with Buildings.Electrical.AC.OnePhase.Sources.Grid or with a voltage source from the package Modelica.Electrical.QuasiStationary.SinglePhase.Sources. Otherwise, there will be no equation that defines the phase angle of the voltage.

The boolean flags potentialReference and definiteReference allows to select the phase angle of the generator as reference for the models connected to it. More info about these flags are available in Buildings.Electrical.AC.UsersGuide.

Extends from Buildings.Electrical.Interfaces.Source (Partial model of a generic source.).

Parameters

TypeNameDefaultDescription
replaceable package PhaseSystemOnePhasePhase system
Frequencyf Frequency of the source [Hz]
AnglephiGen0Phase shift of the source [rad]
Reference Parameters
BooleanpotentialReferencetrueServe as potential root for the reference angle theta
BooleandefiniteReferencefalseServe as definite root for the reference angle theta

Connectors

TypeNameDescription
replaceable package PhaseSystemPhase system
input RealInputPVariable power generated by the source

Modelica definition

model Generator "Model of a generator" extends Buildings.Electrical.Interfaces.Source( redeclare package PhaseSystem = PhaseSystems.OnePhase, redeclare Interfaces.Terminal_p terminal); parameter Modelica.SIunits.Frequency f(start=60) "Frequency of the source"; parameter Modelica.SIunits.Angle phiGen(displayUnit="deg") = 0 "Phase shift of the source"; Modelica.SIunits.Current I "value of current"; Modelica.Blocks.Interfaces.RealInput P "Variable power generated by the source"; protected Modelica.SIunits.Angle thetaRel "Absolute angle of rotating system as offset to thetaRef"; equation if Connections.isRoot(terminal.theta) then PhaseSystem.thetaRef(terminal.theta) = 2*Modelica.Constants.pi*f*time; end if; thetaRel = PhaseSystem.thetaRel(terminal.theta); terminal.i = PhaseSystem.phaseCurrents(I, thetaRel+phiGen); 0 = PhaseSystem.activePower(terminal.v, terminal.i) + P; end Generator;

Buildings.Electrical.AC.OnePhase.Sources.Grid Buildings.Electrical.AC.OnePhase.Sources.Grid

Electrical grid

Buildings.Electrical.AC.OnePhase.Sources.Grid

Information

Model that can be used to represent the electrical grid supply.

The model has an output connector named P that contains information about the power supplied by the grid to the network. The convention is that P.real is positive if real power is consumed from the grid, and negative if it is fed into the grid.

The parameter V is the root means square of the voltage. In US households, this is 120 Volts at 60 Hz, in Europe it is 230 Volts at 50 Hz.

Parameters

TypeNameDefaultDescription
Terminal_pterminalredeclare Buildings.Electric... 
Frequencyf Frequency of the source [Hz]
VoltageV RMS voltage of the source [V]
AnglephiSou0Phase shift angle of the source [rad]
FixedVoltagesouredeclare Buildings.Electric...Voltage source

Connectors

TypeNameDescription
Terminal_pterminal 
PowerOutputPPower consumed from grid if positive, or fed to grid if negative

Modelica definition

model Grid "Electrical grid" replaceable Buildings.Electrical.AC.OnePhase.Interfaces.Terminal_p terminal; parameter Modelica.SIunits.Frequency f(start=60) "Frequency of the source"; parameter Modelica.SIunits.Voltage V(start = 110) "RMS voltage of the source"; parameter Modelica.SIunits.Angle phiSou = 0 "Phase shift angle of the source"; Buildings.Electrical.AC.Interfaces.PowerOutput P "Power consumed from grid if positive, or fed to grid if negative"; replaceable Buildings.Electrical.AC.OnePhase.Sources.FixedVoltage sou( potentialReference=true, definiteReference=true, final f=f, final V=V, final phiSou=phiSou) "Voltage source"; equation P.real = -sou.S[1]; P.apparent = Modelica.Fluid.Utilities.regRoot(sou.S[2]^2 + sou.S[1]^2, delta = 0.01); P.phi = sou.phi; P.cosPhi = cos(sou.phi); connect(sou.terminal, terminal); end Grid;

Buildings.Electrical.AC.OnePhase.Sources.PVSimple Buildings.Electrical.AC.OnePhase.Sources.PVSimple

Simple PV model

Buildings.Electrical.AC.OnePhase.Sources.PVSimple

Information

Model of a simple photovoltaic array.

The electrical connector is an AC interface.

This model computes the active power as

P=A   fact   η   G   ηDCAC,

where A is the panel area, fact is the fraction of the aperture area, η is the panel efficiency, G is the total solar irradiation, which is the sum of direct and diffuse irradiation, and ηDCAC is the efficiency of the conversion between DC and AC.

This active power is equal to P, while the reactive power is equal to Q = P   tan(acos(pf)) where pf is the power factor.

Note: This model takes as input the total solar irradiation on the panel. This has to be computed converting the incoming radiation to take tilt and azimuth into account. For a model that implements this conversion, use Buildings.Electrical.AC.OnePhase.Sources.PVSimpleOriented.

Extends from Buildings.Electrical.Interfaces.PartialAcDcParameters (Partial model that contains basic parameters for a DC/AC conversion system), Buildings.Electrical.Interfaces.PartialPV (Base model for a PV system).

Parameters

TypeNameDefaultDescription
AreaA Net surface area [m2]
RealfAct0.9Fraction of surface area with active solar cells [1]
Realeta0.12Module conversion efficiency [1]
replaceable package PhaseSystemPartialPhaseSystemPhase system
BooleanlinearizedfalseIf =true, introduce a linearization in the load
Capacitiveloadredeclare Buildings.Electric...Load model
AC-Conversion
Realpf0.9Power factor
Realeta_DCAC0.9Efficiency of DC/AC conversion

Connectors

TypeNameDescription
output RealOutputPGenerated power [W]
replaceable package PhaseSystemPhase system
input RealInputGTotal solar irradiation per unit area [W/m2]

Modelica definition

model PVSimple "Simple PV model" extends Buildings.Electrical.Interfaces.PartialAcDcParameters; extends Buildings.Electrical.Interfaces.PartialPV( redeclare package PhaseSystem = Buildings.Electrical.PhaseSystems.OnePhase, redeclare Interfaces.Terminal_p terminal, V_nominal(start = 110)); parameter Boolean linearized=false "If =true, introduce a linearization in the load"; replaceable Buildings.Electrical.AC.OnePhase.Loads.Capacitive load( mode=Buildings.Electrical.Types.Load.VariableZ_P_input, final pf=pf, final V_nominal=V_nominal, final P_nominal = 0, final linearized=linearized) "Load model"; protected Modelica.Blocks.Math.Gain gain_DCAC(final k=eta_DCAC) "Gain that represents the DCAC conversion losses"; equation connect(load.terminal, terminal); connect(solarPower.y, gain_DCAC.u); connect(gain_DCAC.y, load.Pow); end PVSimple;

Buildings.Electrical.AC.OnePhase.Sources.PVSimpleOriented Buildings.Electrical.AC.OnePhase.Sources.PVSimpleOriented

Simple PV model with orientation

Buildings.Electrical.AC.OnePhase.Sources.PVSimpleOriented

Information

Model of a simple photovoltaic array.

This model takes as an input the direct and diffuse solar radiation from the weather bus. The electrical connector is an AC one phase interface.

This model computes the active power as

P=A   fact   η   G   ηDCAC,

where A is the panel area, fact is the fraction of the aperture area, η is the panel efficiency, G is the total solar irradiation, which is the sum of direct and diffuse irradiation, and ηDCAC is the efficiency of the conversion between DC and AC. The model takes into account the location and the orientation of the PV panel, specified by the surface tilt, latitude and azimuth.

This active power is equal to P, while the reactive power is equal to Q = P   tan(acos(pf)), where pf is the power factor.

Extends from Buildings.Electrical.Interfaces.PartialAcDcParameters (Partial model that contains basic parameters for a DC/AC conversion system), Buildings.Electrical.Interfaces.PartialPVOriented (Base model of a PV system with orientation).

Parameters

TypeNameDefaultDescription
AreaA Net surface area [m2]
RealfAct0.9Fraction of surface area with active solar cells [1]
Realeta0.12Module conversion efficiency [1]
replaceable package PhaseSystemPartialPhaseSystemPhase system
BooleanlinearizedfalseIf =true, linearize the load
AC-Conversion
Realpf0.9Power factor
Realeta_DCAC0.9Efficiency of DC/AC conversion
Orientation
Angletil Surface tilt [rad]
Anglelat Latitude [rad]
Angleazi Surface azimuth [rad]

Connectors

TypeNameDescription
output RealOutputPGenerated power [W]
replaceable package PhaseSystemPhase system
BusweaBusWeather data

Modelica definition

model PVSimpleOriented "Simple PV model with orientation" extends Buildings.Electrical.Interfaces.PartialAcDcParameters; extends Buildings.Electrical.Interfaces.PartialPVOriented( redeclare package PhaseSystem = Buildings.Electrical.PhaseSystems.OnePhase, V_nominal(start = 110), redeclare Interfaces.Terminal_p terminal, redeclare replaceable Buildings.Electrical.AC.OnePhase.Sources.PVSimple panel( pf=pf, eta_DCAC=eta_DCAC, V_nominal=V_nominal, linearized=linearized)); parameter Boolean linearized=false "If =true, linearize the load"; end PVSimpleOriented;

Buildings.Electrical.AC.OnePhase.Sources.WindTurbine Buildings.Electrical.AC.OnePhase.Sources.WindTurbine

Simple wind turbine model

Buildings.Electrical.AC.OnePhase.Sources.WindTurbine

Information

Model of a wind turbine whose power is computed as a function of wind-speed as defined in a table.

Input to the model is the local wind speed. The model requires the specification of a table that maps wind speed in meters per second to generated power Pt in Watts. The model has a parameter called scale with a default value of one that can be used to scale the power generated by the wind turbine. The generated active electrical power is

P = Pt scale ηDCAC

where ηDCAC is the efficiency of the conversion of the DC electrical power to AC. For example, the following specification (with default scale=1) of a wind turbine

  WindTurbine_Table tur(
    table=[3.5, 0;
           5.5,   100;
           12, 900;
           14, 1000;
           25, 1000]) "Wind turbine";

yields the performance shown below. In this example, the cut-in wind speed is 3.5 meters per second, and the cut-out wind speed is 25 meters per second, as entered by the first and last entry of the wind speed column. Below and above these wind speeds, the generated power is zero.

alt-image

Extends from Buildings.Electrical.Interfaces.PartialWindTurbine (Partial model of a wind turbine with power output based on table as a function of wind speed).

Parameters

TypeNameDefaultDescription
Realscale1Scaling factor, used to allow adjusting the power output without changing the table
BooleantableOnFilefalsetrue, if table is defined on file or in function usertab
Realtable[:, 2][3.5, 0; 5.5, 0.1; 12, 0.9; ...Table of generated power (first column is wind speed, second column is power)
StringtableName"NoName"Table name on file or in function usertab (see documentation)
StringfileName"NoName"File where matrix is stored
replaceable package PhaseSystemPartialPhaseSystemPhase system
Capacitiveloadredeclare Buildings.Electric...Load model
Wind correction
Realh Height over ground
HeighthRef10Reference height for wind measurement [m]
RealnWin0.4Height exponent for wind profile calculation
AC-Conversion
Realpf0.9Power factor
Realeta_DCAC0.9Efficiency of DC/AC conversion

Connectors

TypeNameDescription
input RealInputvWinSteady wind speed [m/s]
output RealOutputPGenerated power [W]
replaceable package PhaseSystemPhase system

Modelica definition

model WindTurbine "Simple wind turbine model" extends Buildings.Electrical.Interfaces.PartialWindTurbine( redeclare package PhaseSystem = Buildings.Electrical.PhaseSystems.OnePhase, redeclare Interfaces.Terminal_p terminal, V_nominal(start = 110)); parameter Real pf(min=0, max=1) = 0.9 "Power factor"; parameter Real eta_DCAC(min=0, max=1) = 0.9 "Efficiency of DC/AC conversion"; replaceable Buildings.Electrical.AC.OnePhase.Loads.Capacitive load( final mode=Buildings.Electrical.Types.Load.VariableZ_P_input, final pf=pf, final P_nominal=0, final V_nominal=V_nominal) "Load model"; protected Modelica.Blocks.Math.Gain gain_DCAC(final k=eta_DCAC); equation connect(load.terminal, terminal); connect(gain_DCAC.y, load.Pow); connect(gain.y, gain_DCAC.u); end WindTurbine;