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

How to ensure sum of alphas are equal to 1 for a four-phase simulation?

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   July 23, 2021, 08:12
Default How to ensure sum of alphas are equal to 1 for a four-phase simulation?
  #1
New Member
 
Join Date: Oct 2010
Posts: 23
Rep Power: 15
clarkent is on a distinguished road
Hello everyone,

I am trying to simulate a four-phase case by modifying interPhaseChangeFoam solver.

Phase changes (due to cavitation in this case) occur between alpha1(liquid1)<-->alpha2(vapor1) and alpha3(liquid2)<-->alpha4(vapor2), which is modeled with SchneerSauer.

In the results, I receive that alpha1 and alpha3 have almost similar value in most of the individual cells, i.e. in the same cell and same timestep both alpha1 and alpha3 are equal to 1.


My question is that how we can ensure that sum of all alphas are equal to 1?

Regards.

Last edited by clarkent; August 6, 2021 at 04:55. Reason: edit
clarkent is offline   Reply With Quote

Old   August 10, 2021, 05:03
Default
  #2
Senior Member
 
Join Date: Dec 2019
Location: Cologne, Germany
Posts: 355
Rep Power: 8
geth03 is on a distinguished road
you have two options:

1. either calculate the last alpha with alpha = 1 - sum of other alphas

2. or normalize all seperate calculated alphas, i.e. alpha/sum of alphas

if everything is correct both ways should lead to nearly the same result, if something is not correct, the deviation will be large.
geth03 is offline   Reply With Quote

Old   August 10, 2021, 08:10
Default
  #3
New Member
 
Join Date: Oct 2010
Posts: 23
Rep Power: 15
clarkent is on a distinguished road
Quote:
Originally Posted by geth03 View Post
you have two options:

1. either calculate the last alpha with alpha = 1 - sum of other alphas

2. or normalize all seperate calculated alphas, i.e. alpha/sum of alphas

if everything is correct both ways should lead to nearly the same result, if something is not correct, the deviation will be large.
Thank you for the answer geth.

Actually I am already following the first approach in your reply, which is inherited from original interPhaseChangeFoam solver.

Code:
alpha4 = scalar(1) - alpha1 - alpha2 - alpha3;
In my case I have excluded the MULES solver, do you think that the problem might be connected to this? Do you know how within one transport equation the solver enforce the individual alpha is between 0 and 1?

Transport equation of my case for the first phase can be seen below (it is repeated for the other phases) :

Code:
fvScalarMatrix alpha1Eqn
        (
              fvm::ddt(alpha1)
            + fvm::div(phi, alpha1, "div(phi,alpha)")
            - fvm::Sp(divU, alpha1)
            ==
              fvm::Sp(vDotvmcAlphal, alpha1)
            + vDotcAlphal
        );
          alpha1Eqn.solve();
Use of a phase transport equation without MULES can also be found in this study (section 2.1).

Regards.
clarkent is offline   Reply With Quote

Old   August 11, 2021, 02:39
Default
  #4
Senior Member
 
Join Date: Dec 2019
Location: Cologne, Germany
Posts: 355
Rep Power: 8
geth03 is on a distinguished road
yeah most likely,
the mules algo guarrantees boundedness of mass/volume fractions.

how do you want to keep alpha between 0 and 1 if your equation has maybe sources that produce unphysical values?
if your values are positive the best way to keep them below 1 is to normalize like i wrote in 2. in my earlier post.

i read the publication, looks like they are doing more than just solving for the equation you wrote, they also correct in further steps.
maybe that helps to keep alpha between 0 and 1.
geth03 is offline   Reply With Quote

Old   August 13, 2021, 07:43
Default
  #5
New Member
 
Join Date: Oct 2010
Posts: 23
Rep Power: 15
clarkent is on a distinguished road
Quote:
Originally Posted by geth03 View Post
how do you want to keep alpha between 0 and 1 if your equation has maybe sources that produce unphysical values?
I was using below equation for this purpose:
Code:
alpha1 = min(max(alpha1, scalar(0)), scalar(1));
In case above equation is off and normalization is added for each alpha, then the sum is equal to 1. But then individual alphas within the domain can go below 0 or above 1. And non-physical high velocities are produced.


Switching off the source terms in transport equations produce meaningful results, so the problem might be coming from there actually.
clarkent is offline   Reply With Quote

Reply

Tags
alphaeqn.h, cavitation, interphasechangefoam, mulitphase


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
[IHFOAM] The IHFOAM Thread Phicau OpenFOAM Community Contributions 392 September 8, 2023 18:10
[swak4Foam] mass conservation of solid phase violated when using groovyBC with twoPhaseEulerFoam xpqiu OpenFOAM Community Contributions 8 June 17, 2015 02:08
Micro Scale Pore, icoFoam gooya_kabir OpenFOAM Running, Solving & CFD 2 November 2, 2013 13:58
pisoFoam with k-epsilon turb blows up - Some questions Heroic OpenFOAM Running, Solving & CFD 26 December 17, 2012 03:34
IcoFoam parallel woes msrinath80 OpenFOAM Running, Solving & CFD 9 July 22, 2007 02:58


All times are GMT -4. The time now is 15:42.