Name | Description |
---|---|
PrescribedExtraPropertyFlow |
Type | Name | Default | Description |
---|---|---|---|
replaceable package Medium | Buildings.Media.GasesPTDecou... |
Type | Name | Description |
---|---|---|
replaceable package Medium |
model PrescribedExtraPropertyFlow package Medium = Buildings.Media.GasesPTDecoupled.SimpleAir(extraPropertiesNames={"CO2"}); // package Medium = Buildings.Media.GasesPTDecoupled.SimpleAir; MixingVolumes.MixingVolume vol( redeclare package Medium = Medium, initType=Modelica_Fluid.Types.Init.InitialValues, nP=1, V=100) "Mixing volume"; inner Modelica_Fluid.Ambient ambient; PrescribedExtraPropertyFlowRate sou(redeclare package Medium = Medium); Modelica.Blocks.Sources.Step step( startTime=0.5, height=-2, offset=2); FixedResistances.FixedResistanceDpM res( redeclare package Medium = Medium, m0_flow=1, dp0=1) "Resistance, used to check if species are transported between ports"; MixingVolumes.MixingVolume vol1( redeclare package Medium = Medium, initType=Modelica_Fluid.Types.Init.InitialValues, nP=1, V=100) "Mixing volume"; PrescribedExtraPropertyFlowRate sou1( redeclare package Medium = Medium); Buildings.Utilities.Controls.AssertEquality assEqu(threShold=1E-4) "Assert that both volumes have the same concentration"; Modelica.Blocks.Sources.RealExpression reaExp(y=vol.mC[1]); Modelica.Blocks.Sources.RealExpression reaExp1(y=vol1.mC[1]); MixingVolumes.MixingVolume vol2( redeclare package Medium = Medium, nP=2, initType=Modelica_Fluid.Types.Init.SteadyState, p_start=Medium.p_default, V=100) "Mixing volume"; MixingVolumes.MixingVolume vol3( redeclare package Medium = Medium, nP=2, initType=Modelica_Fluid.Types.Init.SteadyState, p_start=Medium.p_default, V=100) "Mixing volume"; Buildings.Fluids.FixedResistances.SplitterFixedResistanceDpM spl( redeclare package Medium = Medium, m0_flow={1,1,1}, dp0={1,1,1}, from_dp=false); Buildings.Utilities.Controls.AssertEquality assEqu1( threShold=1E-4) "Assert that both volumes have the same concentration"; Modelica.Blocks.Sources.RealExpression reaExp2(y=vol2.mC[1]); Modelica.Blocks.Sources.RealExpression reaExp3(y=vol3.mC[1]); MixingVolumes.MixingVolume vol4( redeclare package Medium = Medium, nP=3, initType=Modelica_Fluid.Types.Init.SteadyState, p_start=Medium.p_default, V=100) "Mixing volume"; PrescribedExtraPropertyFlowRate sou2( redeclare package Medium = Medium); PrescribedBoundary_pTX bou( redeclare package Medium = Medium, p=101325, T=293.15); FixedBoundary_pTX bou1( redeclare package Medium = Medium, T=293.15, p=101320); FixedBoundary_pTX bou2( redeclare package Medium = Medium, T=293.15, p=101320); FixedResistances.FixedResistanceDpM res1( redeclare package Medium = Medium, m0_flow=1, dp0=1) "Resistance, used to check if species are transported between ports"; FixedResistances.FixedResistanceDpM res2( redeclare package Medium = Medium, m0_flow=1, dp0=1) "Resistance, used to check if species are transported between ports"; FixedResistances.FixedResistanceDpM res3( redeclare package Medium = Medium, m0_flow=1, dp0=1) "Resistance, used to check if species are transported between ports"; equation connect(sou.port, vol.port[1]); connect(step.y, sou.mC_flow_in[1]); connect(step.y, sou1.mC_flow_in[1]); connect(sou1.port, res.port_a); connect(res.port_b, vol1.port[1]); connect(reaExp.y, assEqu.u1); connect(reaExp1.y, assEqu.u2); connect(reaExp2.y, assEqu1.u1); connect(reaExp3.y, assEqu1.u2); connect(step.y, sou2.mC_flow_in[1]); connect(sou2.port, vol4.port[1]); connect(vol4.port[2], spl.port_3); connect(spl.port_1, vol2.port[1]); connect(spl.port_2, vol3.port[1]); connect(bou1.port, res1.port_b); connect(bou2.port, res2.port_b); connect(res2.port_a, vol3.port[2]); connect(res1.port_a, vol2.port[2]); connect(bou.port, res3.port_a); connect(res3.port_b, vol4.port[3]); end PrescribedExtraPropertyFlow;