Name |
Description |
To_VolumeFraction
|
Example problem for conversion model |
model To_VolumeFraction
extends Modelica.Icons.Example;
package Medium =
Annex60.Media.Air(extraPropertiesNames={"CO2"});
Annex60.Fluid.Sensors.Conversions.To_VolumeFraction conMasVolFra(MMMea=
Modelica.Media.IdealGases.Common.SingleGasesData.CO2.MM)
;
Modelica.Blocks.Sources.Constant volFra(k=1000E-6)
;
Annex60.Controls.Continuous.LimPID limPID(
controllerType=Modelica.Blocks.Types.SimpleController.PI,
reverseAction=true,
Ti=600,
k=2,
Td=1);
Annex60.Fluid.Sensors.TraceSubstances senCO2(
redeclare package Medium =
Medium, substanceName="CO2") ;
Annex60.Fluid.MixingVolumes.MixingVolume vol(
nPorts=4,
redeclare package Medium = Medium,
V=4*4*2.7,
C_start={300E-6}*44.009544/28.9651159,
m_flow_nominal=0.1,
energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial) ;
Annex60.Fluid.Sources.TraceSubstancesFlowSource souCO2(
use_m_flow_in=true,
redeclare package Medium = Medium,
nPorts=1) ;
Modelica.Blocks.Math.Gain CO2Per(k=15/1000/3600*1.977)
;
Annex60.Fluid.Sources.MassFlowSource_T sou(
use_m_flow_in=true,
redeclare package Medium = Medium,
C={300E-6}*44.009544/28.9651159,
nPorts=1) ;
Annex60.Fluid.Sources.FixedBoundary sin(
redeclare package Medium = Medium,
p=100000,
C={300E-6}*44.009544/28.9651159,
nPorts=1) ;
Modelica.Blocks.Math.Gain gai(k=50/3600) ;
Modelica.Blocks.Sources.Constant nPeo(k=1) ;
Annex60.Fluid.Sensors.VolumeFlowRate senVolFlo(
redeclare package Medium =
Medium, m_flow_nominal=0.1);
Modelica.Blocks.Math.Gain norSet(k=1/1000E-6)
;
Modelica.Blocks.Math.Gain norMea(k=1/1000E-6)
;
Modelica.Blocks.Math.Gain conVolFlo(k=3600, y(unit="m3/h"))
;
Annex60.Fluid.Sensors.TraceSubstancesTwoPort senTraSubPeo(m_flow_nominal=0.1,
redeclare package Medium = Medium,
C_start=0,
initType=Modelica.Blocks.Types.Init.InitialState)
;
Annex60.Fluid.Sensors.TraceSubstancesTwoPort senTraSubFre(m_flow_nominal=0.1,
redeclare package Medium = Medium,
C_start=0,
initType=Modelica.Blocks.Types.Init.InitialState)
;
Annex60.Fluid.FixedResistances.PressureDrop res(
redeclare package Medium = Medium,
dp_nominal=10,
m_flow_nominal=50/3600)
;
equation
connect(souCO2.m_flow_in, CO2Per.y);
connect(gai.y, sou.m_flow_in);
connect(limPID.y, gai.u);
connect(nPeo.y, CO2Per.u);
connect(sou.ports[1], senVolFlo.port_a);
connect(senCO2.C, conMasVolFra.m);
connect(conMasVolFra.V, norMea.u);
connect(norMea.y, limPID.u_m);
connect(volFra.y, norSet.u);
connect(norSet.y, limPID.u_s);
connect(conVolFlo.u, senVolFlo.V_flow);
connect(souCO2.ports[1], senTraSubPeo.port_a);
connect(senTraSubPeo.port_b, vol.ports[1]);
connect(senVolFlo.port_b, senTraSubFre.port_a);
connect(senTraSubFre.port_b, vol.ports[2]);
connect(vol.ports[3], senCO2.port);
connect(vol.ports[4], res.port_a);
connect(res.port_b, sin.ports[1]);
end To_VolumeFraction;