Skip to content
Snippets Groups Projects
Commit aff23537 authored by Felix MARSOLLIER's avatar Felix MARSOLLIER
Browse files

Modification to avoid issues when having a medium where the massFraction_pTphi...

Modification to avoid issues when having a medium where the massFraction_pTphi function does not exist
parent 6205009a
No related branches found
No related tags found
No related merge requests found
...@@ -22,6 +22,7 @@ model Atmosphere ...@@ -22,6 +22,7 @@ model Atmosphere
parameter Integer nPorts = 0 "Number of fluidport" annotation(Dialog(connectorSizing=true)); parameter Integer nPorts = 0 "Number of fluidport" annotation(Dialog(connectorSizing=true));
// Internal variables // Internal variables
Medium.ThermodynamicState state ; Medium.ThermodynamicState state ;
Medium.MassFraction X[Medium.nX] "mass fraction of species";
// Imported module // Imported module
...@@ -72,22 +73,31 @@ equation ...@@ -72,22 +73,31 @@ equation
RH_internal = RH; RH_internal = RH;
end if; end if;
state = Medium.setState_pTX(p = p_internal, /* detection of the media between a gas with condensable species and a dry gas */
T = T_internal, if Medium.mediumName == "Moist air" then
X=X_final) ; state = Medium.setState_pTX(p = p_internal,
T = T_internal,
X = {TAeZoSysPro.Media.Air.MoistAir.massFraction_pTphi(p = p_internal, T = T_internal, phi = RH_internal)}) ;
X = cat(1, {TAeZoSysPro.Media.Air.MoistAir.massFraction_pTphi(p = p, T = T, phi = RH)}, {1-TAeZoSysPro.Media.Air.MoistAir.massFraction_pTphi(p = p, T = T, phi = RH)});
else
state = Medium.setState_pTX(p = p_internal,
T = T_internal) ;
X = Medium.reference_X;
end if ;
// Ports handover // Ports handover
// Flowport // Flowport
Flowport.T = T_internal; Flowport.T = T_internal;
Flowport.d=Medium.density(state)*X_final; Flowport.d = Medium.density(state) * X ;
>>>>>>> Modification to avoid issues when having a medium where the massFraction_pTphi function does not exist
// Heatport // Heatport
Heatport.T = T_internal; Heatport.T = T_internal;
// Fluidport // Fluidport
for i in 1:nPorts loop for i in 1:nPorts loop
Fluidport[i].p = p_internal; Fluidport[i].p = p_internal;
Fluidport[i].h_outflow = Medium.specificEnthalpy(state); Fluidport[i].h_outflow = Medium.specificEnthalpy(state);
Fluidport[i].Xi_outflow = X_final[1:Medium.nXi]; Fluidport[i].Xi_outflow = X[1:Medium.nXi];
end for; end for;
annotation( annotation(
Icon(coordinateSystem(initialScale = 0.1), graphics = {Ellipse(origin = {-8, 23}, extent = {{-52, 37}, {68, -83}}, endAngle = 360), Text(origin = {-65, 87}, extent = {{-35, 13}, {165, -7}}, textString = "P=%p"), Text(origin = {-37, 33}, extent = {{-63, 47}, {137, 27}}, textString = "T=%T"), Text(origin = {-17, -97}, extent = {{-83, 17}, {117, -3}}, textString = "RH=%RH")}), Icon(coordinateSystem(initialScale = 0.1), graphics = {Ellipse(origin = {-8, 23}, extent = {{-52, 37}, {68, -83}}, endAngle = 360), Text(origin = {-65, 87}, extent = {{-35, 13}, {165, -7}}, textString = "P=%p"), Text(origin = {-37, 33}, extent = {{-63, 47}, {137, 27}}, textString = "T=%T"), Text(origin = {-17, -97}, extent = {{-83, 17}, {117, -3}}, textString = "RH=%RH")}),
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment