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

 User Name Remember Me Password
 Register Blogs Members List Search Today's Posts Mark Forums Read

 LinkBack Thread Tools Display Modes
 January 27, 2009, 06:22 Hello All, New question: do #21 Senior Member   Mark Couwenberg Join Date: Mar 2009 Location: Netherlands Posts: 130 Rep Power: 10 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

 January 27, 2009, 08:08 Hi Mark This is coming from #22 Senior Member   Niels Gjoel Jacobsen Join Date: Mar 2009 Location: Deltares, Delft, The Netherlands Posts: 1,759 Rep Power: 29 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.

 January 27, 2009, 08:35 N.B.: As long as the water sur #23 Senior Member   Niels Gjoel Jacobsen Join Date: Mar 2009 Location: Deltares, Delft, The Netherlands Posts: 1,759 Rep Power: 29 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.

 January 27, 2009, 13:47 Hi Mark Please read my NB c #24 Senior Member   Niels Gjoel Jacobsen Join Date: Mar 2009 Location: Deltares, Delft, The Netherlands Posts: 1,759 Rep Power: 29 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.

 January 28, 2009, 03:53 Niels, you are right: you ment #25 Senior Member   Mark Couwenberg Join Date: Mar 2009 Location: Netherlands Posts: 130 Rep Power: 10 Niels, you are right: you mentioned the issue yourself already. Brgds, Mark

 October 21, 2009, 04:34 #26 Senior Member   J. Cai Join Date: Apr 2009 Posts: 180 Rep Power: 10 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 (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

 Thread Tools Display Modes Linear Mode

 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 OffTrackbacks are On Pingbacks are On Refbacks are On Forum Rules

 Similar Threads Thread Thread Starter Forum Replies Last Post gopala OpenFOAM Running, Solving & CFD 18 September 12, 2015 15:38 zou_mo OpenFOAM Running, Solving & CFD 127 May 25, 2011 16:30 asaha OpenFOAM Paraview & paraFoam 9 January 26, 2011 09:05 Tran CFX 0 June 19, 2008 21:59 qiu OpenFOAM Running, Solving & CFD 0 May 6, 2007 22:48

All times are GMT -4. The time now is 20:22.

 Contact Us - CFD Online - Privacy Statement - Top