usnistgov / REFPROP-issues

A repository solely used for reporting issues with NIST REFPROP
26 stars 13 forks source link

How to implement an ideal gas heat capacity equation for equilibrium hydrogen in the fluid files. #357

Closed JKIMM1 closed 3 years ago

JKIMM1 commented 3 years ago

Hello,

I want to modify property, ideal gas heat capacity (a function of Temperature) of an original pure fluid file for generating a new fluid file. (Fld file modification?)

I have searched a lot in the REFPROP issues, wrappers but I could not have a clue for the idea.

Is it related to "subroutine FLAGSdll(hFlag, jFlag, kFlag, ierr, herr, hFlag_length, herr_length), CP0PH0"?

then I cant find how to use the subroutine...

Can get any advice for this issue?

Sincerely, Thank you.

Versions

REFPROP Version: [REFPROP 10]
Operating System and Version: [Windows 10]
Access Method: []

EricLemmon commented 3 years ago

You ask a potentially very difficult question! I would suggest looking at my propane publication (link below) and then open up the propane.fld file (which is a simple text file) that is located in your Refprop\Fluids directory and you will see a one-to-one correspondence between the parameters in the paper and those in the fluid file. The fluid files are arranged in a way where the top segment is mostly just information but generally not used in the calculation of properties, the second section contains the parameters of the Helmholtz energy residual part (the non-ideal part of fluid properties), and the third piece contains the parameters for the ideal gas heat capacity, which is then used to obtain the Helmholtz energy ideal gas properties. When combined with the residual part, the real fluid properties of the fluid can be calculated, to about the same level of uncertainty as data that were measured in the laboratory.

What form of equation for the ideal gas heat capacity would you like to add to the fluid file?

https://trc.nist.gov/refprop/Documents/Propane.pdf

JKIMM1 commented 3 years ago

Thank you for your super-rapid comment!

I just modified the text file with a required parameters like you said. and checked the modified properties matches well. What i'd liked to modify was parahyd.fld. and the equation is better not to post here due to the copyright of the journal paper.

Thank you for your kind reply again. You helped me a lot!!!

ianhbell commented 3 years ago

Why do you want to modify the EOS for parahydrogen?

nist-aharvey commented 3 years ago

It should be recognized that changing the ideal-gas heat capacity will produce a temperature-dependent shift of ALL caloric properties (heat capacities, enthalpy, etc.) calculated by the EOS, not just the ideal-gas properties. This may or may not be a problem, depending on what you are doing. If heat capacities or sound speeds were used to fit the EOS, you may reduce the quality of the fit to those data if the differences in ideal-gas heat capacity are large. In other words, the other EOS parameters depend the ideal-gas heat capacity used, and it is potentially dangerous to use different ideal-gas properties without re-doing the fit of the entire EOS.

JKIMM1 commented 3 years ago

Why do you want to modify the EOS for parahydrogen?

I want to get equilibrium H2 by modifying it. And then I will figure out whether the modification is reasonable or not for my case...

JKIMM1 commented 3 years ago

It should be recognized that changing the ideal-gas heat capacity will produce a temperature-dependent shift of ALL caloric properties (heat capacities, enthalpy, etc.) calculated by the EOS, not just the ideal-gas properties. This may or may not be a problem, depending on what you are doing. If heat capacities or sound speeds were used to fit the EOS, you may reduce the quality of the fit to those data if the differences in ideal-gas heat capacity are large. In other words, the other EOS parameters depend the ideal-gas heat capacity used, and it is potentially dangerous to use different ideal-gas properties without re-doing the fit of the entire EOS.

Thank you for detailed information. But I couldnt 100% understand... Do you mean If I modify CP0(ideal gas heat capacity), The EOS also should also be changed? The caloric properties including heat capacities depending on P,T are my concerns. Actually I dont know all the influence to the other properties when I modify the CP0. It will be helpful if you explain more...

jacobleachman commented 3 years ago

Hi @JKIMM1 -- I can help with your parahydrogen EOS issues. Please read this first, specifically the last paragraph, and let me know if you have any questions: https://hydrogen.wsu.edu/2015/06/22/why-equilibrium-hydrogen-doesnt-exist/

nist-aharvey commented 3 years ago

One way to look at it is that the EOS is a sum of the ideal gas term (where Cp0 depends only on temperature) and a residual term representing the deviation from ideal-gas behavior (depending on temperature and density). If you just change Cp0, you change the ideal contributions to the caloric properties, but the residual contributions are left unchanged. So I'm going to completely make up numbers for an example. Let's say that for some liquid hydrogen state the original EOS had a Cp of 10 in some units -- 4 from the ideal-gas part (Cp0) and 6 from the real-fluid part. Now if you change the ideal Cp0 so that Cp0 at that temperature is 5 instead of 4, that means the total Cp will be 11 instead of 10. If the residual terms were fitted to data where the Cp was 10, then your Cp0 change would make the liquid hydrogen numbers wrong.

In other words, if you shift Cp0 independently, you shift all caloric properties at all conditions. If the Cp0 shift is small, or if the conditions you are calculating are at low density so that the properties are dominated by the ideal-gas term, then that probably isn't a problem. But in principle the parameters in the real-fluid part of the EOS depend on what ideal-gas term was assumed when doing the fitting, so changing only the Cp0 of an already fitted EOS will introduce a discrepancy which could be significant in some cases.

JKIMM1 commented 3 years ago

Hi @JKIMM1 -- I can help with your parahydrogen EOS issues. Please read this first, specifically the last paragraph, and let me know if you have any questions: https://hydrogen.wsu.edu/2015/06/22/why-equilibrium-hydrogen-doesnt-exist/

Thank you for your reply! I read your elaborated papers and I have some question. I want to generate theoretical pseudo fluid (equilibrium-hydrogen), continuous, ideal op conversion (not just mixing ortho/para hydrogen). If I change the parameters and coefficients of the ideal-gas heat capacity equation, modifying the para-hydrogen to the equilibrium-hydrogen(*), the modified CP0 would give reasonable Cp and calorific values under various P, T, x(quality) through Leachman et al. EOS? If so, the reliable ranges would be almost the same with the reference para-hydrogen? If not, the residual Helmholtz also needs to be modified? (I find that the accuracy of modified CP0 gets lower when the temperature is under T < 28 K)

-- Maybe these questions are not suitable for this REFPROP issues... If so, I would be very grateful if you let me know your contact. (*)Ref; Accurate Thermodynamic Properties of the Six Isotopomers of Diatomic Hydrogen, Le Roy et al,

JKIMM1 commented 3 years ago

I appreciate for your reply and the detailed example. I could understand more about the Helmholtz EOS, thanks to your comment.

The thing is, I need to make a new pseudo fluid (equilibrium-hydrogen) and it necessarily has different values of CP0. And I wonder the modification of CP0 would still be effective and reliable without changing the residual parts, for making the other calorific data through Leachman EOS...

jacobleachman commented 3 years ago

@JKIMM1 -- many have wanted (and have made) an 'equilibrium' hydrogen equation of state that follows the 'equilibrium' heat capacity curve as you describe. The problem is that this creates unphysical critical region property behaviors that you would never be able to reproduce experimentally. In some cases deviations from experimental properties could be off by more than 50%. So we made the decision not to include or share an equilibrium hydrogen equation of state to prevent people from using it incorrectly or, worse yet, hurting someone.

It is still possible to get the properties of 'equilibrium' hydrogen you are desiring without creating a potentially dangerous or unphysical situation. This is accomplished by mixing the properties of parahydrogen and orthohydrogen (as described in that blog post). By calculating properties of both parahydrogen and orthohydrogen at any given state, you can then look up the equilibrium ortho-parahydrogen fraction at that given temperature and linearly interpolate between the parahydrogen or orthohydrogen property values at that state. If the reference states for the orthohydrogen and parahydrogen equations of state are set to the values described in the blog post, the enthalpies and entropies of conversion can be accurately accounted for.

nist-aharvey commented 3 years ago

It looks like Prof. Leachman has already replied, but I will say a couple of things from my perspective.

The fundamental issue is that "equilibrium hydrogen" is a mixture. Sometimes you can get away with treating a mixture as a pseudo-pure fluid (like with "air" or with "normal" hydrogen in most uses). But that really only works if your mixture has a fixed composition. Equilibrium H2 is a mixture with continually changing composition. The funny behavior of Cp0 is in some sense an artifact of the energy of conversion between the rotational states rather than representing heat capacity of the molecules themselves. As Prof. Leachman said, you really need to treat equilibrium hydrogen as a mixture to avoid a situation where you are calculating nonsense. And even then you need to be careful about reference states to be sure the results are physically correct.

JKIMM1 commented 3 years ago

I understand why they need to be mixed to model their behavior properly. But if I want to concept design a liquefaction process, I need to investigate their behavior inside the heat exchangers (continuous conversion, not at a certain state). We can model a heat exchanger with the mixing model by some iterations, but it is hard to look into the behavior inside. This is why I think I need to manipulate the CP0 to model the equilibrium hydrogen and want to know the reliability of this manipulation. I think you must have thought this situation. I think the mixing model can not create the pseudo CP values for continuous conversion.

For these reasons, I think the manipulation method needs to be adopted, and I wonder how the model would be precise. But If the deviations could be off by more than 50% as you said, I think this method is not adoptable for the concept design... In this case, I need to develop a mixing model (maybe iterative) for the heat exchanger model.

JKIMM1 commented 3 years ago

I agree with your comment, they are actually mixed not a pure fluid. The equilibrium hydrogen actually does not exist (Prof. Leachman's posting) but it is unique because it has a fixed composition for a temperature value. Thus, I think it has a possibility to be modeled as a pseudo-pure fluid. And this would be powerful when I want to see the theoretical(equilibrium) behavior in a heat exchanger. But the manipulation CP0 method is not accurate for various pressure and temperature (calculated by Leachman EOS), I would better not to adopt this CP0 manipulation. I think I need to check the accuracy the calorific properties by this method comparing the values by the mixing method.

EricLemmon commented 3 years ago

I've changed your title to help in searching information for equilibrium hydrogen. I've also added the "feature-request" label and will close this issue. This label will remind us to return to this issue when time permits to better enhance the properties of hydrogen in Refprop.