LLNL / LH2Transfer

Liquid H2 (LH2) is a strong candidate for large scale, cost effective zero-emission transportation. One drawback of using LH2 are the losses along the supply chain, when transferring or using the molecule. This simulation code written in MATLAB enables to quantify the transfer and boil-off losses when using LH2, typically between a LH2 trailer and a stationary storage (e.g. at the refueling station). Different boundary conditions can be simulated for further optimization.
Other
12 stars 7 forks source link

vaporpressure_bis #1

Open life-elixir opened 4 years ago

life-elixir commented 4 years ago

It seems that the vaporpressure_bis function is missing. Could you please help me locate that function? If I just change the vaporpressure_bis in the Data_extraction.m code to vaporpressure I get the following error at the end of simulation:

Done with ODE solver now extracting data Error using refpropm (line 464) [TDFLSH error 5] One or more inputs are out of range; Temperature above 1.5x(upper limit): T = 370651 K, Tmax = 1000.00 K; Pressure above upper limit: P = 2040.05 MPa, Pmax = 2000.00 MPa.

Error in vaporpressure (line 26) pv = refpropm('P','T',Tv,'D',rhov,'PARAHYD')*1e3; % return value in Pa

Error in Data_extraction (line 22) nominal.pv1(z,:)=vaporpressure(nominal.uv1(z,end), nominal.rhov1(z));

Error in runNominal (line 16) Data_extraction;

momengif commented 4 years ago

I have the same problem; "vaporpressure_bis function is undefined". Please, If you you could find a way to solve,would you share it with me ?

momengif commented 4 years ago

I have a prolem with 'vporpressure_bis' function if you could help!

Done with ODE solver now extracting data Unrecognized function or variable 'vaporpressure_bis'.

Error in Data_extraction (line 22) nominal.pv1(z,:)=vaporpressure_bis(nominal.uv1(z,end), nominal.rhov1(z));

Error in runNominal (line 16) Data_extraction;

Error in run (line 91) evalin('caller', strcat(script, ';'));

life-elixir commented 4 years ago

I solved it using a patch knowing that the vapor pressure of solid is ~ 0. So I set its value to 1e-14

momengif commented 4 years ago

do I need to edit the “vaporpressure_bis” function? or should I replace it with “vaporpressure”?! how can I edit the “the vapor pressure of solid” could you write down the steps to do that ??

momengif commented 4 years ago

or a link to the patch ?!

momengif commented 4 years ago

@life-elixir @IanLee1521 @guillaume1982 Could you help ?

guillaume1982 commented 4 years ago

?

On Fri, Sep 18, 2020 at 7:30 AM momengif notifications@github.com wrote:

@life-elixir https://github.com/life-elixir @IanLee1521 https://github.com/IanLee1521 @guillaume1982 https://github.com/guillaume1982 Could you help ?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/LLNL/LH2Transfer/issues/1#issuecomment-694660752, or unsubscribe https://github.com/notifications/unsubscribe-auth/AF6FNI5GCEYOODZCZQ6BURTSGLV6DANCNFSM4QJBAHDQ .

momengif commented 4 years ago

I have the same problem; "vaporpressure_bis function is undefined". Please, If you you could find a way to solve,would you share it with me ?

Done with ODE solver now extracting data Unrecognized function or variable 'vaporpressure_bis'.

Error in Data_extraction (line 22) nominal.pv1(z,:)=vaporpressure_bis(nominal.uv1(z,end), nominal.rhov1(z));

Error in runNominal (line 16) Data_extraction;

Error in run (line 91) evalin('caller', strcat(script, ';'));

@guillaume1982

life-elixir commented 4 years ago

just set the vapor pressure of the solid close to zero. I don't know how to explain that more clearly!

momengif commented 4 years ago

"more clearly!" like what patch did you use? do you have a link? did you use 'vaporpressure_bis' or replaced it with "vaporpressure"? "vapor pressure of the solid" variable in which file?

life-elixir commented 4 years ago

You need to have a physical understanding of the problem before coding things. I don't understand why you always look for some available code to use it. Write your own based on your understanding of the subject matter.

zakmachachi commented 3 years ago

Hello @momengif - I have found a fix for the bug. Change vaporpressure_bis to vaporpressure. The original version was using the internal energy as the input for temperature hence the extremely large "temperature". Copy and paste the following into vaporpressure.m

function pv=vaporpressure(uv,rhov)

% new function for vapor pressure, based on internal energy and density try quality=refpropm('q','D',rhov,'U',uv,'PARAHYD'); catch uv=fix(100uv)/100; try quality=refpropm('q','D',rhov,'U',fix(100uv)/100,'PARAHYD'); DISP('Non-truncation of uv did not converge in "quality". Choosing truncated value instead'); catch quality=refpropm('q','D',fix(100rhov)/100,'U',fix(100uv)/100,'PARAHYD'); rhov=fix(100rhov)/100; %uv=fix(100uv)/100; end end if quality < 1 && quality >0 % 2 phase temp=refpropm('T','D',rhov,'U',uv,'PARAHYD'); pv = refpropm('P','T',temp,'Q',1,'PARAHYD')1e3;% return value in Pa else %supercricical pv = refpropm('P','D',rhov,'U',uv,'PARAHYD')1e3;% return value in Pa end end

Ignore life-elixir on using a patch for solid state - it's not required as the code will never allow the temp to go below the triple point.

@guillaume1982 @IanLee1521 I have forked your repository with the new vaporpressure function - consider adding to master once verified by yourself. Many thanks for the code!

momengif commented 3 years ago

Hello @zakmachachi, it worked perfectly. Thanks a lot, really appreciate your help. I just added a multiplication sign '*' to 100uv and 100rhov.

matrix7956 commented 2 years ago

I solved it using a patch knowing that the vapor pressure of solid is ~ 0. So I set its value to 1e-14

hello @life-elixir I am getting the same error as the others in the comment but even with the different answers I cannot find how to resolve it may be because I am beginner in MATLAB coding. Can you please help me in that? it would be a great help. Thanks for your time.

matrix7956 commented 2 years ago

Hello @zakmachachi @momengif with the code written by @zakmachachi the results wont match from the literature results. so I am guess its wrong. correct me if I am wrong.

matrix7956 commented 2 years ago

@guillaume1982 could you please help me with the solution. for the above issue. I am beginner in MATLAB. it would be great help if you do so. Thanks for your time.

zakmachachi commented 2 years ago

@matrix7956 what literature are you comparing to? Post your issue explicitly otherwise you won't receive adequate help...

matrix7956 commented 2 years ago

@matrix7956 what literature are you comparing to? Post your issue explicitly otherwise you won't receive adequate help...

hello @zakmachachi I am referring from "Boil-off losses along LH2 pathway ,G. Petitpas, May 2, 2018." from where I got the access to this code. I am sharing the literature as well as the comparison after running the code with your change. most of the results match but just heat transfer in vapor and liquid in ET wont match.

[https://drive.google.com/file/d/1p0zxnYC0EA0d2Dq9DoG9NP_nrhJ-gQ7-/view?usp=sharing] (THE LITRETAURE) [https://docs.google.com/presentation/d/1Rg2a5tc9flVrPUEXgWY4K59Mft_JdaiU/edit?usp=sharing&ouid=113248310358927375119&rtpof=true&sd=true] (THE COMPARISON BY SIMULATIING @zakmachachi CODE. )

Please help!! Thanks for your time.

zakmachachi commented 2 years ago

@matrix7956 Temperature, Pressure and Mass transfer are identical so there is no issue there. The issue is how heat transfer is plotted in the paper. Plot it with the same axes and see what happens

matrix7956 commented 2 years ago

@zakmachachi thanks for the help. It worked for heat transfer in vapor results matched. but for heat transfer for liquid I tried but getting same results. Do you have more inputs to give?

matrix7956 commented 2 years ago

@zakmachachi Hello !! I tried doing some things understanding physics but not able to match the results for heat transfer for liquid. Could you please help me it would be great help. it is because different version of REFPROP or MATLAB? Thanks for your time!