Tip Surface elevation in time

From OpenFOAMWiki
Revision as of 16:03, 11 January 2012 by Bernhard (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

1 Introduction

Working with free surface flow, one might want to track a point at the interface in time, possibly as some kind of buoy.

A common method to achieve this (e.g. in interFoam), is to sample the value of alpha1 along a line (x,y,z(t)) and averaging z(t) based on the sampled value alpha1(z). Approaches following this procedure can be found at:

This wiki-page will describe a different method I used, based on first sampling the iso-surface of alpha1=0.5 (which I need anyhow) and subsequentlly sampling points from this iso-surface using Python.

2 Iso-surface

Sampling the iso-surface of alpha1 is straight-forward to perform during runtime. It can be obtained by putting the following sampling function at the end of the controlDict of case.

functions
(
   freeSurface
   {   
       type            surfaces;
       functionObjectLibs
       (   
           "libsampling.so" 
       );  
       outputControl   outputTime;
       outputInterval  1;  
       surfaceFormat  vtk;
       fields
       (   
           alpha1
       );  
       surfaces
       (   
           freeSurface
           {   
               type        isoSurfaceCell;
               isoField    alpha1;
               isoValue    0.5;
               interpolate false;
               regularise  false;
           }   
       );  
       interpolationScheme cell;
   }  
);

3 Probing the buoy