This model shows the impact of renewables on the electric grid.
The sensors show how the voltage per unit fluctuates depending on
the building load and the power produced by the PV and the wind turbine.
To the right of the model is the post-processing that computes the
ratio of energy produced by the renewables over the energy consumed
by the loads.
Th image below shows the ratio between the energy produced by renewable energy sources
over the energy consumed by the loads over one year. The solid line indicates the
Net-Zero Energy goal and the blue line indicates the actual ratio for the
neighborhood represented by the model.
The scatter plots show the voltage levels at different locations in the network. In particular,
the plots highlight how the voltage fluctuations are related to the power generated by the
renewable sources, to the wind speed and the global horizontal irradiation.
As expected, voltage increases with the power generated by the renewables,
causing possible instabilities to the electrical grid.
model RenewableSources
extends Modelica.Icons.Example;
parameter Modelica.SIunits.Frequency f = 60 ;
parameter Modelica.SIunits.Voltage V_nominal = 480 ;
parameter Modelica.SIunits.Power PLoa_nominal = 3500
;
parameter Modelica.SIunits.Power PWin = PLoa_nominal*4
;
parameter Modelica.SIunits.Power PSun = PLoa_nominal*1.0
;
parameter Modelica.SIunits.DensityOfHeatFlowRate W_m2_nominal = 1000
;
parameter Real eff_PV = 0.12*0.85*0.9
;
parameter Modelica.SIunits.Area A_PV = PSun/eff_PV/W_m2_nominal
;
AC.ThreePhasesBalanced.Sources.Grid gri(
f=f,
V=V_nominal,
phiSou=0) ;
AC.ThreePhasesBalanced.Loads.Inductive loa1(mode=Buildings.Electrical.Types.Load.VariableZ_y_input,
V_nominal=V_nominal,
linearized=false,
use_pf_in=false,
pf=0.8,
P_nominal=-PLoa_nominal) ;
AC.ThreePhasesBalanced.Loads.Inductive loa2(mode=Buildings.Electrical.Types.Load.VariableZ_y_input,
V_nominal=V_nominal,
linearized=false,
use_pf_in=false,
pf=0.9,
P_nominal=-PLoa_nominal) ;
AC.ThreePhasesBalanced.Loads.Inductive loa3(mode=Buildings.Electrical.Types.Load.VariableZ_y_input,
V_nominal=V_nominal,
linearized=false,
use_pf_in=false,
pf=0.8,
P_nominal=-PLoa_nominal) ;
AC.ThreePhasesBalanced.Loads.Inductive loa4(mode=Buildings.Electrical.Types.Load.VariableZ_y_input,
V_nominal=V_nominal,
linearized=false,
use_pf_in=false,
pf=0.88,
P_nominal=-PLoa_nominal) ;
AC.ThreePhasesBalanced.Lines.Line line1(mode=Buildings.Electrical.Types.CableMode.automatic,
l=1500,
V_nominal=V_nominal,
P_nominal=7*(PLoa_nominal + PSun) + PWin) ;
AC.ThreePhasesBalanced.Lines.Line line2(mode=Buildings.Electrical.Types.CableMode.automatic,
l=300,
V_nominal=V_nominal,
P_nominal=3*(PLoa_nominal + PSun)) ;
AC.ThreePhasesBalanced.Lines.Line line3(mode=Buildings.Electrical.Types.CableMode.automatic,
l=300,
V_nominal=V_nominal,
P_nominal=2*(PLoa_nominal + PSun)) ;
AC.ThreePhasesBalanced.Lines.Line line4(mode=Buildings.Electrical.Types.CableMode.automatic,
l=300,
V_nominal=V_nominal,
P_nominal=(PLoa_nominal + PSun)) ;
AC.ThreePhasesBalanced.Lines.Line line5(mode=Buildings.Electrical.Types.CableMode.automatic,
l=300,
V_nominal=V_nominal,
P_nominal=3*(PLoa_nominal + PSun) + PWin) ;
AC.ThreePhasesBalanced.Loads.Inductive loa5(mode=Buildings.Electrical.Types.Load.VariableZ_y_input,
V_nominal=V_nominal,
linearized=false,
use_pf_in=false,
pf=0.95,
P_nominal=-PLoa_nominal) ;
AC.ThreePhasesBalanced.Loads.Inductive loa6(mode=Buildings.Electrical.Types.Load.VariableZ_y_input,
V_nominal=V_nominal,
linearized=false,
use_pf_in=false,
pf=0.8,
P_nominal=-PLoa_nominal) ;
AC.ThreePhasesBalanced.Loads.Inductive loa7(mode=Buildings.Electrical.Types.Load.VariableZ_y_input,
V_nominal=V_nominal,
linearized=false,
use_pf_in=false,
pf=0.75,
P_nominal=-PLoa_nominal) ;
AC.ThreePhasesBalanced.Lines.Line line6(mode=Buildings.Electrical.Types.CableMode.automatic,
l=300,
V_nominal=V_nominal,
P_nominal=2*(PLoa_nominal + PSun) + PWin) ;
AC.ThreePhasesBalanced.Lines.Line line7(mode=Buildings.Electrical.Types.CableMode.automatic,
l=300,
V_nominal=V_nominal,
P_nominal=(PLoa_nominal + PSun) + PWin) ;
AC.ThreePhasesBalanced.Sources.PVSimpleOriented pv1(
eta_DCAC=0.89,
A=A_PV,
fAct=0.9,
eta=0.12,
linearized=false,
V_nominal=V_nominal,
pf=0.85,
lat=weaDat.lat,
azi=Buildings.Types.Azimuth.S,
til=0.5235987755983) ;
AC.ThreePhasesBalanced.Sources.PVSimpleOriented pv2(
eta_DCAC=0.89,
A=A_PV,
fAct=0.9,
eta=0.12,
linearized=false,
V_nominal=V_nominal,
pf=0.8,
lat=weaDat.lat,
azi=Buildings.Types.Azimuth.E,
til=0.5235987755983) ;
AC.ThreePhasesBalanced.Sources.PVSimpleOriented pv3(
eta_DCAC=0.89,
A=A_PV,
fAct=0.9,
eta=0.12,
linearized=false,
V_nominal=V_nominal,
pf=0.8,
lat=weaDat.lat,
azi=Buildings.Types.Azimuth.W,
til=0.34906585039887) ;
AC.ThreePhasesBalanced.Sources.PVSimpleOriented pv4(
eta_DCAC=0.89,
A=A_PV,
fAct=0.9,
eta=0.12,
linearized=false,
V_nominal=V_nominal,
pf=0.9,
lat=weaDat.lat,
azi=Buildings.Types.Azimuth.S,
til=0.5235987755983) ;
AC.ThreePhasesBalanced.Sources.PVSimpleOriented pv5(
eta_DCAC=0.89,
A=A_PV,
fAct=0.9,
eta=0.12,
linearized=false,
V_nominal=V_nominal,
pf=0.95,
lat=weaDat.lat,
azi=Buildings.Types.Azimuth.W,
til=0.61086523819802) ;
AC.ThreePhasesBalanced.Sources.PVSimpleOriented pv6(
eta_DCAC=0.89,
A=A_PV,
fAct=0.9,
eta=0.12,
linearized=false,
V_nominal=V_nominal,
pf=0.9,
lat=weaDat.lat,
azi=Buildings.Types.Azimuth.E,
til=0.43633231299858) ;
AC.ThreePhasesBalanced.Sources.PVSimpleOriented pv7(
eta_DCAC=0.89,
A=A_PV,
fAct=0.9,
eta=0.12,
linearized=false,
V_nominal=V_nominal,
pf=0.97,
lat=weaDat.lat,
azi=Buildings.Types.Azimuth.S,
til=0.5235987755983) ;
AC.ThreePhasesBalanced.Sources.WindTurbine winTur(
V_nominal=V_nominal,
h=15,
hRef=10,
pf=0.94,
eta_DCAC=0.92,
nWin=0.4,
tableOnFile=false,
scale=PWin) ;
AC.ThreePhasesBalanced.Lines.Line line8(mode=Buildings.Electrical.Types.CableMode.automatic,
l=300,
V_nominal=V_nominal,
P_nominal=PWin);
BoundaryConditions.WeatherData.ReaderTMY3 weaDat(
computeWetBulbTemperature=false,
filNam="modelica://Buildings/Resources/weatherdata/USA_CA_San.Francisco.Intl.AP.724940_TMY3.mos")
;
BoundaryConditions.WeatherData.Bus weaBus ;
Modelica.Blocks.Sources.CombiTimeTable pow1(extrapolation=
Modelica.Blocks.Types.Extrapolation.Periodic, table=[0,0.1; 2,0.1;
4,0.1; 6,0.1; 8,0.8; 10,0.7; 12,0.3; 14,0.3;
16,0.3; 18,0.8; 20,0.7; 22,0.3; 24,0.1],
timeScale=3600)
;
Modelica.Blocks.Sources.CombiTimeTable pow2(extrapolation=
Modelica.Blocks.Types.Extrapolation.Periodic, table=[0,0.1; 2,0.1;
4,0.1; 6,0.1; 8,0.8; 10,0.7; 12,0.3; 14,0.3;
16,0.3; 18,0.8; 20,0.7; 22,0.3; 24,0.1],
timeScale=3600)
;
Modelica.Blocks.Sources.CombiTimeTable pow3(extrapolation=
Modelica.Blocks.Types.Extrapolation.Periodic, table=[0,0.1; 2,0.1;
4,0.1; 6,0.1; 8,0.8; 10,0.7; 12,0.3; 14,0.3;
16,0.3; 18,0.8; 20,0.7; 22,0.3; 24,0.1],
timeScale=3600)
;
Modelica.Blocks.Sources.CombiTimeTable pow4(extrapolation=
Modelica.Blocks.Types.Extrapolation.Periodic, table=[0,0.2; 2,0.2;
4,0.2; 6,0.2; 8,0.8; 10,0.8; 12,0.6; 14,0.3;
16,0.3; 18,0.8; 20,0.8; 22,0.3; 24,0.3],
timeScale=3600)
;
Modelica.Blocks.Sources.CombiTimeTable pow5(extrapolation=
Modelica.Blocks.Types.Extrapolation.Periodic, table=[0,0.1; 2,0.1;
4,0.1; 6,0.1; 8,0.5; 10,0.2; 12,0.3; 14,0.3;
16,0.3; 18,0.9; 20,0.4; 22,0.2; 24,0.1],
timeScale=3600)
;
Modelica.Blocks.Sources.CombiTimeTable pow6(extrapolation=
Modelica.Blocks.Types.Extrapolation.Periodic, table=[0,0.1; 2,0.1;
4,0.1; 6,0.1; 8,0.8; 10,0.7; 12,0.3; 14,0.3;
16,0.3; 18,0.8; 20,0.7; 22,0.3; 24,0.1],
timeScale=3600)
;
Modelica.Blocks.Sources.CombiTimeTable pow7(extrapolation=
Modelica.Blocks.Types.Extrapolation.Periodic, table=[0,0.2; 2,0.1;
4,0.1; 6,0.1; 8,0.4; 10,0.7; 12,0.3; 14,0.3;
16,0.3; 18,0.2; 20,0.7; 22,0.3; 24,0.2],
timeScale=3600)
;
AC.ThreePhasesBalanced.Sensors.Probe sen1(V_nominal=V_nominal, perUnit=true)
;
AC.ThreePhasesBalanced.Sensors.Probe sen2(V_nominal=V_nominal, perUnit=true)
;
AC.ThreePhasesBalanced.Sensors.Probe sen3(V_nominal=V_nominal, perUnit=true)
;
Modelica.Blocks.Continuous.Integrator EWin
;
Modelica.Blocks.Math.MultiSum PSol(nu=7, y(unit="W"))
;
Modelica.Blocks.Continuous.Integrator ESol
;
Modelica.Blocks.Sources.RealExpression PLoa(
y=PLoa_nominal*(pow1.y[1] + pow2.y[1] + pow3.y[1] + pow4.y[1] + pow5.y[1] + pow6.y[1] + pow7.y[1]))
;
Modelica.Blocks.Continuous.Integrator ELoa(y_start=1E-10)
;
Modelica.Blocks.Math.Add EPro ;
Modelica.Blocks.Math.Division ERat ;
equation
connect(gri.terminal, line1.terminal_n);
connect(line1.terminal_p, loa1.terminal);
connect(line1.terminal_p, line2.terminal_n);
connect(line2.terminal_p, loa2.terminal);
connect(line2.terminal_p, line3.terminal_n);
connect(line3.terminal_p, loa3.terminal);
connect(line3.terminal_p, line4.terminal_n);
connect(line4.terminal_p, loa4.terminal);
connect(line1.terminal_p, line5.terminal_n);
connect(loa5.terminal, line5.terminal_p);
connect(line5.terminal_p, line6.terminal_n);
connect(line6.terminal_p, line7.terminal_n);
connect(loa6.terminal, line6.terminal_p);
connect(loa7.terminal, line7.terminal_p);
connect(line1.terminal_p, pv1.terminal);
connect(line2.terminal_p, pv2.terminal);
connect(line3.terminal_p, pv3.terminal);
connect(line4.terminal_p, pv4.terminal);
connect(pv5.terminal, line5.terminal_p);
connect(pv6.terminal, loa6.terminal);
connect(pv7.terminal, loa7.terminal);
connect(line7.terminal_p, line8.terminal_n);
connect(line8.terminal_p, winTur.terminal);
connect(weaDat.weaBus, pv1.weaBus);
connect(weaDat.weaBus, pv2.weaBus);
connect(weaDat.weaBus, pv3.weaBus);
connect(weaDat.weaBus, pv4.weaBus);
connect(weaDat.weaBus, weaBus);
connect(weaBus.winSpe, winTur.vWin);
connect(weaDat.weaBus, pv5.weaBus);
connect(weaDat.weaBus, pv6.weaBus);
connect(weaDat.weaBus, pv7.weaBus);
connect(loa2.y, pow2.y[1]);
connect(pow1.y[1], loa1.y);
connect(loa3.y, pow3.y[1]);
connect(loa4.y, pow4.y[1]);
connect(loa5.y, pow5.y[1]);
connect(loa6.y, pow6.y[1]);
connect(loa7.y, pow7.y[1]);
connect(sen1.term, line1.terminal_p);
connect(sen2.term, line4.terminal_p);
connect(sen3.term, line8.terminal_p);
connect(EWin.u, winTur.P);
connect(pv1.P, PSol.u[1]);
connect(PSol.u[2], pv2.P);
connect(PSol.u[3], pv3.P);
connect(PSol.u[4], pv4.P);
connect(PSol.u[5], pv5.P);
connect(PSol.y, ESol.u);
connect(PSol.u[6], pv6.P);
connect(PSol.u[7], pv7.P);
connect(ELoa.u, PLoa.y);
connect(EPro.u1, ESol.y);
connect(EPro.u2, EWin.y);
connect(ERat.u1, EPro.y);
connect(ERat.u2, ELoa.y);
end RenewableSources;