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

Incompressible eva sec medium (Brine), Definition #16

Open
WolffISE opened this issue Nov 11, 2024 · 6 comments
Open

Incompressible eva sec medium (Brine), Definition #16

WolffISE opened this issue Nov 11, 2024 · 6 comments

Comments

@WolffISE
Copy link

Is it possible to use brine mediums of coolprop like MPG-20% or MEG-20% at the secondary side of the evaporator? How can i set them up?

Regards
Christian

@FWuellhorst
Copy link
Contributor

Yes, I guess it should be possible if you know what the name in coolprop is (e.g. brine_mpg20) you can specify e.g. secondary_medium="brine_mpg20" in the heat exchanger. The only code part which is fixed on water and air is the calculation of transport properties for cp. Here, you would have to add an elif with an assumption for the pressure in the brine. If you know a good default, we could also add the change to main via a fork.
In vclibpy\components\heat_exchangers\heat_exchanger.py:

            if self.secondary_medium == "water":
                p = 2e5  # 2 bar (default hydraulic pressure)
            elif self.secondary_medium == "air":
                p = 101325  # 1 atm
            else:
                raise NotImplementedError(
                    "Default pressures for secondary_mediums aside from water and air are not supported yet."
                )

@WolffISE
Copy link
Author

Thanks for the suggestion. I think one of the main problems is, that mpg20 is not listed as a fluid in Coolprop. Instead it is listed as an incompressible mixture. So i think we do need to change some more code, or?

@FWuellhorst
Copy link
Contributor

As far as I can see here (http://www.coolprop.org/fluid_properties/Incompressibles.html), you can also specify incompressible mixtures using PropsSI?

@WolffISE
Copy link
Author

WolffISE commented Nov 13, 2024

Thx, i think i found a solution, but i still need to test it. The key was, that also the backend needs to be changed. For this i added the pressure assumption and modified: media/cool_prop.py init() to

def __init__(self, fluid_name, use_high_level_api: bool = False):
       super().__init__(fluid_name=fluid_name)
       # Set molar mass and trigger a possible fluid-name error
       # if the fluid is not supported.
       if "::" in fluid_name:
           back_end, fluid_name = fluid_name.split("::")
           if "[" in fluid_name:
               fluid_name, _fractions = fluid_name.split("[")
               _fractions = _fractions.replace("]", "")
           else:
               _fractions = None
           self._helmholtz_equation_of_state = CoolPropInternal.AbstractState(back_end, fluid_name)
           self._helmholtz_equation_of_state.set_mass_fractions([float(_fractions)]) #TODO check if a mixture could also be volume based
       else:
           self._helmholtz_equation_of_state = CoolPropInternal.AbstractState("HEOS", self.fluid_name)
           self.M = self._helmholtz_equation_of_state.molar_mass()
       self.use_high_level_api = use_high_level_api

The fluid can be defined like: INCOMP::MEG[20] (backend::fluid_name)

@FWuellhorst
Copy link
Contributor

Ok, this looks good and makes sense. Do you want to create a pull request with the change? :)

@WolffISE
Copy link
Author

Yes i will do one soon, after i tested it a little more. :)

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