CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM (http://www.cfd-online.com/Forums/openfoam/)
-   -   interpolated field at iso-surface 0.5 (http://www.cfd-online.com/Forums/openfoam/114455-interpolated-field-iso-surface-0-5-a.html)

Andrea_85 March 11, 2013 12:03

interpolated field at iso-surface 0.5
 
Hi all,

I would like to interpolate a specified field on the iso-surface 0.5 of the color function alpha1 (interFoam) and then sum up all the contribution to get a kind of average value of that field at the interface. Is there a simple way to do that? I tried with sampling and function object but i didn't manage to get what i want.

any help is appreciated!

best
andrea

ybapat March 12, 2013 05:26

Hello,

You can take a look at isoSurface class in sampledSurface. I have not tried it, but I think it will help you.

Regards,
-Yogesh

Andrea_85 March 12, 2013 06:50

Hi,
thanks i solved it adding these lines in my sampleDict

constantIso
{
// Iso surface for constant values.
// Triangles guaranteed not to cross cells.
type isoSurfaceCell; // always triangulated
isoField alpha1;
isoValue 0.5;
interpolate false;
regularise false; // do not simplify
// mergeTol 1e-10; // Optional: fraction of mesh bounding box
// to merge points (default=1e-6)
}


best
andrea

gschaider March 13, 2013 19:58

Quote:

Originally Posted by Andrea_85 (Post 413156)
Hi all,

I would like to interpolate a specified field on the iso-surface 0.5 of the color function alpha1 (interFoam) and then sum up all the contribution to get a kind of average value of that field at the interface. Is there a simple way to do that? I tried with sampling and function object but i didn't manage to get what i want.

any help is appreciated!

best
andrea

Depends on your definition of "simple". I lifted this from one of the examples in swak4Foam:
Code:

    createInterface
    {
        type createSampledSurface;
        outputControl timeStep;
        outputInterval 1;
        surfaceName interface;
        surface {
            type isoSurface;
            isoField alpha1;
            isoValue 0.5;
            interpolate true;
        }
    }
    height
    {
        type swakExpression;
        valueType surface;
        surfaceName interface;
        verbose true;
        expression "pos().y";
        accumulations (
            min
            max
        );       
    }

This gives you the minimum and maximum height of the surface, but other expressions (for instance "otherField*area()/sum(area())") and accumulations (sum) are possible (this should give you the area weighted average of otherField on that surface)


All times are GMT -4. The time now is 07:11.