CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM Running, Solving & CFD (http://www.cfd-online.com/Forums/openfoam-solving/)
-   -   Interface contour - interFoam - swak4foam (http://www.cfd-online.com/Forums/openfoam-solving/109252-interface-contour-interfoam-swak4foam.html)

PrzemekPL November 13, 2012 11:39

Interface contour - interFoam - swak4foam
 
Hello Everybody,
I'm using OF 2.1.1 and interFoam for the flow simulations with the free surface.
Thanks to swak4Foam I'm able to write out some results during the run. What I'm interseted in is the alpha1 field at a given cutting plane.

My controlDict:

libs (
"libOpenFOAM.so"
"libsimpleSwakFunctionObjects.so"
"libswakFunctionObjects.so"
);

functions
{

cuttingPlane_vtk
{
type surfaces;
functionObjectLibs ("libsampling.so");
outputControl outputTime;
surfaceFormat vtk;
fields ( alpha1 );

interpolationScheme cellPoint;

surfaces
(
cuttingPlane
{
type cuttingPlane;
planeType pointAndNormal;
pointAndNormalDict
{
basePoint (0 0 0);
normalVector (0 0 1);
}
interpolate true;
}

);
}

Once I get .vtk files I can load them into paraview, plot the contour alpha1=0.5 and save the contour data as .csv file.

So, my question is if steps which I perform in paraview can be added to the swak4foam procedure?

Thanks in Advance for any help!!!

michielm November 13, 2012 13:49

I think you can set your surfaceFormat to 'raw' and export the cutting plane with alpha1=0.5

I don't know exactly how this cutting plane works, but the code below will export just x,y,z locations for the alpha1=0.5 surface
Code:

DropSurface
  {
      type            surfaces;
      functionObjectLibs
      (
          "libsampling.so"
      );
      outputControl  timeStep;
      outputInterval  150;
      surfaceFormat  raw;
      fields
      (
          //alpha1
      );
     
      surfaces
      (
        constantIso
        {
                type            isoSurfaceCell;    // always triangulated
                isoField        alpha1;
                isoValue        0.5;
                interpolate    false;
                regularise      false;              // do not simplify
        }

      );

      interpolationScheme cellPoint;
  }


PrzemekPL November 14, 2012 09:48

@michielm, thank you for your answer.

Your method works, but it gives the cooordinates of the whole surface.
The question is how to do it for a particular cutting plane? :-)

So far, I use this method to export isoSurface (.raw or .vtk) during the run and use some other software (i.e., matlab) to get the free surface contour at a given plane.
Integrating these steps into the sampling functions would save me a lof of work :-)

thanks!

gschaider November 20, 2012 21:04

Quote:

Originally Posted by PrzemekPL (Post 392058)
@michielm, thank you for your answer.

Your method works, but it gives the cooordinates of the whole surface.
The question is how to do it for a particular cutting plane? :-)

So far, I use this method to export isoSurface (.raw or .vtk) during the run and use some other software (i.e., matlab) to get the free surface contour at a given plane.
Integrating these steps into the sampling functions would save me a lof of work :-)

thanks!

If I understand you correctly you want to cut an iso-surface with a plane to get a "string"/line?

I'm afraid you can't do that with swak4Foam. I'm not quite sure whether there are methods in OF that support that (cutting two surfaces) out-of-the-box

ziemowitzima January 30, 2013 15:09

Hi
Do you know maybe how to extract isosurface of the field (e.g. field T, isosurface for T = 0) during runtime ?
I would need it coordinate in my solver.
Thanks
ZM


All times are GMT -4. The time now is 23:53.