CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Programming & Development (https://www.cfd-online.com/Forums/openfoam-programming-development/)
-   -   compressible flow with phase change (https://www.cfd-online.com/Forums/openfoam-programming-development/110816-compressible-flow-phase-change.html)

mkraposhin December 21, 2012 08:23

compressible flow with phase change
 
Dear friends!

I made model for compressible, two-phase flow with phase change due to temperature and/or pressure variation, which is based on interFoam (VOF). If you are intersted in using it, you can download it by this link (with tutorials). Solver was done for OF-2.1.0 and 1.6-ext

Equations description located here

I need your advices and feed back. I would like to put this solver in OpenFOAM - but this can take some time.

And, of course, excuse me my "great" russian english

Some nice pictures:
http://www.os-cfd.ru/compressibleMix...vap-render.jpg

Coral.Qing April 25, 2013 04:54

thx, i will try it if i can figure out it

sfigato April 29, 2013 10:47

Hi Matvey,

thanks for share your solver!
I have some questions:

1) have you implemented the Singhal model ?? In your opinion is it difficult to do it!?
2) Can I use the solver without the hydrostatic part of the pressure (rho * g *h)?

Thanks
Regards

Marco

zhengzh5 July 26, 2013 12:45

Hi,

when I tried to run the steam-jet tutorial, it complains about not having the nuSgsUSpaldingWallFunction, and I couldn't find such wall function anywhere in my OpenFOAM source either, can someone point to me where to get a copy of it? if it's out there at all. thanks!

mkraposhin August 6, 2013 12:31

Quote:

Originally Posted by sfigato (Post 423908)
Hi Matvey,

thanks for share your solver!
I have some questions:

1) have you implemented the Singhal model ?? In your opinion is it difficult to do it!?
2) Can I use the solver without the hydrostatic part of the pressure (rho * g *h)?

Thanks
Regards

Marco

1) Yes, but it is not included in the current release of the solver. If you will share paper with your description of this model, i can do this
2) Yes, just set g = (0 0 0)

mkraposhin August 6, 2013 12:32

Quote:

Originally Posted by zhengzh5 (Post 442223)
Hi,

when I tried to run the steam-jet tutorial, it complains about not having the nuSgsUSpaldingWallFunction, and I couldn't find such wall function anywhere in my OpenFOAM source either, can someone point to me where to get a copy of it? if it's out there at all. thanks!

This problem shows that you are using incorrect version OpenFOAM. Current version of OpenFOAM - 2.1.0

mkraposhin August 6, 2013 12:43

Quote:

Originally Posted by mkraposhin (Post 398548)
Dear friends!

I made model for compressible, two-phase flow with phase change due to temperature and/or pressure variation, which is based on interFoam (VOF). If you are intersted in using it, you can download it by this link (with tutorials). Solver was done for OF-2.1.0 and 1.6-ext

Equations description located here

I need your advices and feed back. I would like to put this solver in OpenFOAM - but this can take some time.

And, of course, excuse me my "great" russian english

Some nice pictures:
http://www.os-cfd.ru/compressibleMix...vap-render.jpg

Dear friends,

Solver code has been changed. Also, system of equations changed too.
Latest description of the test cases and description you can find here!

Today this solver works well with two type of problem:
1) Cavitation (water)
2) Flashing of water in the adiabatic conditions

Again, solver is available only for OpenFOAM 2.1.0, but i hope to port it to OF2.2.X, OF1.6-ext

sfigato August 6, 2013 13:12

Quote:

Originally Posted by mkraposhin (Post 444166)
1) Yes, but it is not included in the current release of the solver. If you will share paper with your description of this model, i can do this
2) Yes, just set g = (0 0 0)


Hi,

here is the link, where you can download the description of the model:

http://fluidsengineering.asmedigital...icleid=1429576

The model includes also the gas cavitation! You cannot find the full description of the model with the gas mass transfer (one more transport equation)! If you give to me your mail I will send to you it!

thank you for sharing your work
Best Regards

Marco

mkraposhin August 7, 2013 03:06

Quote:

Originally Posted by sfigato (Post 444172)
Hi,

If you give to me your mail I will send to you it!

Marco

I sent my e-mail address to you by using private message

mkraposhin August 7, 2013 03:13

Quote:

Originally Posted by sfigato (Post 444172)


The model includes also the gas cavitation!

Marco

I think, it can be a problem. If gas volume fraction is small enough, and it's density is comparable to density of vapour, then we can neglect influence of the gas on the flow. So we can decouple gas fraction transport from the liquid/vapour transport.

But, if the gas volume fraction is large, then we need a coupled solution, and this can be a slightly more complex case

mkraposhin August 7, 2013 11:59

Quote:

Originally Posted by sfigato (Post 423908)
1) have you implemented the Singhal model ?? In your opinion is it difficult to do it!?

Done with the source code and paper, which you sent to me by e-mail.
Source code and short description located here

But now i have 2 questions:
1) Dimensions of equation (15) are different from (13). Does it mean that constant Ce should have dimensions [meter/second]?
[(eq.13)]=kg/(meter^3 secod)

2) In equations (15) and (16) we can see mass fractions (Fv and Fl), but in our model we are solving for volume fraction. Why did you commented corresponding terms rho2/rho and rho1/rho ?

sfigato August 7, 2013 12:38

Quote:

Originally Posted by mkraposhin (Post 444407)
Done with the source code and paper, which you sent to me by e-mail.
Source code and short description located here

But now i have 2 questions:
1) Dimensions of equation (15) are different from (13). Does it mean that constant Ce should have dimensions [meter/second]?
[(eq.13)]=kg/(meter^3 secod)

2) In equations (15) and (16) we can see mass fractions (Fv and Fl), but in our model we are solving for volume fraction. Why did you commented corresponding terms rho2/rho and rho1/rho ?


Great! First of all! I already validate the Singhal mass transfer model , so we can trust about the implementation!

Answer 1) The dimension of the constants actually is [meters/seconds]. This is due to an author's trick!

Answer 2) To implement the Singhal model I follwed the Tobias Huuva Thesis (this thesis is too long to send but I will send tomorrow just the Sighal Model page)! He replaces the mass fraction with the vapour one. The reason is that the transport equations of Singhal are written for the mass fractions so Singhal needs to scale the vapour fractions! The transport equations in OpenFoam are already written for the vapour fracions so you do not need to scale them!

Fhurter improvements:

1) I have already implemented th Zwart model

link: http://www.google.de/url?sa=t&rct=j&...50310824,d.Yms

It is the Ansys cavitation model and I already validated this implementation..if you want I can send to you tomorrow!

2) What is a real improvement (which no-one has already done) is to take in account for the Gas Cavitation (from equation 24 to equation 30 in Sighal's lecture )! It becomes very important in the past few years (for example for mineral oil applications)! But your model needs to be 4 phases (with condensable and non condesable gas vapour and liquid) and you must add two new transport eqautions. If you want to implement it I can share to you my knowledge (the Singhal model is not clear deriveted and I already made some new impromvents in the mass transfer rates)!

Let me know (by mail too for the two improvments)

regards
Marco

mkraposhin August 7, 2013 13:08

Quote:

Originally Posted by sfigato (Post 444416)
Answer 2) To implement the Singhal model I follwed the Tobias Huuva Thesis (this thesis is too long to send but I will send tomorrow just the Sighal Model page)! He replaces the mass fraction with the vapour one. The reason is that the transport equations of Singhal are written for the mass fractions so Singhal needs to scale the vapour fractions! The transport equations in OpenFoam are already written for the vapour fracions so you do not need to scale them!

Maybe i'm stupid, but here i can't agree with you, because:
1) Av*rhov=rhom*Fv (Av - vapour volume fraction, rhov - vapor density, rhom - mixture density, Fv - mass vapour fraction)
then
ddt(Fv*rhom)+div(Fv*rhom*U)=ddt(Av*rhov) + div(Av*rhov*U)

so, OpenFOAM formulation for Av transport is the same as in Singhal paper

2) Fv in eq, (15) comes from eq. (13) where Av*rhov/rhom=Fv, isn't it?

Please, tell me where am i wrong?

mkraposhin August 7, 2013 15:16

Quote:

Originally Posted by sfigato (Post 444416)

1) I have already implemented th Zwart model

link: http://www.google.de/url?sa=t&rct=j&...50310824,d.Yms

Marco

I added this model to the solver too, and now i'm running test case for hemispherical body. first results will be available tomorrow, or maybe next day after tomorrow.

Also, can you propose your test cases for this models?

sfigato August 8, 2013 05:24

Quote:

Originally Posted by mkraposhin (Post 444437)
I added this model to the solver too, and now i'm running test case for hemispherical body. first results will be available tomorrow, or maybe next day after tomorrow.

Also, can you propose your test cases for this models?


Hi,

I already sent to you an mail!

Regarding the test case, I have also an hydraulic resistence with mineral oil. Moreover, I am preparing an hydraulic valve with cavitation (the geometry looks like really cool).. but it takes time to be ready!

Regards
Marco

mkraposhin August 9, 2013 09:46

Hi, i made update to the solver it is available at the same address

Test cases for the hemispherical body with the Zwart and the Singhal models are still running.

Some notes on the implementation of volume fraction transport in OpenFOAM.
1)
It is formulated in volume fluxes, but it derived from mass fluxes:
ddt(alpha_l * rho_l) + div(alpha_l * rho_l * U) = m_l

ddt(alpha_l) + div(alpha_l U_l) = m_l/rho_l + (alpha_l/rho_l)*DDt(rho_l)

when fluid is incompressible and flow is isothermal, last term is zero, then we have:
ddt(alpha_l) + div(alpha_l U_l) = m_l

m_l - is the sum of m^+ and m^- of the Singhal model. In OpenFOAM m_l is represented by method mDotAlphal. That's why i think that we need to scale terms in Singhal model when switching from the mass fraction to the volume fraction

2)
In Singhal model pressure difference is calculated as: dP=pSat + c*k - p, but OpenFOAM interPhaseChangeFoam solver do not contain term "c*k" in the equation for pressure. And there is no such term in my model. That's why i don't include 0.5*0.39*rho_l*k when i estimate mass evaporation term.
If you want to insert this term in the model (interPhaseChangeFoam or compressibleMixingPhaseChangeFoam), then you need to change equation for pressure to obtain mass and momentum continuity

About NCG.
I think, i can add transport equations for the non-condensible gas in the model in three step:
1) Simple transport of the volume gas fraction without accounting for it's influence on the total mass of the system (alpha_g <= 1.0e-5 or another small value)
2) Transport of the volume gas fraction without desorption or absorption
3) And if two previous models will work, i can try to implement model with desorption and absorption

If you are still interested, it will be nice to run test cases, which you had proposed by e-mail

sfigato August 9, 2013 10:44

Hi Matvej,

1) I will try to validate the model without scaling as well! The point is that it is not clear how Singhal has derivated it. I mean, where exactly he intoduces this scaling.

2) I totally agree with you. I choose to change the all mass transfer models with the 'k' term (as well as for the pressure equation) . Because I think that turbulence effects on cavitation too!

About NCG.
I think that your three steps are right. Just some considerations:

1) You must account for other two phases (dissolved and undissolved) so the transport equations which you were speaking about (in your second point) are two. This is because there is a big diference between vapor and gas. "Dissolved vapor" is the liquid. Dissolved gas has the same property of the liquid but it is not he liquid. You must take in account its fraction in the multiphase..also because it is the limit of the fraction of released undissolved gas !

2) The absorpiton and desorption rates of Singhal show not a very good agreement with experiment. We are developing our own rates. If you are intrested I can (will) provide to you these two OpenFoam files as I did for Singhal (the same framework of the vapour cavitation)

3) I will send to you a presentation about the implementation of NCG in Ansys.

Finally, I understood that you want to upload your solver in OpenFoam. A very good test case could be the valve which I spoke about. The geomety is not easy but it presents (experimentally) both gas and water cavitation. So it could be cool to have this test case. I will manage to do it when your solver is ready. During this time I try to get familiar with your implementation and I prepare the mesh.


I am so sorry that I wrote to much! Anyway, your work is great

Regards
Marco

ma-tri-x September 13, 2013 15:09

Version 210 not available anymore?
 
Hi Matvej

I would really like to use your solver, but I only have the versions 2.1.1, 2.2.0 and 2.2.1 on my computer. The others seem to be not available anymore as ubuntu deb packs from the openfoam site. Is there any chance to use it?
For 2.1.1 I get the message:
--> FOAM FATAL IO ERROR:
[0] keyword div(phi,psiphase1) is undefined in dictionary "/home/mkoch/Master-Arbeit/0010vers211-phasechangeFoam_try/processor0/../system/fvSchemes::divSchemes"

thanks!

ma-tri-x September 14, 2013 06:42

Ah sorry, it works now. I just used my old Dictionaries which were not suitable.

Another Question: what is beta for simpleLiquid?
is it the del rho/del T in the EOS?

mkraposhin September 16, 2013 16:09

Quote:

Originally Posted by ma-tri-x (Post 451643)
Ah sorry, it works now. I just used my old Dictionaries which were not suitable.

Another Question: what is beta for simpleLiquid?
is it the del rho/del T in the EOS?

Hello, ma-tri-x!

I'm sorry for the late response!

Today i'm working on the new version of this solver. The system of equations has been rewritten totally, so, please, wait about 2-4 weeks.
Of course, i will made versions for OF2.1.X and OF2.2.X

Changes are very significant,

ma-tri-x September 17, 2013 06:52

Ah I see. Would be very great to use it! I also got now the meaning of beta and I've rewritten the simpleLiquid to the tait-Equation of state:

rho=rho_0*((p+B)/(p_0 +B))^(1/gamma); gamma=7.15

B = prefactorA + prefactorB*T[°C] + prefactorC*T²[°C²]

psi = d rho/d p

rhoHat not used (set to scalar(1.0)). B is calculated in thermoCorrection(), rho and psi are calculated in psiCorrection()

But it's not very stable and I don't know why... it does not seem to exceed the courant numbers...

Anyway, for sufficiently small starting values for my bubble (r=160mum, alpha=0, T_0<600K, p_rgh_0<4e6Pa) the picture really looks like something expected. More than with any solver before. So it would be really great to get your update soon!

Are you going to change the solver routines or the equations?

simon95 October 30, 2013 08:48

Hi Matvej,

Thanks for your great job.

I am looking for the solver that is compatible with openfoam2.2.x. If you complete a porting of version. please publish it on this site.

Thanks

Simon

simon95 November 1, 2013 04:55

Sorry, I had a very simple question. Regarding tutorial water-flashing, I think that phase2 is atmosphere and rho of phase2 should be set to 1 in file transportProperties. I could not understand why rho of phase2 is set to 0.1 in transportProperties.

Thanks in advance.

Simon

zhengzh5 January 22, 2014 17:13

Hi,

just out of curiosity...

you mentioned that the governing equations have been rewritten along with other significant changes to the solver. Do you mind briefly touched upon what exactly are the improvements, and what are the motivations behind them. I assume there's some flaws in the previous set of governing equations?

Thanks!

Jason

fivos January 24, 2014 04:13

Hi,

I tried to test the new solver (successfully compiled from provided source code for OpenFOAM 2.1.x) on one of the tutorial cases, but it does not work.

I tried to run the hemispherical body (http://openfoamwiki.net/index.php/Co...haseChangeFoam, case 1), but it always diverges at some point at 70ms. I tried to run with constant time step and at 69ms Courant No blows up. I switched to auto-timestepping with max. Co. 0.05, it goes a little bit further, but still crashes.

Has anyone managed to run this particular case for 20s (or more), as it is in the controlDict?

Generally, when running I notice that there are significant oscillations in pressure field and I also get phase change (cavitation) at the slip wall, which does not seem reasonable...

I have not modified any of the tutorial settings or the solver itself...

Any ideas on that?

Thanks in advance.

Juan Carlos March 19, 2014 10:48

Hi Matvej,
I would like to use your solver for compressible two-phase flow with phase change, and I would like to know if the new version of this solver for version OF2.2.X it's available
Thank you in advance for sharing your work
Best Regards
Juan C.

jfp6 April 24, 2014 14:50

Follow-up
 
Were you ever able to finish this solver?

Thanks,

Quote:

Originally Posted by mkraposhin (Post 452095)
Hello, ma-tri-x!

I'm sorry for the late response!

Today i'm working on the new version of this solver. The system of equations has been rewritten totally, so, please, wait about 2-4 weeks.
Of course, i will made versions for OF2.1.X and OF2.2.X

Changes are very significant,


crixman January 5, 2015 10:17

Hi Marco,
any news on the hydraulic resistance test case?
I would like to test it as well! Also, having the solver for OF2.2.x would be great :)


Quote:

Originally Posted by sfigato (Post 444534)

Hi,

I already sent to you an mail!

Regarding the test case, I have also an hydraulic resistence with mineral oil. Moreover, I am preparing an hydraulic valve with cavitation (the geometry looks like really cool).. but it takes time to be ready!

Regards
Marco


zhouhoucun April 1, 2015 18:49

Quote:

Originally Posted by sfigato (Post 444172)
Hi,

here is the link, where you can download the description of the model:

http://fluidsengineering.asmedigital...icleid=1429576

The model includes also the gas cavitation! You cannot find the full description of the model with the gas mass transfer (one more transport equation)! If you give to me your mail I will send to you it!

thank you for sharing your work
Best Regards

Marco

Dear Macro, could share me your code plesse? My email address is 470861844@qq.com, Thank you in advance.

Yours,
Zhou

Kanarya July 21, 2015 10:04

Hi All,

I would like to use the code as well but I could not find it.
Is the code still available?

Thanks!

fkika October 16, 2015 02:50

Hi matvey.

I am not able to reach the page for the download.
The solver is still available? Can I implemeted it in OpenFOAM-2.3?

Thank you

Federica

bhh January 14, 2016 08:39

Link for download
 
Quote:

Originally Posted by mkraposhin (Post 444733)
Hi, i made update to the solver it is available at the same address

Test cases for the hemispherical body with the Zwart and the Singhal models are still running.

Some notes on the implementation of volume fraction transport in OpenFOAM.
1)
It is formulated in volume fluxes, but it derived from mass fluxes:
ddt(alpha_l * rho_l) + div(alpha_l * rho_l * U) = m_l

ddt(alpha_l) + div(alpha_l U_l) = m_l/rho_l + (alpha_l/rho_l)*DDt(rho_l)

when fluid is incompressible and flow is isothermal, last term is zero, then we have:
ddt(alpha_l) + div(alpha_l U_l) = m_l

m_l - is the sum of m^+ and m^- of the Singhal model. In OpenFOAM m_l is represented by method mDotAlphal. That's why i think that we need to scale terms in Singhal model when switching from the mass fraction to the volume fraction

2)
In Singhal model pressure difference is calculated as: dP=pSat + c*k - p, but OpenFOAM interPhaseChangeFoam solver do not contain term "c*k" in the equation for pressure. And there is no such term in my model. That's why i don't include 0.5*0.39*rho_l*k when i estimate mass evaporation term.
If you want to insert this term in the model (interPhaseChangeFoam or compressibleMixingPhaseChangeFoam), then you need to change equation for pressure to obtain mass and momentum continuity

About NCG.
I think, i can add transport equations for the non-condensible gas in the model in three step:
1) Simple transport of the volume gas fraction without accounting for it's influence on the total mass of the system (alpha_g <= 1.0e-5 or another small value)
2) Transport of the volume gas fraction without desorption or absorption
3) And if two previous models will work, i can try to implement model with desorption and absorption

If you are still interested, it will be nice to run test cases, which you had proposed by e-mail


Hi,
It seems that the link to downloading the code is wrong. Is it possible to get an updated link for downloading?
Kind regards
Bjorn

bhh January 15, 2016 09:35

Link for downloading the code from Matvey Kraposhin
 
Hi,
It seems that the link for downloading this code is inactive:mad:. Does anybody in this thread have any infomation on how to download the code from Matvey Kraposhin mentioned in his post:)?
Kind regards
Bjørn

popovich January 17, 2016 20:29

Link for downloading the code from Matvey Kraposhin
 
Hi,
It seems that the link to downloading the code is wrong. Is it possible to get an updated link for downloading?
Kind regards
popovich

zhouhoucun July 21, 2016 23:11

Singhal and Zwart model
 
Quote:

Originally Posted by sfigato (Post 444416)
Great! First of all! I already validate the Singhal mass transfer model , so we can trust about the implementation!

Answer 1) The dimension of the constants actually is [meters/seconds]. This is due to an author's trick!

Answer 2) To implement the Singhal model I follwed the Tobias Huuva Thesis (this thesis is too long to send but I will send tomorrow just the Sighal Model page)! He replaces the mass fraction with the vapour one. The reason is that the transport equations of Singhal are written for the mass fractions so Singhal needs to scale the vapour fractions! The transport equations in OpenFoam are already written for the vapour fracions so you do not need to scale them!

Fhurter improvements:

1) I have already implemented th Zwart model

link: http://www.google.de/url?sa=t&rct=j&...50310824,d.Yms

It is the Ansys cavitation model and I already validated this implementation..if you want I can send to you tomorrow!

2) What is a real improvement (which no-one has already done) is to take in account for the Gas Cavitation (from equation 24 to equation 30 in Sighal's lecture )! It becomes very important in the past few years (for example for mineral oil applications)! But your model needs to be 4 phases (with condensable and non condesable gas vapour and liquid) and you must add two new transport eqautions. If you want to implement it I can share to you my knowledge (the Singhal model is not clear deriveted and I already made some new impromvents in the mass transfer rates)!

Let me know (by mail too for the two improvments)

regards
Marco

Dear sfigato,
I also implemented the Singhal and Zwart cavitaiton model into interPahseChangeFoam solver, and I tested these two model with the 2D NACA66 hydrofoil, unfortunately,they gave the wrong results, can you share you code, or I can send my code to your email box? My email address is 470861844@qq.com.

Thanks you.
Houcun

linhz0hz January 8, 2018 23:21

Yeah I am trying to work on similar problems, and found this potentially very helpful. Like many others, I noticed the download is not available anymore. Does anyone have access to it? Thanks in advance.

abhi07 July 19, 2021 03:22

Hello Matvey! It has been a long time but can you please share recent developments of your solver?

abhi07 July 19, 2021 03:23

Hello Matvey! It has been a long time but can you please share the recent developments of your solver?

silviliril August 6, 2021 09:24

Can you please share the solver compressibleMixingPhaseChangeFoam? I need to solve problem related to heat pipe. Looks like the solver has been removed from all the links. If you have a copy, please share with me at silviliril@gmail.com

asenya July 15, 2023 05:43

Hello! It has been a long time, but can you please share exampleCase of this solver? If you have a copy, please share with me at asenya7@yandex.ru


All times are GMT -4. The time now is 21:58.