Skip to content

Commit

Permalink
Corrected assignment of nominal attribute.
Browse files Browse the repository at this point in the history
This addresses
ibpsa/modelica-ibpsa#95
for the Buildings library.
  • Loading branch information
mwetter committed Oct 6, 2014
1 parent 964de78 commit ba7b994
Show file tree
Hide file tree
Showing 7 changed files with 36 additions and 36 deletions.
13 changes: 9 additions & 4 deletions Buildings/Airflow/Multizone/MediumColumnDynamic.mo
Expand Up @@ -16,16 +16,16 @@ model MediumColumnDynamic
"Nominal mass flow rate"
annotation(Dialog(group = "Nominal condition, used only for steady-state model"));
Modelica.Fluid.Interfaces.FluidPort_a port_a(
redeclare package Medium = Medium,
redeclare final package Medium = Medium,
m_flow(min=if allowFlowReversal then -Constants.inf else 0),
p(start=Medium.p_default, nominal=Medium.p_default))
p(start=Medium.p_default))
"Fluid connector a (positive design flow direction is from port_a to port_b)"
annotation (Placement(transformation(extent={{-10,90},{10,110}}, rotation=0),
iconTransformation(extent={{-10,90},{10,110}})));
Modelica.Fluid.Interfaces.FluidPort_b port_b(
redeclare package Medium = Medium,
redeclare final package Medium = Medium,
m_flow(max=if allowFlowReversal then +Constants.inf else 0),
p(start=Medium.p_default, nominal=Medium.p_default))
p(start=Medium.p_default))
"Fluid connector b (positive design flow direction is from port_a to port_b)"
annotation (Placement(transformation(extent={{10,-110},{-10,-90}}, rotation=
0), iconTransformation(extent={{10,-110},{-10,-90}})));
Expand Down Expand Up @@ -192,6 +192,11 @@ at the top of the column.
</html>",
revisions="<html>
<ul>
<li><i>October 6, 2014</i> by Michael Wetter:<br/>
Removed assignment of <code>port_?.p.nominal</code> to avoid a warning
in OpenModelica because
alias sets have different nominal values.
</li>
<li><i>July 31, 2011</i> by Michael Wetter:<br/>
Changed model to use new base class
<a href=\"modelica://Buildings.Fluid.Interfaces.LumpedVolumeDeclarations\">
Expand Down
9 changes: 4 additions & 5 deletions Buildings/Media/GasesConstantDensity/MoistAir.mo
Expand Up @@ -23,11 +23,10 @@ package MoistAir "Package with moist air model with constant density"
constant AbsolutePressure pStp = 101325 "Pressure for which dStp is defined";
constant Density dStp = 1.2 "Fluid density at pressure pStp";

// Redeclare ThermodynamicState to avoid the warning
// "Base class ThermodynamicState is replaceable"
// during model check
redeclare record extends ThermodynamicState
"ThermodynamicState record for moist air"
redeclare record extends ThermodynamicState(
p(start=p_default),
T(start=T_default),
X(start=X_default)) "ThermodynamicState record for moist air"
end ThermodynamicState;

redeclare replaceable model extends BaseProperties(
Expand Down
9 changes: 4 additions & 5 deletions Buildings/Media/GasesConstantDensity/MoistAirUnsaturated.mo
Expand Up @@ -24,11 +24,10 @@ package MoistAirUnsaturated
constant AbsolutePressure pStp = 101325 "Pressure for which dStp is defined";
constant Density dStp = 1.2 "Fluid density at pressure pStp";

// Redeclare ThermodynamicState to avoid the warning
// "Base class ThermodynamicState is replaceable"
// during model check
redeclare record extends ThermodynamicState
"ThermodynamicState record for moist air"
redeclare record extends ThermodynamicState(
p(start=p_default),
T(start=T_default),
X(start=X_default)) "ThermodynamicState record for moist air"
end ThermodynamicState;

redeclare replaceable model extends BaseProperties(
Expand Down
6 changes: 4 additions & 2 deletions Buildings/Media/GasesPTDecoupled/MoistAir.mo
Expand Up @@ -27,8 +27,10 @@ package MoistAir
// Redeclare ThermodynamicState to avoid the warning
// "Base class ThermodynamicState is replaceable"
// during model check
redeclare record extends ThermodynamicState
"ThermodynamicState record for moist air"
redeclare record extends ThermodynamicState(
p(start=p_default),
T(start=T_default),
X(start=X_default)) "ThermodynamicState record for moist air"
end ThermodynamicState;

redeclare replaceable model extends BaseProperties(
Expand Down
17 changes: 7 additions & 10 deletions Buildings/Media/GasesPTDecoupled/MoistAirUnsaturated.mo
Expand Up @@ -28,35 +28,32 @@ package MoistAirUnsaturated
// "Base class ThermodynamicState is replaceable"
// during model check
redeclare record extends ThermodynamicState(
p(nominal=p_default),
X(nominal=X_default,
start=X_default)) "ThermodynamicState record for moist air"
p(start=p_default),
T(start=T_default),
X(start=X_default)) "ThermodynamicState record for moist air"
end ThermodynamicState;

redeclare replaceable model extends BaseProperties(
T(stateSelect=if preferredMediumStates then StateSelect.prefer else StateSelect.default),
p(stateSelect=if preferredMediumStates then StateSelect.prefer else StateSelect.default),
Xi(each stateSelect=if preferredMediumStates then StateSelect.prefer else StateSelect.default,
nominal=X_default[1:nXi]),
X(nominal=X_default),
Xi(each stateSelect=if preferredMediumStates then StateSelect.prefer else StateSelect.default),
final standardOrderComponents=true)

/* p, T, X = X[Water] are used as preferred states, since only then all
other quantities can be computed in a recursive sequence.
If other variables are selected as states, static state selection
is no longer possible and non-linear algebraic equations occur.
*/
MassFraction x_water(nominal=X_default[1])
"Mass of total water/mass of dry air";
MassFraction x_water "Mass of total water/mass of dry air";
Real phi "Relative humidity";

protected
constant SI.MolarMass[2] MMX = {steam.MM,dryair.MM}
"Molar masses of components";

// MassFraction X_liquid "Mass fraction of liquid water";
MassFraction X_steam(nominal=X_default[1]) "Mass fraction of steam water";
MassFraction X_air(nominal=X_default[2]) "Mass fraction of air";
MassFraction X_steam "Mass fraction of steam water";
MassFraction X_air "Mass fraction of air";
MassFraction X_sat
"Steam water mass fraction of saturation boundary in kg_water/kg_moistair";
MassFraction x_sat
Expand Down
9 changes: 4 additions & 5 deletions Buildings/Media/PerfectGases/MoistAir.mo
Expand Up @@ -24,11 +24,10 @@ package MoistAir
constant Modelica.SIunits.Temperature TMin = 200 "Minimum temperature";
constant Modelica.SIunits.Temperature TMax = 400 "Maximum temperature";

// Redeclare ThermodynamicState to avoid the warning
// "Base class ThermodynamicState is replaceable"
// during model check
redeclare record extends ThermodynamicState
"ThermodynamicState record for moist air"
redeclare record extends ThermodynamicState(
p(start=p_default),
T(start=T_default),
X(start=X_default)) "ThermodynamicState record for moist air"
end ThermodynamicState;

redeclare replaceable model extends BaseProperties(
Expand Down
9 changes: 4 additions & 5 deletions Buildings/Media/PerfectGases/MoistAirUnsaturated.mo
Expand Up @@ -20,11 +20,10 @@ package MoistAirUnsaturated
Buildings.Media.PerfectGases.Common.SingleGasData.H2O;
import SI = Modelica.SIunits;

// Redeclare ThermodynamicState to avoid the warning
// "Base class ThermodynamicState is replaceable"
// during model check
redeclare record extends ThermodynamicState
"ThermodynamicState record for moist air"
redeclare record extends ThermodynamicState(
p(start=p_default),
T(start=T_default),
X(start=X_default)) "ThermodynamicState record for moist air"
end ThermodynamicState;

redeclare replaceable model extends BaseProperties(
Expand Down

0 comments on commit ba7b994

Please sign in to comment.