This model demonstrates how to connect fluid flow component to a
boundary condition that has environmental conditions as
obtained from a weather file.
The model draws a constant mass flow rate of outside air through
its components.
This model demonstrates the use of a source for ambient conditions that computes
the wind pressure on a facade of a low-rise building.
Weather data are used for San Francisco, for a period of a week
where the wind blows primarily from North-West.
The plot shows that the wind pressure on the north- and west-facing
facade is positive,
whereas it is negative for the south- and east-facing facades.
model Outside_CpLowRise
extends Modelica.Icons.Example;
package Medium =
Annex60.Media.Air ;
Annex60.Fluid.Sources.Outside_CpLowRise west(
redeclare package Medium = Medium,
s=5,
azi=Annex60.Types.Azimuth.W,
Cp0=0.6) ;
Annex60.BoundaryConditions.WeatherData.ReaderTMY3 weaDat(
filNam="modelica://Annex60/Resources/weatherdata/USA_CA_San.Francisco.Intl.AP.724940_TMY3.mos");
Annex60.Fluid.Sources.Outside_CpLowRise north(
redeclare package Medium = Medium,
s=1/5,
azi=Annex60.Types.Azimuth.N,
Cp0=0.6) ;
Annex60.Fluid.Sources.Outside_CpLowRise south(
redeclare package Medium = Medium,
s=1/5,
azi=Annex60.Types.Azimuth.S,
Cp0=0.6) ;
Annex60.Fluid.Sources.Outside_CpLowRise east(
redeclare package Medium = Medium,
s=5,
azi=Annex60.Types.Azimuth.E,
Cp0=0.6) ;
equation
connect(weaDat.weaBus, west.weaBus);
connect(weaDat.weaBus, north.weaBus);
connect(weaDat.weaBus, south.weaBus);
connect(weaDat.weaBus, east.weaBus);
end Outside_CpLowRise;
model TraceSubstancesFlowSource
extends Modelica.Icons.Example;
package Medium =
Annex60.Media.Air(extraPropertiesNames={"CO2"});
MixingVolumes.MixingVolume vol(
redeclare package Medium = Medium,
V=100,
m_flow_nominal=1,
nPorts=3,
energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial) ;
Sources.TraceSubstancesFlowSource sou(
redeclare package Medium = Medium,
use_m_flow_in=true,
nPorts=1);
Modelica.Blocks.Sources.Step step( startTime=0.5,
height=-2,
offset=2);
FixedResistances.PressureDrop res(
redeclare package Medium = Medium,
m_flow_nominal=1,
dp_nominal=1)
;
MixingVolumes.MixingVolume vol1(
redeclare package Medium = Medium,
V=100,
m_flow_nominal=1,
nPorts=3,
energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial) ;
Sources.TraceSubstancesFlowSource sou1(
redeclare package Medium = Medium,
use_m_flow_in=true,
nPorts=1);
Annex60.Utilities.Diagnostics.AssertEquality assEqu(threShold=1E-4)
;
MixingVolumes.MixingVolume vol2(
redeclare package Medium = Medium,
p_start=Medium.p_default,
V=100,
m_flow_nominal=1,
nPorts=3,
energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial) ;
MixingVolumes.MixingVolume vol3(
redeclare package Medium = Medium,
p_start=Medium.p_default,
V=100,
m_flow_nominal=1,
nPorts=3,
energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial) ;
Annex60.Utilities.Diagnostics.AssertEquality assEqu1(
threShold=1E-4)
;
MixingVolumes.MixingVolume vol4(
redeclare package Medium = Medium,
nPorts=4,
p_start=Medium.p_default,
V=100,
m_flow_nominal=1,
energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial) ;
Sources.TraceSubstancesFlowSource sou2(
redeclare package Medium = Medium,
use_m_flow_in=true,
nPorts=1);
Annex60.Fluid.Sources.Boundary_pT bou(
redeclare package Medium = Medium,
p=101325,
nPorts=1,
T=293.15);
Annex60.Fluid.Sources.Boundary_pT sin(
redeclare package Medium = Medium,
nPorts=2,
p=101320,
T=293.15) ;
FixedResistances.PressureDrop res1(
redeclare package Medium = Medium,
m_flow_nominal=1,
dp_nominal=1)
;
FixedResistances.PressureDrop res2(
redeclare package Medium = Medium,
m_flow_nominal=1,
dp_nominal=1)
;
FixedResistances.PressureDrop res3(
redeclare package Medium = Medium,
m_flow_nominal=1,
dp_nominal=1)
;
Sensors.TraceSubstances C(
redeclare package Medium = Medium)
;
Sensors.TraceSubstances C1(
redeclare package Medium = Medium)
;
Sensors.TraceSubstances C2(
redeclare package Medium = Medium)
;
Sensors.TraceSubstances C3(
redeclare package Medium = Medium)
;
FixedResistances.PressureDrop res4(
redeclare package Medium = Medium,
m_flow_nominal=1,
dp_nominal=1)
;
FixedResistances.PressureDrop res6(
redeclare package Medium = Medium,
m_flow_nominal=1,
dp_nominal=1)
;
FixedResistances.PressureDrop res5(
redeclare package Medium = Medium,
m_flow_nominal=1,
dp_nominal=1)
;
FixedResistances.PressureDrop res7(
redeclare package Medium = Medium,
m_flow_nominal=1,
dp_nominal=1)
;
Annex60.Fluid.Sources.Boundary_pT sin1(
redeclare package Medium = Medium,
nPorts=2,
p=101320,
T=293.15) ;
equation
connect(res3.port_b, vol4.ports[2]);
connect(res1.port_b, sin.ports[1]);
connect(res2.port_b, sin.ports[2]);
connect(bou.ports[1], res3.port_a);
connect(sou1.ports[1], res.port_a);
connect(sou2.ports[1], vol4.ports[1]);
connect(step.y, sou.m_flow_in);
connect(step.y, sou1.m_flow_in);
connect(step.y, sou2.m_flow_in);
connect(assEqu.u1, C.C);
connect(C1.C, assEqu.u2);
connect(assEqu1.u1, C2.C);
connect(C3.C, assEqu1.u2);
connect(sou.ports[1], vol.ports[1]);
connect(vol.ports[2], C.port);
connect(res.port_b, vol1.ports[1]);
connect(vol1.ports[2], C1.port);
connect(vol2.ports[1], res1.port_a);
connect(vol3.ports[1], res2.port_a);
connect(C2.port, vol2.ports[2]);
connect(C3.port, vol3.ports[2]);
connect(vol4.ports[3], res4.port_a);
connect(vol4.ports[4], res6.port_a);
connect(res6.port_b, vol3.ports[3]);
connect(res4.port_b, vol2.ports[3]);
connect(vol.ports[3], res5.port_a);
connect(res5.port_b, sin1.ports[1]);
connect(vol1.ports[3], res7.port_a);
connect(res7.port_b, sin1.ports[2]);
end TraceSubstancesFlowSource;