CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Programming & Development (https://www.cfd-online.com/Forums/openfoam-programming-development/)
-   -   Surface tracking in interfoam (https://www.cfd-online.com/Forums/openfoam-programming-development/83508-surface-tracking-interfoam.html)

Mjoelnir January 1, 2011 08:34

Surface tracking in interfoam
 
Hi everyone,

i need to track to interface in interFoam. this is my current attempt:

Code:

    forAll(mesh.cells(), celli)
{
    if ((alpha1[celli] >= scalar(0.01))&&(alpha1[celli] <= scalar(0.99)))
    {
        T[celli] = scalar(200);

       
    }

       
}

Where T is the Temperature but i use it to mark the cells that i have found.

the problem with that is that the interface in interfoam isn't 100% sharp. It is a bit diffuse. So i track sometimes double the cells. Simply right alpha == 0.5 doesn't work. The programm now finds the cells that have the alpha value of 0.5, but a cell can be a surface cell with a value of 0.01 to 0.99.
In paraFoam simply typing alpha 0.5 is working fine. Does anyone know what the name of the function is to find the surface. It is finding the right surace cells.

Best regards

Henning

gschaider January 3, 2011 10:56

Quote:

Originally Posted by Mjoelnir (Post 288968)
Hi everyone,

i need to track to interface in interFoam. this is my current attempt:

Code:

    forAll(mesh.cells(), celli)
{
    if ((alpha1[celli] >= scalar(0.01))&&(alpha1[celli] <= scalar(0.99)))
    {
        T[celli] = scalar(200);

       
    }

       
}

Where T is the Temperature but i use it to mark the cells that i have found.

the problem with that is that the interface in interfoam isn't 100% sharp. It is a bit diffuse. So i track sometimes double the cells. Simply right alpha == 0.5 doesn't work. The programm now finds the cells that have the alpha value of 0.5, but a cell can be a surface cell with a value of 0.01 to 0.99.
In paraFoam simply typing alpha 0.5 is working fine. Does anyone know what the name of the function is to find the surface. It is finding the right surace cells.

Best regards

Henning

What do you want to use the data for afterwards. If you just want to statically postprocess the results the sample-utilitiy with a isosurface (alpha==0.5) might be sufficient.

http://openfoamwiki.net/index.php/Contrib/swak4Foaman can now work for sampledSurfaces and example where this is used to track the height of a surface is
https://openfoam-extend.svn.sourcefo...capillaryRise/

But of course if you afterwards need the T-field to implement some physics that depend on the interface then this won't help you

Bernhard

Mjoelnir January 4, 2011 09:53

Does paraFoam use the sample surface to create the surface?

I want to implent some physics by this

gschaider January 5, 2011 08:41

Quote:

Originally Posted by Mjoelnir (Post 289214)
Does paraFoam use the sample surface to create the surface?

I want to implent some physics by this

If the sampled surface is written in VTK-format paraview can read them.

If you need the surface for physics, then swak won't help you. Maybe there is a way to easily find out which cells a sampledSurface passes through (but I'm not aware of it)


All times are GMT -4. The time now is 21:32.