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

function to record water level of the whole domain

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By tomf

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   September 20, 2016, 20:17
Default function to record water level of the whole domain
  #1
Member
 
Zhifang Hu
Join Date: Sep 2015
Location: Brisbane
Posts: 54
Rep Power: 11
ce73stargazer is on a distinguished road
Hi there.

I did some multiphase problem with OpenFOAM and I used probe sampling to extract alpha.water at certain location to find out the water level changes over the simulation time.

Meanwhile, I am wondering if there is any function available in OpenFOAM to extract the whole domain's water level at any specific time step, for example at t =10s.

I went through the user manual without much luck, anyone has any suggestion?


Cheers
Zhifang
ce73stargazer is offline   Reply With Quote

Old   September 21, 2016, 05:28
Default
  #2
Senior Member
 
Tom Fahner
Join Date: Mar 2009
Location: Breda, Netherlands
Posts: 646
Rep Power: 32
tomf will become famous soon enoughtomf will become famous soon enough
Send a message via MSN to tomf Send a message via Skype™ to tomf
Hi,

I think generating an isosurface of alpha=0.5 might work for you. You can than make a vtk surface that you could plot in paraview. I guess the following would work for version 3.0, maybe also 4.0, but syntax may have changed.

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

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

    surfaceFormat   vtk;
    fields          (p U k epsilon);

    interpolationScheme cellPoint;

    surfaces
    (
        isoAlpha
        {
            type            isoSurface;
            isoField        alpha.water;
            isoValue        0.5;
            interpolate     true;
        }
    );
}


// ************************************************************************* //
For inspiration try this:

Code:
grep -r isoSurface $FOAM_TUTORIALS
Cheers,
Tom
raj kumar saini likes this.
tomf is offline   Reply With Quote

Old   September 22, 2016, 00:04
Default
  #3
Member
 
Zhifang Hu
Join Date: Sep 2015
Location: Brisbane
Posts: 54
Rep Power: 11
ce73stargazer is on a distinguished road
Quote:
Originally Posted by tomf View Post
Hi,

I think generating an isosurface of alpha=0.5 might work for you. You can than make a vtk surface that you could plot in paraview. I guess the following would work for version 3.0, maybe also 4.0, but syntax may have changed.

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

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

    surfaceFormat   vtk;
    fields          (p U k epsilon);

    interpolationScheme cellPoint;

    surfaces
    (
        isoAlpha
        {
            type            isoSurface;
            isoField        alpha.water;
            isoValue        0.5;
            interpolate     true;
        }
    );
}


// ************************************************************************* //
For inspiration try this:

Code:
grep -r isoSurface $FOAM_TUTORIALS
Cheers,
Tom
Hi Tom

Thanks for your reply, but I dont quite get what you meaning but using a isosurface of alpha.water=0.5. From my point of view, water surface level is obtained by summing up all the product of alpha.water value and the relevant cells size, the usual VOF way. Hence, the results be bias, if i just put a single threshold for it, as the water level change will no be well presented.

Dont you mind explaining this a bit further. Thanks in advance.
ce73stargazer is offline   Reply With Quote

Old   September 22, 2016, 04:29
Default
  #4
Senior Member
 
Tom Fahner
Join Date: Mar 2009
Location: Breda, Netherlands
Posts: 646
Rep Power: 32
tomf will become famous soon enoughtomf will become famous soon enough
Send a message via MSN to tomf Send a message via Skype™ to tomf
I think that if your cell sizes are small enough there would not be much difference in between both methods. I guess your method would be more accurate, but it would require some coding. Maybe you can compare my method with your probing to see if there is a big difference. I am not sure how your method should be implemented, so I can not help you with that.

Regards,
Tom
tomf is offline   Reply With Quote

Reply


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 Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
mesh file for flow over a circular cylinder Ardalan Main CFD Forum 7 December 15, 2020 14:06
LTSInterFoam ship flow: Water level rise at start of domain JanZ OpenFOAM Running, Solving & CFD 0 January 21, 2014 05:22
OpenFOAM static build on Cray XT5 asaijo OpenFOAM Installation 9 April 6, 2011 13:21
Droplet Evaporation Christian Main CFD Forum 2 February 27, 2007 07:27
uptodate water distribution network fredius,magige,tanzanian,(e.a) Main CFD Forum 0 January 27, 2002 08:10


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