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

[waves2Foam] A rectangular box heaving in calm water

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   July 18, 2018, 00:51
Default A rectangular box heaving in calm water
  #1
Member
 
Xiantao Zhang
Join Date: Nov 2014
Posts: 31
Rep Power: 11
zhxter is on a distinguished road
Dear waves2Foamers,

I am trying to run a case where a rectangular box is forced to heave (with a single frequency) in calm water.

I use openfoam 2.4.0. The forced motion of the box is realized by using the inherent boundary condition in openfoam - oscillatingDisplacement. The solver for dynamics mesh - "interDyMFoam" is adopted to perform the simulation.

In order to calculate the free surface elevation, I add the libarary "libwaves2FoamSampling.so" in the system/controlDict file.

Now the problem is described as follows,
(1) when I use one core to perform the simulation, I get the correct results for the radiated wave elevation whether or not adding the "libwaves2FoamSampling.so" in system/controlDict.

(2) when I use two or more than two cores to run the simulation in parallel, I get the correct results for radiated wave elevation if I did not add the "libwaves2FoamSampling.so" in system/controlDict.

(3) when I use two or more than two cores to run the simulation in parallel, I get the wrong results for radiated wave elevation if I add the "libwaves2FoamSampling.so" in system/controlDict.

It seems that when using interDyMFoam to run dynamic mesh cases in parallel (using more than one cores), adding the library from waves2Foam - i.e. libwaves2FoamSampling.so will affect the computation and lead to a wrong result. For the specific case, the boundary oscillatingDisplacement is used.

Did anyone have similar problems? or Could anyone give some suggestions on this problem?

The files for this case is attached.

Many thanks
Xiantao
The University of Western Australia
zhxter is offline   Reply With Quote

Old   July 18, 2018, 00:57
Default a rectangular box heaving in calm water- case files
  #2
Member
 
Xiantao Zhang
Join Date: Nov 2014
Posts: 31
Rep Power: 11
zhxter is on a distinguished road
The case files are listed as follows:

0/alpha.water
FoamFile
{
version 2.0;
format ascii;
class volScalarField;
location "0";
object alpha.water;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

dimensions [0 0 0 0 0 0 0];

internalField uniform 0;

boundaryField
{
inlet
{
type zeroGradient;

/* type waveAlpha;
refValue uniform 0;
refGrad uniform 0;
valueFraction uniform 1;
value uniform 0;*/
}
bottom
{
type zeroGradient;
}
outlet
{
type zeroGradient;
}
atmosphere
{
type inletOutlet;
inletValue uniform 0;
value uniform 0;
}
vessel
{
type zeroGradient;
}
frontBack
{
type empty;
}
}


// ************************************************** *********************** //


0/P_rgh

FoamFile
{
version 2.0;
format ascii;
class volScalarField;
location "0";
object p_rgh;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

dimensions [1 -1 -2 0 0 0 0];

internalField uniform 0;

boundaryField
{
inlet
{
type zeroGradient;
}
bottom
{
type zeroGradient;
}
outlet
{
type zeroGradient;
}
atmosphere
{
type totalPressure;
U U;
phi phi;
rho none;
psi none;
gamma 1;
p0 uniform 0;
value uniform 0;
}
vessel
{
type zeroGradient;
}
frontBack
{
type empty;
}
}


// ************************************************** *********************** //

0/pointDisplacement

FoamFile
{
version 2.0;
format ascii;
class pointVectorField;
location "0";
object pointDisplacement;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

dimensions [0 1 0 0 0 0 0];

internalField uniform (0 0 0);

boundaryField
{
inlet
{
type uniformFixedValue;
uniformValue (0 0 0);
}

bottom
{
type uniformFixedValue;
uniformValue (0 0 0);
}

outlet
{
type uniformFixedValue;
uniformValue (0 0 0);
}

atmosphere
{
type uniformFixedValue;
uniformValue (0 0 0);
}

vessel
{
type oscillatingDisplacement;
amplitude (0 0.04 0);
omega 9.90448;
value uniform (0 0 0);
}

frontBack
{
type empty;
}
}


0/ U

FoamFile
{
version 2.0;
format ascii;
class volVectorField;
location "0";
object U;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

dimensions [0 1 -1 0 0 0 0];

internalField uniform ( 0.0 0.0 0.0);

boundaryField
{
inlet
{
type fixedValue;
value uniform ( 0 0 0 );
/* type waveVelocity;
refValue uniform ( 0 0 0 );
refGradient uniform ( 0 0 0 );
valueFraction uniform 1;
value uniform ( 0 0 0 ); */
}
bottom
{
type fixedValue;
value uniform ( 0 0 0 );
}
outlet
{
type fixedValue;
value uniform ( 0 0 0 );
}
atmosphere
{
type pressureInletOutletVelocity;
value uniform ( 0 0 0 );
}
vessel
{
type movingWallVelocity;
value uniform ( 0 0 0 );
}
frontBack
{
type empty;
}
}


// ************************************************** *********************** //


system/controlDict

FoamFile
{
version 2.0;
format ascii;
class dictionary;
object controlDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

application interDyMFoam;

startFrom startTime;

startTime 0;

stopAt endTime;

endTime 2;

deltaT 0.001;

writeControl adjustableRunTime;

writeInterval 0.04;

purgeWrite 0;

writeFormat ascii;

writePrecision 6;

writeCompression uncompressed;

timeFormat general;

timePrecision 6;

runTimeModifiable yes;

adjustTimeStep yes;

maxCo 0.25;

maxAlphaCo 0.25;

maxDeltaT 1;

libs
(
"libwaves2FoamSampling.so"
);

functions
{
#includeIfPresent "../waveGaugesNProbes/surfaceElevationAnyName1_controlDict";
#includeIfPresent "../waveGaugesNProbes/surfaceElevationAnyName2_controlDict";
}
// ************************************************** *********************** //
zhxter is offline   Reply With Quote

Old   July 23, 2018, 05:51
Default
  #3
ngj
Senior Member
 
Niels Gjoel Jacobsen
Join Date: Mar 2009
Location: Copenhagen, Denmark
Posts: 1,900
Rep Power: 37
ngj will become famous soon enoughngj will become famous soon enough
Hi Xiantao,

How do you define right and wrong results? I recall correcting something for moving meshes and surface elevation tool in earlier versions, but I cannot immediately see why results should be affected.

You could try to redo the simulations in a more recent version, e.g. 1712 or 1806. OpenFoam 2.4 is getting pretty old by now and many bugs are likely resolved and the functionObject library is completely reimplemented. Also, I am not cross-compiling waves2Foam on such old versions, so compatibility may be compromised in the future.

Kind 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 offline   Reply With Quote

Old   July 30, 2018, 22:21
Default
  #4
Member
 
Xiantao Zhang
Join Date: Nov 2014
Posts: 31
Rep Power: 11
zhxter is on a distinguished road
Hi Niels,

When I said wrong or correct results, I compared the CFD simulated radiated wave elevation with that calculated by linear potential flow method. For using one core, the results of wave elevation calculated using cfd and potential flow agreed with each other quite well. However, for using two or more cores, it was obvious that cfd gave a wrong result, both the amplitude and phase of the radiated wave being wrong (inconsistent with that by potential flow theory or cfd using one core).

I am trying to install the version 1712 to see if the problem has been solved.

Regards
Xiantao
The University of Western Australia
zhxter is offline   Reply With Quote

Old   December 16, 2021, 12:16
Default
  #5
New Member
 
cem
Join Date: Feb 2021
Posts: 6
Rep Power: 5
sharkilwo5 is on a distinguished road
Did you also analyze the added mass and damping coefficients?
sharkilwo5 is offline   Reply With Quote

Old   December 17, 2021, 14:49
Default
  #6
ngj
Senior Member
 
Niels Gjoel Jacobsen
Join Date: Mar 2009
Location: Copenhagen, Denmark
Posts: 1,900
Rep Power: 37
ngj will become famous soon enoughngj will become famous soon enough
Hi,


This reference might be interesting for you, when it comes to modelling of free decay and the avoidance of contamination from partially reflective boundaries:


https://www.researchgate.net/publica...ed_heave_decay


Kind 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 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
Water diffusion into air MGabr CFX 19 September 3, 2023 19:06
simulation of free falling sphere into calm water? pedyspider CFX 17 June 25, 2015 11:03
Water Evaporation and condensation modeling Linjie CFX 6 May 24, 2007 14:55
Water vapour condensation in CFX-5.7.1 hdj CFX 1 November 27, 2005 07:15
uptodate water distribution network fredius,magige,tanzanian,(e.a) Main CFD Forum 0 January 27, 2002 07:10


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