Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
TAeZoSysPro
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
TAeZoSysPro
TAeZoSysPro
Commits
946f97bd
Commit
946f97bd
authored
2 years ago
by
PASCAL BOREL
Browse files
Options
Downloads
Patches
Plain Diff
bug fix : atmo source X
parent
aff23537
Branches
master
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
FluidDynamics/Sources/Atmosphere.mo
+6
-17
6 additions, 17 deletions
FluidDynamics/Sources/Atmosphere.mo
with
6 additions
and
17 deletions
FluidDynamics/Sources/Atmosphere.mo
+
6
−
17
View file @
946f97bd
...
...
@@ -22,7 +22,6 @@ model Atmosphere
parameter Integer nPorts = 0 "Number of fluidport" annotation(Dialog(connectorSizing=true));
// Internal variables
Medium.ThermodynamicState state ;
Medium.MassFraction X[Medium.nX] "mass fraction of species";
// Imported module
...
...
@@ -73,31 +72,21 @@ equation
RH_internal = RH;
end if;
/* detection of the media between a gas with condensable species and a dry gas */
if Medium.mediumName == "Moist air" then
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 ;
state = Medium.setState_pTX(p = p_internal,
T = T_internal,
X=X_final) ;
// Ports handover
// Flowport
Flowport.T = T_internal;
Flowport.d = Medium.density(state) * X ;
>>>>>>> Modification to avoid issues when having a medium where the massFraction_pTphi function does not exist
Flowport.d = Medium.density(state) * X_final ;
// Heatport
Heatport.T = T_internal;
// Fluidport
for i in 1:nPorts loop
Fluidport[i].p = p_internal;
Fluidport[i].h_outflow = Medium.specificEnthalpy(state);
Fluidport[i].Xi_outflow = X[1:Medium.nXi];
Fluidport[i].Xi_outflow = X
_final
[1:Medium.nXi];
end for;
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")}),
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment