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)

francesco_b January 7, 2008 05:33

Hi all, I would like to simula
 
Hi all, I would like to simulate the movement of boats-like objects using OpenFoam, is it possible? Of course I think the answer is positive, but i can't find anything on the net. The problem is quite complex because it could be defined as liquid-solid-gas case with free surface.

Can someone give me a hint of how to solve it using OpenFOAM?

Thank you in advance

Francesco B.

egp January 7, 2008 06:34

Hi Francesco, I am working
 
Hi Francesco,

I am working on ships and floating bodies in waves using OpenFOAM. You need:

1. Free surface (rasInterFoam)

2. Ocean wave model, or simple Stokes wave model for simulating experimental facilities such as a wave basin.

3. Non-reflective outflow BC's

4. Dynamic meshing to capture the relative motion between the object and the free surface.

5. Ability to resolve or model rudders and propulsors.

6. 6DOF solver to computer the trajectory of the object.

In theory, it should be straight-forward to stitch together mostly existing code. However, there are issues which must be addressed. E.g., I recently put together rasInterDyMFoam (rasInterFoam + icoDyMFoam), and am working through a few minor issues.

Good luck, Eric

francesco_b January 7, 2008 10:30

Hi Eric, >> You need: >> 1
 
Hi Eric,

>> You need:
>> 1. Free surface (rasInterFoam)

Ok

>>2. Ocean wave model, or simple Stokes wave model for simulating experimental facilities such as a wave basin.

I think I'll use a simple wave model, I'm not worried about this

>> 3. Non-reflective outflow BC's

How can I impose them?

>> 4. Dynamic meshing to capture the relative motion between the object and the free surface.

icoDynMFoam does it

>> 5. Ability to resolve or model rudders and propulsors.

For my earlier applications I don't have them

>> 6. 6DOF solver to computer the trajectory of the object.

I don't know which solver could be used in this case

>> In theory, it should be straight-forward to stitch together mostly existing code.
>> However, there are issues which must be addressed. E.g.,
>> I recently put together rasInterDyMFoam (rasInterFoam + icoDyMFoam), and am working through a few minor issues.

Can you suggest me how to perform this task? I'm quite new to OpenFoam,
Thanks for your help

Best Regards

Francesco

jlpelerin January 7, 2008 11:30

Hi Eric, I did also try to
 
Hi Eric,

I did also try to mix rasInterFoam and icoDyMFoam. Unfortunately, I was unable to get a convincing result.
The first problem I encountered was : how to set the U values on boundaries equal to the rigid body velocity...

Would it be possible you post your code?

Thanks,

Best regards,

Jean-Luc

miguel_q February 8, 2008 17:54

Hello all, this is my first po
 
Hello all, this is my first post. I am still a beginner to openfoam. I have spent the past few weeks learning the program and using the interfoam solver to generate waves. I have put a box in the middle of my wave tank and I am trying to simulate wave motions of the box, I hope to implement a ship hull one I get the box to work. My question is, how to enable the box to move with the waves and extract the data in numerical form to show how much the box moves with the interaction (6 DOF)? I was also interested in asking, does openfoam adjust how the object will float through the metacentric height and center of gravity? Because I simply put the box in the tank and set fields to where I calculated the water line to be. Sorry for the long question, I am beginning and I am really interested in the program so I look forward to any and all advice.

michaelp February 8, 2008 18:33

Miguel, I am also trying to
 
Miguel,

I am also trying to get a numerical wave tank working, I seem to have got sidetracked trying to build some surface tracking routines that won't compile for me from OpenFOAM-dev. Would you be willing to show me the initial/boundary conditions you have used for interfoam?

Regards

Michael

miguel_q February 8, 2008 19:09

Michael, I am still new at
 
Michael,

I am still new at all this. The best advice I could give at this point is to look at the forum below and download the the files for wave phase and wave velocity and then follow the directions for implementing them. Use the wavephase for the inlet of gamma and the wavevelocity for inlet of velocity. You must follow the directions from the mentioned forum on the wave tank on where to put the files.


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

miguel_q May 5, 2008 00:31

I was wondering if anyone coul
 
I was wondering if anyone could give me some insight on how to combine rasInterFoam and icoDyMFoam? Advice, jounral articles, publications...? I have been struggling with this for some time and would love to hear where you found your information. Anything would help me at this point. Thanks in advance.
Miguel Q.

markc May 5, 2008 07:36

Dear all, Also I am interes
 
Dear all,

Also I am interested in solving problems related to ship design and ship motions. So far I succeeded in solving a wave pattern of a boat sailing in calm water using interFoam. This already caused a lot of challenges with respect to boundary conditions, meshing, solver strategies, schemes settings etc. I am very curious if anyone also succeeded in this relatively simple task.
I am still working on finalising this model, trying some more variations. Once I am satisfied, I will post some results and experiences here.
The next step is indeed using dynamic mesh. Instead of a 6DOF solver I am firstly interested in a 2DOF solver: sinkage (displacement in Z direction) and trim (rotation around Y axis).
This will be a next challenge. Not the math but the implementation in proper code. Any experience here already?

Once I am able to solve problems in calm water, taking a seaway into account is next. However I am currently focussing on the first two points.

With respect to propulsors and appendages: I am also conducting calculations regarding this. However, this involves more detailed investigations instead of full ship/water interactions. I am working on some models were I modelled the propeller using the actuator disk theory in order to investigate propeller/hull interaction. I am confident that such models could be coupled to interFoam models, however it makes models needlessly large in my opinion.

In short: I am slowly progressing in solving wave patterns/wave resistance of ships sailing in calm water and I am very curious if anyone has experience in this already.

brgds,

Mark

qtian May 16, 2008 10:25

Jaswi, I will be happy to m
 
Jaswi,

I will be happy to make some contribution to our forum. Since this is a 3d bump, the mesh size is too big. I am not sure that we can include such information in the test case. If you don't think that will be a problem, I will be glad to work on a test case.

Quinn

alexandrepereira May 16, 2008 12:00

Hi Mark, I am following thi
 
Hi Mark,

I am following this topic with interest...

Just tell me, how do you plan to solve for the generalized equations of motion of the boat...?

From the dynamic pressure from water you get moments and forces in respect to the CG of the boat, but how do you plan to model the rigid body dynamics?

...a full set of six rotational and translational springs and dampers with properly chosen constants might be an idea, but how do you couple it with a dynamic mesh in OpenFOAM...?

Also, since a boat has a complex shape, and its metacentric height changes in a non linear way with the angle of roll, and furthermore depends on the other DOF... i guess that some kind of nonlinear second order differential integrator might be required...

I am currently trying to solve such a problem in ADINA... but if one wants to be exact in the CFD-RBD modelling, well... it is not easy...

... BTW, how the heck did those japs built the Yamato warship, and the Zuikaku and Shokaku carriers without ever dreaming of CFD analysis...?

... just the thought of it makes an engineer feel rather small... :-)

brgds

Alex

alexandrepereira May 21, 2008 09:34

Hi ppl I have started to co
 
Hi ppl

I have started to code a 6 DOF differential stiff solver with automatic time stepping and error estimation.

I is supposed to solve the a rigid motion problem of a body immersed in a fluid ( compute the generalized displacements of its CG in absolute inertial frame, in response to a set of time varying set of forces/moments applied to its CG )

It will use a single step 4th order Runge Kutta integrator with error estimation to compute the n initial values of displacement, coupled to a 4th order Gear multistep predictor-corrector integrator to continue the integration through the rest time period, reducing iteration workload compared to Runge-Kutta.

My issue is: How can i integrate this solver within the framework of OpenFOAM?

How do i couple the calculated displacement with the dynamic mesh change, so as to update the position of my floating object within the boundaries of gamma<1 ( z-translation, roll, trim, and pitch rotations ? )

Thanks in advance

Alex

hjasak May 21, 2008 09:57

Hi Alex, Have a look at thi
 
Hi Alex,

Have a look at this video:

http://powerlab.fsb.hr/ped/kturbo/Op...ngCylinder.mpg

I take it this is something you are after... Have a look at the dev SVN repository and you will find most components ready for you, inculding an ODE solver and a 6-DOF ODE class. What remains is a moving deforming mesh VOF solver, force calculation and coupling.

I think Eric Paterson is preparing the case I've shown you as a tutorial for the Milan Workshop - this would presumably mean all the files and solvers will be given away.

To summarise, main components are:
- moving mesh VOF solver
- dynamic moving mesh class which
- identifies moving surface
- calculates forces on the body
- contains a 6-DOF ODE and solver for those forces
- uses automatic mehs motion to deform the mesh

We have actually gone further and protected cell layers close to the solid body, used mesh subset to minimise the cost of mesh deformation solver, integrated motion accuracy to second order (mean velocity and rotation) etc, but this is the basic setup. (people who contributed but didn't get a mention, please accept my apologies: this is joint work and I'm not trying to take all the credit).

Hope this helps,

Hrv

alexandrepereira May 21, 2008 10:16

Thanks Hrv I will give a lo
 
Thanks Hrv

I will give a look at that.

brgds

Alex

alexandrepereira May 21, 2008 13:20

Hi That vid is amazing Hrv.
 
Hi

That vid is amazing Hrv... awesome... :-)

Just tell me, how do you model Archimedes impulse...?

As a nonlinear spring attached from the cylinder to the global reference frame, or do you really integrate the displacement volume above a prescribed (... say 0.99 ) beta threshold, and integrate the z displacement in the ODE class... ?

Doing it in Z, and YPR rotational coordinates is rather highly nonlinear due to coupling effects, and the very nature of a Boat geometry ( nonlinear variation of metacentric height with roll angle... etc )

... In my best days, i can TRY to write such a piece of code in Fortran 95... no classes, no data abstraction, no polymorphism or virtual methods... duh :-( ...

... should have invested in c++ instead of Fortran... Do you believe that a couple of weeks ago i did not knew what a class was... ?

... I realy am a long way of understanding how OpenFOAM works...

Nice work ... awesome... :-)

Alex

hjasak May 21, 2008 16:02

Why don't you drop me an E-mai
 
Why don't you drop me an E-mail - let's talk about it...

Hrv

markc June 18, 2008 10:53

Hi All, Here some first res
 
Hi All,

Here some first results/experiences of a boat modeled free sailing, using interFoam.
The domain consists of the SB half of a boat. Water domain is calm water, no waves, so actually steady state.
Domain is tet mesh with a finer distribution near water surface and boatÅ› hull. Number of elements appr 280K.
The boat is sailing appr at its hull speed, appr Froude number = 0.4.
The wave profile is more or less visualized below by plotting all elements with gamma>0.5:
http://www.cfd-online.com/OpenFOAM_D...ges/1/8082.jpg

The hull is colored by pressure results.

I experienced a lot of problems with stability. This is probably partly caused by the fact that the model is tet-meshed, though checkmesh gives nil errors/warnings. At this moment I do not have the tools to (at least partly) mesh the domain with hexagon so I had no opportunity to investigate this further.
Furthermore the solver and schemes settings are important. The files are given below.
http://www.cfd-online.com/OpenFOAM_D...hment_icon.gif files.zip

Especially the relaxationFactors appeared crucial, besides using upwind on div scheme.

I still have one corner with a too high velocity, see picture below. Note that boat speed is 5 m/s, while one cell in the corner gets upto 11 m/s. Such velocity spikes always occurred just above the water surface on the boundaries and often in corners. However with the presented settings solution was stable.
http://www.cfd-online.com/OpenFOAM_D...ges/1/8083.jpg

One issue I do not feel comfortable about is the fact that the solution in fact is still not converged. The number of iterations needed is not decreasing anymore. Below the last solution step from the solver log is presented:
"
MULES: Solving for gamma
Liquid phase volume fraction = 0.890947 Min(gamma) = -9.21406e-19 Max(gamma) = 1
MULES: Solving for gamma
Liquid phase volume fraction = 0.890947 Min(gamma) = -1.46065e-19 Max(gamma) = 1
MULES: Solving for gamma
Liquid phase volume fraction = 0.890947 Min(gamma) = -3.5428e-19 Max(gamma) = 1
MULES: Solving for gamma
Liquid phase volume fraction = 0.890947 Min(gamma) = -1.9693e-18 Max(gamma) = 1
smoothSolver: Solving for Ux, Initial residual = 7.38197e-05, Final residual = 2.63128e-07, No Iterations 2
smoothSolver: Solving for Uy, Initial residual = 0.000170614, Final residual = 8.25023e-07, No Iterations 2
smoothSolver: Solving for Uz, Initial residual = 0.000814927, Final residual = 2.51264e-07, No Iterations 3
GAMG: Solving for pd, Initial residual = 0.0166, Final residual = 7.92732e-07, No Iterations 8
GAMG: Solving for pd, Initial residual = 0.00488644, Final residual = 7.28804e-07, No Iterations 7
GAMG: Solving for pd, Initial residual = 0.00161011, Final residual = 9.83858e-07, No Iterations 5
time step continuity errors : sum local = 4.67858e-10, global = 2.57875e-11, cumulative = 6.93357e-07
ExecutionTime = 53492.3 s ClockTime = 53522 s
"
Can anyone comment on this? How should I make the solution converge to nil iterations? Maybe the mesh is still too coarse?

The next steps will be:
- investigate pressure integration results over the hull and compare with wave resistance.

- make iterations around changing of boat position in the water due to trim and sinkage. For this, integration of boat hull over water volume (gamma > 0.5) is necessary and next, hull needs to be moved/rotated according these results (moving/deformed mesh?)

- investigate application of moving mesh to follow wave pattern. It would be great to capture the interface by moving a certain mesh layer at gamma = 0.5 (e.g.).

Hrv / Alex, do I understand right: are tools already available to perform the latter 2 steps?

Topics in this forum thread are amongst others about 6 dof solvers taking dynamics into account in which I am very interested. However, I have not seen any attempt yet with a simple (but real) boat geometry modelled with a commercial mesher (tet) sailing in calm water (steady state). I am very curious about other peoples experiences in these relatively simple tasks before moving to the next steps.

Awaiting any comments,

Brgds,

Mark

egp June 18, 2008 12:07

Mark, I would recommend tha
 
Mark,

I would recommend that you take a look at my wigley hull case:

http://idisk.mac.com/egpaterson-Public/wigley.tar.gz

It is similar to what you are doing and runs OK with the standard rasInterFoam solver.

Eric

alexandrepereira June 18, 2008 14:22

Hi Mark, Impressive your re
 
Hi Mark,

Impressive your results, :-)

Acoording to Hrv, OpenFOAM includes a 6 DOF solver class, it can be used to integrate the rigid body
motion in CP fixed inertial frame from calculated Forces/moments obtained from pressures over the hull, but i guess that updating the buoyacy forces due to relative motion of the waterplane won't be an easy task... what geometric description do you have of the hull surface? one approach might be to integrate the displacement volume above beta=.99 so as to try to relocate the metacenter and feed the free body force system to teh equations to be solved in the ODE solver... Just an idea here... didn't think much about the issue yet...

and there are issues of stiffness in the differential equation system in the ODE solver : I antecipate they will be highly nonlinear, what is the ratio of orders of magnitude of the boat's self motion velocity ( periods of roll and trim ) compared to the speed of free surface flow...?

That must also be taken care of... i guess...

Nice work though... :-)

brgds

Alex

alexandrepereira June 18, 2008 20:49

Hi again Mark I have run yr
 
Hi again Mark

I have run yr model. do you have any idea where i may learn a suitable wave model to impose on the inlet, and a non reflective BC to impose on the outlet ?

I think that a rather interesting phenomenon to be simulated with rigid body motion update, might be the resonance of wave period with vertical hull motion period, considering that the hull length is short compared to wave length...

...should be interesting to say the least... :-)

Ever heard of what happened to a battleship, from KuK ( Koenigliche und Kaiserliche ) marine in WW1...?

BTW why didn't you use a single inlet patch with funkySetFields to account for water level at inlet...?

Does one really need two inlet patches...?

Just one more thing, which mesher did you use...?

brgds

Alex

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 21:02.