Tags and keywords
These plots show some values from a typical simulation execution in Wolfram SystemModeler.
The 1st (top) plot shows:
- The
oHumidity
from theHumidifiedRoom
(which may in fact be a large space). - The
iSwitch
for theControl
. - The
targetHumidity
from theHeaterControl
. - The
oHeaterPowerRatio
from theHeaterControl
.
The 2nd plot (in the middle) shows the iEnergyRate
going into the Heating
block compared with the oWaterRadiation
from the Radiation
block.
If you look carefully you might notice that the radiation is in fact slightly negative for a short period at the beginning of the run, which makes sense if the water temperature is lower than the room temperature (it will absorb heat), however:
The 3rd plot (at the bottom) shows the oVapor
from the VaporGenerationPlant
.
We can do a quick comparison with the waterVolumeRate
of 0.1 L/s from the TemperatureIncrease
block. When oVapor is maximum it's about 572000 mL/hr, which converts to about 0.156 L/s, which is reasonably consistent given that it is on and off offer over the entire run time.
The export of block
HumidifierSystem_S1
from the MagicDraw SysML Plugin or Magic Cyber-Systems Engineer® (Cameo Systems Modeler®) gives:
model HumidifierSystem_S1
HumidifierSystem_S1 _HumidifierSystem_S1;
model HumidifierSystem_S1
extends HumidifierSystem(redeclare Humidifier_S1 h,redeclare HumidifiedRoom_S1 hR);
end HumidifierSystem_S1;
model HumidifierSystem
replaceable Humidifier h;
replaceable HumidifiedRoom hR;
equation
connect(hR.oHumidityPct,h.iHumidityPct);
connect(h.oVapor,hR.iVapor);
end HumidifierSystem;
model Humidifier_S1
extends Humidifier(redeclare HeaterControl_S1 hC,redeclare Control_S1 c,redeclare VaporGenerationPlant_S1 vGP,redeclare WaterTank_S1 wT,redeclare UsageScenario_S1 uS);
end Humidifier_S1;
model HumidifiedRoom_S1
extends HumidifiedRoom(redeclare VolumeConversion_S1 vC,redeclare SaturationVaporPressure_S1 sVP,redeclare PercentageConversion_S1 pC,redeclare RelativeHumidity_S1 rH);
end HumidifiedRoom_S1;
model Humidifier
Modelica.Blocks.Interfaces.RealOutput oVapor;
Modelica.Blocks.Interfaces.RealInput iHumidityPct;
replaceable HeaterControl hC;
replaceable Control c;
replaceable VaporGenerationPlant vGP;
replaceable WaterTank wT;
replaceable UsageScenario uS;
equation
connect(iHumidityPct,hC.iHumidityPct);
connect(vGP.oVapor,wT.iConsumption);
connect(vGP.oVapor,oVapor);
connect(wT.oWaterVolume,c.iWaterVolume);
connect(c.oFanPowerRatio,vGP.iWaterFanPowerRatio);
connect(vGP.oTemperature,c.iWaterTemperature);
connect(c.oMode,hC.iMode);
connect(uS.oSwitch,c.iSwitch);
connect(hC.oHeaterPowerRatio,vGP.iHeaterPowerRatio);
end Humidifier;
model HumidifiedRoom
replaceable VolumeConversion vC;
replaceable SaturationVaporPressure sVP;
replaceable PercentageConversion pC;
replaceable RelativeHumidity rH;
Modelica.Blocks.Interfaces.RealInput iVapor;
Modelica.Blocks.Interfaces.RealOutput oHumidityPct;
equation
connect(pC.o,oHumidityPct);
connect(rH.oHumidity,pC.i);
connect(rH.oHumidity,rH.iHumidity);
connect(vC.o,rH.iVapor);
connect(iVapor,vC.i);
connect(sVP.oSatVaporPressure,rH.iSatVaporPressure);
end HumidifiedRoom;
model HeaterControl_S1
extends HeaterControl(redeclare HeaterPowerRatio prLow(start=0.0,fixed=true),redeclare HeaterPowerRatio prHigh(start=1.0,fixed=true),redeclare HumidityPct thresholdPct(start=0.5,fixed=true),redeclare HumidityPct targetHumidityPct(start=50.0,fixed=true));
end HeaterControl_S1;
model Control_S1
extends Control(redeclare WaterTemperature safeTemperature(start=50.0,fixed=true));
end Control_S1;
model VaporGenerationPlant_S1
extends VaporGenerationPlant(redeclare VaporGenerationPlantCalculation_S1 vGPC,redeclare Radiation_S1 r,redeclare Evaporation_S1 e,redeclare Heating_S1 h);
end VaporGenerationPlant_S1;
model WaterTank_S1
extends WaterTank(redeclare WaterVolume tankVolume(start=50000.0,fixed=true),redeclare ConversionFactor litpSec2mLitpHr(start=3600000.0,fixed=true));
end WaterTank_S1;
model UsageScenario_S1
extends UsageScenario;
end UsageScenario_S1;
model VolumeConversion_S1
extends VolumeConversion(redeclare ConversionFactor gain(start=2.8E-4,fixed=true));
end VolumeConversion_S1;
model SaturationVaporPressure_S1
extends SaturationVaporPressure(redeclare Unitless p2(start=7.5,fixed=true),redeclare Pressure_hPa p1(start=6.11,fixed=true),redeclare Real logBase(start=10.0,fixed=true),redeclare Temperature roomTemperature(start=30.0,fixed=true),redeclare ConversionFactor hPa2Pa(start=100.0,fixed=true),redeclare Temperature celciusOffset(start=273.0,fixed=true));
end SaturationVaporPressure_S1;
model PercentageConversion_S1
extends PercentageConversion(redeclare ConversionFactor gain(start=100.0,fixed=true));
end PercentageConversion_S1;
model RelativeHumidity_S1
extends RelativeHumidity(redeclare VaporPressureCalculation_S1 vPC,redeclare RelativeHumidityCalculation_S1 rHC,redeclare HumidityBalance_S1 hB);
end RelativeHumidity_S1;
model HeaterControl
Modelica.Blocks.Interfaces.RealInput iHumidityPct;
Modelica.Blocks.Interfaces.RealOutput oHeaterPowerRatio;
Modelica.Blocks.Interfaces.IntegerInput iMode;
replaceable parameter HeaterPowerRatio prLow;
replaceable parameter HeaterPowerRatio prHigh;
replaceable parameter HumidityPct thresholdPct;
replaceable parameter HumidityPct targetHumidityPct;
HeaterControlSM _HeaterControlSM;
block HeaterControlSM
Modelica.StateGraph.InitialStep HeaterControlSM_region1_pseudostate4(nIn=0,nOut=1);
Modelica.StateGraph.Step Off(nIn=3,nOut=1);
Modelica.StateGraph.Step On(nIn=1,nOut=2);
Modelica.StateGraph.Transition HeaterControlSM_region1_transition0(condition=true);
Modelica.StateGraph.Transition HeaterControlSM_region1_transition1(condition=iMode==0);
Modelica.StateGraph.Transition HeaterControlSM_region1_transition2(condition=iHumidityPct>targetHumidityPct);
Modelica.StateGraph.Transition HeaterControlSM_region1_transition3(condition=iMode==1 and iHumidityPct=99);
Modelica.StateGraph.Transition ControlSM_region1_transition5(condition=iSwitch==0);
Modelica.StateGraph.Transition ControlSM_region1_transition6(condition=iWaterVolume<=0.1);
Modelica.Blocks.Interfaces.IntegerOutput oMode;
Modelica.Blocks.Interfaces.IntegerInput iSwitch;
Modelica.Blocks.Interfaces.RealInput iWaterVolume;
Modelica.Blocks.Interfaces.RealInput iWaterTemperature;
Modelica.Blocks.Interfaces.IntegerOutput oFanPowerRatio;
WaterTemperature safeTemperature;
equation
connect(ControlSM_region1_pseudostate7.outPort[1], ControlSM_region1_transition0.inPort);
connect(ControlSM_region1_transition0.outPort, Off.inPort[1]);
connect(Off.outPort[1], ControlSM_region1_transition1.inPort);
connect(ControlSM_region1_transition1.outPort, WarmUp.inPort[1]);
connect(CoolDown.outPort[1], ControlSM_region1_transition2.inPort);
connect(ControlSM_region1_transition2.outPort, Off.inPort[2]);
connect(WarmUp.outPort[1], ControlSM_region1_transition3.inPort);
connect(ControlSM_region1_transition3.outPort, CoolDown.inPort[1]);
connect(WarmUp.outPort[2], ControlSM_region1_transition4.inPort);
connect(ControlSM_region1_transition4.outPort, On.inPort[1]);
connect(On.outPort[1], ControlSM_region1_transition5.inPort);
connect(ControlSM_region1_transition5.outPort, CoolDown.inPort[2]);
connect(On.outPort[2], ControlSM_region1_transition6.inPort);
connect(ControlSM_region1_transition6.outPort, CoolDown.inPort[3]);
algorithm
if Off.active then oMode:=0;oFanPowerRatio:=0; end if;
if WarmUp.active then oMode:=1;oFanPowerRatio:=0; end if;
if CoolDown.active then oMode:=0;oFanPowerRatio:=1; end if;
if On.active then oMode:=1;oFanPowerRatio:=1; end if;
end ControlSM;
equation
oMode=_ControlSM.oMode;
iSwitch=_ControlSM.iSwitch;
iWaterVolume=_ControlSM.iWaterVolume;
iWaterTemperature=_ControlSM.iWaterTemperature;
oFanPowerRatio=_ControlSM.oFanPowerRatio;
safeTemperature=_ControlSM.safeTemperature;
end Control;
model VaporGenerationPlant
replaceable VaporGenerationPlantCalculation vGPC;
replaceable Radiation r;
replaceable Evaporation e;
replaceable Heating h;
Modelica.Blocks.Interfaces.IntegerInput iWaterFanPowerRatio;
Modelica.Blocks.Interfaces.RealInput iHeaterPowerRatio;
Modelica.Blocks.Interfaces.RealOutput oVapor;
Modelica.Blocks.Interfaces.RealOutput oTemperature;
equation
connect(iHeaterPowerRatio,vGPC.iHeaterPowerRatio);
connect(vGPC.oEnergyRate,h.iEnergyRate);
connect(vGPC.oEnergyRate,e.iEnergyRate);
connect(h.oTemperature,e.iTemperature);
connect(h.oTemperature,oTemperature);
connect(e.oVapor,oVapor);
connect(h.oTemperature,r.iWaterTemperature);
connect(r.oWaterRadiationRate,vGPC.iWaterRadiationRate);
connect(iWaterFanPowerRatio,r.iWaterFanPower);
end VaporGenerationPlant;
model WaterTank
Modelica.Blocks.Interfaces.RealOutput oWaterVolume;
Modelica.Blocks.Interfaces.RealInput iConsumption;
replaceable parameter WaterVolume tankVolume;
replaceable parameter ConversionFactor litpSec2mLitpHr;
WaterVolume xInteg;
equation
oWaterVolume=tankVolume-min(50000,xInteg);
der(xInteg)=iConsumption/litpSec2mLitpHr;
end WaterTank;
model UsageScenario
Modelica.Blocks.Interfaces.IntegerOutput oSwitch;
UsageScenarioSM _UsageScenarioSM;
block UsageScenarioSM
Modelica.StateGraph.InitialStep UsageScenarioSM_region1_pseudostate3(nIn=0,nOut=1);
Modelica.StateGraph.Step Started(nIn=1,nOut=1);
Modelica.StateGraph.Step On(nIn=1,nOut=1);
Modelica.StateGraph.Step Off(nIn=1,nOut=0);
Modelica.StateGraph.Transition UsageScenarioSM_region1_transition0(condition=true);
Modelica.StateGraph.Transition UsageScenarioSM_region1_transition1(enableTimer=true,waitTime=300,condition=true);
Modelica.StateGraph.Transition UsageScenarioSM_region1_transition2(enableTimer=true,waitTime=3300,condition=true);
Modelica.Blocks.Interfaces.IntegerOutput oSwitch;
equation
connect(UsageScenarioSM_region1_pseudostate3.outPort[1], UsageScenarioSM_region1_transition0.inPort);
connect(UsageScenarioSM_region1_transition0.outPort, Started.inPort[1]);
connect(Started.outPort[1], UsageScenarioSM_region1_transition1.inPort);
connect(UsageScenarioSM_region1_transition1.outPort, On.inPort[1]);
connect(On.outPort[1], UsageScenarioSM_region1_transition2.inPort);
connect(UsageScenarioSM_region1_transition2.outPort, Off.inPort[1]);
algorithm
if On.active then oSwitch:=1; end if;
if Off.active then oSwitch:=0; end if;
end UsageScenarioSM;
equation
oSwitch=_UsageScenarioSM.oSwitch;
end UsageScenario;
model VolumeConversion
replaceable parameter ConversionFactor gain;
Modelica.Blocks.Interfaces.RealInput i;
Modelica.Blocks.Interfaces.RealOutput o;
equation
o=i*gain;
end VolumeConversion;
model SaturationVaporPressure
replaceable parameter Unitless p2;
replaceable parameter Pressure_hPa p1;
replaceable parameter Real logBase;
replaceable parameter Temperature roomTemperature;
replaceable parameter ConversionFactor hPa2Pa;
replaceable parameter Temperature celciusOffset;
Modelica.Blocks.Interfaces.RealOutput oSatVaporPressure;
equation
oSatVaporPressure=hPa2Pa*(p1*exp((log(logBase)*((p2*roomTemperature)/(roomTemperature+celciusOffset)))));
end SaturationVaporPressure;
model PercentageConversion
replaceable parameter ConversionFactor gain;
Modelica.Blocks.Interfaces.RealInput i;
Modelica.Blocks.Interfaces.RealOutput o;
equation
o=i*gain;
end PercentageConversion;
model RelativeHumidity
replaceable VaporPressureCalculation vPC;
replaceable RelativeHumidityCalculation rHC;
replaceable HumidityBalance hB;
Modelica.Blocks.Interfaces.RealOutput oHumidity;
Modelica.Blocks.Interfaces.RealInput iVapor;
Modelica.Blocks.Interfaces.RealInput iHumidity;
Modelica.Blocks.Interfaces.RealInput iSatVaporPressure;
equation
connect(iVapor,vPC.iVapor);
connect(vPC.oPressure,rHC.iPressure);
connect(hB.oChange,rHC.iChange);
connect(iHumidity,hB.iHumidity);
connect(iSatVaporPressure,rHC.iSat);
connect(rHC.oHumidity,oHumidity);
end RelativeHumidity;
type HeaterPowerRatio=Unitless;
type HumidityPct=Percent;
type WaterTemperature=Real(unit="degC");
model VaporGenerationPlantCalculation_S1
extends VaporGenerationPlantCalculation(redeclare Power maxHeaterPower(start=400.0,fixed=true));
end VaporGenerationPlantCalculation_S1;
model Radiation_S1
extends Radiation(redeclare Temperature roomTemperature(start=30.0,fixed=true),redeclare FanEfficiency fanEfficiency(start=0.1,fixed=true),redeclare RadiationFactor radiationFactor(start=0.1,fixed=true));
end Radiation_S1;
model Evaporation_S1
extends Evaporation(redeclare EvaporationCalculation_S1 eC,redeclare EvaporationCalculation2_S1 eC2);
end Evaporation_S1;
model Heating_S1
extends Heating(redeclare HeatingCalculation1 hC,redeclare TemperatureIncrease_S1 tI);
end Heating_S1;
type WaterVolume=Real(unit="L");
type ConversionFactor=Unitless;
type Unitless=Dimensionless;
type Pressure_hPa=Real(unit="hPa");
type Temperature=Real(unit="degC");
model VaporPressureCalculation_S1
extends VaporPressureCalculation(redeclare Temperature roomTemperature(start=30.0,fixed=true),redeclare GasConstant gasConst(start=8.314,fixed=true),redeclare MolecularWeight molecularW(start=18.015,fixed=true),redeclare Temperature celciusOffset(start=273.0,fixed=true),redeclare SpaceVolume volume(start=25000.0,fixed=true));
end VaporPressureCalculation_S1;
model RelativeHumidityCalculation_S1
extends RelativeHumidityCalculation(redeclare Time c2(start=1.0,fixed=true));
end RelativeHumidityCalculation_S1;
model HumidityBalance_S1
extends HumidityBalance(redeclare AirExchangeRate airExchangeRate(start=1.0E-8,fixed=true),redeclare Humidity envHumidity(start=0.35,fixed=true),redeclare SpaceVolume volume(start=25000.0,fixed=true));
end HumidityBalance_S1;
model VaporGenerationPlantCalculation
Modelica.Blocks.Interfaces.RealInput iWaterRadiationRate;
Modelica.Blocks.Interfaces.RealInput iHeaterPowerRatio;
Modelica.Blocks.Interfaces.RealOutput oEnergyRate;
replaceable parameter Power maxHeaterPower;
equation
oEnergyRate=((maxHeaterPower*iHeaterPowerRatio)-iWaterRadiationRate);
end VaporGenerationPlantCalculation;
model Radiation
Modelica.Blocks.Interfaces.IntegerInput iWaterFanPower;
Modelica.Blocks.Interfaces.RealOutput oWaterRadiationRate;
Modelica.Blocks.Interfaces.RealInput iWaterTemperature;
replaceable parameter Temperature roomTemperature;
replaceable parameter FanEfficiency fanEfficiency;
replaceable parameter RadiationFactor radiationFactor;
equation
oWaterRadiationRate=(iWaterTemperature-roomTemperature)*(radiationFactor+(iWaterFanPower*fanEfficiency));
end Radiation;
model Evaporation
replaceable EvaporationCalculation eC;
replaceable EvaporationCalculation2 eC2;
Modelica.Blocks.Interfaces.RealInput iTemperature;
Modelica.Blocks.Interfaces.RealOutput oVapor;
Modelica.Blocks.Interfaces.RealInput iEnergyRate;
equation
connect(iEnergyRate,eC.iEnergy);
connect(eC.oVapor,eC2.iVapor);
connect(eC2.oVapor,oVapor);
connect(iTemperature,eC2.iTemperature);
end Evaporation;
model Heating
replaceable HeatingCalculation hC;
replaceable TemperatureIncrease tI;
Modelica.Blocks.Interfaces.RealInput iEnergyRate;
Modelica.Blocks.Interfaces.RealOutput oTemperature;
equation
connect(hC.oTemperature,oTemperature);
connect(tI.oTemperatureIncrease,hC.iTemperatureIncrease);
connect(iEnergyRate,tI.iEnergy);
end Heating;
model VaporPressureCalculation
Modelica.Blocks.Interfaces.RealInput iVapor;
Modelica.Blocks.Interfaces.RealOutput oPressure;
replaceable parameter Temperature roomTemperature;
replaceable parameter GasConstant gasConst;
replaceable parameter MolecularWeight molecularW;
replaceable parameter Temperature celciusOffset;
replaceable parameter SpaceVolume volume;
equation
oPressure=iVapor*(gasConst*((roomTemperature+celciusOffset)/(molecularW*volume)));
end VaporPressureCalculation;
model RelativeHumidityCalculation
Modelica.Blocks.Interfaces.RealInput iSat;
Modelica.Blocks.Interfaces.RealOutput oHumidity;
Modelica.Blocks.Interfaces.RealInput iChange;
Modelica.Blocks.Interfaces.RealInput iPressure;
Humidity xInt;
replaceable parameter Time c2;
equation
oHumidity=max(min(1,xInt),0);
(der(xInt))=((iPressure/iSat)-iChange)/c2;
end RelativeHumidityCalculation;
model HumidityBalance
Modelica.Blocks.Interfaces.RealInput iHumidity;
Modelica.Blocks.Interfaces.RealOutput oChange;
replaceable parameter AirExchangeRate airExchangeRate;
replaceable parameter Humidity envHumidity;
replaceable parameter SpaceVolume volume;
equation
oChange=((iHumidity-envHumidity)*(volume*airExchangeRate));
end HumidityBalance;
type Percent=Dimensionless;
type Dimensionless=Real;
type Power=Real(unit="J/s");
type FanEfficiency=Real(unit="J/(K.s)");
type RadiationFactor=Real(unit="J/(K.s)");
model EvaporationCalculation_S1
extends EvaporationCalculation(redeclare EvaporationHeat_J_per_mL evaporationHeat(start=2270.0,fixed=true),redeclare HeatCapacity_J_per_mLK specificHeat(start=1.996,fixed=true),redeclare WaterTemperature boilingTemperature(start=100.0,fixed=true),redeclare Temperature environmentTemperature(start=20.0,fixed=true));
end EvaporationCalculation_S1;
model EvaporationCalculation2_S1
extends EvaporationCalculation2(redeclare WaterTemperature boilingTemperature(start=99.99,fixed=true),redeclare Unitless noPower(start=0.0,fixed=true),redeclare ConversionFactor litPSec2mLitPHour(start=3600000.0,fixed=true));
end EvaporationCalculation2_S1;
model HeatingCalculation1
extends HeatingCalculation(redeclare Time c1(start=1.0,fixed=true));
end HeatingCalculation1;
model TemperatureIncrease_S1
extends TemperatureIncrease(redeclare HeatCapacity_J_per_KL specificHeat(start=4180.0,fixed=true),redeclare WaterVolumeRate waterVolumeRate(start=0.1,fixed=true));
end TemperatureIncrease_S1;
type GasConstant=Real(unit="J/(K.mol)");
type MolecularWeight=Real(unit="g/mol");
type SpaceVolume=Real(unit="m3");
type Time=Real(unit="s");
type AirExchangeRate=Real(unit="1/m3");
type Humidity=Unitless;
model EvaporationCalculation
Modelica.Blocks.Interfaces.RealInput iEnergy;
Modelica.Blocks.Interfaces.RealOutput oVapor;
replaceable parameter EvaporationHeat_J_per_mL evaporationHeat;
replaceable parameter HeatCapacity_J_per_mLK specificHeat;
replaceable parameter WaterTemperature boilingTemperature;
replaceable parameter Temperature environmentTemperature;
equation
oVapor=iEnergy/(evaporationHeat+specificHeat*(boilingTemperature-environmentTemperature));
end EvaporationCalculation;
model EvaporationCalculation2
Modelica.Blocks.Interfaces.RealInput iVapor;
Modelica.Blocks.Interfaces.RealInput iTemperature;
replaceable parameter WaterTemperature boilingTemperature;
replaceable parameter Unitless noPower;
replaceable parameter ConversionFactor litPSec2mLitPHour;
Modelica.Blocks.Interfaces.RealOutput oVapor;
equation
oVapor=litPSec2mLitPHour*(((max(min(iVapor,1),0))*max((iTemperature-boilingTemperature),0)/(iTemperature-boilingTemperature))+noPower*(max((boilingTemperature-iTemperature),0)/(boilingTemperature-iTemperature)));
end EvaporationCalculation2;
model HeatingCalculation
Modelica.Blocks.Interfaces.RealOutput oTemperature;
Modelica.Blocks.Interfaces.RealInput iTemperatureIncrease;
WaterTemperature xIntg;
replaceable parameter Time c1;
equation
oTemperature=max(min(100,xIntg),0);
der(xIntg)=iTemperatureIncrease/c1;
end HeatingCalculation;
model TemperatureIncrease
Modelica.Blocks.Interfaces.RealInput iEnergy;
Modelica.Blocks.Interfaces.RealOutput oTemperatureIncrease;
replaceable parameter HeatCapacity_J_per_KL specificHeat;
replaceable parameter WaterVolumeRate waterVolumeRate;
equation
oTemperatureIncrease=iEnergy/(specificHeat*waterVolumeRate);
end TemperatureIncrease;
type EvaporationHeat_J_per_mL=Real(unit="J/mL");
type HeatCapacity_J_per_mLK=Real(unit="J/(K.mL)");
type HeatCapacity_J_per_KL=Real(unit="J/(K.L)");
type WaterVolumeRate=Real(unit="L/s");
end HumidifierSystem_S1;