Buildings.Fluids.Examples

Collection of models that illustrate model use and test models

Information


This package contains examples for the use of models
that can be found in 
Buildings.Fluid.

Package Content

NameDescription
Buildings.Fluids.Examples.BaseClasses BaseClasses Package with base classes for example models
Damper  
Delay  
FixedResistance  
FixedResistancesParallel  
FlowMachine  
MITScalable System model for MIT building
MixingVolume  
MixingVolumeDryAir  
MixingVolumeInitialization  
MixingVolumeMoistAir  
OAMixingBoxMinimumDamper  
Resistances Test of multiple resistances
SplitterFixedResistanceDpM  
ThreeWayValves  
TwoWayValves  
TwoWayValvesMotor  
VAVBoxExponential  


Buildings.Fluids.Examples.Damper

Buildings.Fluids.Examples.Damper

Parameters

TypeNameDefaultDescription
replaceable package MediumBuildings.Media.IdealGases.S... 

Connectors

TypeNameDescription
replaceable package Medium 

Modelica definition

model Damper 
  
  
 package Medium = Buildings.Media.IdealGases.SimpleAir;
  
  Buildings.Fluids.Actuators.Dampers.Exponential res(
    A=1,
    redeclare package Medium = Medium);
    Modelica.Blocks.Sources.Ramp yRam(
    duration=0.3,
    height=1,
    offset=0,
    startTime=0.2);
  Buildings.Fluids.Sources.PrescribedBoundary_pTX sou(redeclare package Medium 
      = Medium, T=293.15);
  Buildings.Fluids.Sources.PrescribedBoundary_pTX sin(redeclare package Medium 
      = Medium, T=293.15);
    Modelica.Blocks.Sources.Constant PAtm(k=101325);
  Buildings.Fluids.Actuators.Dampers.Exponential res1(
    A=1,
    redeclare package Medium = Medium);
    Modelica.Blocks.Sources.Ramp yRam1(
    duration=0.3,
    height=1,
    offset=0);
    Modelica.Blocks.Sources.Ramp P1(
    duration=0.5,
    startTime=0.5,
    height=-10,
    offset=101330);
  Buildings.Fluids.Sources.PrescribedBoundary_pTX sou1(
                                                    redeclare package Medium = 
        Medium, T=293.15);
  Buildings.Fluids.Sources.PrescribedBoundary_pTX sin1(
                                                    redeclare package Medium = 
        Medium, T=293.15);
    Modelica.Blocks.Sources.Constant PAtm1(
                                          k=101325);
    Modelica.Blocks.Sources.Constant PAtm0(k=101335);
equation 
  connect(yRam.y, res.y);
  connect(res.port_b, sin.port);
  connect(res.port_a, sou.port);
  connect(PAtm.y, sin.p_in);
  connect(yRam1.y, res1.y);
  connect(res1.port_b, sin1.port);
  connect(res1.port_a, sou1.port);
  connect(P1.y, sou1.p_in);
  connect(PAtm1.y, sin1.p_in);
  connect(PAtm0.y, sou.p_in);
end Damper;

Buildings.Fluids.Examples.Delay

Buildings.Fluids.Examples.Delay

Parameters

TypeNameDefaultDescription
replaceable package MediumBuildings.Media.ConstantProp... 

Connectors

TypeNameDescription
replaceable package Medium 

Modelica definition

model Delay 
  
 package Medium = Buildings.Media.ConstantPropertyLiquidWater;
// package Medium = Buildings.Media.IdealGases.SimpleAir;
  
    Modelica.Blocks.Sources.Constant PAtm(k=101325);
    Modelica.Blocks.Sources.Ramp P(
      duration=1,
    height=20,
    offset=101315);
    Buildings.Fluids.FixedResistances.FixedResistanceDpM res1(
    from_dp=true,
    m0_flow=5,
    dp0=5,
    redeclare package Medium = Medium);
  Buildings.Fluids.Sources.PrescribedBoundary_pTX sou(
                T=293.15, redeclare package Medium = Medium);
  Buildings.Fluids.Sources.PrescribedBoundary_pTX sin(
                T=283.15, redeclare package Medium = Medium);
    Buildings.Fluids.FixedResistances.FixedResistanceDpM res2(
    from_dp=true,
    m0_flow=5,
    dp0=5,
    redeclare package Medium = Medium);
  Buildings.Fluids.Delays.DelayFirstOrder del(         m0_flow=5, redeclare 
      package Medium = Medium,
    T_start=283.15,
    initType=Modelica_Fluid.Types.Init.InitialValues);
equation 
  connect(P.y, sou.p_in);
  connect(PAtm.y, sin.p_in);
  connect(sou.port, res1.port_a);
  connect(res2.port_b, sin.port);
  connect(del.port_b, res2.port_a);
  connect(del.port_a, res1.port_b);
end Delay;

Buildings.Fluids.Examples.FixedResistance

Buildings.Fluids.Examples.FixedResistance

Parameters

TypeNameDefaultDescription
replaceable package MediumBuildings.Media.ConstantProp... 

Connectors

TypeNameDescription
replaceable package Medium 

Modelica definition

model FixedResistance 
  import Buildings;
  
 package Medium = 
        Buildings.Media.ConstantPropertyLiquidWater;
    Modelica.Blocks.Sources.Constant PAtm(k=101325);
    Modelica.Blocks.Sources.Ramp P(
      duration=1,
    height=20,
    offset=101315);
    Buildings.Fluids.FixedResistances.FixedResistanceDpM res1(
    redeclare package Medium = Medium,
    from_dp=true,
    m0_flow=5,
    dp0=10);
  Buildings.Fluids.Sources.PrescribedBoundary_pTX sou1(
                                                    redeclare package Medium = 
        Medium, T=293.15);
  Buildings.Fluids.Sources.PrescribedBoundary_pTX sin1(
                                                    redeclare package Medium = 
        Medium, T=283.15);
    Buildings.Fluids.FixedResistances.FixedResistanceDpM res2(
    redeclare package Medium = Medium,
    from_dp=true,
    m0_flow=5,
    dp0=10,
    use_dh=true);
  Buildings.Fluids.Sources.PrescribedBoundary_pTX sou2(
                                                    redeclare package Medium = 
        Medium, T=293.15);
  Buildings.Fluids.Sources.PrescribedBoundary_pTX sin2(
                                                    redeclare package Medium = 
        Medium, T=283.15);
    Buildings.Fluids.FixedResistances.FixedResistanceDpM res3(
    redeclare package Medium = Medium,
    from_dp=true,
    m0_flow=5,
    dp0=10,
    use_dh=true);
  Buildings.Fluids.Sources.PrescribedBoundary_pTX sou3(
                                                    redeclare package Medium = 
        Medium, T=293.15);
  Buildings.Fluids.Sources.PrescribedBoundary_pTX sin3(
                                                    redeclare package Medium = 
        Medium, T=283.15);
  FixedResistances.LosslessPipe pipCon(redeclare package Medium = Medium) 
    "Lossless pipe connection";
  Modelica_Fluid.Sensors.MassFlowRate masFlo2(redeclare package Medium = Medium) 
    "Mass flow rate sensor";
  Modelica_Fluid.Sensors.MassFlowRate masFlo3(redeclare package Medium = Medium) 
    "Mass flow rate sensor";
  Buildings.Utilities.Controls.AssertEquality assEqu(threShold=1E-4, message=
        "Inputs differ, check that lossless pipe is correctly implemented.") 
    "Assert equality of the two mass flow rates";
equation 
  connect(PAtm.y, sin1.p_in);
  connect(sou1.port, res1.port_a);
  connect(sin1.port, res1.port_b);
  connect(PAtm.y, sin2.p_in);
  connect(sou2.port, res2.port_a);
  connect(PAtm.y,sin3. p_in);
  connect(sou3.port,res3. port_a);
  connect(pipCon.port_b, sin3.port);
  connect(P.y, sou1.p_in);
  connect(P.y, sou2.p_in);
  connect(P.y, sou3.p_in);
  connect(res2.port_b, masFlo2.port_a);
  connect(masFlo2.port_b, sin2.port);
  connect(res3.port_b, masFlo3.port_a);
  connect(masFlo3.port_b, pipCon.port_a);
  connect(masFlo2.m_flow, assEqu.u1);
  connect(masFlo3.m_flow, assEqu.u2);
end FixedResistance;

Buildings.Fluids.Examples.FixedResistancesParallel

Buildings.Fluids.Examples.FixedResistancesParallel

Parameters

TypeNameDefaultDescription
replaceable package MediumBuildings.Media.ConstantProp... 

Connectors

TypeNameDescription
replaceable package Medium 

Modelica definition

model FixedResistancesParallel 
  import Buildings;
  
 package Medium = 
        Buildings.Media.ConstantPropertyLiquidWater;
    Modelica.Blocks.Sources.Constant PAtm(k=101325);
    Modelica.Blocks.Sources.Ramp P(
      duration=1,
    height=20,
    offset=101315);
    Buildings.Fluids.FixedResistances.FixedResistanceDpM res1(
    redeclare package Medium = Medium,
    m0_flow=5,
    dp0=10,
    deltaM=0.3,
    linearized=false,
    from_dp=false);
  Buildings.Fluids.Sources.PrescribedBoundary_pTX sou1(
                                                    redeclare package Medium = 
        Medium, T=293.15);
  Buildings.Fluids.Sources.PrescribedBoundary_pTX sin1(
                                                    redeclare package Medium = 
        Medium, T=283.15);
    Buildings.Fluids.FixedResistances.FixedResistanceDpM res2(
    redeclare package Medium = Medium,
    m0_flow=5,
    dp0=10,
    deltaM=0.3,
    linearized=false,
    from_dp=false);
  Modelica_Fluid.Sensors.MassFlowRate masFlo2(redeclare package Medium = Medium) 
    "Mass flow rate sensor";
  Buildings.Utilities.Controls.AssertEquality assEqu(threShold=1E-4, message=
        "Inputs differ, check that lossless pipe is correctly implemented.") 
    "Assert equality of the two mass flow rates";
  Modelica_Fluid.Sensors.MassFlowRate masFlo1(redeclare package Medium = Medium) 
    "Mass flow rate sensor";
equation 
  connect(PAtm.y, sin1.p_in);
  connect(sou1.port, res1.port_a);
  connect(P.y, sou1.p_in);
  connect(res2.port_b, masFlo2.port_a);
  connect(res1.port_b, masFlo1.port_a);
  connect(masFlo1.port_b, sin1.port);
  connect(masFlo2.port_b, sin1.port);
  connect(sou1.port, res2.port_a);
  connect(masFlo1.m_flow, assEqu.u1);
  connect(masFlo2.m_flow, assEqu.u2);
end FixedResistancesParallel;

Buildings.Fluids.Examples.FlowMachine

Buildings.Fluids.Examples.FlowMachine

Parameters

TypeNameDefaultDescription
replaceable package MediumBuildings.Media.PerfectGases... 

Connectors

TypeNameDescription
replaceable package Medium 

Modelica definition

model FlowMachine 
  
   //package Medium = Buildings.Media.IdealGases.SimpleAir;
    package Medium =  Buildings.Media.PerfectGases.MoistAir;
    Modelica.Blocks.Sources.Ramp P(
    height=-1500,
    offset=101325,
    duration=1.5);
  Buildings.Fluids.Movers.FlowMachinePolynomial fan(
    D=0.6858,
    a={4.2904,-1.387,4.2293,-3.92920,0.8534},
    b={0.1162,1.5404,-1.4825,0.7664,-0.1971},
    mNorMin_flow=1,
    mNorMax_flow=2,
    redeclare package Medium = Medium);
  Modelica.Blocks.Sources.Constant N(k=22.3333);
  Buildings.Fluids.Sources.PrescribedBoundary_pTX sou(redeclare package Medium 
      = Medium, T=293.15);
  Buildings.Fluids.Sources.PrescribedBoundary_pTX sin(redeclare package Medium 
      = Medium, T=293.15);
    Modelica.Blocks.Sources.Constant PAtm(k=101325);
  Utilities.printer printer(
    fileName="outputFan.txt",
    nin=6,
    header="time dp dpNorm mNorm m_flow power");
  Modelica.Blocks.Sources.RealExpression fan_mFlow(y=fan.m_flow);
  Modelica.Blocks.Sources.RealExpression simTim2(y=time);
  Modelica.Blocks.Sources.RealExpression fan_dp(y=fan.dp);
  Modelica.Blocks.Sources.RealExpression fan_dpNor(y=fan.pNor);
  Modelica.Blocks.Sources.RealExpression fan_mNor(y=fan.mNor_flow);
  Modelica.Blocks.Sources.RealExpression fan_PSha(y=fan.PSha);
equation 
  
  connect(simTim2.y, printer.x[1]);
  connect(fan_dp.y, printer.x[2]);
  connect(fan_dpNor.y, printer.x[3]);
  connect(fan_mNor.y, printer.x[4]);
  connect(fan_PSha.y, printer.x[6]);
  connect(fan_mFlow.y, printer.x[5]);
  connect(sin.port, fan.port_b);
  connect(sou.port, fan.port_a);
  connect(N.y, fan.N_in);
  connect(P.y, sou.p_in);
  connect(PAtm.y, sin.p_in);
end FlowMachine;

Buildings.Fluids.Examples.MITScalable

System model for MIT building

Buildings.Fluids.Examples.MITScalable

Parameters

TypeNameDefaultDescription
replaceable package MediumBuildings.Media.GasesPTDecou... 
IntegerNSui1Number of suites
MassFlowRatemOneSuite_flowsui[1].m0Tot_flowNominal mass flow rate of one suite [kg/s]
MassFlowRatemMIT_flowmOneSuite_flow + vav44.m0_flowNominal mass flow rate of MIT system model as in ASHRAE 825-RP [kg/s]
Pressuredp0SuiSup95Pressure drop supply air leg with splitters of one suite (obtained from simulation) [Pa]
Pressuredp0SuiRet233Pressure drop return air leg with splitters of one suite (obtained from simulation) [Pa]
Pressuredp0FanSupMIT1050Pressure increase over supply fan in MIT system model as in ASHRAE 825-RP (obtained from simulation) [Pa]
Pressuredp0FanRetMIT347Pressure increase over supply fan in MIT system model as in ASHRAE 825-RP (obtained from simulation) [Pa]
RealscaM_flow(mMIT_flow + (NSui - 1)*mOne...Scaling factor for mass flow rate with NSui number of suites
RealscaDp0FanSup(dp0FanSupMIT + (NSui - 1)*d...Scaling factor for supply fan pressure lift with NSui number of suites
RealscaDp0FanRet(dp0FanRetMIT + (NSui - 1)*d...Scaling factor for supply fan pressure lift with NSui number of suites

Connectors

TypeNameDescription
replaceable package Medium 

Modelica definition

model MITScalable "System model for MIT building" 
  
  
// package Medium = Buildings.Media.IdealGases.SimpleAir;
// package Medium = Modelica.Media.Air.SimpleAir;
// package Medium = Modelica.Media.Air.MoistAir;
// package Medium = Buildings.Media.GasesPTDecoupled.SimpleAir;
// package Medium = Buildings.Media.PerfectGases.MoistAir;
// this currently does not converge package Medium = Buildings.Media.PerfectGases.MoistAirNonsaturated;
  package Medium = Buildings.Media.GasesPTDecoupled.MoistAir;
  
  parameter Integer NSui = 1 "Number of suites";
  parameter Modelica.SIunits.MassFlowRate mOneSuite_flow = sui[1].m0Tot_flow 
    "Nominal mass flow rate of one suite";
  parameter Modelica.SIunits.MassFlowRate mMIT_flow = mOneSuite_flow + vav44.m0_flow 
    "Nominal mass flow rate of MIT system model as in ASHRAE 825-RP";
  
  parameter Modelica.SIunits.Pressure dp0SuiSup = 95 
    "Pressure drop supply air leg with splitters of one suite (obtained from simulation)";
  parameter Modelica.SIunits.Pressure dp0SuiRet = 233 
    "Pressure drop return air leg with splitters of one suite (obtained from simulation)";
  parameter Modelica.SIunits.Pressure dp0FanSupMIT = 1050 
    "Pressure increase over supply fan in MIT system model as in ASHRAE 825-RP (obtained from simulation)";
  parameter Modelica.SIunits.Pressure dp0FanRetMIT = 347 
    "Pressure increase over supply fan in MIT system model as in ASHRAE 825-RP (obtained from simulation)";
  
  parameter Real scaM_flow = ( mMIT_flow + (NSui-1) * mOneSuite_flow)  / mMIT_flow 
    "Scaling factor for mass flow rate with NSui number of suites";
  parameter Real scaDp0FanSup = ( dp0FanSupMIT + (NSui-1) * dp0SuiSup) / dp0FanSupMIT 
    "Scaling factor for supply fan pressure lift with NSui number of suites";
  parameter Real scaDp0FanRet = ( dp0FanRetMIT + (NSui-1) * dp0SuiRet)  / dp0FanRetMIT 
    "Scaling factor for supply fan pressure lift with NSui number of suites";
  
  Buildings.Fluids.Actuators.Dampers.OAMixingBoxMinimumDamper mixBox(
    dp0Out=0.467,
    dp0Rec=0.665,
    dp0Exh=0.164,
    dp0OutMin=0.467,
    AOutMin=scaM_flow*0.38,
    AOut=scaM_flow*1.32,
    AExh=scaM_flow*1.05,
    ARec=scaM_flow*1.05,
    m0OutMin_flow=scaM_flow*0.1*1,
    m0Out_flow=scaM_flow*1,
    m0Rec_flow=scaM_flow*1,
    m0Exh_flow=scaM_flow*1,
    redeclare package Medium = Medium) "mixing box";
    Buildings.Fluids.Sources.PrescribedBoundary_pTX bouIn(redeclare package 
      Medium = Medium, T=293.15);
    Buildings.Fluids.Sources.PrescribedBoundary_pTX bouExh(redeclare package 
      Medium = Medium, T=293.15);
    Modelica.Blocks.Sources.Constant PAtm(k=101325);
    Modelica.Blocks.Sources.Constant yMinOA(k=0.5);
    Buildings.Fluids.Sources.PrescribedBoundary_pTX bouIn2(redeclare package 
      Medium = Medium, T=293.15);
  Buildings.Fluids.FixedResistances.FixedResistanceDpM res31(
                                                 dp0=0.546,
    m0_flow=scaM_flow*1,
    dh=sqrt(scaM_flow)*1,
    redeclare package Medium = Medium);
  Buildings.Fluids.Movers.FlowMachinePolynomial fan32(
    D=0.6858,
    a={4.2904,-1.387,4.2293,-3.92920,0.8534},
    b={0.1162,1.5404,-1.4825,0.7664,-0.1971},
    mNorMin_flow=1,
    mNorMax_flow=2,
    scaM_flow=scaM_flow,
    scaDp=scaDp0FanSup,
    redeclare package Medium = Medium);
  Buildings.Fluids.FixedResistances.FixedResistanceDpM res33(
    dp0=0.164,
    dh=sqrt(scaM_flow)*1,
    m0_flow=scaM_flow*1,
    redeclare package Medium = Medium);
  Buildings.Fluids.FixedResistances.FixedResistanceDpM res57(
                                                 dp0=0.118000,
    m0_flow=scaM_flow*1,
    dh=sqrt(scaM_flow)*1,
    redeclare package Medium = Medium);
  Buildings.Fluids.Movers.FlowMachinePolynomial fan56(
    D=1.13,
    a={4.19370,-1.63370,12.2110,-23.9619,9.81620},
    b={0.619000E-01,3.14170,-5.75510,6.16760,-3.37480},
    mNorMin_flow=0.7,
    mNorMax_flow=1.0,
    scaM_flow=scaM_flow,
    scaDp=scaDp0FanRet,
    redeclare package Medium = Medium);
  Buildings.Fluids.Actuators.Dampers.VAVBoxExponential vav44(
    dp0=0.999E2,
    A=0.024,
    m0_flow=0.132*1.2,
    redeclare package Medium = Medium);
  Buildings.Fluids.MixingVolumes.MixingVolume roo50(redeclare package Medium = Medium,
    initType=Modelica_Fluid.Types.Init.SteadyStateHydraulic,
    V=10*5*2.5,
    nP=5);
  Buildings.Fluids.Examples.BaseClasses.RoomLeakage lea50(redeclare package 
      Medium = 
        Medium) "Room leakage model";
  Buildings.Fluids.FixedResistances.FixedResistanceDpM res1(
                                      m0_flow=1, dp0=0.1E3,
    redeclare package Medium = Medium);
  Buildings.Fluids.Examples.BaseClasses.Suite[NSui] sui(redeclare each package 
      Medium = Medium);
  Buildings.Fluids.Examples.BaseClasses.ControlSignals y;
equation 
  connect(yMinOA.y, mixBox.yOutMin);
  connect(mixBox.port_Sup, res31.port_a);
  connect(res31.port_b,fan32.port_a);
  connect(fan32.port_b, res33.port_a);
  connect(fan56.port_b, res57.port_b);
  connect(res57.port_a, mixBox.port_Ret);
  connect(bouExh.port, mixBox.port_Exh);
  connect(PAtm.y, bouExh.p_in);
  connect(PAtm.y, bouIn2.p_in);
  connect(PAtm.y, bouIn.p_in);
  connect(bouIn.port, mixBox.port_OutMin);
  connect(bouIn2.port, mixBox.port_Out);
  connect(vav44.port_b,roo50.port[1]);
  connect(PAtm.y, lea50.p);
  connect(lea50.port_b,roo50.port[2]);
  connect(res1.port_a, roo50.port[3]);
  connect(sui[1].port_aRoo, res1.port_b);
  connect(roo50.port[4], sui[NSui].port_aExh);
  connect(vav44.port_a, sui[NSui].port_bSup);
  connect(sui[NSui].port_bRoo, roo50.port[5]);
  connect(res33.port_b, sui[1].port_aSup);
  connect(fan56.port_a, sui[1].port_bExh);
  for i in 1:NSui loop
  connect(PAtm.y, sui[i].p);
  connect(y.yVAV, sui[i].yDam);
  end for;
  for i in 1:NSui-1 loop
  connect(sui[i+1].port_aSup, sui[i].port_bSup);
  connect(sui[i+1].port_bExh, sui[i].port_aExh);
  connect(sui[i+1].port_aRoo, sui[i].port_bRoo);
  end for;
  
  connect(y.ySupFan, fan32.N_in);
  connect(y.yRetFan, fan56.N_in);
  connect(y.yOSA, mixBox.y);
  connect(y.yVAV, vav44.y);
end MITScalable;

Buildings.Fluids.Examples.MixingVolume

Buildings.Fluids.Examples.MixingVolume

Parameters

TypeNameDefaultDescription
replaceable package MediumBuildings.Media.PerfectGases... 

Connectors

TypeNameDescription
replaceable package Medium 

Modelica definition

model MixingVolume 
  import Buildings;
  
  
// package Medium = Buildings.Media.IdealGases.SimpleAir;
 package Medium = Buildings.Media.PerfectGases.MoistAir;
  
    Modelica.Blocks.Sources.Ramp P(
    duration=0.5,
    startTime=0.5,
    height=-10,
    offset=101330);
  Buildings.Fluids.Sources.PrescribedBoundary_pTX sou(redeclare package Medium 
      = Medium, T=293.15);
  Buildings.Fluids.Sources.PrescribedBoundary_pTX sin(redeclare package Medium 
      = Medium, T=283.15);
    Modelica.Blocks.Sources.Constant PAtm(k=101325);
    Buildings.Fluids.FixedResistances.FixedResistanceDpM res1(
    redeclare each package Medium = Medium,
    dp0=5,
    from_dp=true,
    m0_flow=2);
  MixingVolumes.MixingVolume vol1(
    redeclare package Medium = Medium,
    initType=Modelica_Fluid.Types.Init.SteadyStateHydraulic,
    nP=2,
    V=0.1);
    Buildings.Fluids.FixedResistances.FixedResistanceDpM res2(
    redeclare each package Medium = Medium,
    dp0=5,
    from_dp=true,
    m0_flow=2);
  Buildings.Fluids.Sources.PrescribedBoundary_pTX sou1(
                                                    redeclare package Medium = 
        Medium, T=293.15);
  Buildings.Fluids.Sources.PrescribedBoundary_pTX sin1(
                                                    redeclare package Medium = 
        Medium, T=283.15);
    Buildings.Fluids.FixedResistances.FixedResistanceDpM res11(
    redeclare each package Medium = Medium,
    dp0=5,
    from_dp=true,
    m0_flow=2);
    Buildings.Fluids.FixedResistances.FixedResistanceDpM res12(
    redeclare each package Medium = Medium,
    dp0=5,
    from_dp=true,
    m0_flow=2);
  Modelica_Fluid.Volumes.MixingVolume vol(
    redeclare package Medium = Medium,
    initType=Modelica_Fluid.Types.Init.SteadyStateHydraulic,
    V=0.1);
  Buildings.Utilities.Controls.AssertEquality assertEquality;
  Buildings.Fluids.Sensors.EnthalpyFlowRate entFloRat(redeclare package Medium 
      = Medium) "Enthalpy flow rate";
  Buildings.Fluids.Sensors.EnthalpyFlowRate entFloRat1(redeclare package Medium
      = Medium) "Enthalpy flow rate";
  Buildings.Fluids.MixingVolumes.MixingVolumeMoistAir vol2(
    redeclare package Medium = Medium,
    initType=Modelica_Fluid.Types.Init.SteadyStateHydraulic,
    nP=2,
    V=0.1);
  Buildings.Fluids.Sources.PrescribedBoundary_pTX sou2(
                                                    redeclare package Medium = 
        Medium, T=293.15);
  Buildings.Fluids.Sources.PrescribedBoundary_pTX sin2(
                                                    redeclare package Medium = 
        Medium, T=283.15);
    Buildings.Fluids.FixedResistances.FixedResistanceDpM res21(
    redeclare each package Medium = Medium,
    dp0=5,
    from_dp=true,
    m0_flow=2);
    Buildings.Fluids.FixedResistances.FixedResistanceDpM res22(
    redeclare each package Medium = Medium,
    dp0=5,
    from_dp=true,
    m0_flow=2);
  Buildings.Utilities.Controls.AssertEquality assertEquality1;
  Buildings.Fluids.Sensors.EnthalpyFlowRate entFloRat2(redeclare package Medium
      = Medium) "Enthalpy flow rate";
    Modelica.Blocks.Sources.Constant zero(k=0);
    Modelica.Blocks.Sources.Constant TLiq(k=283.15);
equation 
  connect(P.y, sou.p_in);
  connect(PAtm.y, sin.p_in);
  connect(sou.port, res1.port_a);
  connect(sin.port, res2.port_b);
  connect(sou1.port, res11.port_a);
  connect(sin1.port, res12.port_b);
  connect(P.y, sou1.p_in);
  connect(PAtm.y, sin1.p_in);
  connect(res2.port_a, entFloRat.port_b);
  connect(res12.port_a, entFloRat1.port_b);
  connect(entFloRat.H_flow, assertEquality.u1);
  connect(entFloRat1.H_flow, assertEquality.u2);
  connect(res1.port_b, vol.port_a);
  connect(vol.port_b, entFloRat.port_a);
  connect(res11.port_b, vol1.port[2]);
  connect(entFloRat1.port_a, vol1.port[1]);
  connect(sou2.port, res21.port_a);
  connect(sin2.port, res22.port_b);
  connect(P.y,sou2. p_in);
  connect(PAtm.y,sin2. p_in);
  connect(res22.port_a, entFloRat2.port_b);
  connect(entFloRat.H_flow, assertEquality1.u1);
  connect(entFloRat2.H_flow, assertEquality1.u2);
  connect(res21.port_b, vol2.port[2]);
  connect(entFloRat2.port_a, vol2.port[1]);
  connect(zero.y, vol2.mWat_flow);
  connect(TLiq.y, vol2.TWat);
end MixingVolume;

Buildings.Fluids.Examples.MixingVolumeDryAir

Buildings.Fluids.Examples.MixingVolumeDryAir

Parameters

TypeNameDefaultDescription
replaceable package MediumBuildings.Media.IdealGases.S...Medium in the component

Connectors

TypeNameDescription
replaceable package MediumMedium in the component

Modelica definition

model MixingVolumeDryAir 
  import Buildings;
  
  
 package Medium = Buildings.Media.IdealGases.SimpleAir(T_min=Modelica.SIunits.Conversions.from_degC(-50)) 
    "Medium in the component";
  
    Modelica.Blocks.Sources.Ramp P(
    duration=0.5,
    startTime=0.5,
    height=-10,
    offset=101330);
  Buildings.Fluids.Sources.PrescribedBoundary_pTX sou(redeclare package Medium 
      = Medium, T=293.15);
  Buildings.Fluids.Sources.PrescribedBoundary_pTX sin(redeclare package Medium 
      = Medium, T=283.15);
    Modelica.Blocks.Sources.Constant PAtm(k=101325);
    Buildings.Fluids.FixedResistances.FixedResistanceDpM res1(
    redeclare each package Medium = Medium,
    dp0=5,
    from_dp=true,
    m0_flow=2);
  MixingVolumes.MixingVolume vol1(
    redeclare package Medium = Medium,
    initType=Modelica_Fluid.Types.Init.SteadyStateHydraulic,
    nP=2,
    V=0.1);
    Buildings.Fluids.FixedResistances.FixedResistanceDpM res2(
    redeclare each package Medium = Medium,
    dp0=5,
    from_dp=true,
    m0_flow=2);
  Buildings.Fluids.Sources.PrescribedBoundary_pTX sou1(
                                                    redeclare package Medium = 
        Medium, T=293.15);
  Buildings.Fluids.Sources.PrescribedBoundary_pTX sin1(
                                                    redeclare package Medium = 
        Medium, T=283.15);
    Buildings.Fluids.FixedResistances.FixedResistanceDpM res11(
    redeclare each package Medium = Medium,
    dp0=5,
    from_dp=true,
    m0_flow=2);
    Buildings.Fluids.FixedResistances.FixedResistanceDpM res12(
    redeclare each package Medium = Medium,
    dp0=5,
    from_dp=true,
    m0_flow=2);
  Modelica_Fluid.Volumes.MixingVolume vol(
    redeclare package Medium = Medium,
    initType=Modelica_Fluid.Types.Init.SteadyStateHydraulic,
    V=0.1);
  Buildings.Utilities.Controls.AssertEquality assertEquality;
  Buildings.Fluids.Sensors.EnthalpyFlowRate entFloRat(redeclare package Medium 
      = Medium) "Enthalpy flow rate";
  Buildings.Fluids.Sensors.EnthalpyFlowRate entFloRat1(redeclare package Medium
      = Medium) "Enthalpy flow rate";
  Buildings.Fluids.MixingVolumes.MixingVolumeDryAir vol2(
    redeclare package Medium = Medium,
    initType=Modelica_Fluid.Types.Init.SteadyStateHydraulic,
    nP=2,
    V=0.1);
  Buildings.Fluids.Sources.PrescribedBoundary_pTX sou2(
                                                    redeclare package Medium = 
        Medium, T=293.15);
  Buildings.Fluids.Sources.PrescribedBoundary_pTX sin2(
                                                    redeclare package Medium = 
        Medium, T=283.15);
    Buildings.Fluids.FixedResistances.FixedResistanceDpM res21(
    redeclare each package Medium = Medium,
    dp0=5,
    from_dp=true,
    m0_flow=2);
    Buildings.Fluids.FixedResistances.FixedResistanceDpM res22(
    redeclare each package Medium = Medium,
    dp0=5,
    from_dp=true,
    m0_flow=2);
  Buildings.Utilities.Controls.AssertEquality assertEquality1;
  Buildings.Fluids.Sensors.EnthalpyFlowRate entFloRat2(redeclare package Medium
      = Medium) "Enthalpy flow rate";
    Modelica.Blocks.Sources.Constant zero(k=0);
    Modelica.Blocks.Sources.Constant TLiq(k=283.15);
equation 
  connect(P.y, sou.p_in);
  connect(PAtm.y, sin.p_in);
  connect(sou.port, res1.port_a);
  connect(sin.port, res2.port_b);
  connect(sou1.port, res11.port_a);
  connect(sin1.port, res12.port_b);
  connect(P.y, sou1.p_in);
  connect(PAtm.y, sin1.p_in);
  connect(res2.port_a, entFloRat.port_b);
  connect(res12.port_a, entFloRat1.port_b);
  connect(entFloRat.H_flow, assertEquality.u1);
  connect(entFloRat1.H_flow, assertEquality.u2);
  connect(res1.port_b, vol.port_a);
  connect(vol.port_b, entFloRat.port_a);
  connect(res11.port_b, vol1.port[2]);
  connect(entFloRat1.port_a, vol1.port[1]);
  connect(sou2.port, res21.port_a);
  connect(sin2.port, res22.port_b);
  connect(P.y,sou2. p_in);
  connect(PAtm.y,sin2. p_in);
  connect(res22.port_a, entFloRat2.port_b);
  connect(entFloRat.H_flow, assertEquality1.u1);
  connect(entFloRat2.H_flow, assertEquality1.u2);
  connect(res21.port_b, vol2.port[2]);
  connect(entFloRat2.port_a, vol2.port[1]);
  connect(zero.y, vol2.mWat_flow);
  connect(TLiq.y, vol2.TWat);
end MixingVolumeDryAir;

Buildings.Fluids.Examples.MixingVolumeInitialization

Buildings.Fluids.Examples.MixingVolumeInitialization

Parameters

TypeNameDefaultDescription
replaceable package MediumBuildings.Media.GasesPTDecou... 

Connectors

TypeNameDescription
replaceable package Medium 

Modelica definition

model MixingVolumeInitialization 
  
  
// package Medium = Buildings.Media.IdealGases.SimpleAir;
 //package Medium = Buildings.Media.PerfectGases.MoistAir;
 package Medium = Buildings.Media.GasesPTDecoupled.SimpleAir;
  
    Modelica.Blocks.Sources.Constant PAtm(k=101320);
  Buildings.Fluids.Sources.PrescribedBoundary_pTX sou1(
                                                    redeclare package Medium = 
        Medium, T=293.15);
  Buildings.Fluids.Sources.PrescribedBoundary_pTX sin1(
                                                    redeclare package Medium = 
        Medium, T=293.15);
  Modelica_Fluid.PressureLosses.WallFrictionAndGravity pipe1(
    redeclare package Medium = Medium,
    p_start=101325,
    flowDirection=Modelica_Fluid.Types.FlowDirection.Bidirectional,
    length=1,
    diameter=0.25);
  Modelica_Fluid.PressureLosses.WallFrictionAndGravity pipe2(
    redeclare package Medium = Medium,
    p_start=101325,
    flowDirection=Modelica_Fluid.Types.FlowDirection.Bidirectional,
    length=1,
    diameter=0.25);
  inner Modelica_Fluid.Ambient ambient;
    Modelica.Blocks.Sources.Constant PAtm1(k=101330);
  MixingVolumes.MixingVolume vol1(
    redeclare package Medium = Medium,
    V=0.1,
    initType=Modelica_Fluid.Types.Init.NoInit);
equation 
  connect(PAtm.y, sin1.p_in);
  connect(sou1.port, pipe1.port_a);
  connect(pipe2.port_b, sin1.port);
  connect(PAtm1.y, sou1.p_in);
  connect(pipe1.port_b, vol1.port[1]);
  connect(pipe2.port_a, vol1.port[2]);
end MixingVolumeInitialization;

Buildings.Fluids.Examples.MixingVolumeMoistAir

Buildings.Fluids.Examples.MixingVolumeMoistAir

Parameters

TypeNameDefaultDescription
replaceable package MediumBuildings.Media.GasesPTDecou... 

Connectors

TypeNameDescription
replaceable package Medium 

Modelica definition

model MixingVolumeMoistAir 
  import Buildings;
  
// package Medium = Buildings.Media.PerfectGases.MoistAir;
   package Medium = Buildings.Media.GasesPTDecoupled.MoistAir;
//   package Medium = Buildings.Media.GasesPTDecoupled.MoistAirNoLiquid;
  
  Buildings.Fluids.MixingVolumes.MixingVolumeMoistAir vol1(
    redeclare package Medium = Medium,
    V=1,
    nP=2) "Volume";
  Modelica.Thermal.HeatTransfer.TemperatureSensor TSen "Temperature sensor";
  Modelica.Blocks.Sources.Constant XSet(k=0.005) 
    "Set point for water mass fraction";
  Modelica.Thermal.HeatTransfer.PrescribedHeatFlow preHeaFlo;
  Modelica.Blocks.Sources.Constant TSet(k=273.15 + 20) 
    "Set point for temperature";
  Buildings.Utilities.Psychrometrics.HumidityRatioPressure humRat 
    "Conversion from humidity ratio to partial water vapor pressure";
  Buildings.Utilities.Psychrometrics.DewPointTemperature dewPoi 
    "Dew point temperature";
  Modelica.Thermal.HeatTransfer.HeatFlowSensor heatFlowSensor;
  Modelica.Blocks.Continuous.Integrator QSen "Sensible heat transfer";
  Modelica.Blocks.Continuous.Integrator QWat "Enthalpy of extracted water";
  Modelica.Blocks.Sources.RealExpression HWat_flow(y=vol1.HWat_flow) 
    "MoistAir heat flow rate";
  Buildings.Fluids.Sources.PrescribedMassFlowRate_TX sou(
    redeclare package Medium = Medium,
    T=293.15,
    m_flow=0.01);
  Buildings.Fluids.Sources.FixedBoundary_pTX sin(redeclare package Medium = 
        Medium, T=293.15);
  Modelica.Blocks.Continuous.LimPID PI(
    Ni=0.1,
    controllerType=Modelica.Blocks.Types.SimpleController.PI,
    yMax=1000,
    k=1,
    Ti=1);
  Modelica.Blocks.Continuous.LimPID PI1(
    Ni=0.1,
    Ti=1,
    controllerType=Modelica.Blocks.Types.SimpleController.PI,
    k=10,
    yMax=1,
    yMin=-1);
  Modelica_Fluid.Sensors.MassFlowRate mIn_flow(redeclare package Medium = 
        Medium);
  Modelica_Fluid.Sensors.MassFlowRate mOut_flow(redeclare package Medium = 
        Medium);
  Modelica.Blocks.Math.Add dM_flow(k2=-1);
  Modelica.Blocks.Math.Gain gai(k=200);
  Modelica.Blocks.Math.Gain gai1(k=0.1);
equation 
  connect(vol1.thermalPort, TSen.port);
  connect(dewPoi.p_w, humRat.p_w);
  connect(preHeaFlo.port, heatFlowSensor.port_a);
  connect(heatFlowSensor.port_b, vol1.thermalPort);
  connect(heatFlowSensor.Q_flow, QSen.u);
  connect(HWat_flow.y,QWat. u);
  connect(TSet.y, PI.u_s);
  connect(TSen.T, PI.u_m);
  connect(XSet.y, PI1.u_s);
  connect(sou.port, mIn_flow.port_a);
  connect(mIn_flow.port_b, vol1.port[1]);
  connect(mOut_flow.port_b, sin.port);
  connect(mOut_flow.port_a, vol1.port[2]);
  connect(mOut_flow.m_flow, dM_flow.u1);
  connect(mIn_flow.m_flow, dM_flow.u2);
  connect(PI.y, gai.u);
  connect(gai.y, preHeaFlo.Q_flow);
  connect(PI1.y, gai1.u);
  connect(gai1.y, vol1.mWat_flow);
  connect(dewPoi.T, vol1.TWat);
  connect(vol1.XWat, PI1.u_m);
  connect(vol1.XWat, humRat.XWat);
end MixingVolumeMoistAir;

Buildings.Fluids.Examples.OAMixingBoxMinimumDamper

Buildings.Fluids.Examples.OAMixingBoxMinimumDamper

Modelica definition

model OAMixingBoxMinimumDamper 
  
  
 package Medium = Buildings.Media.GasesPTDecoupled.SimpleAir 
    "Medium in the component";
  
  Buildings.Fluids.Actuators.Dampers.OAMixingBoxMinimumDamper mixBox(
    AOutMin=0.3,
    AOut=0.7,
    AExh=1,
    ARec=1,
    m0OutMin_flow=0.3,
    dp0OutMin=20,
    m0Out_flow=1,
    dp0Out=20,
    m0Rec_flow=1,
    dp0Rec=20,
    m0Exh_flow=1,
    dp0Exh=20,
    redeclare package Medium = Medium) "mixing box";
    Buildings.Fluids.Sources.PrescribedBoundary_pTX bouIn(redeclare package 
      Medium = Medium, T=273.15 + 10);
    Buildings.Fluids.Sources.PrescribedBoundary_pTX bouSup(redeclare package 
      Medium = Medium, T=273.15 + 26);
    Buildings.Fluids.Sources.PrescribedBoundary_pTX bouRet(redeclare package 
      Medium = Medium, T=273.15 + 20);
    Buildings.Fluids.Sources.PrescribedBoundary_pTX bouExh(redeclare package 
      Medium = Medium, T=273.15 + 10);
    Modelica.Blocks.Sources.Constant PAtm(k=101325);
    Modelica.Blocks.Sources.Constant yDamMin(k=0.5);
    Buildings.Fluids.Sources.PrescribedBoundary_pTX bouIn2(redeclare package 
      Medium = Medium, T=273.15 + 10);
    Modelica.Blocks.Sources.Ramp PSup(
    offset=101320,
    height=-10,
    startTime=0,
    duration=20);
    Modelica.Blocks.Sources.Ramp PRet(
    height=10,
    offset=101330,
    duration=20,
    startTime=20);
    Modelica.Blocks.Sources.Ramp yDam(
    duration=20,
    startTime=40,
    height=0.1,
    offset=0.45);
  
equation 
  connect(yDamMin.y, mixBox.yOutMin);
  connect(yDam.y, mixBox.y);
  connect(bouIn.p_in, PAtm.y);
  connect(bouIn2.p_in, PAtm.y);
  connect(bouExh.p_in, PAtm.y);
  connect(PRet.y, bouRet.p_in);
  connect(bouSup.p_in, PSup.y);
  connect(mixBox.port_Sup, bouSup.port);
  connect(mixBox.port_Ret, bouRet.port);
  connect(bouIn.port, mixBox.port_OutMin);
  connect(bouIn2.port, mixBox.port_Out);
  connect(bouExh.port, mixBox.port_Exh);
end OAMixingBoxMinimumDamper;

Buildings.Fluids.Examples.Resistances

Test of multiple resistances

Buildings.Fluids.Examples.Resistances

Parameters

TypeNameDefaultDescription
replaceable package MediumBuildings.Media.IdealGases.S... 
Pressuredp05Nominal pressure drop for each resistance [Pa]
IntegernRes3Number of resistances

Connectors

TypeNameDescription
replaceable package Medium 

Modelica definition

model Resistances "Test of multiple resistances" 
 package Medium = Buildings.Media.IdealGases.SimpleAir;
  
    Modelica.Blocks.Sources.Constant PAtm(k=101325);
   parameter Modelica.SIunits.Pressure dp0 = 5 
    "Nominal pressure drop for each resistance";
    Modelica.Blocks.Sources.Ramp P(
      duration=1,
    height=2*dp0*nRes,
    offset=101325 - dp0*nRes);
  Buildings.Fluids.Sources.PrescribedBoundary_pTX sou(redeclare package Medium 
      =        Medium, T=273.15 + 20);
  Buildings.Fluids.Sources.PrescribedBoundary_pTX sin(redeclare package Medium 
      =        Medium, T=273.15 + 10);
  parameter Integer nRes( min=2) = 3 "Number of resistances";
    Buildings.Fluids.FixedResistances.FixedResistanceDpM[
                       nRes] res(
    redeclare each package Medium = Medium,
    each dp0=dp0,
    each from_dp = false,
    each m0_flow=2);
equation 
  connect(sou.port, res[1].port_a);
  connect(res[nRes].port_b, sin.port);
  for i in 1:nRes-1 loop
  connect(res[i].port_b, res[i+1].port_a);
  end for;
  connect(PAtm.y, sin.p_in);
  connect(P.y, sou.p_in);
end Resistances;

Buildings.Fluids.Examples.SplitterFixedResistanceDpM

Buildings.Fluids.Examples.SplitterFixedResistanceDpM

Parameters

TypeNameDefaultDescription
replaceable package MediumBuildings.Media.IdealGases.S... 

Connectors

TypeNameDescription
replaceable package Medium 

Modelica definition

model SplitterFixedResistanceDpM 
  
  
 package Medium = Buildings.Media.IdealGases.SimpleAir;
  
  Buildings.Fluids.FixedResistances.SplitterFixedResistanceDpM spl(
    m0_flow={1,2,3},
    dp0={5,10,15},
    dh={1,2,3},
    redeclare package Medium = Medium) "Splitter";
  Buildings.Fluids.Sources.PrescribedBoundary_pTX bou1(redeclare package Medium
      =        Medium, T=273.15 + 10);
  Buildings.Fluids.Sources.PrescribedBoundary_pTX bou2(redeclare package Medium
      =        Medium, T=273.15 + 20);
  Buildings.Fluids.Sources.PrescribedBoundary_pTX bou3(redeclare package Medium
      =        Medium, T=273.15 + 30);
    Modelica.Blocks.Sources.Constant P2(k=101325);
    Modelica.Blocks.Sources.Ramp P1(
    offset=101320,
    height=10,
    duration=0.5);
    Modelica.Blocks.Sources.Ramp P3(
      offset=101320,
      height=10,
    duration=0.5,
    startTime=0.5);
equation 
  connect(P1.y, bou1.p_in);
  connect(bou1.port, spl.port_1);
  connect(spl.port_2, bou2.port);
  connect(P2.y, bou2.p_in);
  connect(bou3.port, spl.port_3);
  connect(bou3.p_in, P3.y);
end SplitterFixedResistanceDpM;

Buildings.Fluids.Examples.ThreeWayValves

Buildings.Fluids.Examples.ThreeWayValves

Information


Test model for three way valves. Note that the leakage flow rate has been set to a large value and the rangeability to a small value for better visualization of the valve characteristics. To use common values, use the default values.


Parameters

TypeNameDefaultDescription
replaceable package MediumBuildings.Media.ConstantProp...Medium in the component

Connectors

TypeNameDescription
replaceable package MediumMedium in the component

Modelica definition

model ThreeWayValves 
  
  
 package Medium = Buildings.Media.ConstantPropertyLiquidWater 
    "Medium in the component";
  
  Buildings.Fluids.Actuators.Valves.ThreeWayLinear valLin(
    redeclare package Medium = Medium,
    k_SI=2/sqrt(6000),
    l={0.05,0.05}) "Valve model, linear opening characteristics";
    Modelica.Blocks.Sources.Ramp y(
    height=1,
    duration=1,
    offset=0) "Control signal";
    Modelica.Blocks.Sources.Ramp P(
    duration=0.5,
    startTime=0.5,
    height=6E3,
    offset=3E5);
  Buildings.Fluids.Sources.PrescribedBoundary_pTX sou(redeclare package Medium 
      = Medium, T=293.15);
  Buildings.Fluids.Sources.PrescribedBoundary_pTX sin(redeclare package Medium 
      = Medium, T=293.15);
    Modelica.Blocks.Sources.Constant PSin(k=3E5);
    Modelica.Blocks.Sources.Constant PSou(k=306000);
  Buildings.Fluids.Sources.PrescribedBoundary_pTX sou1(
                                                    redeclare package Medium = 
        Medium, T=293.15);
  Actuators.Valves.ThreeWayEqualPercentageLinear valEquPerLin(
    k_SI=2/sqrt(6000),
    l={0.05,0.05},
    redeclare package Medium = Medium,
    R=10);
equation 
  connect(y.y, valLin.y);
  connect(PSin.y, sin.p_in);
  connect(PSou.y, sou.p_in);
  connect(PSou.y, sou1.p_in);
  connect(sou1.port, valLin.port_3);
  connect(sou.port, valLin.port_1);
  connect(sin.port, valLin.port_2);
  connect(sou.port, valEquPerLin.port_1);
  connect(sou1.port, valEquPerLin.port_3);
  connect(valEquPerLin.port_2, sin.port);
  connect(y.y, valEquPerLin.y);
end ThreeWayValves;

Buildings.Fluids.Examples.TwoWayValves

Buildings.Fluids.Examples.TwoWayValves

Information


Test model for two way valves. Note that the leakage flow rate has been set to a large value and the rangeability to a small value for better visualization of the valve characteristics. To use common values, use the default values.


Parameters

TypeNameDefaultDescription
replaceable package MediumBuildings.Media.ConstantProp... 

Connectors

TypeNameDescription
replaceable package Medium 

Modelica definition

model TwoWayValves 
  
  
 package Medium = Buildings.Media.ConstantPropertyLiquidWater;
  
  Buildings.Fluids.Actuators.Valves.TwoWayLinear valLin(
    redeclare package Medium = Medium,
    l=0.05,
    k_SI=2/sqrt(6000)) "Valve model, linear opening characteristics";
    Modelica.Blocks.Sources.Ramp y(
    height=1,
    duration=1,
    offset=0) "Control signal";
    Modelica.Blocks.Sources.Ramp P(
    duration=0.5,
    startTime=0.5,
    height=6E3,
    offset=3E5);
  Buildings.Fluids.Sources.PrescribedBoundary_pTX sou(redeclare package Medium 
      = Medium, T=293.15);
  Buildings.Fluids.Sources.PrescribedBoundary_pTX sin(redeclare package Medium 
      = Medium, T=293.15);
    Modelica.Blocks.Sources.Constant PSin(k=3E5);
    Modelica.Blocks.Sources.Constant PSou(k=306000);
  Buildings.Fluids.Actuators.Valves.TwoWayQuickOpening valQui(
    redeclare package Medium = Medium,
    l=0.05,
    k_SI=2/sqrt(6000)) "Valve model, quick opening characteristics";
  Buildings.Fluids.Actuators.Valves.TwoWayEqualPercentage valEqu(
    redeclare package Medium = Medium,
    l=0.05,
    k_SI=2/sqrt(6000),
    R=10,
    delta0=0.1) "Valve model, equal percentage opening characteristics";
equation 
  connect(y.y, valLin.y);
  connect(valLin.port_b, sin.port);
  connect(valLin.port_a, sou.port);
  connect(PSin.y, sin.p_in);
  connect(PSou.y, sou.p_in);
  connect(y.y, valQui.y);
  connect(valQui.port_b, sin.port);
  connect(valQui.port_a, sou.port);
  connect(y.y, valEqu.y);
  connect(valEqu.port_b, sin.port);
  connect(valEqu.port_a, sou.port);
end TwoWayValves;

Buildings.Fluids.Examples.TwoWayValvesMotor

Buildings.Fluids.Examples.TwoWayValvesMotor

Information


Test model for two way valves. Note that the leakage flow rate has been set to a large value and the rangeability to a small value for better visualization of the valve characteristics. To use common values, use the default values.


Parameters

TypeNameDefaultDescription
replaceable package MediumBuildings.Media.ConstantProp... 

Connectors

TypeNameDescription
replaceable package Medium 

Modelica definition

model TwoWayValvesMotor 
  
  
 package Medium = Buildings.Media.ConstantPropertyLiquidWater;
  
  Buildings.Fluids.Actuators.Valves.TwoWayLinear valLin(
    redeclare package Medium = Medium,
    l=0.05,
    k_SI=2/sqrt(6000)) "Valve model, linear opening characteristics";
  Buildings.Fluids.Sources.PrescribedBoundary_pTX sou(redeclare package Medium 
      = Medium, T=293.15);
  Buildings.Fluids.Sources.PrescribedBoundary_pTX sin(redeclare package Medium 
      = Medium, T=293.15);
    Modelica.Blocks.Sources.Constant PSin(k=3E5);
    Modelica.Blocks.Sources.Constant PSou(k=306000);
  Buildings.Fluids.Actuators.Valves.TwoWayQuickOpening valQui(
    redeclare package Medium = Medium,
    l=0.05,
    k_SI=2/sqrt(6000)) "Valve model, quick opening characteristics";
  Buildings.Fluids.Actuators.Valves.TwoWayEqualPercentage valEqu(
    redeclare package Medium = Medium,
    l=0.05,
    k_SI=2/sqrt(6000),
    R=10,
    delta0=0.1) "Valve model, equal percentage opening characteristics";
  Modelica.Blocks.Sources.TimeTable ySet(table=[0,0; 60,0; 60,1; 120,1; 180,0.5;
        240,0.5; 300,0; 360,0; 360,0.25; 420,0.25; 480,1; 540,1.5; 600,-0.25]) 
    "Set point for actuator";
  Actuators.Motors.IdealMotor mot(                 tOpe=60) "Motor model";
equation 
  connect(valLin.port_b, sin.port);
  connect(valLin.port_a, sou.port);
  connect(PSin.y, sin.p_in);
  connect(PSou.y, sou.p_in);
  connect(valQui.port_b, sin.port);
  connect(valQui.port_a, sou.port);
  connect(valEqu.port_b, sin.port);
  connect(valEqu.port_a, sou.port);
  connect(ySet.y, mot.u);
  connect(mot.y, valEqu.y);
  connect(mot.y, valQui.y);
  connect(mot.y, valLin.y);
end TwoWayValvesMotor;

Buildings.Fluids.Examples.VAVBoxExponential

Buildings.Fluids.Examples.VAVBoxExponential

Parameters

TypeNameDefaultDescription
replaceable package MediumBuildings.Media.IdealGases.S... 

Connectors

TypeNameDescription
replaceable package Medium 

Modelica definition

model VAVBoxExponential 
  
 package Medium = Buildings.Media.IdealGases.SimpleAir;
  
  Buildings.Fluids.Actuators.Dampers.Exponential dam(
         redeclare package Medium = Medium, A=1.8);
    Modelica.Blocks.Sources.Ramp yRam(
    duration=0.4,
    height=-1,
    offset=1,
    startTime=0.6);
    Modelica.Blocks.Sources.Ramp P(
    duration=0.4,
    height=-10,
    offset=101330,
    startTime=0);
  Buildings.Fluids.Sources.PrescribedBoundary_pTX sou(redeclare package Medium 
      =        Medium, T=273.15 + 20);
  Buildings.Fluids.Sources.PrescribedBoundary_pTX sin(redeclare package Medium 
      =        Medium, T=273.15 + 20);
    Modelica.Blocks.Sources.Constant PAtm(k=101325);
  Buildings.Fluids.Actuators.Dampers.VAVBoxExponential vav(
                                                        m0_flow=2,
    redeclare package Medium = Medium,
    dp0=5,
    A=1.8);
  Buildings.Fluids.Sources.PrescribedBoundary_pTX sou1(redeclare package Medium=Medium,
     T=273.15 + 10);
  Buildings.Fluids.Sources.PrescribedBoundary_pTX sin1(redeclare package Medium=Medium,
     T=273.15 + 10);
    Buildings.Fluids.FixedResistances.FixedResistanceDpM res(
    from_dp=true,
    m0_flow=2,
    redeclare package Medium = Medium,
    dp0=5 - 0.45*2^2/1.2/1.8^2/2);
equation 
  connect(yRam.y,dam. y);
  connect(P.y, sou.p_in);
  connect(PAtm.y, sin.p_in);
  connect(yRam.y, vav.y);
  connect(sou1.port, vav.port_a);
  connect(vav.port_b, sin1.port);
  connect(PAtm.y, sin1.p_in);
  connect(sou.port, res.port_a);
  connect(res.port_b, dam.port_a);
  connect(P.y, sou1.p_in);
  connect(dam.port_b, sin.port);
end VAVBoxExponential;

HTML-documentation generated by Dymola Tue Sep 30 14:24:30 2008.