
[Sponsors] 
June 1, 2007, 13:25 
I am a relatively new user to

#1 
Member
Adam Donaldson
Join Date: Mar 2009
Location: Ottawa, Ontario, Canada
Posts: 37
Rep Power: 7 
I am a relatively new user to the OpenFOAM community, and would appreciate some feedback/direction on a new solver I will be working on in OpenFOAM as part of my PhD.
From the documentation I have seen to date, there does not appear to be an implementation of the Phase Field multiphase flow model in OpenFOAM at this time. I have been reviewing the existing solvers and just about all the documentation I can get my hands on, but I am finding that there is still not a good stepbystep tutorial out there on development of a new solver in OpenFOAM. Below is a brief outline of the application I am trying to develop: //*********************************************// Phase Field Model Most similar to levelset method, but with the order parameter governed by the CahnHilliard equation which uses chemical potential gradients and the minimization of free energy to govern interface movement). Parameters: phi  typically representing mole fraction velocity field pressure field Solver Pseudocode: Step 1: Update phi: 1) Calculate chemical potential field based on the leplacian of phi and an energy of mixing term (linear equation which is a function of phi). 2) Solve the CahnHilliard equation implicitely for the new phi (involves temporal term, convective term, and diffusive term with the leplacian of the chemical potential). In reality, this step could be solved in one stage, but unfortunately there is a forth order derivative involved for which the documentation has lead me to believe is not supported with OpenFOAM's grid structure (cannot find second neighbor for 5point descretization). So instead, I plan to calculate the chemical potential, then take the leplacian to get the final results. Step 2: Solve the momentum conservation equation, with an additional source term incorporating the momentum forcing from the chemical potential gradients (similar to curvature * surface tension * surface normal vector). Step 3: Perform pressure velocity correction Step 4: Calculate residuals for phi and velocity, and confirm a divergence free velocity vield. Step 5: If all residuals are below the specified tolerance, move to the next timestep. otherwise, go back to step 1, but using the new velocity field. //*********************************************// In regards to the questions and feedback: 1) The most obvious, Is there an existing solver in OpenFOAM (or one that you know of that is not in the standard release) that could be easily adapted to meet the needs of this application? 2) Has anyone come across a comprehensive outline describing the addition of a new solver from start to finish (i.e. adding new scalar fields, defining them in the FoamX configuration files so that they can be accessed in FoamX, outlining the function of each #include statement, and describing when each is required. etc.) 3) I am a bit concerned about my intended method for solving the cahn hilliard equation via a calculated chemical potential field (cheat for 4th order derivative). I know that it will use additional resources and could introduce additional numerical instability, but I have not been able to find a viable alternative as of yet... I would appreciate some input on any complications that you might foresee, or any methods which might prove to be better suited. Thank you in advance for any help provided. 

June 1, 2007, 13:32 
As an additional note, the mod

#2 
Member
Adam Donaldson
Join Date: Mar 2009
Location: Ottawa, Ontario, Canada
Posts: 37
Rep Power: 7 
As an additional note, the model will eventually need to include easily edited functions describing such properties as the mixing energy (used in the calculation of the chemical poential), and twophase properties as a function of phi (density, viscosity, mobility).
There are also a number of constants required which need to be incorporated into the dictionary files for ease of modification. Thanks. Adam 

November 30, 2007, 20:34 
Hi Adam,
I have been toying

#3 
New Member
C.E.M.
Join Date: Mar 2009
Posts: 16
Rep Power: 7 
Hi Adam,
I have been toying with modeling a CahnHilliard solution in openfoam as well. I'm not sure that I can be of too much help at this point, but my initial thought is that the biharmonic operator should be fairly stable out of the box, so to speak. This might be helpful as well: http://portal.acm.org/citation.cfm?id=1036150 If you get things working at all please do share. I plan to start working with this model soon, so I'll post back here as well if I get anywhere. Best, Evan 

January 15, 2008, 20:20 
Adam,
Still haven't had a

#4 
New Member
C.E.M.
Join Date: Mar 2009
Posts: 16
Rep Power: 7 
Adam,
Still haven't had a chance to work too much on this, but thought I'd pass along a neat opensource C code that might come in handy: http://gururajan.mp.googlepages.com/phasefield thanks to Mogadalai Pandurangan Gururajan. Evan 

July 15, 2009, 08:39 

#5 
Member
Bjorn H. Hjertager
Join Date: Mar 2009
Posts: 69
Rep Power: 7 
Hi,
Has anybody got a OF solver for the CahnHilliard equation? regards Bjorn 

December 7, 2009, 11:41 
PhaseField solver built?

#6 
Senior Member
Claus Meister
Join Date: Aug 2009
Location: Wiesbaden, Germany
Posts: 241
Rep Power: 8 
Hello adona058!
I have just read you post which was posted in March, well, a half year ago. I just want to inform myself if you had any succeed to build a phase field solver for openfoam? cheers, Claus 

February 16, 2011, 13:26 

#7 
Member

Hi all,
I am also considering Phasefiled method for my case. I just wonder if anyone is successful in implementing that method in OF? Cheers, Duong 

August 7, 2012, 05:38 

#8 
New Member
Xuan Cai
Join Date: Mar 2011
Location: Karlsruhe, Germany
Posts: 9
Rep Power: 5 
I am also very interested on whether anyone has already implemented that in openfoam?


January 23, 2013, 11:56 

#9 
New Member
Join Date: Aug 2012
Posts: 13
Rep Power: 4 
no news about a phasefield formulation in OF?


July 24, 2014, 16:53 

#10 
New Member

Hi,
I am pretty far on implementing the CahnHilliard model into the twophase solver interFoam. The new solver compiles and it also runs. However I have to fix some problem with the alpha limiter. The problem is the 4th order diffusion term most certainly. When this is fixed I am going to validate the solver and share it with the public. If you guys are still interested just let me know. Regards, Sebastian. 

August 3, 2014, 14:59 

#11 
Member
Hrushi
Join Date: Jan 2013
Posts: 51
Rep Power: 3 
Hi Sebastian,
How far are you in two phase solver? I am working on same but do not know how to implement 4th order derivative. Could you please share some details? Regards, Hrushi 

August 4, 2014, 04:02 

#12  
New Member

Quote:
I've got the same problem. Leaving this 4th order diffusion term out of the equation works and the results seem realistic. However I want to implement the whole equation so I am still working on it. I've build my solver upon the interFoam code and I used the equation from fipy documentaion: http://www.ctcms.nist.gov/fipy/examp...2DCoupled.html I introduced a second equation for Psi for the diffusion term in the alpha1 equation which is solved at first. However the 4th order diffusion term gives me weird alphas maybe because of the explicit calculation of Psi. I am pretty much stuck at this point. I can upload the solver if you're interested. Which equations are you using and how far are you? Regards, Sebastian. 

August 4, 2014, 08:41 

#13 
Member
Hrushi
Join Date: Jan 2013
Posts: 51
Rep Power: 3 
Do you get non physical values of alpha1? Because that is where I am stuck too. I am solving the diffusion equation and not the NavierStokes couple.
BTW, the Psi term does not look physical with second order derivative of free energy. Is there a documentation for this term? Regards, Hrushi 

August 4, 2014, 08:55 

#14  
New Member

Quote:
I think the second order derivative of the free energy is correct because you have to write f'(phi) in canonical form. Thats how you end up with the equation for Psi. Also this equation works in my code without the energy gradient term. Regards, Sebastian. 

Today, 07:38 

#15 
New Member
Anil Kunwar
Join Date: Jun 2013
Posts: 29
Rep Power: 2 
Hi all,
If i have to begin a phase field modeling for simple example in OpenFOAM, where do i have to begin from? Has anyone prepared some tutorials/test examples in OpenFOAM for diffused interface model? Yours Anil Kunwar 

Thread Tools  
Display Modes  


Similar Threads  
Thread  Thread Starter  Forum  Replies  Last Post 
problem in Phase Field method  qunwuhe@hotmail.com  Main CFD Forum  6  February 16, 2011 13:20 
phase field or CahnHilliard method  dusky.he  Main CFD Forum  3  February 2, 2006 17:43 
about phasefield or second gradient theory  Dusky.He  Main CFD Forum  9  December 17, 2005 01:42 
Differences between VOF and phase field  2L  Main CFD Forum  2  July 4, 2004 14:30 
simulating a twophase flow with an external field  Yi  Main CFD Forum  7  August 9, 2000 12:12 