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

Issues with Cp, Cv, u, and viscosity with QT_INPUTS where Q=0 or 1 (xxx&REFPROP backend) #871

Closed
mapipolo opened this issue Nov 16, 2015 · 3 comments
Milestone

Comments

@mapipolo
Copy link

I'm using the latest nightly build to try to move forward on computing bubble point and dew point properties for mixtures. I begin by trying to find dew point properties for R438A at 244.3 K using TTSE and REFPROP:

AbstractState stateTab = AbstractState.factory("TTSE&REFPROP", "R438A.mix");
stateTab.update(input_pairs.QT_INPUTS, 1.0, 244.3);
stateTab.umass() -> Exception: "Pointer to vector y is unset in is_inside"
stateTab.cpmass() -> Exception: "Two-phase not possible for cpmolar currently"
stateTab.viscosity() -> Exception: "muV is invalid"

I tried to work around these issues by moving the calculation point just to the right of the vapor dome, then using PT inputs to recalculate:

AbstractState stateTab = AbstractState.factory("TTSE&REFPROP", "R438A.mix");
stateTab.update(input_pairs.QT_INPUTS, 1.0, 244.3);
stateTab.update(input_pairs.PT_INPUTS, stateTab.p(), stateTab.T() + 0.001);
stateTab.umass() -> succeeds
stateTab.cpmass() -> succeeds
stateTab.viscosity() -> Exception: "Cell to TTSEBackend::evaluate_single_phase_transport must have four valid corners for now"

Using BICUBIC and REFPROP, the latter workaround often works to calculate all the properties at the dew point, but doesn't at other times. I seem to have less luck at the bubble point, as we see here:

AbstractState stateTab = AbstractState.factory("BICUBIC&REFPROP", "R438A.mix");
stateTab.update(input_pairs.QT_INPUTS, 0.0, 266.154);
stateTab.umass() -> Exception: "Pointer to vector y is unset in is_inside"
stateTab.cpmass() -> Exception: "Two-phase not possible for cpmolar currently"
stateTab.viscosity() -> Exception: "muV is invalid"

And again trying the workaround:

AbstractState stateTab = AbstractState.factory("BICUBIC&REFPROP", "R438A.mix");
stateTab.update(input_pairs.QT_INPUTS, 0.0, 266.154);
stateTab.update(input_pairs.PT_INPUTS, stateTab.p(), stateTab.T() - 0.001); -> Exception: "Cell is invalid and has no good neighbors for p = 422161 Pa, T= 266.819 K"

Using: C#, 11/16 nightly build

@ibell
Copy link
Contributor

ibell commented Nov 17, 2015

Fixed umass = hmass - p/rhomass, not sure what to do about cpmass at saturation, that's a trickier one. Viscosity should be fixable too.

@ibell
Copy link
Contributor

ibell commented Nov 17, 2015

On second thought, with REFPROP this is a bit trickier since REFPROP doesn't offer the chance to evaluate transport properties as the phase envelope is constructed. Might have to stick to the workaround for now.

@ibell ibell added this to the v5.1.2 milestone Dec 6, 2015
@ibell ibell closed this as completed in 4f0b5ca Dec 13, 2015
@ibell
Copy link
Contributor

ibell commented Dec 13, 2015

Ok, got this working:

std::vector<std::string> backends;
    backends.push_back("TTSE&REFPROP");
    backends.push_back("REFPROP");
    for (int i = 0; i<2; ++i){
        shared_ptr<CoolProp::AbstractState> stateTab(CoolProp::AbstractState::factory(backends[i], "R438A.mix"));
        stateTab->update(CoolProp::QT_INPUTS, 1.0, 244.3);
        std::cout << "umass: " << stateTab->umass() <<std::endl;
        std::cout << "cpmass: " << stateTab->cpmass() <<std::endl;
        std::cout << "cvmass: " << stateTab->cvmass() <<std::endl;
        std::cout << "viscosity: " << stateTab->viscosity() <<std::endl;
        std::cout << "conductivity: " << stateTab->conductivity() <<std::endl;
    }

yields

umass: 346586
cpmass: 803.382
cvmass: 688.494
viscosity: 1.01175e-005
conductivity: 0.00978884
umass: 346552
cpmass: 803.086
cvmass: 688.332
viscosity: 1.01175e-005
conductivity: 0.00978918

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