
[Sponsors] 
How to ensure sum of alphas are equal to 1 for a fourphase simulation? 

LinkBack  Thread Tools  Search this Thread  Display Modes 
July 23, 2021, 08:12 
How to ensure sum of alphas are equal to 1 for a fourphase simulation?

#1 
New Member
Join Date: Oct 2010
Posts: 23
Rep Power: 14 
Hello everyone,
I am trying to simulate a fourphase 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 

August 10, 2021, 05:03 

#2 
Senior Member
Join Date: Dec 2019
Location: Cologne, Germany
Posts: 323
Rep Power: 7 
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. 

August 10, 2021, 08:10 

#3  
New Member
Join Date: Oct 2010
Posts: 23
Rep Power: 14 
Quote:
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; 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(); Regards. 

August 11, 2021, 02:39 

#4 
Senior Member
Join Date: Dec 2019
Location: Cologne, Germany
Posts: 323
Rep Power: 7 
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. 

August 13, 2021, 07:43 

#5  
New Member
Join Date: Oct 2010
Posts: 23
Rep Power: 14 
Quote:
Code:
alpha1 = min(max(alpha1, scalar(0)), scalar(1)); Switching off the source terms in transport equations produce meaningful results, so the problem might be coming from there actually. 

Tags 
alphaeqn.h, cavitation, interphasechangefoam, mulitphase 
Thread Tools  Search this Thread 
Display Modes  


Similar Threads  
Thread  Thread Starter  Forum  Replies  Last Post 
[IHFOAM] The IHFOAM Thread  Phicau  OpenFOAM Community Contributions  386  March 30, 2023 07:13 
[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 kepsilon 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 