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

Rename FourPort #299

Closed
mwetter opened this issue Jul 17, 2015 · 5 comments · Fixed by #352
Closed

Rename FourPort #299

mwetter opened this issue Jul 17, 2015 · 5 comments · Fixed by #352

Comments

@mwetter
Copy link
Contributor

mwetter commented Jul 17, 2015

The model Annex60.Fluid.Interfaces.FourPort should be renamed to Annex60.Fluid.Interfaces.PartialFourPort and the following declarations should be removed

  parameter Modelica.SIunits.SpecificEnthalpy h_outflow_a1_start = Medium1.h_default 
    "Start value for enthalpy flowing out of port a1"
    annotation (Dialog(tab="Advanced", group="Initialization"));

  parameter Modelica.SIunits.SpecificEnthalpy h_outflow_b1_start = Medium1.h_default 
    "Start value for enthalpy flowing out of port b1"
    annotation (Dialog(tab="Advanced", group="Initialization"));

  parameter Modelica.SIunits.SpecificEnthalpy h_outflow_a2_start = Medium2.h_default 
    "Start value for enthalpy flowing out of port a2"
    annotation (Dialog(tab="Advanced", group="Initialization"));

  parameter Modelica.SIunits.SpecificEnthalpy h_outflow_b2_start = Medium2.h_default 
    "Start value for enthalpy flowing out of port b2"
    annotation (Dialog(tab="Advanced", group="Initialization"));

We should also check whether we want to add from PartialTwoPort the section

  // Model structure, e.g., used for visualization
protected 
  parameter Boolean port_a_exposesState = false 
    "= true if port_a exposes the state of a fluid volume";
  parameter Boolean port_b_exposesState = false 
    "= true if port_b.p exposes the state of a fluid volume";
  parameter Boolean showDesignFlowDirection = true 
    "= false to hide the arrow in the model icon";

These changes will make the models identical, except for the number of ports.

mwetter added a commit that referenced this issue Oct 30, 2015
bramvdh91 added a commit to bramvdh91/modelica-ibpsa that referenced this issue Nov 10, 2015
@bramvdh91
Copy link
Contributor

I have made an implementation for this PartialFourPort based on the PartialTwoPort. I have duplicated the exposesState variables, but kept one showDesignFlowDirection (since I assume the flow in the two circuits will be equal but opposite). The component can be found in https://github.com/bramvdh91/modelica-annex60/tree/issue264_pipe (since I changed it working on issue 264) under Experimental.Pipe.BaseClasses.PartialFourPort.

@mwetter
Copy link
Contributor Author

mwetter commented Nov 11, 2015

@bramvdh91 : Can you please move your model to Annex60.Fluid.Interfaces.PartialFourPort. This way, we can integrate it into the Annex 60 library and address this ticket separately from the pipe model. (It usually is easier to have smaller pull request as opposed to addressing multiple issues in one pull request.)

bramvdh91 added a commit to bramvdh91/modelica-ibpsa that referenced this issue Nov 11, 2015
@bramvdh91
Copy link
Contributor

I have added the component in a separate branch to limit the pull request.

mwetter added a commit that referenced this issue Nov 12, 2015
mwetter added a commit that referenced this issue Nov 12, 2015
mwetter added a commit that referenced this issue Nov 12, 2015
mwetter added a commit that referenced this issue Nov 12, 2015
@mwetter
Copy link
Contributor Author

mwetter commented Nov 12, 2015

@bramvdh91 : Thanks for your pull request. I merged it to the development branch.

For now, I did not use exposesState as I don't think this is used by any model. I suggest to consider whether we should remove this parameter from all models, or else add it to the PartialFourPort and use it in models that extend from PartialFourPort. (Removing parameters is always harder as this can cause incompatibilities that require a major version update.)

I also revised your pull request to make the model identical to PartialTwoPort except for the changes that are needed because of having four ports.

I did not implement the showDesignFlowDirection flag as this is not used by other models. I made a new ticket to consider removing this in the two port models as well (#349).

Can you please check whether the version on the development branch issue299_partialfourport satisfies your need for the pipe model. You will however have to introduce the parameters

replaceable package Medium = Modelica.Media.Interfaces.PartialMedium
    "Medium in the component" annotation (choicesAllMatching=true);

  parameter Boolean allowFlowReversal=true
    "= true to allow flow reversal, false restricts to design direction (port_a -> port_b)"
    annotation (Dialog(tab="Assumptions"), Evaluate=true);

and assign them to allowFlowReversal1 and allowFlowReversal2, and also to Medium1 and Medium2.

@bramvdh91
Copy link
Contributor

Okay, I think I misinterpreted the opening comment of this issue, which is why I didn't add the two media.

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

Successfully merging a pull request may close this issue.

3 participants