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/)
-   -   Wave Tank (https://www.cfd-online.com/Forums/openfoam-solving/57882-wave-tank.html)

fugu March 17, 2008 16:47

Niels, you are right, it would
 
Niels, you are right, it would certainly be more computationally expensive. The main reason for me to use the moving boundary is to reproduce laboratory flumes in order to make some comparisons with experimental data. It might be also interesting on the design side for situations where continuous waves are not required.
I looked at your BC and I will try to use it for
continuous generation.
As for the tsunamis it might be interesting to use OF to model extreme wave/structure interaction or extreme wave generation due to bodies falling in the water.

Hrvoje, the swirling glass is amazing. Was it made with bc provided in the regular OF release ?

Regards,
Luca

hjasak March 17, 2008 17:34

What do you mean a "boundary c
 
What do you mean a "boundary condition"? What you are looking at is a moving mesh simulation, with mesh motion specified in any way you want it. This is just one of the "prescribed motion" classes. I also have some more sophisticated ones, like 3-DOF translation + solid body motion, used with the same VOF solver. Have a look at a:

bobbing cylinder DOF + free surface + automatic mesh motion

I am still playing with that one.

All this stuff is checked into the public SVN version; if something is missing, please drop me a line and I'll make it available in some way.

Enjoy,

Hrv

fugu March 17, 2008 18:38

Hrvoje, sorry no bc other tha
 
Hrvoje,
sorry no bc other than walls and atmosphere there! What I really meant was the moving boundary algorithm. Do you have to recompile the solver in order to specify a moving mesh like that?

I have looked at the repo at
https://openfoam-extend.svn.sourceforge.net/
svnroot/openfoam-extend/trunk/Core/
OpenFOAM-1.4.1-dev
but couldn't locate examples like that in the tutorials. On the other hand I noticed a bunch
of classes in /src/dynamicFvMesh/ and /topoChangerFvMesh/
but not being a C++ programmer doesn't make the whole business of setting up the simulation easy.
I guess one should be able to infer what to put in the dynamicMeshDict by reading the classes code.
Although I consider myself a decent java programmer I still find C++ syntax obscure http://www.cfd-online.com/OpenFOAM_D...part/happy.gif
maybe time has come to finally dive in the C++ realm.

Best regards
Luca

fugu March 27, 2008 10:20

Ok, after playing around with
 
Ok, after playing around with the moving cone tutorial in icoDyMFoam I tried to create very simple moving boundary case in interFoam. Basically my case is a 2D box with atmosphere at the top boundary, walls at right and bottom boundaries and moving wall at the left. I managed to get a similar case working in icoDyMFoam with outlet at the right boundary, fixed wall at the top and obviously a single phase. In the interFoam run the moving wall at the left seems to stay put. Also I don't get any pointMotionU and cellMotionU in the output directories for t>0.
Any suggestion ? I am running the standard OF 1.4 binary distribution.
Best regards
Luca Liberti

musahossein August 13, 2008 11:36

Gentlemen: I am newbie to o
 
Gentlemen:

I am newbie to openFoam and tyring to figure out how to model sloshing in a tank. I see there has been a good amount of discussion on this topic. However I was unable to download or open the trz files by Eugene De Villers to look at the BC conditions proposed by him and apparently used by others on this forum. I would appreciate it very much if anyone tell me how to download this file.

http://www.cfd-online.com/cgi-bin/Op...3236#POST13236

musahossein August 13, 2008 12:31

I tried to play the mpg files
 
I tried to play the mpg files in the following link posted in the following link. But Kaffiene in SuSe linux wont open it. Does anyone know whether there are patches avaiable to fix this? Thanks.

http://www.cfd-online.com/cgi-bin/Op...3243#POST13243

eugene August 15, 2008 05:22

Right-click, save-as. Then cha
 
Right-click, save-as. Then change the extensions from "-4256.unk" to ".tgz" before decompressing with this command:

tar xzf <filename>.tgz

However, I suggest you contact Eric to try and get hold of his latest version of this boundary which is much better than my original posting.

ngj September 10, 2008 13:22

Hi all I am currently looki
 
Hi all

I am currently looking into further extending my wave boundary condition to include a sponge layer, so reflected waves does not interact with the wave-maker.

The sponge layer work as follows:

1) Locate cells within the sponge.
2) Remove the reflected part of the velocity/pressure signal through a filtering process with the wanted, i.e. incoming, signal.

The issue is as since the wave generation and the filtering is closely related, I would like to apply the filter from within the boundary condition. I have looked in Doxygen and I have not been able to find a way to access the volFields from a fvPatchField ... all, I have been able to find, return const volField.

If any know how to deal with this, I would be very greatful.

The goal is that everything in connection with the wave generation is lifted out of the solver and into the boundary condition.

Thanks,

Niels

liu September 10, 2008 13:56

You might be interested to see
 
You might be interested to see the waveTransmissive (check the spelling) boundary condition. Essentially, from my understanding, you want a non-reflective BC. This has been discussed sometime ago. I don't know if anybody has come up with a better idea.

ngj September 10, 2008 14:22

Hi Xiaofeng Thanks for the
 
Hi Xiaofeng

Thanks for the suggestion, but the thing is somewhat more complex. If I have a steep sloping bottom or surface piercing objects, which take up a lot of the cross section, my incoming waves will be reflected, such as the standing wave test we discussed some time ago. Thus I want to avoid this reflected wave to hit my wave-inlet boundary.

If I have understood waveTransmissive-BC correct, then it allows a wave to move through, but a combination of wave generation and wave transmission on one patch, is that possible?

Thanks,

Niels

kjmaki September 10, 2008 14:27

Hi Niels, I implemented you
 
Hi Niels,

I implemented your suggestion of a sponge layer into my multiphase solver. I had to modify the solver itself, but I specify the parameters for the beach, namely the strength and starting position, from the same place I specify my wave conditions, in the environmentalProperties dictionary. It was rather painless, and I have been happy with it, though I have not carefully documented its performance.

Thanks for the suggestion at the meeting in Milan!

Kevin

ngj September 11, 2008 03:59

Hi Kevin Glad to hear that
 
Hi Kevin

Glad to hear that you got it workinghttp://www.cfd-online.com/OpenFOAM_D...part/happy.gif

/ Niels

erik023 December 17, 2008 08:43

sorry guys, for this maybe ban
 
sorry guys, for this maybe banal question but i do not get it:

void surfaceWavePhaseFvPatchScalarField::extrapolateGra dient()
{
// const fvPatchField<vector>& gradGamma =
// lookupPatchField<volvectorfield,>("gradGamma");

const Field<vector>& gradGamma = this->patch().lookupPatchField
(
"gradGamma",
reinterpret_cast<const>(NULL),
reinterpret_cast<const>(NULL)
);

scalar alpha = 0.0;
this->refGrad() = this->refGrad()*alpha +
(1-alpha)*(gradGamma.patchInternalField()
& (patch().Sf()/patch().magSf()));

}

however, i get this error: surfaceWaveVelocity/surfaceWaveVelocityFvPatchVectorField.C:83: error: 'lookupPatchField' was not declared in this scope
surfaceWaveVelocity/surfaceWaveVelocityFvPatchVectorField.C:83: error: expected primary-expression before ',' token
surfaceWaveVelocity/surfaceWaveVelocityFvPatchVectorField.C:83: error: expected initializer before '>' token

what to do you think?

as you see i tried to rewrite this to run on 1.5.
any ideas?

kalaim January 27, 2009 07:19

hi friends, I am attempting t
 
hi friends,
I am attempting to model a wave tank . i have applied 2 boundary conditions at free surface (kinematic and dynamic ) ... remaining walls are solid wall boundary conditions . i am doing formulations in FDM by writing the code.

still i am confusing to develope the code further .. Can i get any model code like this problem? please any one here ? ....

kalaim January 27, 2009 07:23

hi friends, I am attempting t
 
hi friends,
I am attempting to model a wave tank . i have applied 2 boundary conditions at free surface (kinematic and dynamic ) ... remaining walls are solid wall boundary conditions . i am doing formulations in FDM by writing the code.

still i am confusing to develope the code further .. Can i get any model code like this problem? please any one here ? ....

egp January 27, 2009 07:48

kalaivani, Don't post the s
 
kalaivani,

Don't post the same question under two threads. You posted it under "Wave Tank" and "Surface Tracking"!

To your question: Explicitly applying KFSBC and DFSBC implies that you want to use a tracking scheme with dynamic mesh, as opposed to a capturing scheme with homogeneous multiphase (such as VOF or level-set). If this is what you want, look at the 1.5-dev version, under applications/solvers/surfaceTracking.

Look for OpenFOAM-1.5-dev out on sourceforge.

gareth__it_power February 16, 2009 08:19

Please could someone direct me
 
Please could someone direct me to somewhere where I can learn how to apply the boundary conditions posted above? I'm quite new to OF, and haven't really got to grips with how to 'compile' new commands/boundary conditions.

I'm only interested in the inlet for now!

Many thanks

Gareth

lukasfischer February 26, 2009 14:06

I am also interested in wave t
 
I am also interested in wave tank modelling and tried a very basic simulation of an OWC chamber with the compressibleLesInterFoam solver. As the reflected waves strongly interfere with my boundaries I would also be happy to have that sponge layer for a wave maker boundary as Kevin Maki and Niels Gjoel Jacobsen discussed. Is the code available somewhere?
Thanks, Lukas.

sxhdhi February 27, 2009 03:26

Hi FOAMers, I am trying an
 
Hi FOAMers,

I am trying an open channel flow case by using InterFOAM. but I am failure with bc setup below.

/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \ / O peration | Version: 1.5 |
| \ / A nd | Web: http://www.OpenFOAM.org |
| \/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object blockMeshDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

convertToMeters 1.0;

vertices
(

(0 0 0) //point0
(20 0 0) //point1
(0 2 0) //point2
(20 2 0) //point3
(0 0 0.1) //point4
(20 0 0.1) //point5
(0 2 0.1) //point6
(20 2 0.1) //point7

);

blocks
(

hex (0 1 3 2 4 5 7 6) (200 20 1) simpleGrading (1 1 1)

);

edges
(
);

patches
(
patch Inlet
(

(0 4 6 2)

)

patch Outlet
(

(1 3 7 5)

)

patch Atmosphere
(

(2 6 7 3)

)
patch Bottom
(

(0 1 5 4)

)
);

mergePatchPairs
(
);

// ************************************************** *********************** //
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \ / O peration | Version: 1.5 |
| \ / A nd | Web: http://www.OpenFOAM.org |
| \/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volVectorField;
location "0";
object U;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

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

internalField uniform (0.1 0 0);

boundaryField
{
Inlet
{
type fixedValue;
value uniform (0.1 0 0);
}
Outlet
{
type zeroGradient;
}
Atmosphere
{
type pressureInletOutletVelocity;
phi phi;
value uniform (0.1 0 0);
}
Bottom
{
type fixedValue;
value uniform (0.1 0 0);
}
defaultFaces
{
type empty;
}
}


// ************************************************** *********************** //
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \ / O peration | Version: 1.5 |
| \ / A nd | Web: http://www.OpenFOAM.org |
| \/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volScalarField;
location "0";
object gamma;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

dimensions [0 0 0 0 0 0 0];

internalField nonuniform List<scalar>
4000
(
1
etcetc
);

boundaryField
{
Inlet
{
type zeroGradient;
}
Outlet
{
type fixedValue;
value nonuniform List<scalar>
20
(
1
1
1
1
1
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
);
}
Atmosphere
{
type inletOutlet;
inletValue uniform 0;
value uniform 0;
}
Bottom
{
type zeroGradient;
}
defaultFaces
{
type empty;
}
}

/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \ / O peration | Version: 1.5 |
| \ / A nd | Web: http://www.OpenFOAM.org |
| \/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volScalarField;
location "0";
object pd;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

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

internalField uniform 0;

boundaryField
{
Inlet
{
type fixedValue;
value uniform 0;
}

Outlet
{
type fixedValue;
value uniform 0;
}
Atmosphere
{
type totalPressure;
U U;
phi phi;
rho none;
psi none;
gamma 1;
p0 uniform 0;
value uniform 0;
}
Bottom
{
type zeroGradient;
}
defaultFaces
{
type empty;
}
}


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

error information is
MULES: Solving for gamma
Liquid phase volume fraction = 0.493981 Min(gamma) = -0.00197787 Max(gamma) = 1
MULES: Solving for gamma
Liquid phase volume fraction = 0.493981 Min(gamma) = -0.00181447 Max(gamma) = 1
DICPCG: Solving for pd, Initial residual = 0.951035, Final residual = 0.0368047, No Iterations 11
DICPCG: Solving for pd, Initial residual = 0.277992, Final residual = 0.00971876, No Iterations 11
DICPCG: Solving for pd, Initial residual = 0.624551, Final residual = 9.92305e-08, No Iterations 51
time step continuity errors : sum local = 1.31837e-09, global = -2.23413e-10, cumulative = 4.58463e-05
ExecutionTime = 5.11 s ClockTime = 11 s

Courant Number mean: 0.00402776 max: 11.3122
#0 Foam::error::printStack(Foam:http://www.cfd-online.com/OpenFOAM_D...part/proud.gifstream&) in "/home/user/OpenFOAM/OpenFOAM-1.5/lib/linuxGccDPOpt/libOpenFOAM.so"
#1 Foam::sigFpe::sigFpeHandler(int) in "/home/user/OpenFOAM/OpenFOAM-1.5/lib/linuxGccDPOpt/libOpenFOAM.so"
#2 Uninterpreted: [0xb7ff5400]
#3 Foam::Time::adjustDeltaT() in "/home/user/OpenFOAM/OpenFOAM-1.5/lib/linuxGccDPOpt/libOpenFOAM.so"
#4 Foam::Time::setDeltaT(double) in "/home/user/OpenFOAM/OpenFOAM-1.5/lib/linuxGccDPOpt/libOpenFOAM.so"
#5 main in "/home/user/OpenFOAM/OpenFOAM-1.5/applications/bin/linuxGccDPOpt/interFoam"
#6 __libc_start_main in "/lib/tls/i686/cmov/libc.so.6"
#7 _start in "/home/user/OpenFOAM/OpenFOAM-1.5/applications/bin/linuxGccDPOpt/interFoam"
Floating point exception

it would be appreciated if anyone can give suggestion, thanks in advance

Su Xiaohui

gareth__it_power February 27, 2009 04:35

Lucas, Su, Have you managed
 
Lucas, Su,

Have you managed to get wave input, or are you using constant velocity input?


All times are GMT -4. The time now is 04:19.