Skip to content

Commit

Permalink
Removed assertion if no water is added
Browse files Browse the repository at this point in the history
For #1650
  • Loading branch information
mwetter committed Oct 24, 2022
1 parent 39cef3f commit 1f527fa
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 8 deletions.
8 changes: 5 additions & 3 deletions IBPSA/Fluid/Interfaces/ConservationEquation.mo
Expand Up @@ -170,11 +170,13 @@ protected

initial equation
// Assert that the substance with name 'water' has been found.
assert(Medium.nXi == 0 or abs(sum(s)-1) < 1e-5,
"In " + getInstanceName() + ":
if use_mWat_flow then
assert(Medium.nXi == 0 or abs(sum(s) - 1) < 1e-5, "In " + getInstanceName()
+ ":
If Medium.nXi > 1, then substance 'water' must be present for one component of '"
+ Medium.mediumName + "'.
+ Medium.mediumName + "'.
Check medium model.");
end if;

// Make sure that if energyDynamics is SteadyState, then
// massDynamics is also SteadyState.
Expand Down
5 changes: 3 additions & 2 deletions IBPSA/Fluid/Interfaces/StaticTwoPortConservationEquation.mo
Expand Up @@ -108,11 +108,12 @@ protected
"Needed to connect to conditional connector";
initial equation
// Assert that the substance with name 'water' has been found.
assert(Medium.nXi == 0 or abs(sum(s)-1) < 1e-5,
if use_mWat_flow then
assert(Medium.nXi == 0 or abs(sum(s)-1) < 1e-5,
"If Medium.nXi > 1, then substance 'water' must be present for one component.'"
+ Medium.mediumName + "'.\n"
+ "Check medium model.");

end if;
equation
// Conditional connectors
connect(mWat_flow, mWat_flow_internal);
Expand Down
6 changes: 3 additions & 3 deletions IBPSA/Fluid/MixingVolumes/Validation/MSLCombustionAir.mo
@@ -1,8 +1,8 @@
within IBPSA.Fluid.MixingVolumes.Validation;
model MSLCombustionAir
"Test of MSL mixture gas with Modelica IBPSA components"
package Medium = Modelica.Media.IdealGases.MixtureGases.CombustionAir; // Doesn't work, substance 'water' is missing
// package Medium = Modelica.Media.IdealGases.MixtureGases.FlueGasSixComponents; // Doesn't work
//package Medium = Modelica.Media.IdealGases.MixtureGases.CombustionAir; // Doesn't work, substance 'water' is missing
package Medium = Modelica.Media.IdealGases.MixtureGases.FlueGasSixComponents; // Doesn't work
//package Medium = Modelica.Media.IdealGases.SingleGases.N2; // Works fine

parameter Modelica.Units.SI.PressureDifference dp_nominal=1e4;
Expand All @@ -22,7 +22,7 @@ model MSLCombustionAir
redeclare package Medium = Medium,
nPorts=1)
annotation (Placement(transformation(extent={{60,-10},{40,10}})));
IBPSA.Fluid.MixingVolumes.BaseClasses.MixingVolumeHeatPort vol(
IBPSA.Fluid.MixingVolumes.MixingVolume vol(
redeclare package Medium = Medium,
m_flow_nominal=m_flow_nominal,
V=1,
Expand Down
1 change: 1 addition & 0 deletions IBPSA/Fluid/MixingVolumes/Validation/package.order
Expand Up @@ -4,6 +4,7 @@ CoupledVolumesSpecializedAirPerfectGas
CoupledVolumesSpecializedWaterConstantProperties_pT
CoupledVolumesSpecializedWaterTemperatureDependentDensity
CoupledVolumesWater
FixmeMSLCombustionAir
MSLCombustionAir
MixingVolume
MixingVolumeAdiabaticCooling
Expand Down

0 comments on commit 1f527fa

Please sign in to comment.