CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Running, Solving & CFD

strange behaviour of interCondensingEvaporatingFoam for a simple 1D Stefan condensati

Register Blogs Members List Search Today's Posts Mark Forums Read

Like Tree1Likes
  • 1 Post By gaza

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   September 21, 2016, 12:07
Default strange behaviour of interCondensingEvaporatingFoam for a simple 1D Stefan condensati
  #1
Senior Member
 
Przemek
Join Date: Jun 2011
Posts: 249
Rep Power: 15
gaza is on a distinguished road


Hi Foamers,


I created simple 1D test case for condensation, which is basically the Stefan problem for which analytical solution exists. The test case is a rod filled with a water vapour (alpha.liquid = 0) at saturation temperature of 380.26 K. In the first case (StefanCond_left) I set:
  • on the left wall T = 370.26 K, the right wall is adiabatic and for the rest of the surfaces, empty boundary condition is appllied . In this configuration one can observe rapid condensation and after time 0.1 s all vapour is condensed (alpha.liquid = 1)
In the second case (StefanCond_right) I changed only the side of the cold wall, namely:
  • the left wall is adiabatic, the right wall is at T = 370.26 K and for the rest of the surfaces, empty boundary condition is appllied . In this configuration one can observe very slow condensation and after time 0.1 s only 0.0254598 of the vapour condensed (alpha.liquid = 0.0254598).
Is it a bug? The solution should be the mirror image. Can you explain why the condensation rate decreases so much while it shouldn't change? Here are the two mentioned test cases (35MB):


http://fluid.itcmp.pwr.wroc.pl/~pbla...fanCond.tar.gz
Kummi likes this.
__________________
best regards
pblasiak
gaza is offline   Reply With Quote

Old   September 22, 2016, 08:57
Default
  #2
Senior Member
 
Przemek
Join Date: Jun 2011
Posts: 249
Rep Power: 15
gaza is on a distinguished road
Hi again,
I did described above the two test cases in Fluent and there I got mirror image solutions when I only changed the side of the cooled wall. So in interCondensingEvaporatingFoam is bug. It is more interesting because I found the same strange behavior in interThermalPhaseChangeFoam, as described here

https://github.com/MahdiNabil/CFD-PC/issues/3

So it can be bug that can be inherent in all interFoam based family solvers.
__________________
best regards
pblasiak
gaza is offline   Reply With Quote

Old   October 18, 2016, 14:11
Default
  #3
Senior Member
 
Andrea Ferrari
Join Date: Dec 2010
Posts: 319
Rep Power: 16
Andrea_85 is on a distinguished road
Hi,

i am also working with evaporation/condensation and i want to implement my own phase change model in openFOAM. I started by having a look at the existing solvers: interPhaseChangeFoam and interCondesingEvaporatingFoam.
I do not understand the energy formulation in interCondesingEvaporatingFoam, do you know why there are no source terms to account for extra energies due to evaporation/condensation?
By starting from single-phase equations and deriving the equation for the mixture i think source terms should appear....or am i missing something?


Best,
Andrea
Andrea_85 is offline   Reply With Quote

Old   October 19, 2016, 03:40
Default
  #4
Senior Member
 
Przemek
Join Date: Jun 2011
Posts: 249
Rep Power: 15
gaza is on a distinguished road
Quote:
Originally Posted by Andrea_85 View Post
Hi,

i am also working with evaporation/condensation and i want to implement my own phase change model in openFOAM. I started by having a look at the existing solvers: interPhaseChangeFoam and interCondesingEvaporatingFoam.
I do not understand the energy formulation in interCondesingEvaporatingFoam, do you know why there are no source terms to account for extra energies due to evaporation/condensation?
By starting from single-phase equations and deriving the equation for the mixture i think source terms should appear....or am i missing something?


Best,
Andrea
Hi Andrea,
source terms to account for extra energies due to evaporation/condensation are included in the definition of internal energy e
please see the file twoPhaseMixtureThermo.H where they defined
e1 = Cv1(T - Tsat) + Hv1
e2 = Cv2(T - Tsat) + Hv2
e = (alpha1*rho1*e1 + alpha2*rho2*e2)/(alpha1*rho1 + alpha2*rho2)

and then in the transportProperties dict we set Hv1 = 0 for the liquid phase
__________________
best regards
pblasiak
gaza is offline   Reply With Quote

Old   October 19, 2016, 10:17
Default
  #5
Senior Member
 
Andrea Ferrari
Join Date: Dec 2010
Posts: 319
Rep Power: 16
Andrea_85 is on a distinguished road
Thanks for the reply,

however I am not yet convinced of the energy formulation. In my opinion the source term for the energy equation should be proportional to the specific mass that is evaporating/condinsing in the unit time (mDotAlphal() according to constant.C) multiply by the specific latent heat of vaporization/condensation. isn't it? here it does not seem to be the case....

Another question...the heat flux term, div(q), in the energy equation can be rewritten using Fourier law as

div(q) = -div(kappa*grad(T))

where k is the thermal conductivitiy. Then assuming e = Cv*T, where "e" is the internal energy, the term should read

-div(kappa/Cv * grad(e))

but in eEqn.H we have

- fvm::laplacian(kappaEff/cp, e)

So, why kappa is divided by Cp and not by Cv?...then Cv and Cp are not constant in space so i am not sure we can take them out of the gradient of T.

Last thing and i am sorry if i bother you.
The term

fvm::Sp(fvc::ddt(rho) + fvc::div(rhoPhi), e)

Does it have a mathematical derivation? or it is artificially added to improve stability (negative implicit source term)? a similar term is also added in the momentum eq. It is the continuity eq. which should be zero...

Best,

andrea

Last edited by Andrea_85; October 19, 2016 at 11:37.
Andrea_85 is offline   Reply With Quote

Old   October 21, 2016, 06:43
Default
  #6
Senior Member
 
Przemek
Join Date: Jun 2011
Posts: 249
Rep Power: 15
gaza is on a distinguished road
Quote:
Originally Posted by Andrea_85 View Post
Thanks for the reply,

however I am not yet convinced of the energy formulation. In my opinion the source term for the energy equation should be proportional to the specific mass that is evaporating/condinsing in the unit time (mDotAlphal() according to constant.C) multiply by the specific latent heat of vaporization/condensation. isn't it? here it does not seem to be the case....
Hi Andrea,

I did not track all the equations and I cannot give the answer. The correct equations you can find here

http://www.tandfonline.com/doi/abs/1...07780903423908

Quote:
Originally Posted by Andrea_85 View Post

Another question...the heat flux term, div(q), in the energy equation can be rewritten using Fourier law as

div(q) = -div(kappa*grad(T))

where k is the thermal conductivitiy. Then assuming e = Cv*T, where "e" is the internal energy, the term should read

-div(kappa/Cv * grad(e))

but in eEqn.H we have

- fvm::laplacian(kappaEff/cp, e)

So, why kappa is divided by Cp and not by Cv?...then Cv and Cp are not constant in space so i am not sure we can take them out of the gradient of T.
The energy equation that is implemented is almost the same as in the Anderson's book on page 77

ftp://210.212.172.242/Digital_Librar...20anderson.pdf

However in the interCondensingEvaporatingFoam we have e under laplacian
and your question is justified why we devide kappa by cp and not by cv. I do not understand it as well.

Quote:
Originally Posted by Andrea_85 View Post
Last thing and i am sorry if i bother you.
The term

fvm::Sp(fvc::ddt(rho) + fvc::div(rhoPhi), e)

Does it have a mathematical derivation? or it is artificially added to improve stability (negative implicit source term)? a similar term is also added in the momentum eq. It is the continuity eq. which should be zero...

Best,

andrea
Regarding the term

fvm::Sp(fvc::ddt(rho) + fvc::div(rhoPhi), e)

I do not fully understand it but my interpretation is the same as yours, namely it is additional term that enhance convergence and it is zero because it is something like continuity equation. However I have some doubts because in the OpenFOAM, the continuity equation for incompressible fluid should be

fvm::Sp(fvc::ddt(rho) + fvc::div(phi), e)

or am I wrong?
__________________
best regards
pblasiak
gaza is offline   Reply With Quote

Old   October 21, 2016, 09:09
Default
  #7
Senior Member
 
Andrea Ferrari
Join Date: Dec 2010
Posts: 319
Rep Power: 16
Andrea_85 is on a distinguished road
Hi,

i understand the formulation in Kunkelmann paper. There the source term in the energy eq. is calculated as the product of the evaporation/condensation rate and the latent heat, i.e.

J=(T-Tsat)/(Ri DeltaH) * DeltaH
which means that if the cell is not evaporating/condensing the source term is zero for that cell.

In interCondesingEvaporatingFoam the evaporation rate is calculated as

Revap = coeff*alpha1*rho1*max(T-Tsat,0)
where it is assumed alpha1=1 in the liquid.

Now if we have a cell completely full with liquid (alpha1=1) but at a temperature lower than Tsat, the liquid in the cell will not evaporate (as it should be, Revap=0). However, if i've understood the energy formulation in OF (and probably i've not), the energy for that cell will be calculated by adding the contribution of the latent heat to the internal energy even if the liquid is not evaporating,

i.e. by assuming we only have evaporation (Hf2=0) and alpha1=1

e = (T-Tsat)*(Cv+Hf1) < 0

which looks weird to me....but maybe i am missing something.


Regarding the energy equation, i derived it from the total energy equation, neglecting viscous dissipation and gravity term, and i got

ddt(rho*e) + div(rhoPhi*e) + ddt(rho*K) + div(rhoPhi*K) + div(pU) = + div(kappa*grad(T)) + Se

which is not exactly what is implemented is eEqn.H. The term p*div(U) that is in eEqn.H appears if you simplify the mechanical contribution using the momentum eq. Have a look here for example

http://cfd.direct/openfoam/energy-equation/


The continuity equation for the mixture is written as

ddt(rho)+div(rho*U)=0 where rho=alpha1*rho1+alpha2*rho2

In the OF syntax this reads

fvc::ddt(rho)+fvc::div(rhoPhi)

phi= volumetric flux
rhoPhi= mass flux = rho*phi

So the term fvm::Sp(fvc::ddt(rho) + fvc::div(rhoPhi), e) is the continuity eq. multiply by the internal energy.


Best,
Andrea
Andrea_85 is offline   Reply With Quote

Old   October 22, 2016, 06:25
Default
  #8
Senior Member
 
Przemek
Join Date: Jun 2011
Posts: 249
Rep Power: 15
gaza is on a distinguished road
Hi Andrea,
Thanks a lot for explanation.
Maybe you know why does interCondensingEvaporatingFoam behave strangely as I described in post #1 ??
__________________
best regards
pblasiak
gaza is offline   Reply With Quote

Old   October 23, 2016, 10:09
Default
  #9
Senior Member
 
Andrea Ferrari
Join Date: Dec 2010
Posts: 319
Rep Power: 16
Andrea_85 is on a distinguished road
Honestly, i do not know.
I'll do some tests in the next days, if i have news ill let you know.

andrea
Andrea_85 is offline   Reply With Quote

Old   October 23, 2016, 15:26
Default
  #10
Senior Member
 
Przemek
Join Date: Jun 2011
Posts: 249
Rep Power: 15
gaza is on a distinguished road
Hi
It is very strange because I did it the same in Fluent and everything works well there.
__________________
best regards
pblasiak
gaza is offline   Reply With Quote

Old   October 7, 2023, 13:12
Default
  #11
New Member
 
Jaymeen Patel
Join Date: Jan 2023
Location: Chennai
Posts: 7
Rep Power: 3
jaymeen721 is on a distinguished road
Quote:
Originally Posted by gaza View Post

Hi Foamers,


I created simple 1D test case for condensation, which is basically the Stefan problem for which analytical solution exists. The test case is a rod filled with a water vapour (alpha.liquid = 0) at saturation temperature of 380.26 K. In the first case (StefanCond_left) I set:
  • on the left wall T = 370.26 K, the right wall is adiabatic and for the rest of the surfaces, empty boundary condition is appllied . In this configuration one can observe rapid condensation and after time 0.1 s all vapour is condensed (alpha.liquid = 1)
In the second case (StefanCond_right) I changed only the side of the cold wall, namely:
  • the left wall is adiabatic, the right wall is at T = 370.26 K and for the rest of the surfaces, empty boundary condition is appllied . In this configuration one can observe very slow condensation and after time 0.1 s only 0.0254598 of the vapour condensed (alpha.liquid = 0.0254598).
Is it a bug? The solution should be the mirror image. Can you explain why the condensation rate decreases so much while it shouldn't change? Here are the two mentioned test cases (35MB):


http://fluid.itcmp.pwr.wroc.pl/~pbla...fanCond.tar.gz
Hi, Gaza, can you share your case as it is not available over this link. http://fluid.itcmp.pwr.wroc.pl/~pbla...fanCond.tar.gz
jaymeen721 is offline   Reply With Quote

Old   October 7, 2023, 14:31
Default
  #12
Senior Member
 
Przemek
Join Date: Jun 2011
Posts: 249
Rep Power: 15
gaza is on a distinguished road
Quote:
Originally Posted by jaymeen721 View Post
Hi, Gaza, can you share your case as it is not available over this link. http://fluid.itcmp.pwr.wroc.pl/~pbla...fanCond.tar.gz
yes you can download it here
https://thermores.pwr.edu.pl/pracown...asiak/download
__________________
best regards
pblasiak
gaza is offline   Reply With Quote

Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Strange behaviour: Ethanol solution flow on channel with interface to porous domain khariel CFX 6 December 11, 2014 18:08
Strange behaviour while running in parallel samiam1000 OpenFOAM 3 September 19, 2012 15:23
Problem with SST-Model - strange behaviour Peter85 OpenFOAM Running, Solving & CFD 11 November 18, 2010 02:32
strange behaviour of GGI in parallel on axis symmetrical case A.Devesa OpenFOAM Running, Solving & CFD 0 April 6, 2010 04:58
Strange Solution for a simple pipe flow!! shekharc Main CFD Forum 4 May 9, 2005 10:21


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