|
[Sponsors] |
April 22, 2022, 13:45 |
|
#21 |
Member
Tony Zhang
Join Date: Nov 2019
Location: soton
Posts: 45
Rep Power: 7 |
Hi Jan,
Thank you for your reply. The calculation is about the ship running in calm water first with a speed of 1.588m/s, then letting the wave encounter the moving ship and the wave speed is 2.602m/s. When I did the simulation, the hull is still while the domain has a speed of 1.588m/s, so I am not sure how to set up when a moving ship encounters the wave. Many thanks and best regards, Tony |
|
April 22, 2022, 13:55 |
|
#22 |
Senior Member
Jan
Join Date: Jul 2009
Location: Hamburg
Posts: 144
Rep Power: 20 |
Hi Tony, sorry but I still don't understand what you mean with wave velocity. The ship is still sailing with 1.588 m/s?
The orbital velocities of the wave results from the wave length. |
|
April 22, 2022, 16:24 |
|
#23 | |
Member
Tony Zhang
Join Date: Nov 2019
Location: soton
Posts: 45
Rep Power: 7 |
Quote:
Yes, the ship is still sailing at 1.588m/s. Like in the towing tank test, the ship is towed by the carriage and the speed is 1.588m/s. The wave generator can generate the wave from one end of the towing tank. The wave condition is wavelength=4.338m, wave frequency=0.60Hz, wave period=1.667s, wave speed=2.602m/s, wave amplitude=0.038m. My current simulation seems the wave has been generated at t=0, which I can see from the paraview when I generate the free surface contour. I am thinking about how to make the wave start from the inlet and encounter the moving ship, is this possible? Many thanks, Tony |
||
April 25, 2022, 12:20 |
|
#24 | |
Senior Member
Jan
Join Date: Jul 2009
Location: Hamburg
Posts: 144
Rep Power: 20 |
Quote:
Ok, understand. Assuming your ship is sailing in positive x-direction and the waves approaching from the inlet (i. e. head waves) towards the ship, then you should set: Code:
UMean to (-1.588 0 0); direction (-1 0 0); The wave is always generated at the inlet, and then travels through the domain. If you look at the free surface elevation at t=0, this is the result from the initialization with setWaves. If you want to have the wave crest at t=0 at any other postion, you can change the origin of the wave coordinate system. Have a look at the DTCHullWave tutorial. There the ship sails with 1.668 m/s through head waves. Hope this helps, Jan |
||
April 25, 2022, 12:51 |
|
#25 | |
Member
Tony Zhang
Join Date: Nov 2019
Location: soton
Posts: 45
Rep Power: 7 |
Quote:
Many thanks for your detailed reply. I think now I know how to setup the ship speed and for wave, just set wavelength, wave height, phase, angle rather than wave velocity. But I am confused about the scale table in waveProperties file. I have attached my waveProerties file and also the free surface contours. You can see wave is there at t=0. but the simulation starts, there seems no wave, I dont know why, maybe the wrong setup in that scale table. And my domain ranges from -9.5 to +9 in x-direction. Thus I think I need to make sure the scale is 1 when x<9m, thats the reason why I set (10,1) (20,0). Please correct me if I am wrong. Code:
/*--------------------------------*- C++ -*----------------------------------*\ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org \\ / A nd | Version: 7 \\/ M anipulation | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class dictionary; location "constant"; object waveProperties; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // origin (0 0 0.1772); direction (-1 0 0); speed 1.588; waves ( Stokes2 { length 2.455; amplitude 0.019; phase 0; angle 0; } ); UxMean -1.958; UMean ($UxMean 0 0); scale table ((10 1) (20 0)); // ************************************************************************* // Many thanks for your help and best regards, Tony |
||
April 25, 2022, 13:10 |
|
#26 |
Senior Member
Jan
Join Date: Jul 2009
Location: Hamburg
Posts: 144
Rep Power: 20 |
When I remember correctly, the scale is calclulated with reference to the wave coordinate system. So, if you want the scaling to be effective behind your ship, you should habe something similar as in the tutorial, e.g. :
Code:
scale table ((2 1) (9 0)); But from the contour plots you have shown, it seems there is something other going wrong. Do you specifiy some damping in the fvModels file? |
|
April 25, 2022, 13:23 |
|
#27 | |
Member
Tony Zhang
Join Date: Nov 2019
Location: soton
Posts: 45
Rep Power: 7 |
Quote:
Many thanks for your quick reply. I will try to resetup the waveProperties and see how it is going. I am not sure about the fvModels file, I dont think I have that file in my case. I am using OpenFOAM version 7 now. The ship is free to heave and pitch and I setup the damping restraints in dynamicMeshDict file according to DTCHullMoving tutorial. I also attached the fvsolution file, please have a look: Code:
/*--------------------------------*- C++ -*----------------------------------*\ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org \\ / A nd | Version: 7 \\/ M anipulation | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class dictionary; location "system"; object fvSolution; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // solvers { "alpha.water.*" { nAlphaCorr 3; nAlphaSubCycles 1; cAlpha 1; icAlpha 0; MULESCorr yes; nLimiterIter 15; alphaApplyPrevCorr yes; solver smoothSolver; smoother symGaussSeidel; tolerance 1e-10; relTol 0; minIter 1; } "pcorr.*" { solver GAMG; smoother DIC; tolerance 1e-3; relTol 0; }; p_rgh { solver GAMG; smoother DIC; tolerance 5e-8; relTol 0; }; p_rghFinal { $p_rgh; relTol 0; } "(U|k|omega).*" { solver smoothSolver; smoother symGaussSeidel; nSweeps 1; tolerance 1e-7; relTol 0; minIter 1; }; } PIMPLE { momentumPredictor no; nOuterCorrectors 3; nCorrectors 1; nNonOrthogonalCorrectors 0; correctPhi yes; moveMeshOuterCorrectors yes; turbOnFinalIterOnly yes; } relaxationFactors { equations { ".*" 1; } } cache { grad(U); } // ************************************************************************* // Tony |
||
April 25, 2022, 13:51 |
|
#28 |
Senior Member
Jan
Join Date: Jul 2009
Location: Hamburg
Posts: 144
Rep Power: 20 |
with damping I mean some kind of source term, which enforces the velocity field to some defined value. This can be used to damp out reflections, which otherwise lead to unphysiclly oscillating forces. I think in Version7 this can be defined in fvOptions. Or if you dont have one, there must be some other reason why your waves are vanishing. May you mesh is way too coarse..
|
|
May 3, 2022, 12:25 |
|
#29 | |
Member
Tony Zhang
Join Date: Nov 2019
Location: soton
Posts: 45
Rep Power: 7 |
Quote:
Hope you are doing well. Based on your suggestion, I have reduced the distance between the inlet and the ship bow, also refine the mesh around the bow and inlet. Now the wave seems working, please have a look at the attached free surface contours. Also, I changed the deltaT to 0.0001 from 0.01, this setting is based on the DTCHullWave tutorial. But smaller delta T means longer simulation time, I am not sure whether different values of delta T will make a difference to the results? Many thanks for your help as always, Best regards, Tony |
||
May 6, 2022, 04:46 |
|
#30 |
Senior Member
Jan
Join Date: Jul 2009
Location: Hamburg
Posts: 144
Rep Power: 20 |
Hi Tony,
good to see that you are making progress. Just be careful not to have your inlet too close to the ship in order to avoid influence of the boundary conditions on the result. Regarding you question on time step size: in general smaller time step will give better results, as the temporal discretization error is reduced. Similar as reducing spatial discretization error by refining the mesh. But as you said, with smaller time step the simulation time increases. Therefore you need to find a good compromise between accuracy and efficiency. If you are using Euler as ddt scheme, you can also try to use a higher order scheme instead, i.e. Crank-Nicholson. Best, Jan |
|
August 10, 2023, 02:25 |
what's the angle in waveProperties?
|
#31 |
New Member
Zicheng Li
Join Date: Dec 2019
Posts: 8
Rep Power: 7 |
Can anyone tell me what the angle in waveProperties means?
HTML Code:
waves ( Stokes2 { length 3; amplitude 0.04; phase 0; [U] angle 0;[/U] } ); |
|
August 14, 2023, 05:49 |
|
#32 |
Senior Member
Jan
Join Date: Jul 2009
Location: Hamburg
Posts: 144
Rep Power: 20 |
This is the angle relative to the
Code:
direction |
|
September 12, 2023, 18:42 |
Total displacement of the water when created a wave
|
#33 |
New Member
Sarah Aguiar
Join Date: Sep 2023
Posts: 10
Rep Power: 3 |
Hey everyone, I'm in a bit of a situation now. I created a mesh using blockmesh and basewaveflume tutorial like base, BUT my simulation goes crazy, it's like the wave created displace all the water of the ocean and become a tsuname. I'm sending the pics so you guys can understand better. I'm putting below my wave dict, fvschemes, and fvsolution here.
Dis you guys already saw something like this? Can help me or give me any tips? Thanks in advance. FVSCHEMES /*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: 2.3.0 | | \\ / A nd | Web: www.OpenFOAM.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class dictionary; location "system"; object fvSchemes; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // ddtSchemes { default Euler; } gradSchemes { default Gauss linear; } divSchemes { div(rhoPhi,U) Gauss limitedLinearV 1; div(U) Gauss linear; div((rhoPhi|interpolate(porosity)),U) Gauss upwind 1; div(rhoPhiPor,UPor) Gauss upwind 1; div(rhoPhi,UPor) Gauss upwind 1; div(rhoPhiPor,U) Gauss upwind 1; div(phi,alpha) Gauss vanLeer; div(phirb,alpha) Gauss interfaceCompression; div((muEff*dev(T(grad(U))))) Gauss linear; div(phi,k) Gauss upwind; div(phi,epsilon) Gauss upwind; div((phi|interpolate(porosity)),k) Gauss upwind; div((phi|interpolate(porosity)),epsilon) Gauss upwind; div(phi,omega) Gauss upwind; div((phi|interpolate(porosity)),omega) Gauss upwind; } laplacianSchemes { default Gauss linear corrected; } interpolationSchemes { default linear; } snGradSchemes { default corrected; } fluxRequired { default no; p_rgh; pcorr; alpha.water; } // ************************************************** *********************** // FVSOLUTION /*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: 2.3.0 | | \\ / A nd | Web: www.OpenFOAM.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class dictionary; location "system"; object fvSolution; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // solvers { "alpha.water.*" { nAlphaCorr 1; nAlphaSubCycles 2; alphaOuterCorrectors yes; cAlpha 1; MULESCorr no; nLimiterIter 3; solver PCG; preconditioner DIC; tolerance 1e-07; relTol 0.05; } "pcorr.*" { solver PCG; preconditioner DIC; tolerance 1e-5; relTol 0; } p_rgh { solver PCG; preconditioner DIC; tolerance 1e-07; relTol 0.05; } p_rghFinal { $p_rgh; relTol 0; } U { solver PCG; preconditioner DIC; tolerance 1e-07; relTol 0.05; } } PIMPLE { momentumPredictor no; nOuterCorrectors 1; nCorrectors 3; nNonOrthogonalCorrectors 0; } relaxationFactors { fields { } equations { ".*" 1; } } // ************************************************** *********************** // WAVE DICT /*---------------------------------------------------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: 1.3 | | \\ / A nd | Web: http://www.openfoam.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class dictionary; location "constant"; object waveDict; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // waveType regular; waveTheory StokesII; genAbs 1; absDir 0.0; nPaddles 1; waveHeight 1.0; wavePeriod 4.05; waveDir 0.0; wavePhase 1.57079633; // Change both entries to true to re-read this dictionary upon restart. rereadAlpha false; rereadU false; // ************************************************** *********************** // |
|
December 6, 2023, 08:05 |
|
#34 | |
New Member
Ali Burhan
Join Date: Apr 2017
Location: İstanbul
Posts: 13
Rep Power: 9 |
Hello everyone,
What exactly the "phase" in waveProperties file? Does that mean phase shift in Stokes 2 formula? Quote:
|
||
December 7, 2023, 05:10 |
|
#35 |
Senior Member
Jan
Join Date: Jul 2009
Location: Hamburg
Posts: 144
Rep Power: 20 |
yes. With the phase entry you can controll the "position" of the wave (crest and trough) relative to space and time of your reference system. Time is the simulation time and space the wave coordinate system defined with the origin entry in the waveProperties file.
|
|
December 7, 2023, 05:13 |
|
#36 |
Senior Member
Jan
Join Date: Jul 2009
Location: Hamburg
Posts: 144
Rep Power: 20 |
you can easily check by specifiying an arbitrary phase angle (e.g. 0.5 pi), initialize with setWaves and vizualize the resulting wave.
|
|
Tags |
openfoam 5.0, speed, wave boundary conditions |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
need tutorial files(Simulation of Wave Generation in a Tank) | gholamghar | FLUENT | 45 | May 6, 2018 11:57 |
[Virtualization] OpenFOAM oriented tutorial on using VMware Player - support thread | wyldckat | OpenFOAM Installation | 2 | July 11, 2012 17:01 |
How to generate waves of particular wave height...please help | nims | FLUENT | 0 | September 21, 2010 03:48 |
Scaling up a wave energy converter - free surface flow | mark_l | CFX | 3 | February 17, 2010 17:57 |
need tutorial files(Simulation of Wave Generation in a Tank) | gholamghar | FLUENT | 0 | March 28, 2009 04:08 |