CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM (http://www.cfd-online.com/Forums/openfoam/)

 Alucard November 28, 2011 06:26

InterFoam: add a source term in alpha eq.

Goodmorning,

I'm try to simulate the growth of a cristal using,as a basis, interfoam.
As i'm at the beginning, i consider as a first case, a simple 2D circle that grows at a constant velocity "Uoo". Alpha=1 in the circle and 0 outside.

So what i want to "see" it's just a simple circle that grows in time in my square domain.
If the basic alpha transport equation is something like that:

in my case I add a "second" velocity that is the envelope growth:

So if I initialise my U=0 (I 've not motion of my circle) and I impose a constant Ug, how it's possible to integrate correctly this term "Ug*grad(alpha)" in the equation?

I tried to replace directly U=Ug BUT the calculation of the phi fluxes is quite complicated and realted to Ueqn so I cannot do that easily.
I know perhaps is a dummy question but it's 10 days I'm trying to figure out how to solve it and I don't see a clever solution to that.

 sabin.ceuca November 28, 2011 08:37

Hi,
if i were you i would take a look at the alphaEqn.H of interPhaseChangeFoam and just tailor it to suite your needs.
Although i don't understand your reasons behind it, because the alpha transport equation reads somehow different from what you have posted here.

 Alucard November 28, 2011 09:24

Quote:
 Originally Posted by sabin.ceuca (Post 333795) Hi, if i were you i would take a look at the alphaEqn.H of interPhaseChangeFoam and just tailor it to suite your needs. Although i don't understand your reasons behind it, because the alpha transport equation reads somehow different from what you have posted here.
Hi,
thank you I'm looking at it right now I guess I've to work on the "Su" term (I don't know exactly how yet!
Why I'm using the interfoam approach?
Cause I have two phases in my study (liquid and solid) and So I need a "marker" for the phase.
So as I need a method that allows me to transport phases without numerical diffusion I thought to interFoam where all the "tricks" in order to have a sharp interface during time are already developped.
So i tried rigid translations and roatation of a circle with success and now I was trying to add the term related to surface growth.
In the complete problem it will be function of Temperature and other thermodynamical parameters but for the moment I impose it.
Why so do you think my approach is not the good one?
Thanks :)

 Alucard November 28, 2011 09:39

So a good way to do that could be to write the "Su" term like that?

volScalarField Su
(
IOobject
(
"Su",
runTime.timeName(),
mesh
),
// Divergence term is handled explicitly to be
// consistent with the explicit transport solution

);

where Ug is the "growth velocity" vector field (I already initalised in my code)?

Thank you again.

 olivierG November 28, 2011 09:41

Hello,

I think interFoam is not the best method in cristal grow, because usually the interface transition is very sharp, and with VOF method, you will get a "sharp but not enough" interface, + difficulties to set thermal source / density.

The best method may be Level set, but i don"t know how to deal with in OpenFoam (though i've seen a VOF/ level set coupling related to openFoam somewhere in a workshop pdf.)

Anyway, i would try to setup an hybrid buoyant+InterFoam, i.e thermal with variable properties and VOF, so if you go that way, we can share some part of the solver.

regards,

olivier

 sabin.ceuca November 28, 2011 10:20

Hi Alucard,
yes your Su looks fine, give it a try. From the point of view of OF it looks good :), if it makes sense from a point of view of the physics you'll see.
Greets

 Alucard November 28, 2011 13:02

Quote:
 Originally Posted by sabin.ceuca (Post 333806) Hi Alucard, yes your Su looks fine, give it a try. From the point of view of OF it looks good :), if it makes sense from a point of view of the physics you'll see. Greets
Thank you ,
it worked in OF (compilation+running) but not under a phisical point of view...I don't know why, i also tried to solve explicitly the equation:

with Ug_mod, module of the velocity vector
but I'm having strong oscillations close to the circle-interface and alpha that becomes higher than 1.
Do you think something is wrong?

(before I tried to put Su as supposed and i got the same kinda of results)

 sabin.ceuca November 29, 2011 05:10

Hmm,
don't worry it never works at the first try:) Did you also implement source and sink terms to the pEqn and UEqn? Because it might be that you create some 1st phase but do not transport it away.
Bon courage!
Sabin

 akidess November 29, 2011 09:50

olivierG, the solid-liquid interface is sharp for pure materials, and diffuse for melting of alloys.

Nonetheless I agree interFoam is not the best choice for this problem. Instead, if not too late, I recommend having a look at phase-change solvers which other users have posted:
http://www.cfd-online.com/Forums/ope...g-problem.html

 fabian_roesler January 13, 2012 11:16

melting solver

Hi all

nice that my melting solver

http://www.cfd-online.com/Forums/ope...g-problem.html