CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM (https://www.cfd-online.com/Forums/openfoam/)
-   -   generate Waves in openfoam (https://www.cfd-online.com/Forums/openfoam/66544-generate-waves-openfoam.html)

 anon_c July 18, 2009 05:07

generate Waves in openfoam

hello!

i am very very new in the field of numerical simulation spcialy in CFD and even in OpenFoam, but i wanne thank all people how make it possible that an opensurce projeckt get such a powerful like comercial CFDṕrogrammes

now: i studied matherialtheorie, and i worked allways only anayltical and know there is something i have to check numerical:

i would like to use the VOF mithod ( discriped in decoumentation: 2.3 Breaking of dam)

but i wanne do it like this

water is only 5m high on the bottom and the domain is (200m lengh x 50m high) and i wane generate a wave with a moving piston (v=v(t), v is the speed of the moving wall i.e. piston) that is even 50m high on the left wall

that means the left wall is a moving wall (the pisto) in the x-direction (in the lengh direction) to generate the wave

is that posible with openfoam?? i reallyyy dont have an idee to make that moving wall (i.e. piston)

the geometrie and the 2phases are allready done (and i even do the RASproperties to get the kepsilon standard modell)

plz i would like to get your help, but i am really new in openfoam and i dont understand alout of the things that have been wirten in this fourm

thank you :)

 elvis July 18, 2009 06:54

Dear Amar,

from Ship hydrodynamics and Fluid-structure interaction
further take a look at http://openfoamwiki.net/index.php/Co...yBC#User-Cases =>groovyWaveTank
and take a look at http://openfoamwiki.net/index.php/Si..._Hydrodynamics

i don't understand exactly if you want to use piston and moving wall to generate the BoundaryConditions to generate the waves (that is not necessary and needs more computation power) or do you want to dimension via FSI your WaveTank

google for wave tank site:www.cfd-online.com wave tank
http://www.cfd-online.com/Forums/ope...ace-141-a.html

 anon_c July 18, 2009 09:24

thank you for helping

i wanne that the moving wall going to be the piston

i mean like this

I___________________I
I>__________________I
I___________________I

__I_________________I
_>I_________________I
__I_________________I

i would read the pages and if there is a problem i would wirte here again

thank you very much

 elvis July 18, 2009 10:07

http://www.openfoamworkshop.org/2009...son_slides.pdf
page 19/35 - 24/35 are very good for starting

 anon_c July 18, 2009 10:16

hi elvis

that is not what i need (they are generating waves really :D )

i wanne check the breaking of a wave front on a wall that moves! i calculate this analytical and i have allrady simulate it in fluent by help from my freand how is a fluent expert (bcz that is not my working doman)

i only need to do a wall that moves in openfoam and could be solved by interFoam ??
and the inlet condition is water that is about 5m high in a square doman that is not moving (inlet) then by t=0s the wall (piston) on the left side moves and in theorie it could be break the wave even on the wall if the wall get a high speed

 elvis July 18, 2009 11:35

hi ammar,

take a look at something that has a *dyn*foam in it's name, because there are solvers there dynamics are included.

So your purpose is to break a wave "actively" by a moving wall driven by a piston against a wave?

=>with the dynamic mesh stuff you have 6 degree of freedom but i never used that stuff.

sorry that i thought you wanted a just a wave tank

elvis

 anon_c July 18, 2009 11:48

hi

no no problem i just have to thankyou

yeh, i wirte for one year my diplom theyses on this problem and know i am a phd student and i wanne wirte a paper so my prof. told me if it is posible to simulate this to get a valdation

so i wanne look how fast the wall could be without breaking the wave ahead the wall the analytical solution was very hard, and the simulation with fluent was ok but it was slow and i can only calculate on one or tow prozessors that is why i am traing to do this with openfoam

yes the piston is the moving wall

ok i would lock after that

thank you i would wirte later

 elvis July 18, 2009 11:59

so it is more or less
http://www.dhcae-tools.de/images/Cas...penfoam_de.ppt (take a look at the last slides)
with a moving wall

 anon_c July 18, 2009 12:10

you speek german? sprichst du deutsch :)

 elvis July 18, 2009 12:57

Yes that's my motherlanguage

 anon_c July 18, 2009 13:03

ja meine fast auch :) ich bin seit 13 jahre in deutschland

arbeitest du auch in cfd bereich mit openfoam?? promovierst du auch ?? wenn du vieleicht interesse und spass hast dan können wir über icq oder msn reden und arbeiten :)

 elvis July 18, 2009 17:01

I did only easy cfd calculations in the polymer sector using OF, right now i'm in automotive sector doing non cfd stuff in a R&D department. But i'm very interessed what's going on in CFD and especially OF.

If you live in germany take the opportuny to visit a OpenFOAM-Stammtisch there are several over the country so it does not take to much effort to meet other people. which part of germany do you live?

 anon_c July 18, 2009 17:09

hessen north i would like to do more, but i am not on numerics or simulations interested i am doning only materialtheorie, and once a year i do some calculations i am training now some thing if it work i would post it here

thank you

 ngj July 20, 2009 05:02

Hi Ammar

I would recommend that you look at the tutorials for movingCone in icoDymFoam and combine it with interDymFOAM. As I understand it, all you need is a moving wall of constant velocity, hence it should be fairly simple to combine the two tutorials into what you need.
A note of caution! When using interDymFoam together with moving mesh, then the number of gamma evaluations per timestep needs to be 1.

Good luck,

Niels

 anon_c August 4, 2009 13:30

hello!

yeh that is the best

to compine the movinCone with the interDy...

but it is even beter to compine the movingConeTopo with the VOF solver interDy

but the problem ist i dont need only a constant velocity of the moving wall i need also a linear time dependent velocity of the wall

and i wanne do it like this

if (CURRENT_TIME<=1)
velocity of moving wall is v=v(t)
else
v=0

 ngj August 13, 2009 05:56

You might want to take a look here:

OpenFOAM/OpenFOAM-1.5.x/src/fvMotionSolver/pointPatchFields/derived/oscillatingDisplacement

Best regards,

Niels

 gautami September 12, 2009 09:38

Hello,

I am using OpenFOAM-1.5 on Suse linux 10.3

I am trying to model a wave tank as in the groovyBC wave tank case using interDyMFoam.I am trying to create the waves by moving the inlet of the wave tank with the wave velocity equations.

Can I do something like that?

I am doing the following

My dynamicDict file in the constant folder is as follows:

dynamicFvMesh dynamicMotionSolverFvMesh;
twoDMotion yes;
motionSolverLibs ("libfvMotionSolvers.so");
solver velocityLaplacian;
diffusivity uniform;
frozenDiffusion off;

The U,pd gamma in 0 folder are the same as groovyBC wave tank case,except I changed inlet as movingWall.
I want to move the inlet of the wave tank with the velocities as in groovyBC wave case.

The pointMotionU in 0 folder is as follows:

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!pointMotionU!!!!!! !!!!!!!!!!!
FoamFile
{
version 2.0;
format ascii;
class pointVectorField;
object pointMotionU;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

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

internalField uniform (0 0 0);

boundaryField
{
movingWall
{
type groovyBC;
refValue uniform (0 0 0);
valueFraction uniform 1;
value uniform (0 0 0);
valueExpression "(pos().z<=A*cos(-w*time())+0.5*k*A*A*cos(2*(-w*time()))) ? vector( A*w*exp(k*pos().z)*cos(-w*time()), 0, A*w*exp(k*pos().z)*sin(-w*time())) : vector(0,0,0)";
fractionExpression "1";
variables "l=5;A=0.1;g=vector(0,0,-9.81);k=2*pi/l;w=sqrt(k*mag(g));";
timelines (
);
}
outlet
{
}
bottom
{
type slip;
}
atmosphere
{

type pressureInletOutletVelocity;
phi phi;
value uniform (0 0 0);
}
frontAndBack
{
type empty;
}
}

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!

After executing the command interDyMFoam,I get the following error..

Create time

Create mesh for time = 0

Selecting dynamicFvMesh dynamicMotionSolverFvMesh
Selecting motion solver: velocityLaplacian

Not Implemented
Trying to construct an genericFvPatchField on patch atmosphere of field cellMotionU#0 Foam::error::printStack(Foam::Ostream&) in "/home/gali/OpenFOAM/OpenFOAM-1.5/lib/linuxGccDPOpt/libOpenFOAM.so"
#1 Foam::error::abort() in "/home/gali/OpenFOAM/OpenFOAM-1.5/lib/linuxGccDPOpt/libOpenFOAM.so"
#2 Foam::genericFvPatchField<Foam::Vector<double> >::genericFvPatchField(Foam::fvPatch const&, Foam::DimensionedField<Foam::Vector<double>, Foam::volMesh> const&) in "/home/gali/OpenFOAM/OpenFOAM-1.5/lib/linuxGccDPOpt/libfiniteVolume.so"
#3 Foam::fvPatchField<Foam::Vector<double> >::addpatchConstructorToTable<Foam::genericFvPat ch Field<Foam::Vector<double> > >::New(Foam::fvPatch const&, Foam::DimensionedField<Foam::Vector<double>, Foam::volMesh> const&) in "/home/gali/OpenFOAM/OpenFOAM-1.5/lib/linuxGccDPOpt/libfiniteVolume.so"
#4 Foam::fvPatchField<Foam::Vector<double> >::New(Foam::word const&, Foam::fvPatch const&, Foam::DimensionedField<Foam::Vector<double>, "/home/gali/OpenFOAM/OpenFOAM-1.5/applications/bin/linuxGccDPOpt/interDyMFoam"
#14 __libc_start_main in "/lib/libc.so.6"
#15 Foam::regIOobject::writeObject(Foam::IOstream::str eamFormat, Foam::IOstream::versionNumber, Foam::IOstream::compressionType) const in "/home/gali/OpenFOAM/OpenFOAM-1.5/applications/bin/linuxGccDPOpt/interDyMFoam"

From function genericFvPatchField<Type>::genericFvPatchField(con st fvPatch& p, const DimensionedField<Type, volMesh>& iF)
in file fields/fvPatchFields/basic/generic/genericFvPatchField.C at line 45.

FOAM aborting

Aborted
gali@SAI:~/OpenFOAM/gali-1.5/run/tutorials/interDyMFoam/growavmovinsb>

Can someone please suggest as to what I can do.

Thank You,
Gautami.
http://www.cfd-online.com/Forums/ima...ser_online.gif http://www.cfd-online.com/Forums/ima...ns/forward.gif

 gschaider September 15, 2009 09:39

Quote:
 Originally Posted by gautami (Post 229328) Can I do something like that?
Yep. There is an example with a moving mesh in the example-folder that comes with groovyBC. Nevertheless you'll have to be very careful with the boundary conditions for the flow at the moving inlet

Quote:
 Originally Posted by gautami (Post 229328) !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!pointMotionU!!!!!! !!!!!!!!!!! FoamFile { version 2.0; format ascii; class pointVectorField; object pointMotionU; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // dimensions [0 1 -1 0 0 0 0]; internalField uniform (0 0 0); boundaryField { movingWall { type groovyBC; refValue uniform (0 0 0); refGradient uniform (0 0 0); valueFraction uniform 1; value uniform (0 0 0); valueExpression "(pos().z<=A*cos(-w*time())+0.5*k*A*A*cos(2*(-w*time()))) ? vector( A*w*exp(k*pos().z)*cos(-w*time()), 0, A*w*exp(k*pos().z)*sin(-w*time())) : vector(0,0,0)"; gradientExpression "vector(0,0,0)"; fractionExpression "1"; variables "l=5;A=0.1;g=vector(0,0,-9.81);k=2*pi/l;w=sqrt(k*mag(g));"; timelines ( ); } outlet { type zeroGradient; } bottom { type slip; } atmosphere { type pressureInletOutletVelocity; phi phi; value uniform (0 0 0); } frontAndBack { type empty; } } !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!! After executing the command interDyMFoam,I get the following error.. Not Implemented Trying to construct an genericFvPatchField on patch atmosphere of field cellMotionU#0 Foam::error::printStack(Foam::Ostream&) in "/home/gali/OpenFOAM/OpenFOAM-1.5/lib/linuxGccDPOpt/libOpenFOAM.so"
That is not a problem with groovyBC. What OF is trying to tell you (granted, it has a funny way of saying this) is: "On the boundary atmosphere you are specifying a type that I don't know FOR THAT FIELD". In other words pressureInletOutletVelocity is not defined for pointVectorFields. And what sense would it make for a mesh-motion anyway?

Bernhard

BTW: please don't duplicate public questions by sending me a "Private Message". I only answer public questions ... if I have time. So it doesn't speed things up

 gautami September 15, 2009 17:41

Hello Mr Gschaider,

Thank you very much for your reply.I am really sorry for that private message.

I have changed the atmosphere type as follows in the pointMotionU dictionary

atmosphere
{

type fixedValue;
value uniform (0 0 0);
}

but now I get this error.

A point-field was wanted but we got a face
#0 Foam::error::printStack(Foam::Ostream&) in "/home/gali/OpenFOAM/OpenFOAM-1.5/lib/linuxGccDPOpt/libOpenFOAM.so"
#1 Foam::error::abort() in "/home/gali/OpenFOAM/OpenFOAM-1.5/lib/linuxGccDPOpt/libOpenFOAM.so"
#2 Foam::tmp<Foam::Field<Foam::Vector<double> > > Foam::PatchValueExpressionDriver::getResult<Foam:: Vector<double> >(bool) in "/home/gali/OpenFOAM/gali-1.5/lib/linuxGccDPOpt/libgroovyBC.so"
#3 Foam::groovyBCPointPatchField<Foam::Vector<double> >::updateCoeffs() in "/home/gali/OpenFOAM/gali-1.5/lib/linuxGccDPOpt/libgroovyBC.so"
#4 Foam::velocityLaplacianFvMotionSolver::solve() in "/home/gali/OpenFOAM/OpenFOAM-1.5/lib/linuxGccDPOpt/libfvMotionSolvers.so"
#5 Foam::motionSolver::newPoints() in "/home/gali/OpenFOAM/OpenFOAM-1.5/lib/linuxGccDPOpt/libdynamicMesh.so"
#6 Foam::dynamicMotionSolverFvMesh::update() in "/home/gali/OpenFOAM/OpenFOAM-1.5/lib/linuxGccDPOpt/libdynamicFvMesh.so"
#7 main in "/home/gali/OpenFOAM/OpenFOAM-1.5/applications/bin/linuxGccDPOpt/interDyMFoam"
#8 __libc_start_main in "/lib/libc.so.6"
#9 Foam::regIOobject::writeObject(Foam::IOstream::str eamFormat, Foam::IOstream::versionNumber, Foam::IOstream::compressionType) const in "/home/gali/OpenFOAM/OpenFOAM-1.5/applications/bin/linuxGccDPOpt/interDyMFoam"

From function PatchValueExpressionDriver::getResult(bool qPoint)
in file PatchValueExpressionDriverI.H at line 73.

FOAM aborting

Can someone please suggest some documentation or references for understanding the dynamic mesh motion.

Thank you,
Gautami.

 gschaider September 16, 2009 04:46

Quote:
 Originally Posted by gautami (Post 229602) but now I get this error. A point-field was wanted but we got a face
The "problem" is that by default the values groovy calculates are defined on the patch-faces. The pointMotionU is defined on the points. The easiest fix is to use "toPoints" to interpolate the face-values to point-values. But you should try to "go to" point values as early as possible to avoid interpolation artifacts.Have (for instance) a look at the distortedCone-example that comes with groovyBC

Bernhard

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