Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a static pipe model for comparison #76

Open
marcusfuchs opened this issue Jun 9, 2017 · 4 comments
Open

Add a static pipe model for comparison #76

marcusfuchs opened this issue Jun 9, 2017 · 4 comments
Assignees

Comments

@marcusfuchs
Copy link
Collaborator

As discussed in the past, it is possible to model static pipe behavior within a model structure similar to the newly developed pipe model. This needs 2 changes

  • change heat loss model to calculate heat losses based on current velocity instead of travel time of fluid parcels
  • replace plug flow model with hydraulic resistance

I'll add such a model for comparison and reference.

@GersHub sorry for the long delay in getting to this.

@marcusfuchs marcusfuchs self-assigned this Jun 9, 2017
marcusfuchs pushed a commit that referenced this issue Jun 9, 2017
marcusfuchs pushed a commit that referenced this issue Jun 9, 2017
marcusfuchs pushed a commit that referenced this issue Jun 9, 2017
@marcusfuchs
Copy link
Collaborator Author

@GersHub I added the static model to the branch pipe_issue76_static. Please raise any issues or questions you may encounter.

marcusfuchs pushed a commit that referenced this issue Jul 3, 2017
@marcusfuchs
Copy link
Collaborator Author

@bramvdh91 @GersHub
I'm playing around with JModelica, and in the current implementation of HeatLossPipeStatic I get a type error on

Tin_a = Medium.temperature_phX(
    port_a.p,
    inStream(port_a.h_outflow),
    inStream(port_a.Xi_outflow));

Any objections to changing this to

  Tin_a = Medium.temperature_phX(
    port_a.p,
    inStream(port_a.h_outflow),
    Medium.X_default);

?

@k-sartor
Copy link
Collaborator

k-sartor commented Jul 5, 2017 via email

@marcusfuchs
Copy link
Collaborator Author

Haven't looked too deep into this, but I guess it has something to do with how JModelica and Dymola handle the mass fractions of a medium. Modelica.Media.UsersGuide.MediumUsage.BasicUsage gives a bit of information on this, including

If a fluid consists of a single substance, nXi = 0 and the vector of mass fractions Xi is not present.

Therefore, JModelica could be correct in returning an empty value of type Real[0] for inStream(port_a.Xi_outflow) with a single-substance water medium, raising an error as Medium.temperature_phX expects an input of type Real[1] for X. Dymola on the other hand seems to tolerate this.

marcusfuchs pushed a commit that referenced this issue Jul 5, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants