|
[Sponsors] |
[waves2Foam] How to use stream function wave theory |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
November 29, 2016, 10:35 |
How to use stream function wave theory
|
#1 |
New Member
Wang Xi
Join Date: Nov 2016
Location: Delft
Posts: 2
Rep Power: 0 |
Hi all, I met some problems when I was trying to use stream function wave theory into my case.
First I run generateStreamFile.m and put the result into waveProperties.input. But when I run setWaveParameters, it shows that keyword height is undefined in dictionary "/home/wxi/OpenFOAM/wxi-2.4.0/applications/utilities/waves2Foam/tutorials/mycase/real/3.validate/validatestream/constant/waveProperties.input.inletCoeffs" Then I add the wave height into waveProperties.input and run it, it shows keyword specifyPeriod is undefined in dictionary "/home/wxi/OpenFOAM/wxi-2.4.0/applications/utilities/waves2Foam/tutorials/mycase/real/3.validate/validatestream/constant/waveProperties.input.inletCoeffs" In generateStreamFile.m, I set 'H=0.12,h=0.6,T=0.8,uEors=0,EorS=0,N=15' In waveProperties.input : seaLevel 0.0; relaxationNames ( inlet outlet ); initializationName outlet; inletCoeffs { waveType streamFunction; N 15; depth 0.600000; omega 7.853982; phi 0.000000; waveNumber (5.622357 0.0 0.0); uBar 1.39692; A nonuniform List<scalar> 15 ( 0.056124 0.0108254 0.00326968 0.0011939 0.000483655 0.000209166 9.46084e-05 4.42151e-05 2.11873e-05 1.03602e-05 5.16046e-06 2.63074e-06 1.40627e-06 8.53606e-07 3.47706e-07 ); B nonuniform List<scalar> 15 ( 0.408132 0.0186686 0.00260019 0.000466129 8.11037e-05 1.51577e-05 2.88303e-06 5.59405e-07 1.10116e-07 2.19105e-08 4.39949e-09 8.90332e-10 1.82825e-10 3.86484e-11 7.43894e-12 ); relaxationZone { relaxationScheme Spatial; relaxationShape Rectangular; beachType Empty; relaxType INLET; startX ( -8 0 0 ); endX ( 0 0 0.1 ); orientation ( 1 0 0 ); } } outletCoeffs { waveType potentialCurrent; U ( 0 0 0 ); Tsoft 2; relaxationZone { relaxationScheme Spatial; relaxationShape Rectangular; beachType Empty; relaxType OUTLET; startX ( 10 0 0 ); endX ( 18 0 0.1 ); orientation ( 1 0 0 ); } } I don't know how to solve it. Anyone can help? Thanks a lot! |
|
November 29, 2016, 15:36 |
|
#2 |
Senior Member
Niels Gjoel Jacobsen
Join Date: Mar 2009
Location: Copenhagen, Denmark
Posts: 1,900
Rep Power: 37 |
Hi Wang,
You do not need to use the matlab script any longer. Stream function waves are now supported directly with setWaveParameters as of the 19th of May 2016. See https://openfoamwiki.net/index.php/C..._.28History.29 Kind regards, Niels
__________________
Please note that I do not use the Friend-feature, so do not be offended, if I do not accept a request. |
|
November 29, 2016, 16:42 |
|
#3 |
New Member
Wang Xi
Join Date: Nov 2016
Location: Delft
Posts: 2
Rep Power: 0 |
Hi Niels,
Many thanks for reply. For using setWaveParameters, I am wondering which parameters should be set under inletcoeffs or do I still need to fill the parameters shown below, and how to setl uBar, A, B? +++ Example - setWaveParameters +++ // Currently not working +++ Example - Running +++ waveType streamFunction; omega <scalar>; depth <scalar>; phi <scalar>; waveNumber <vector>; uBar <scalar>; N <scalar>; A <scalarField>; B <scalarField>; Tsoft <scalar>; // Not required Tstart <scalar>; // Not required (Default 0.0); Tend <scalar>; // Not required (Default GREAT); Thanks again! |
|
November 30, 2016, 12:50 |
|
#4 |
Senior Member
Niels Gjoel Jacobsen
Join Date: Mar 2009
Location: Copenhagen, Denmark
Posts: 1,900
Rep Power: 37 |
Good evening,
@Wang: Merely step through a couple of time iterations and provide iteratively the information that setWaveParameters request. The WIKI is not up to date in terms of the streamFunction wave. If you want, I would be happy if you could improve the WIKI for the streamFunction description. Kind regards, Niels
__________________
Please note that I do not use the Friend-feature, so do not be offended, if I do not accept a request. Last edited by wyldckat; August 25, 2018 at 07:30. Reason: removed answers to other posts that were on the main thread |
|
May 27, 2020, 10:03 |
|
#5 |
New Member
Michiel Bots
Join Date: Jan 2020
Posts: 9
Rep Power: 6 |
Hi Niels,
I am trying to generate a wave using the streamFunction at the inlet and potentialCurrent with zero velocity at the outlet. However, I can't manage to generate any waves while using both streamFunction and potentialCurrent. When I use streamFunction at both inlet and outlet, everything seems to work fine. Do you have any idea what could be causing this? Thank you your help! Michiel Code:
seaLevel 0; seaLevelAsReference true; // A list of the relaxation zones in the simulation. The parameters are given // in <name>Coeffs below. relaxationNames (inlet outlet); initializationName outlet; inletCoeffs { waveType streamFunction; specifyPeriod true; specifyEuler false; stokesVelocity 0; N 32; Niter 8; Tsoft 1.2; depth 0.4; period 1.2; phi 4.20156075; direction (1.0 0.0 0.0); height 0.06; relaxationZone { relaxationScheme Spatial; relaxationShape Rectangular; beachType Empty; relaxType INLET; startX ( -6 1.125 -1.3 ); endX ( -3.7 -0.375 1.3 ); orientation ( 1 0 0 ); } }; outletCoeffs { waveType potentialCurrent; U ( 0 0 0 ); Tsoft 1.2; // waveType streamFunction; // specifyPeriod true; // specifyEuler false; // stokesVelocity 0; // N 32; // Niter 8; // Tsoft 0; // depth 0.4; // period 1.2; // phi 4.20156075; // direction (1.0 0.0 0.0); // height 0.06; relaxationZone { relaxationScheme Spatial; relaxationShape Rectangular; beachType Empty; relaxType OUTLET; startX ( 9.7 1.125 -1.3 ); endX ( 12 -0.375 1.3 ); orientation ( 1 0 0 ); } }; // ************************************************************************* // |
|
May 27, 2020, 11:00 |
|
#6 |
Senior Member
Niels Gjoel Jacobsen
Join Date: Mar 2009
Location: Copenhagen, Denmark
Posts: 1,900
Rep Power: 37 |
Hi Michiel,
I have done similar things many times, so it should work. I cannot spot any flaws in your waveProperties.input file. One thing is that you should watch out for the definition of the relaxation zone, which should be defined in the horizontal plane only. Try to run relaxationZoneLayout tool on your setup to verify that you are content with the relaxationZone definition. Kind regards Niels
__________________
Please note that I do not use the Friend-feature, so do not be offended, if I do not accept a request. |
|
May 28, 2020, 06:13 |
|
#7 |
New Member
Michiel Bots
Join Date: Jan 2020
Posts: 9
Rep Power: 6 |
Hi Niels,
Thank you very much for your response. The layout of the relaxation zone seems fine to me, I visualized it in Paraview (see attached figure). weight.PNG alphawater.PNG relaxZone.PNG The waves move along the x-axis and the gravity works along the y-axis. I've also tried running a case that worked with both streamFunction and potentialCurrent before. However, when I run it, it doesn't work. Could there be something wrong with the installation? Michiel |
|
May 28, 2020, 08:32 |
|
#8 |
New Member
Michiel Bots
Join Date: Jan 2020
Posts: 9
Rep Power: 6 |
Hi Niels,
Just to be sure, I just studied the manual again and I found the section about 'combined waves': combinedwaves.PNG I guess you only have to use 'combined waves' if you want to apply two wave theories to the same relaxation zone, right? Michiel PS:An update, I've adjusted the waveFlume tutorial to use the streamFunction (inlet) and potentialCurrent (outlet, zero velocity). I used both the waveFoam and the waveDyMFoam solver to run this case. When using the waveFoam solver everything goes fine; the waves are generated properly and they also dampen out in the outlet. However, when using the waveDyMFoam solver the waves are generted properly, but they do not dampen out in the outlet. Do you think this might be an indication for the waveDyMFoam solver being not properly compiled? Last edited by mbots; May 28, 2020 at 09:56. |
|
May 28, 2020, 12:10 |
|
#9 |
Senior Member
Niels Gjoel Jacobsen
Join Date: Mar 2009
Location: Copenhagen, Denmark
Posts: 1,900
Rep Power: 37 |
Hi Michiel,
I would guess that you have not generated your waveDyMFoam solver correctly. Make sure that the statement 'relaxation.correct();' (or similar, please check waveFoam) is not missing. Kind regards Niels
__________________
Please note that I do not use the Friend-feature, so do not be offended, if I do not accept a request. |
|
May 29, 2020, 07:11 |
|
#10 |
New Member
Michiel Bots
Join Date: Jan 2020
Posts: 9
Rep Power: 6 |
Hi Niels,
Thank you very much! With your suggestion, I managed to solve the issue For other users that might run into a similar issue, I will describe what I did exactly below, using OpenFOAM version 1606+. Best regards, Michiel 1. Go to the .../solvers/solvers1606_PLUS/waveFoam folder run the command 'wclean'. Do the same in the folder .../solvers/solvers1606_PLUS/waveFoam/waveDyMFoam. 2. Make sure that you've sourced waves2Foam. In order to do so go to the folder .../applications/utilities/waves2Foam and in this folder run the command: source ./bin/bashrc 3. Return to the folder .../solvers/solvers1606_PLUS/waveFoam/waveDyMFoam in the file waveDyMFoam.C add the line 'relaxing.correct();', like below: Code:
#include "alphaControls.H" #include "alphaEqnSubCycle.H" // include here relaxing.correct() like in waveFoam.C relaxing.correct(); mixture.correct(); #include "UEqn.H" Now the relaxation zones should work fine. You can check this by running the waveFlume tutorial using the waveDyMFoam solver instead of the waveFoam solver (adjust the Allrun file accordingly). |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
foamToTecplot360 | thomasduerr | OpenFOAM Post-Processing | 121 | June 11, 2021 10:05 |
[swak4Foam] installation problem with version 0.2.3 | Claudio87 | OpenFOAM Community Contributions | 9 | May 8, 2013 10:20 |
[blockMesh] non-orthogonal faces and incorrect orientation? | nennbs | OpenFOAM Meshing & Mesh Conversion | 7 | April 17, 2013 05:42 |
latest OpenFOAM-1.6.x from git failed to compile | phsieh2005 | OpenFOAM Bugs | 25 | February 9, 2010 04:37 |
Version 15 on Mac OS X | gschaider | OpenFOAM Installation | 113 | December 2, 2009 10:23 |