CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > OpenFOAM Running, Solving & CFD

How to calculate liquid volume as the interface moves for interFoam Solver

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

Reply
 
LinkBack Thread Tools Display Modes
Old   January 27, 2009, 06:22
Default Hello All, New question: do
  #21
Senior Member
 
Mark Couwenberg
Join Date: Mar 2009
Location: Netherlands
Posts: 130
Rep Power: 8
markc is on a distinguished road
Hello All,

New question: does anyone know a code snippet to perform the following task in interFoam-like solvers:
- consider a basin with water (and air) with a floating body in it. Now I want to calculate the area of the waterline of the floating body. In other words: the area of the hole in the interface which is made by the floating object.
I am considering something like: the still surface is oriented along the X-Y plane. Then sum over all faces of the body patch. If gamma at a face is between 0 and 1, take Y value and multiply with projected cell length in X direction. Repeat for all patch faces.
However I think this won't work because with this formulation the interface is not very sharp.
Any better ideas?

Thanks in advance and best regards,

Mark
markc is offline   Reply With Quote

Old   January 27, 2009, 08:08
Default Hi Mark This is coming from
  #22
ngj
Senior Member
 
Niels Gjoel Jacobsen
Join Date: Mar 2009
Location: Deltares, Delft, The Netherlands
Posts: 1,619
Rep Power: 25
ngj will become famous soon enoughngj will become famous soon enough
Hi Mark

This is coming from the top of my head, so it is written in pseudo-code, where all values are referring to the hull-patch:

missingArea = - gammaPatch * (patch.Sf() & vector(0,0,1));

The thing is, that taking the vertical projection of all faces on the patch should do the trick. If you have a bulb, then the direction of Sf() should remove the opposite contributions. Of course this is assuming that your floating body is not leaking, i.e. having a hole below the water line.

Funny little question, it kept bouncing in my head untill I came up with an idea

Best regards,

Niels
__________________
Please note that I do not use the Friend-feature, so do not be offended, if I do not accept a request.
ngj is online now   Reply With Quote

Old   January 27, 2009, 08:35
Default N.B.: As long as the water sur
  #23
ngj
Senior Member
 
Niels Gjoel Jacobsen
Join Date: Mar 2009
Location: Deltares, Delft, The Netherlands
Posts: 1,619
Rep Power: 25
ngj will become famous soon enoughngj will become famous soon enough
N.B.: As long as the water surface is horizontal this will give something which is correct, but as soon you start getting undulations it will be incorrect, but of course it depends on the physical environment (size of undulations), and to what degree you can accept inaccurate estimates of the area, and the slope of the hull at the interface, as it will not affect the result as long as the hull is vertical.

/Niels
__________________
Please note that I do not use the Friend-feature, so do not be offended, if I do not accept a request.
ngj is online now   Reply With Quote

Old   January 27, 2009, 13:47
Default Hi Mark Please read my NB c
  #24
ngj
Senior Member
 
Niels Gjoel Jacobsen
Join Date: Mar 2009
Location: Deltares, Delft, The Netherlands
Posts: 1,619
Rep Power: 25
ngj will become famous soon enoughngj will become famous soon enough
Hi Mark

Please read my NB carefully, as I write

"As long as the water surface is horizontal this will give something which is correct".

The trouble arises when you are have, say waves along the side of the ship, and you have to define some average horizontal intersection. Then this procedure might not give the correct result. But as long as the water surface is _horizontal_ then the result must be correct.

But it looks reasonable what you are doing, and without giving to too many thoughts your approachs seems to give the average horizontal intersection irrespectively of the sea state.

Best regards,

Niels
__________________
Please note that I do not use the Friend-feature, so do not be offended, if I do not accept a request.
ngj is online now   Reply With Quote

Old   January 28, 2009, 03:53
Default Niels, you are right: you ment
  #25
Senior Member
 
Mark Couwenberg
Join Date: Mar 2009
Location: Netherlands
Posts: 130
Rep Power: 8
markc is on a distinguished road
Niels, you are right: you mentioned the issue yourself already.

Brgds,

Mark
markc is offline   Reply With Quote

Old   October 21, 2009, 04:34
Default
  #26
Senior Member
 
J. Cai
Join Date: Apr 2009
Posts: 180
Rep Power: 8
chiven is on a distinguished road
Is it too late to ask some questions about interFoam revision?

I am trying to revise the incompressibleTwoPhaseMixture codes for interFoam solver.
I want to put the rho1 (dimensionedScalar) to rho3 (volScalarField), the code is shown in
Code:
    rho3_
    (
        IOobject
        (
            "rho3",
            U_.time().timeName(),
            U_.db(),
            IOobject::NO_READ,
            IOobject::NO_WRITE
        ),
        U_.mesh(),
        rho1_
    ),
    alpha1_(U_.db().lookupObject<const volScalarField> (alpha1Name)),
    nu_
    (
        IOobject
        (
            "nu",
            U_.time().timeName(),
            U_.db()
        ),
        U_.mesh(),
        dimensionedScalar("nu", dimensionSet(0, 2, -1, 0, 0), 0),
        calculatedFvPatchScalarField::typeName
    )                                                                                 ------line137 
{
    calcNu();
}
However, errors occur when compiling the codes.
HTML Code:
incompressibleTwoPhaseMixture/twoPhaseMixture.C:137: error: member initializer expression list treated as compound expression
incompressibleTwoPhaseMixture/twoPhaseMixture.C:137: error: invalid initialization of reference of type 'const Foam::volScalarField&' from expression of type 'Foam::dimensionedScalar'
make: *** [Make/linuxIA64GccDPOpt/twoPhaseMixture.o] Error 1
When I delete the part of rho3, it is OK.

Thank you very much.
chiven
chiven 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
Calculating Interface Area with InterFoam gopala OpenFOAM Running, Solving & CFD 14 June 8, 2015 10:18
About interFoam solver zou_mo OpenFOAM Running, Solving & CFD 127 May 25, 2011 16:30
How to plot time vs distance traveled by the interface interFoam asaha OpenFOAM Paraview & paraFoam 9 January 26, 2011 09:05
Pressure at liquid liquid interface Tran CFX 0 June 19, 2008 21:59
About interfoam solver qiu OpenFOAM Running, Solving & CFD 0 May 6, 2007 22:48


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