CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM Running, Solving & CFD (http://www.cfd-online.com/Forums/openfoam-solving/)
-   -   free surface around a ship hull (http://www.cfd-online.com/Forums/openfoam-solving/90449-free-surface-around-ship-hull.html)

Stephy July 10, 2011 22:49

free surface around a ship hull
 
Hello all,
I am trying to model the elevation/trough of free surface around a ship hull. Being new to OF, I am starting with a simple mesh (inlet, oulet, floor+sides+hull walls, and free surface) in a simple case (icoFoam, using only p and U).

Here are my boundary, p, and U files and then my current problem when I start the simulation.

p:
FoamFile
{
version 2.0;
format ascii;
class volScalarField;
object p;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

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

internalField uniform 0;

boundaryField
{
wall
{
type buoyantPressure;
}

outflow
{
type freestreamPressure;
}

inflow
{
type freestreamPressure;
}

symmetry
{
type zeroGradient;
}
}
---------

U:
FoamFile
{
version 2.0;
format ascii;
class volVectorField;
object U;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

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

internalField uniform (0 0 0);

boundaryField
{
wall
{
type fixedValue;
value uniform (0 0 0);
}

outflow
{
type zeroGradient;
}

inflow
{
type fixedValue;
value uniform (0 0 1);
}

symmetry
{
type zeroGradient;
}
}
----------------------------------------

Now, here is what I get when I type "icoFoam" in a terminal:

Create time

Create mesh for time = 0

Reading transportProperties

Reading field p

Reading field U

Reading/calculating face flux field phi


Starting time loop

Time = 0.1

Courant Number mean: 0.000506547 max: 0.315347
DILUPBiCG: Solving for Ux, Initial residual = 0, Final residual = 0, No Iterations 0
DILUPBiCG: Solving for Uy, Initial residual = 0, Final residual = 0, No Iterations 0
DILUPBiCG: Solving for Uz, Initial residual = 1, Final residual = 3.31525e-08, No Iterations 2


--> FOAM FATAL ERROR:
Continuity error cannot be removed by adjusting the outflow.
Please check the velocity boundary conditions and/or run potentialFoam to initialise the outflow.
Total flux : 41.8405
Specified mass inflow : 0
Specified mass outflow : 185.25
Adjustable mass outflow : 0


From function adjustPhi(surfaceScalarField& phi, const volVectorField& U,const volScalarField& p
in file cfdTools/general/adjustPhi/adjustPhi.C at line 116.

FOAM exiting
-------
------

"symmetry" corresponding to the free surface.
I tried to run potentialFoam but I get "--> FOAM FATAL IO ERROR:
keyword potentialFlow is undefined in dictionary ..[...]... FOAM Exiting".

Please let me know if you have any suggestion about this issue,

thank you very much,

Stephy

Stephy July 10, 2011 22:50

my boundary file:

FoamFile
{
version 2.0;
format ascii;
class polyBoundaryMesh;
location "constant/polyMesh";
object boundary;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

4
(
wall
{
type wall;
nFaces 11332;
startFace 229789;
}
outflow
{
type patch;
nFaces 446;
startFace 241121;
}
inflow
{
type patch;
nFaces 452;
startFace 241567;
}
symmetry
{
type patch;
nFaces 6692;
startFace 242019;
}
)

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

Stephy July 12, 2011 23:28

Anybody ? I'm still stuck on it....

thank you :-) !

pablodecastillo July 13, 2011 04:26

there is examples at this forum (wigley hull), and talking about freesurfaces try with interFoam.

Stephy July 13, 2011 22:44

Pablo,

thank you for your advice, I have already tried the wigley hull tutorial and read the topics dedicated to this on the forum (very complicated, people talk more about turbulence and forces issues, which is not yet my problem), but as I would want to understand what I am doing I try not to copy this case without understanding.
Anyway, I wasn't even able to adapt the wigley hull to my mesh, which is basically the same, but the boundaries, as defined previously, are a bit different (the walls are actual walls).
Do you have any idea of how I could adapt the wigley hull to my mesh and boundaries ? I guess I would have to change not only "p" and "U" but all those files dedicated to turbulence coefficients and others...

jantheron October 10, 2011 06:00

Quote:

Originally Posted by Stephy (Post 316060)
Pablo,

thank you for your advice, I have already tried the wigley hull tutorial and read the topics dedicated to this on the forum (very complicated, people talk more about turbulence and forces issues, which is not yet my problem), but as I would want to understand what I am doing I try not to copy this case without understanding.
Anyway, I wasn't even able to adapt the wigley hull to my mesh, which is basically the same, but the boundaries, as defined previously, are a bit different (the walls are actual walls).
Do you have any idea of how I could adapt the wigley hull to my mesh and boundaries ? I guess I would have to change not only "p" and "U" but all those files dedicated to turbulence coefficients and others...

The first thing you should do is to replace the wigley stl file in constant/trisurface with your stl file. Scale it so that it is about the same size as the wigley hull size. then replace the reference to the wigley stl file in system/snappehexmesh with the name of your file. Make sure that your stl file is ascii and that it starts with "solid body" end ends with "endsolid body".

Edit Allrun and comment out last few lines so that you only run blockmesh and snappyHexMesh. Modify the settings in constant/polymesh/bleckmesh and snappyhexmesh until you are able to generate a nice grid. This will actually take quite some time in my experience as a co-newbie. Only then should you start to play with boundary conditions etc.

Jan
www.kanoefabrik.com

parkh32 April 10, 2012 06:47

Hi Jan

I am exactly dong what you said in your post.

I have put my own ".stl" file and run "blockMesh", "snappyHexMesh", "LTSInterFoam", and "paraFoam". there is some Foam warning but no error.

In paraView, I have played but nothing changed I mean colour is all through same until time and fames are finished.

can you give me some guides, please?

hs//


Quote:

Originally Posted by jantheron (Post 327293)
The first thing you should do is to replace the wigley stl file in constant/trisurface with your stl file. Scale it so that it is about the same size as the wigley hull size. then replace the reference to the wigley stl file in system/snappehexmesh with the name of your file. Make sure that your stl file is ascii and that it starts with "solid body" end ends with "endsolid body".

Edit Allrun and comment out last few lines so that you only run blockmesh and snappyHexMesh. Modify the settings in constant/polymesh/bleckmesh and snappyhexmesh until you are able to generate a nice grid. This will actually take quite some time in my experience as a co-newbie. Only then should you start to play with boundary conditions etc.

Jan
www.kanoefabrik.com


jantheron April 14, 2012 06:49

hs

Did you change the name of the stl file to your filename inside snappyHexMeshDict?

Jan

Quote:

Originally Posted by parkh32 (Post 353945)
Hi Jan

I am exactly dong what you said in your post.

I have put my own ".stl" file and run "blockMesh", "snappyHexMesh", "LTSInterFoam", and "paraFoam". there is some Foam warning but no error.

In paraView, I have played but nothing changed I mean colour is all through same until time and fames are finished.

can you give me some guides, please?

hs//


parkh32 April 15, 2012 03:54

thank you for your reply.

Yes, I changed to my own file name in snappyHexMeshDict.
When I ran snappyHexMesh I got Foam waring as;

>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> >>>>>>>>>
(1)

Morph iteration 0
-----------------
Calculating patchDisplacement as distance to nearest surface point ...
Wanted displacement : average:0.0160589 min:1.71113e-06 max:0.0546716
Calculated surface displacement in = 0.33 s

--> FOAM Warning : Displacement (0.000203702 0.00140685 0.0031613) at mesh point 3484 coord (-21.4617 -2.48765 -0.395662) points through the surrounding patch faces
Smoothing displacement ...
Iteration 0
Iteration 10
Iteration 20
Displacement smoothed in = 3.98 s

(2)

Did not succesfully snap mesh. Giving up.

>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> >>>>>>>>>>>


I also have got this warning and error after "paraFoam";

>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> >
$ paraFoam

created temporary 'Hull70.OpenFOAM'
--> FOAM Warning :
From function polyMesh::readUpdateState polyMesh::readUpdate()
in file meshes/polyMesh/polyMeshIO.C at line 204
Number of patches has changed. This may have unexpected consequences. Proceed with care.

--> FOAM FATAL IO ERROR:
size 5760 is not equal to the given value of 287774

file: /home/administrator/OpenFOAM/administrator-2.1.0/run/tutorials/multiphase/LTSInterFoam/Hull70/100/nut from line 18 to line 5803.

From function Field<Type>::Field(const word& keyword, const dictionary&, const label)
in file /home/opencfd/OpenFOAM/OpenFOAM-2.1.0/src/OpenFOAM/lnInclude/Field.C at line 236.

FOAM exiting
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

would you like to have look the log, please? I can send the log to your email.

thanks.

hs//

jantheron April 16, 2012 01:56

shm
 
hs

There can be many reasons for not being able to snap. Start by making sure your refinement regions are set correctly (surround your geometry with a refined region), and that your refinement levels are high enough; if too coarse, it won't be able to snap.

Jan
Quote:

Originally Posted by parkh32 (Post 354736)
thank you for your reply.

Yes, I changed to my own file name in snappyHexMeshDict.
When I ran snappyHexMesh I got Foam waring as;

>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> >>>>>>>>>
(1)

Morph iteration 0
-----------------
Calculating patchDisplacement as distance to nearest surface point ...
Wanted displacement : average:0.0160589 min:1.71113e-06 max:0.0546716
Calculated surface displacement in = 0.33 s

--> FOAM Warning : Displacement (0.000203702 0.00140685 0.0031613) at mesh point 3484 coord (-21.4617 -2.48765 -0.395662) points through the surrounding patch faces
Smoothing displacement ...
Iteration 0
Iteration 10
Iteration 20
Displacement smoothed in = 3.98 s

(2)

Did not succesfully snap mesh. Giving up.

>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> >>>>>>>>>>>


I also have got this warning and error after "paraFoam";

>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> >
$ paraFoam

created temporary 'Hull70.OpenFOAM'
--> FOAM Warning :
From function polyMesh::readUpdateState polyMesh::readUpdate()
in file meshes/polyMesh/polyMeshIO.C at line 204
Number of patches has changed. This may have unexpected consequences. Proceed with care.

--> FOAM FATAL IO ERROR:
size 5760 is not equal to the given value of 287774

file: /home/administrator/OpenFOAM/administrator-2.1.0/run/tutorials/multiphase/LTSInterFoam/Hull70/100/nut from line 18 to line 5803.

From function Field<Type>::Field(const word& keyword, const dictionary&, const label)
in file /home/opencfd/OpenFOAM/OpenFOAM-2.1.0/src/OpenFOAM/lnInclude/Field.C at line 236.

FOAM exiting
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

would you like to have look the log, please? I can send the log to your email.

thanks.

hs//


parkh32 April 16, 2012 20:02

hi Jan

thank you for your comments.

hs//

colinB April 19, 2012 07:37

Hi hs//

to your second problem

Quote:

>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> >> >
$ paraFoam

created temporary 'Hull70.OpenFOAM'
--> FOAM Warning :
From function polyMesh::readUpdateState polyMesh::readUpdate()
in file meshes/polyMesh/polyMeshIO.C at line 204
Number of patches has changed. This may have unexpected consequences. Proceed with care.

--> FOAM FATAL IO ERROR:
size 5760 is not equal to the given value of 287774

file: /home/administrator/OpenFOAM/administrator-2.1.0/run/tutorials/multiphase/LTSInterFoam/Hull70/100/nut from line 18 to line 5803.

From function Field<Type>::Field(const word& keyword, const dictionary&, const label)
in file /home/opencfd/OpenFOAM/OpenFOAM-2.1.0/src/OpenFOAM/lnInclude/Field.C at line 236.

FOAM exiting
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

I might have the solution which was posted here some while ago:

http://www.cfd-online.com/Forums/ope...celllevel.html

regards

Colin

parkh32 April 24, 2012 01:12

thanks Collin

hs


All times are GMT -4. The time now is 14:37.