CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Running, Solving & CFD (https://www.cfd-online.com/Forums/openfoam-solving/)
-   -   Simulate the movement of boats (https://www.cfd-online.com/Forums/openfoam-solving/57929-simulate-movement-boats.html)

ngj June 19, 2008 05:08

Hi Alexandre Take a look at
 
Hi Alexandre

Take a look at this (advertising own product):

http://www.cfd-online.com/OpenFOAM_D...es/1/6919.html

Download path has been changed, i.e. s001581 to be replaced by ngja.

Have fun,

Niels

markc June 19, 2008 05:13

Hi All, Eric, I saw some of
 
Hi All,

Eric, I saw some of your Wigley hull results somewhere else in this forum. I will have a look at your case files. Very curious about how you did it. Have you implemented corrections for trim/sinkage?

Alex,
I did use a single inlet patch and created a simple utility which sets gamma 1 based on z coordinate. I posted the files somewhere else in this forum (setBoundarygamma). If you get it running, funkysetfields can do exactly the same (and a lot more).
Regarding 6 dof solvers: I am not sure if I get you right but you need this especially for dynamic simulations, right? Though this is surely a target, for this moment I am focusing on calm water, which for me is quiet challenging already. Having the results as shown, one now should integrate the displaced water volume. The difference with this volume (x rho) should be compared with ships weight and hull shall be moved in domain, both in z translation and y rotation. This integration needs to be performed anyway, both for dynamic and steady state simulations. I think I will be able to write some routine which is able to do this, based on gamma > 0.5 e.g. However, due to mesh fineness/coarseness, the water-air interface may be several decimeters thick, so integrating hull volume might be rather inaccurate. Therefore I am thinking about using movingmesh to let the initial water-air interface follow a certain gamma value, e.g. 0.5. Or possibly it is a better idea to make it follow a pressure value (pd=0)? The strategy to follow here may also depend on the ultimate target. If you are only interested in steady state, you may assume that water stays connected. However if you ultimately intend to perform dynamic simulations, breaking waves may occur, making it more challenging to apply movingmesh.

My mesh is generated using GiD, some commercial mesher which works well but has limited possiblities. I also succesfully used gmsh. With Salome (which has netgen implemented) I was less lucky.

Stiffness: my first guess is that the order of magnitudes are the same for static velocity and roll/trim. Roll period of this 16m boat will be something like 4-6 sec.

Thanks all for your input,

Brgds,

Mark

markc June 19, 2008 05:21

Alex, Your question regardi
 
Alex,

Your question regarding wave models: frankly, I have no idea. However I will discuss this with a colleague who is specialized in seakeeping behavior.

Brgds,

Mark

markc June 19, 2008 05:46

Eric, I had an initial glan
 
Eric,

I had an initial glance at your model, one first question: how did you create your mesh? Do you think the method is suitable to generate mesh using any kind of hull shape, supplied e.g. in iges format?
I suspect that using a hex mesh like you did is really the key to stability, especially at the boundaries.

Brgds,

Mark

egp June 19, 2008 06:40

Mark/Alex, Grid: grid was
 
Mark/Alex,

Grid: grid was generated using Gridgen from Pointwise, Inc, which directly reads geometry in IGES format (plus a number of other CAD formats). My experience is that to get good boundary layer and free-surface resolution, you need to minimally use structured hex mesh in these regions. Of course, I wouldn't be doing this if the approach wasn't extensible beyond the Wigley Hull!

Sinkage & Trim: We have a 6DOF version of rasInterFOAM running and are going through the validation process. We've done free-roll, and roll in beam seas, and comparisons with data are quite good. With this code, sinkage and trim should be trivial, however, we haven't done it yet. I'm planning to report on our free-surface hydrodynamics work at the Milan workshop next month.

Wave BC: We've been successfully creating waves, and there are some threads here on that topic. However, I don't like our implementation, and was working with Hrv last month when he visited Wash DC to clean it up. Unfortunately, I've been too busy to finish the coding to a level where I could push it back to the SVN repository.

Eric

alexandrepereira June 20, 2008 08:29

Hi Mark, I know this is a b
 
Hi Mark,

I know this is a bit marginal to this forum, but could you give me some advice on good references on Ship Design methodology ?

There are very good and complete books on Aicraft design from Thorenbeek, Raymer, and Roskham for instance, but i have never found such complete references on Ship design : Design synthesis and sizing, structure, Hydrostatic analysis, Hydrodynamic behaviour and seakeeping, propulsion, reliability...

Can You pls geve me some hint here... ?

Brgds

Alex

markc June 20, 2008 08:30

Ok, lets try the buoyancy calc
 
Ok, lets try the buoyancy calculation. I will make use of the patchIntegrate utility and modify it in order to calculate submerged volume of the hull.
For reference onlt, the piece of code in patchIntegrate which sums the scalar field variable over a certain patch is:
sum
(
mesh.Sf().boundaryField()[patchi]
*field.boundaryField()[patchi]
)
I am thinking about a setup as sketched below:
http://www.cfd-online.com/OpenFOAM_D...ges/1/8102.jpg

So: Sf is a cell-surface along the boat's hull. The projected surface on the x-z plane (normal to the y-vector) times the average y distance to centreplane gives dV. Summing dV for the entire hull for all cells having gamma > (e.g.) 0.5 should give displaced volume, right?
Now, can anyone give me some advice how to implement this in proper C code, making use of existing OF class/methods?
Looking at the patchIntegrate code, it seems that it is possible to perform this integration with some really simple code.

Thanks in advance,

Mark

alexandrepereira June 20, 2008 09:04

Hi Eric, I have run your w
 
Hi Eric,

I have run your wigley.tar.gz case, ant it behaves physically until approx. t=4.35...

Courant number strarts shrinking way before, at say 4.3 to avoid divergence...

Time = 4.05
Reading U
Calculating magU
mag(U): max: 2.71141 min: 0.000114998

Time = 4.1
Reading U
Calculating magU
mag(U): max: 3.24376 min: 0.000174194

Time = 4.15
Reading U
Calculating magU
mag(U): max: 5.3944 min: 0.000138052

Time = 4.2
Reading U
Calculating magU
mag(U): max: 4.60657 min: 5.476e-05

Time = 4.25
Reading U
Calculating magU
mag(U): max: 4.34207 min: 0.000132352

Time = 4.3
Reading U
Calculating magU
mag(U): max: 4.98272 min: 0.00060542

Time = 4.35
Reading U
Calculating magU
mag(U): max: 50.7562 min: 0.000439034

End


50 m/s is just non physical here...

as for the iteration history, dt is below 10^-6 at 4.36...

Can this odd behaviour be related to face skewness...?


root@iskandhar:/home/alex/Desktop/Boat# checkMesh . wigley
/*---------------------------------------------------------------------------*\
| ========= | |
| \ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \ / O peration | Version: 1.4.1 |
| \ / A nd | Web: http://www.openfoam.org |
| \/ M anipulation | |
\*---------------------------------------------------------------------------*/

Exec : checkMesh . wigley
Date : Jun 20 2008
Time : 13:53:18
Host : iskandhar
PID : 7289
Root : /home/alex/Desktop/Boat
Case : wigley
Nprocs : 1
Create time

Create polyMesh for time = constant

Time = constant

Mesh stats
points: 300135
edges: 886258
faces: 872324
internal faces: 844876
cells: 286200
boundary patches: 7
point zones: 0
face zones: 0
cell zones: 0

Number of cells of each type:
hexahedra: 286200
prisms: 0
wedges: 0
pyramids: 0
tet wedges: 0
tetrahedra: 0
polyhedra: 0

Checking topology...
Boundary definition OK.
Point usage OK.
Upper triangular ordering OK.
Topological cell zip-up check OK.
Face vertices OK.
Face-face connectivity OK.
Number of regions: 1 (OK).

Checking patch topology for multiply connected surfaces ...
Patch Faces Points Surface
outflow-4 2700 2805 ok (not multiply connected)
symmetry-5 8524 8785 ok (not multiply connected)
Atmosphere-6 5724 5885 ok (not multiply connected)
Airinlet-7 1080 1155 ok (not multiply connected)
waterInlet-8 1620 1705 ok (not multiply connected)
wall-9 2500 2601 ok (not multiply connected)
freeStream-10 5300 5457 ok (not multiply connected)

Checking geometry...
Domain bounding box: (-1 -3.63555e-18 -1.99986) (2 1.95493 0.05)
Boundary openness (-4.0462e-16 2.87496e-15 7.73935e-16) OK.
Max cell openness = 3.67678e-16 OK.
Max aspect ratio = 236.795 OK.
Minumum face area = 6.66382e-07. Maximum face area = 0.0755204. Face area magnitudes OK.
Min volume = 3.28498e-09. Max volume = 0.00247106. Total volume = 9.57195. Cell volumes OK.
Mesh non-orthogonality Max: 62.4377 average: 12.4339
Non-orthogonality check OK.
Face pyramids OK.
***Max skewness = 5.37638, 62 highly skew faces detected which may impair the quality of the results
<<Writing 62 skew faces to set skewFaces
Min/max edge length = 0.000496028 0.36044 OK.
All angles in faces OK.
Face flatness (1 = flat, 0 = butterfly) : average = 0.999996 min = 0.967851
All face flatness OK.

Failed 1 mesh checks.

End

Using a finer mesh maybe, I don't know how to use gridgen, but is this a structured or a hybrid mesh...?

Best regards

Alex

alexandrepereira June 20, 2008 09:15

Mark, I think that the pro
 
Mark,

I think that the proper selection of the gamma limit on the above integral is critical on the accuracy of the calculated displacement volume, why using 0.5 is more accurate than, say gamma>0.8 ? isn't that limit "mesh coarseness" dependent ? or has an even more complex relation to surface tension of gamma phase...?

But yes, i think this is the right approach for calculating displacement volume...sorry for not being able to answer you specific question,


Best regards

Alex

ngj June 20, 2008 10:34

Hi Mark Try if this works.
 
Hi Mark

Try if this works.

label patchI = mesh.boundaryMesh().findPatchID("hull");
scalar gammaLim(0.5);
scalar yCenter(0);

sum
(
mag(mesh.Sf().boundaryField()[patchI] & vector(0,1,0)) *
(mesh.Cf().boundaryField()[patchI].component(1) - yCenter) *
pos(gamma.boundaryField()[patchI].boundaryInternalField() - gammaLim)
);

First line: Projects the surface normal vector onto the y-axis, i.e. x-y-plane area.
Second line: Defines distance between centerline and face-center.
Third line: Returns 1 if gamma - 0.5 > 0 else 0 is returned.

Hope this can help you,

Niels

markc June 20, 2008 12:04

Hi All, Niels, Thanks for
 
Hi All,

Niels,
Thanks for your advice. I am going to try as soon as time allows.
Alex,
Some very good readings:
Principles of Naval Architecture. Comes in 3 volumes. Quiet expensive tough.
Furthermore: Rawson, Tupper, basic ship design, Vol 1 and 2. Or: Watson, practical ship design.

Brgds,

Mark

alexandrepereira June 20, 2008 12:44

Thanks Mark Alex
 
Thanks Mark

Alex

markc June 23, 2008 15:00

Hi Niels, others, I tried y
 
Hi Niels, others,

I tried your code snippet. I got the following error during compiling on your 3rd line with wmake:
>>>
request for member 'boundaryField' in 'gamma', which is of non-class type 'double ()(double)throw ()'
<<<
I understand what the error is about but do not really know how to solve it. Hopefully you can help me a bit further.

For reference, the line with the error is given below:
>>>
pos(gamma.boundaryField()[patchi].boundaryInternalField() - gammaLim)
<<<


Thanks in advance,

Mark

ngj June 24, 2008 02:50

Hi Mark Yes, I have just tr
 
Hi Mark

Yes, I have just tried to compile it, and I am told that boundaryField does not have a member boundaryInternalField. I was a little bit in doubt about that specific point, but if you remove boundaryInternalField() and just use the boundaryField-values, you should get the same, as you probably has zeroGradient for gamma at your hull.
If I remove that part it compiles.

/ Niels

markc June 28, 2008 08:26

Hello All, Based on code sn
 
Hello All,

Based on code snippet of Niels I succeeded in calculating the buoyancy of a hull. Also added lines which multiply dV with X coordinate in order to calculate trimming moment.
Attached the complete utility folder, named "buoyancy".
http://www.cfd-online.com/OpenFOAM_D...hment_icon.gif buoyancy.zip

Next step is to implement this utility in interFoam and use the results to deform mesh (move Hull in the domain according buoyancy force and trimming moment). Therefore any examples with moving/deforming mesh would be of great help. I studied the icoDyMFoam tutorial "MovingCone". However some other examples or explanation on the tutorial would be very helpfull. By the way, is it possible to apply movingMesh on unstructured tet meshes anyway?

Thanks for any input,

Mark

hjasak June 28, 2008 09:20

Hi Mark, Are you coming to
 
Hi Mark,

Are you coming to Milan for the Workshop? From what I hear, Eric will do a tutorial on this subject, and the code and case will be made available (if I understand things correctly).

Re mesh motion, all polyhedral cell shapes, including tets, can be moved using automatic mesh motion routines with no trouble.

Hrv

markc June 28, 2008 12:19

Unfortunately I can not attend
 
Unfortunately I can not attend the Milan Workshop (seatrials on real ship). Waiting for the next opportunity...
I will keep an eye on Eric's case.

Mark

alexandrepereira June 28, 2008 18:29

Hi Mark Tried to compile th
 
Hi Mark

Tried to compile the buoyancy app, and i did, but it segfaults...

root@iskandhar:~/OpenFOAM/root-1.4.1/run# cd /home/alex/Desktop/buoyancy


root@iskandhar:/home/alex/Desktop/buoyancy# wmake
root@iskandhar:/home/alex/Desktop/buoyancy# wclean
root@iskandhar:/home/alex/Desktop/buoyancy# run
root@iskandhar:~/OpenFOAM/root-1.4.1/run# buoyancy . wigley

/*---------------------------------------------------------------------------*\
| ========= | |
| \ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \ / O peration | Version: 1.4.1 |
| \ / A nd | Web: http://www.openfoam.org |
| \/ M anipulation | |
\*---------------------------------------------------------------------------*/

Exec : buoyancy . wigley
Date : Jun 28 2008
Time : 23:24:41
Host : iskandhar
PID : 6767
Root : /root/OpenFOAM/root-1.4.1/run
Case : wigley
Nprocs : 1
Create time

Create mesh for time = 0

Time = 0
Reading field gamma

#0 Foam::error::printStack(Foam:http://www.cfd-online.com/OpenFOAM_D...part/proud.gifstream&) in "/root/OpenFOAM/OpenFOAM-1.4.1/lib/linuxGccDPOpt/libOpenFOAM.so"
#1 Foam::sigSegv::sigSegvHandler(int) in "/root/OpenFOAM/OpenFOAM-1.4.1/lib/linuxGccDPOpt/libOpenFOAM.so"
#2 Uninterpreted: [0xffffe420]
#3 Foam::operator-(Foam::UList<double> const&, double const&) in "/root/OpenFOAM/OpenFOAM-1.4.1/lib/linuxGccDPOpt/libOpenFOAM.so"
#4 main in "/root/OpenFOAM/OpenFOAM-1.4.1/applications/bin/linuxGccDPOpt/buoyancy"
#5 __libc_start_main in "/lib/tls/i686/cmov/libc.so.6"
#6 Foam::regIOobject::readIfModified() in "/root/OpenFOAM/OpenFOAM-1.4.1/applications/bin/linuxGccDPOpt/buoyancy"
Segmentation fault (core dumped)
root@iskandhar:~/OpenFOAM/root-1.4.1/run# ls wigley
0 0.15 0.3 0.45 0.6 0.75 0.9 1.05 1.2 1.35 1.5 1.65 1.8 1.95 2.1 2.25 2.4 2.55 2.7 2.85 3 3.15 3.3 3.45 3.6 3.75 3.9 4.05 4.2 4.35 VTK
0.05 0.2 0.35 0.5 0.65 0.8 0.95 1.1 1.25 1.4 1.55 1.7 1.85 2 2.15 2.3 2.45 2.6 2.75 2.9 3.05 3.2 3.35 3.5 3.65 3.8 3.95 4.1 4.25 constant
0.1 0.25 0.4 0.55 0.7 0.85 1 1.15 1.3 1.45 1.6 1.75 1.9 2.05 2.2 2.35 2.5 2.65 2.8 2.95 3.1 3.25 3.4 3.55 3.7 3.85 4 4.15 4.3 system

and the folders definitely have information on gamma, since this is an interFoam case...

root@iskandhar:~/OpenFOAM/root-1.4.1/run# ls wigley/0
divU enstrophy epsilon flowType gamma gamma.org k Lambda2 magGradU magU magVorticity nut nuTilda pd Q R U uprime vorticity wallGradU

can you tell me what went wrong here...?

brgds

Alex

alexandrepereira June 29, 2008 18:06

....Ok... Dumbass question
 
....Ok...

Dumbass question my last one... :-)

The patch name is supposed to be "Hull"...

It works allright...

Alex

nico765 July 18, 2008 13:04

Hello, Reading the above
 
Hello,

Reading the above posts, the approach is to couple a VOF solver (interFoam) with a dynamic meshing. I have seen that this has been included into v1.5.
In the industry i do believe that the most common approach is to apply a motion to the whole mesh (no deformation). (this works fine because sinkage and trim are small).
Is this possible with one of the Openfoam solvers? My concerns are about boundary conditions (inlet/outlet) when the mesh is moving.

Regards,

Nicolas


All times are GMT -4. The time now is 09:47.