CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > OpenFOAM Post-Processing

surface sampling during runtime

Register Blogs Members List Search Today's Posts Mark Forums Read

Like Tree1Likes
  • 1 Post By Bernhard

Reply
 
LinkBack Thread Tools Display Modes
Old   December 14, 2010, 10:41
Default surface sampling during runtime
  #1
Member
 
fisch
Join Date: Feb 2010
Posts: 97
Rep Power: 7
fisch is on a distinguished road
Hello,
I' more or less beginner in programming in OpenFoam; so hopefully i'm not bugging you with silly questions...

I want to do something like plane sampling during the runtime of my solver and at best i will have at the final end my sampling areas like the boundary patches to treat them in common in every timestep e.g. in paraview as vtk files.

I tried to extract lines of the code of sample.C and of Averaging due to parallel running - cuttingPlane
but it was not working for solvers with meshmotion (produced memory access errors as soon meshmotion routines want to handle the mesh).
I have no idea how to proceed...

Can you help me?
I'm thankful for every little advide.

rupert
fisch is offline   Reply With Quote

Old   December 14, 2010, 17:26
Default
  #2
Senior Member
 
Bernhard
Join Date: Sep 2009
Location: Delft
Posts: 790
Rep Power: 12
Bernhard is on a distinguished road
I use the following for monitoring the free surface in an interFoam simulation. You have to put it in your controlDict. You can alter it for your case with the same definitions that are used in sampleDict. Have fun!
Code:
functions
(
    elevation
    {
        type            surfaces;
        functionObjectLibs
        (
            "libsampling.so"
        );
        outputControl   outputTime;
        surfaceFormat  raw;
        fields
        (
            alpha1
        );
        surfaces
        (
            topFreeSurface
            {
                type        isoSurface;
                isoField    alpha1;
                isoValue    0.5;
                interpolate true;
            }
        );
    }
)
David* likes this.
Bernhard is offline   Reply With Quote

Old   March 1, 2011, 10:39
Default
  #3
Member
 
Florian Ettner
Join Date: Mar 2009
Location: Munich, Germany
Posts: 40
Rep Power: 8
dohnie is on a distinguished road
Bernhard, thank your for this piece of code.
I would like to understand it a little better, but I cannot find the respective source code. It seems to me that functions() can be combined with a lot of stuff, but not the one I'm looking for...

Which "types" are possible?
So far I've found "surfaces", "probes", "fieldAverage".
Which other options are there?
Can I tell OF to continue the existing output file of a stopped run or does it always start a new file?

Specifically, I would like to post-process some numbers (scalars) which I calculate during the run to characterize the flow.

Thanks,
Florian
dohnie is offline   Reply With Quote

Old   March 1, 2011, 17:03
Default
  #4
Senior Member
 
Steven van Haren
Join Date: Aug 2010
Location: The Netherlands
Posts: 149
Rep Power: 6
stevenvanharen is on a distinguished road
us the famous "bananas" trick for problems like this:

Code:
type            bananas;//fieldAverage;
OpenFOAM will create this ERROR message:

Code:
--> FOAM FATAL ERROR: 
Unknown function type bananas
Valid functions are : 
9
(
cellSource
faceSource
fieldAverage
fieldMinMax
probes
readFields
sets
surfaceInterpolateFields
surfaces
)
Now you know all the available functions.
stevenvanharen is offline   Reply With Quote

Old   March 2, 2011, 08:00
Default appending to existing output file
  #5
Member
 
Florian Ettner
Join Date: Mar 2009
Location: Munich, Germany
Posts: 40
Rep Power: 8
dohnie is on a distinguished road
Thank you, Steven,
as far as I understand it now,
a function object is created
which takes the values from a runTimeSelectionTable
which is provided by a library ("libsampling.so" in this case).

However, the writing options seem to be limited to: timestep, outputTime
The result is always written into a folder named after the starting time of the computation (e.g. probes/0.0/p).
If the computation is stopped and then continued, it creates a new folder with the latest time step (e.g. probes/1.0/p)

I would like to change this behaviour, so that it always writes to the same file and appends if it already exists (e.g. probes/p), but I cannot find the source code of this function object. Can anybody help me there?
Thanks in advance!
dohnie is offline   Reply With Quote

Old   March 2, 2011, 09:42
Default
  #6
Senior Member
 
Steven van Haren
Join Date: Aug 2010
Location: The Netherlands
Posts: 149
Rep Power: 6
stevenvanharen is on a distinguished road
Here is the source code for how the probes function samples and appends to a file:

/software/OpenFOAM/OpenFOAM-1.7.1/src/sampling/probes/probesTemplates.C
stevenvanharen is offline   Reply With Quote

Old   March 2, 2011, 12:14
Default
  #7
Member
 
Florian Ettner
Join Date: Mar 2009
Location: Munich, Germany
Posts: 40
Rep Power: 8
dohnie is on a distinguished road
That's what I was looking for, thank you!
Somehow, I was looking for something like functions.C
because I thought that's the class which determines I/O.
dohnie is offline   Reply With Quote

Old   November 1, 2012, 07:42
Default
  #8
New Member
 
Join Date: Aug 2012
Posts: 14
Rep Power: 4
Cloudy1988 is on a distinguished road
hello Bernhard,

I would like to ask you how do you know the sampling function input in controlDict? I just found the sampling file (.c and .H) but it didnt tell you how to use them. Is there any instruction about how to setup these ultities?

Thanks
Cloudy
Cloudy1988 is offline   Reply With Quote

Old   October 3, 2013, 06:52
Default Sampling for a specific timestep
  #9
New Member
 
Rob Gordon
Join Date: Aug 2013
Posts: 8
Rep Power: 3
r_gordon is on a distinguished road
Hi,

I was wondering if anyone knew how to output a cuttingPlane for a specific time step. I currently output horizontal slice surfaces at the outputTime but would like to output other surfaces at selected time steps. Is this possible?

My cuttingPlane file

Code:
/*--------------------------------*- C++ -*----------------------------------*\
| =========                 |                                                 |
| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
|  \\    /   O peration     | Version:  2.2.1                                 |
|   \\  /    A nd           | Web:      www.OpenFOAM.org                      |
|    \\/     M anipulation  |                                                 |
\*---------------------------------------------------------------------------*/

cuttingPlane
{
    type            surfaces;
    functionObjectLibs ("libsampling.so");
    outputControl   outputTime;

    setFormat raw;
    surfaceFormat   vtk;
    

    interpolationScheme cellPointFace;

    fields          (U UMean);

    surfaces
    (
        vertPlane // I would like to output this at only select timesteps
        {
            type            cuttingPlane;
            planeType pointAndNormal;
            pointAndNormalDict
            {
                basePoint       (-425 0 100);
                normalVector    (0 1 0);
            }
            interpolate     true;
        }
        horPlane2
        {
            type            cuttingPlane;
            planeType pointAndNormal;
            pointAndNormalDict
            {
                basePoint       (-425 0 1.5);
                normalVector    (0 0 1);
            }
            interpolate     true;
        }
        horPlane10
        {
            type            cuttingPlane;
            planeType pointAndNormal;
            pointAndNormalDict
            {
                basePoint       (-425 0 10);
                normalVector    (0 0 1);
            }
            interpolate     true;
        }
    
    );
}
Thanks.
r_gordon is offline   Reply With Quote

Old   April 30, 2014, 18:06
Default
  #10
Senior Member
 
Join Date: Jan 2013
Posts: 196
Rep Power: 4
openfoammaofnepo is on a distinguished road
Dear Bernhard,

When we use the utilities you mentioned, can we get the velocity normal to and parallel with the iso-surface? Particualy when the iso-surface is curved. Do you have any experience with that? Thank you.

OFFO.

Quote:
Originally Posted by Bernhard View Post
I use the following for monitoring the free surface in an interFoam simulation. You have to put it in your controlDict. You can alter it for your case with the same definitions that are used in sampleDict. Have fun!
Code:
functions
(
    elevation
    {
        type            surfaces;
        functionObjectLibs
        (
            "libsampling.so"
        );
        outputControl   outputTime;
        surfaceFormat  raw;
        fields
        (
            alpha1
        );
        surfaces
        (
            topFreeSurface
            {
                type        isoSurface;
                isoField    alpha1;
                isoValue    0.5;
                interpolate true;
            }
        );
    }
)
openfoammaofnepo is offline   Reply With Quote

Old   February 12, 2015, 13:31
Default
  #11
Member
 
Vignesh
Join Date: Oct 2012
Location: Darmstadt, Germany
Posts: 33
Rep Power: 4
vigneshTG is on a distinguished road
Dear All,

I am simulating (2D) the shape of static meniscus attached to a wall. The interface is set horizontal at the start, which later changes its shape according to the contact angle defined at the wall, eventually forming a meniscus. I use the function object (given below) to extract the shape of the interface. I see oscillations of the interface when plotted, but i don't see it when visualised using paraview. Can someone explain why does it happen or how to rectify this ?

Code:
functions
(
    elevation
    {
        interpolationScheme cell;
        type            surfaces;
        functionObjectLibs
        (
            "libsampling.so"
        );
        outputControl   outputTime;
        surfaceFormat  raw;
        fields
        (
            alpha1
        );
        surfaces
        (
            interpolatedIso
            {
                // Iso surface for interpolated values only
                type            isoSurface;    // always triangulated
                isoField        alpha1;
                isoValue        0.5;
                interpolate     true;
                regularise      true;
            }

        );
    }
);
Attached Images
File Type: png Meniscus_BC.png (30.7 KB, 61 views)
__________________
Thanks and Regards

Vignesh TG
vigneshTG is offline   Reply With Quote

Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem with Gmsh nishant_hull Open Source Meshers: Gmsh, Netgen, CGNS, ... 18 April 22, 2015 08:43
boundaries with gmshToFoam‏ ouafa Open Source Meshers: Gmsh, Netgen, CGNS, ... 7 May 21, 2010 12:43
sampling of a curved surface with distance-based coordinate? johannesk OpenFOAM Post-Processing 0 May 2, 2010 16:53
Error : Self intersecting surface mesh, computing intersections & Error : Impossible velan Open Source Meshers: Gmsh, Netgen, CGNS, ... 0 June 29, 2009 00:48
CFX4.3 -build analysis form Chie Min CFX 5 July 12, 2001 23:19


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