|
[Sponsors] |
May 30, 2013, 09:03 |
Tweaks to waves2foam
|
#401 |
Member
Dennis Kingsley
Join Date: Mar 2009
Location: USA
Posts: 45
Rep Power: 17 |
Niels,
I have made some tweaks to the build scripts to allow the top level Allwmake script set the location of the GSL includes and libs, and the location to install the waves2foam libs and applications. I routinely have to change both of these when I build a new version for our cluster. While I was at it, I updated the solver220 for the head of the OF2.2.x git trunk and included the waveDyMFoam while I was at it. The top level Allwmake also was modified to build waveDyMFoam when building for 220. I plan on having Kevin create 2d and 3d tutorials for a floating object when I can free him up from his current projects. I have attached a patch file for these changes. Let me know if you are willing to accept these proposed changes. regards, Dennis |
|
May 30, 2013, 13:50 |
|
#402 |
Senior Member
Niels Gjoel Jacobsen
Join Date: Mar 2009
Location: Copenhagen, Denmark
Posts: 1,903
Rep Power: 37 |
Hi Dennis,
Thanks a lot; the already posted and coming contributions are greatly appreciated. I am currently without my "waves2Foam" computer and also without access to the SVN (still), though I will make sure that these contributions are added in the next release. The date for the next release, however, is a bit uncertain, as it depends on when the shipping company finds its way to my new home Sincerely, Niels |
|
May 31, 2013, 00:46 |
|
#403 |
New Member
Hf
Join Date: Nov 2012
Posts: 29
Rep Power: 14 |
Hi Niels,
As I still struggle with the breaking wave problem, I have two questions about wave2Foam:
|
|
June 1, 2013, 05:56 |
|
#404 |
Senior Member
Niels Gjoel Jacobsen
Join Date: Mar 2009
Location: Copenhagen, Denmark
Posts: 1,903
Rep Power: 37 |
Hi Jason,
For a large number of cells GAMG will outperform PCG, and furthermore I have once been told that PCG is not well suited for parallel computing (only statement from my part, as I do not know for certain). For small meshes you will find that PCG is faster than GAMG, however, then the speed hardly matters. With respect to wind, then I really do not know anything about that. I can only advice you to test it. Only reason for the addition of the wind vector was due to requests from people doing moving ships in a translated coordinate system. Kind regards Niels |
|
June 2, 2013, 08:11 |
Effect of temporal schemes in waveFlume tutorial and steepness limitations
|
#405 |
New Member
Agnimitro Chakrabarti
Join Date: Mar 2012
Location: Louisiana, USA
Posts: 6
Rep Power: 14 |
Hi Niels,
First of all thank you for such a wonderful (and easy to use!) wave generation and absorption toolbox, it has made life so easy for us fellow coastal engineers! I really appreciate your continuous effort in helping everyone out through this forum and for painstakingly answering each and everyone's questions. I have been using your toolbox for about a couple of months now and my ultimate research goal is to use it for fluid structure interaction, particularly to study wave dissipation and resulting turbulence generation through coastal vegetation. Since I am interested in simulations based on laboratory scale flumes I started with the waveFlume tutorial and was doing some sensitivity analysis with a bunch of different parameters (resolution, PCG/GAMG pressure solvers, convection and temporal schemes, alpha schemes, turbulence models, Co number, length of relaxation zone, type of relaxation i.e, exponential/free poly/3rd order poly, wave steepness, Ursell number, etc) and happened to stumble upon a phenomenon where there is an un-physical growth of wave height as the waves propagate through the domain in the cases when any of the OF temporal scheme other than the Euler is used (Fig. 1 in attachment). It appears that the extra diffusion due to its first order nature balances whatever is causing the growth. Also noticeable is the standing wave signature when Crank Nicholson/backward is used with reducing 'phi' values for CN yielding better and better results due to progression towards pure Euler. Pure CN (phi = 1) appears to be unstable as the simulation blows up a little after 4.5s. Regarding the sponge layer relaxation technique the free polynomial performs marginally better in reducing the standing wave problem (with increasing exponents till about 6 giving good results). Why this bothers me is that a first order in time will be too diffusive for LES models and since my final goal is to use LES to study fluid structure interactions I am wandering whether waveFoam will be accurate for LES applications. I did not find any second order temporal schemes in any of the available waveFoam tutorials and was wandering if you could provide some insights into this wave height growth or point out to me if I am missing something. I am also not sure if this is a VOF-MULES thing as I did not find any of the interFoam tutorials also using anything other than a Euler. May be OpenFOAM VOF experts working in fields other than waves can also comment on this or provide me with a reference which gives an idea why MULES should be unstable with a second order in time scheme. I also tested a bunch of different wave cases (all using the streamFunction theory) with the goal of understanding any limitations as to steepness and Ursell number. I found that steepness of > 0.05 causes instability in the free surface and the waves lose their monochromatic nature (Fig 2, all cases have T=0.75s, h=0.3m with at least 6 cells/wave ht) and this also corroborates the findings of Afshar (2010)*. If I understand correctly in the thesis one of the causes was attributed to the un-physical high velocities in the air phase just at the interface. I used the technique as in Patterson (2008)** to take convection out of the air phase but it appears to have no effect on the weird behaviour (only benefit is the time stepping and somewhat reduced computation time). Inspection of the spectra suggest (Figs. 4 & 6) that the interaction among the higher harmonics for >0.05 steepness waves increase rapidly as waves exit the inlet sponge and progress towards the sponge layer. The Ursell number seems to have almost no effect (provided the boundary inlet wave is of sufficiently high streamFunction order) so long the steepness is less than 0.05. I wanted to know whether you have faced similar problems during your runs and if yes if you found a solution to it. The sample case files are attached (Btw I am using waveFoam with OF 2.1.x). If you need the full dataset and all the files please let me know I will email you the link. Thank you once again for such a wonderful tool and wishing you all the very best for the continued development of the open-source CFD community. *M.A. Afshar (2010), Numerical Wave Generation in OpenFOAM, M.S. Thesis, Chalmers Univ. Technology. **E. Paterson (2008), Multiphase and free surface flow simulations, Third OpenFOAM workshop, Pollitecnico di Milano, Milan, Italy. |
|
June 2, 2013, 15:38 |
|
#406 |
Senior Member
Niels Gjoel Jacobsen
Join Date: Mar 2009
Location: Copenhagen, Denmark
Posts: 1,903
Rep Power: 37 |
Hi Agnimitro,
A warm welcome to the forum. I will try to address your two main questions namely (i) higher order time stepping and (ii) steepness of the waves individually. However, first let me thank you for the analyses that you have performed, as it does reflect a lot of the issues in terms of VOF and waves. ad. i: If you look into my PhD-thesis ([1]) I considered the Beji and Battjes experiment over a submerged bar; a test case, which has recently been added due to a kind contribution from Jorge Cadelho. Here I considered the effect of using either implicit Euler or Crank-Nicholson time integration and I found a considerable improvement in the predictions by using Crank-Nicholson. But, but and but! The CN time integration scheme was not the native scheme in OF, since I have never quite understood how the Crank-Nicholson was defined over three (3) time steps, since the ddt0(rho,U) terms are stored and used for the time integration. The solution to be revealed below. I has occurred to me at this instance (incorrectly?) that the second order time integration schemes in OF assumes constant time steps, however, most often variable time steps are used for VOF-simulations. At least I derived the third order explicit Adam-Bashforth time integration for variable time steps once, and the coefficients became exceptionally ugly, and I do not recall seeing such ugliness in the OF-source. If I used the AB3 with variable time steps under the assumption that I could use the constant time step formulation did give mass conservation errors. Sorry, rambling a bit. The solution was to follow the Ferziger and Peric book and simply define the CN directly based on two time instances. This is done by correcting the implicit terms, e.g. convection, from Code:
fmv::div(rhoPhi,U) Code:
0.5 * fvm::div(rhoPhi,U) + 0.5 * fvc::div(rhoPhi,U) ad. ii: Please read our journal article, which accompanied the release of waves2Foam. Here, you will see a nice example on the effect of cell aspect ratio on the stability of the interface. Also, as an interesting analysis see Ed Ransley's et al. poster ([2]), where they found that it is much faster to reach convergence, if you use an aspect ratio of 1 around the free surface. I hope that this has answered some of your questions and that you will be able to progress from here. Kind regards Niels [1]: http://orbit.dtu.dk/en/publications/...b7ff01%29.html [2]: http://www.google.nl/url?q=http://ww...6faml3SrlMqesw |
|
June 3, 2013, 07:37 |
creating a new wave theory
|
#407 |
Member
Ed Ransley
Join Date: Jul 2012
Posts: 30
Rep Power: 14 |
Dear all,
Hi Niels, waves2Foam continues to be an excellent tool for my studies. I'm currently trying to create a new wave theory to generate focused waves with a second order correction. I'm not familiar with C++ and have done little programming in the past. I've come across the newWaveTheory files in the waveTheories directory, can these be used to generate a new theory easily or should I make a copy of an existing theory, modify it and recompile. Would I have to recompile the whole of waves2foam? Is there any documentation or tutorials on how to generate a new wave theory? Thanks a lot. Ed Ransley |
|
June 3, 2013, 13:48 |
|
#408 |
Senior Member
Niels Gjoel Jacobsen
Join Date: Mar 2009
Location: Copenhagen, Denmark
Posts: 1,903
Rep Power: 37 |
Hi Ed,
No, the newWaveTheory.C is a runTime selection method, which allows you to specify the wave theories in a dictionary by a type name. Furthermore, at the moment there are no tutorial in creating a new wave theory, however, please fill the gaps on the Wiki, if you are so kind. For a new wave theory merely choose any of the wave theories and fill out the functions with the correct algebraic functions, e.g. stokesFirst.[C,H], and remember to change to class name throughout. Since you are doing second order focused waves, I suspect that you will find the bichromaticSecond.[C,H] interesting, simply because the transfer functions for the super- and subharmonics are implemented (for two waves). However, if you consider the second order irregular wave description by Fuhrman and Madsen (or is it Madsen and Fuhrman?), then the transfer functions are the same. Kind regards Niels |
|
June 4, 2013, 03:25 |
Re: Effect of temporal schemes in waveFlume tutorial and steepness limitations
|
#409 |
New Member
Agnimitro Chakrabarti
Join Date: Mar 2012
Location: Louisiana, USA
Posts: 6
Rep Power: 14 |
Hi Niels,
Thanks a lot for your most informative answers and the piece of code. Here is a follow up of our previous discussion: (i) Higher order time stepping: I have read your PhD dissertation and have found it extremely instructive. When you mentioned the submerged breaker bar test case from Jorge Cadelho, is that a tutorial that has been recently added to the toolbox? I could not find it in the package that is on the Contrib/waves2Foam website. Is it on a different branch, if so can you forward me the link? I too have been confused with the 3 level times for Crank Nicholson and was one of the reasons I avoided it till now. From my LES experiments for various types of flow around cylinders (for both constant and variable time steps) I have always found the backward scheme better than Crank Nicholson (ph=1, i.e., pure) (and of course Euler) in prediction of turbulence quantities for 0.1< Co < 0.3 and below 0.1 I found them to be of similar accuracy when used with a limited central difference scheme for the convection, however the stability of CN is notoriously bad for high Re, strong boundary layer separation problems. For the present problem I did a few more tests to find out the effect of constant time stepping and also the traditional CN formulation you mentioned. Constant time stepping does not seem to cure the problem though it betters the results slightly (attached Fig. 8). The traditional CN as the way you mentioned indeed gives excellent results and even removes the diffusion in Euler. I went ahead and experimented by adding a little more of the explicit contribution and the balance of 0.2*fvm + 0.8*fvc seems to be just about right with almost no diffusion yet maintaining stability. (ii) Steepness of the waves individually: Yes I have read the paper that accompanied the toolbox and carefully kept the aspect ratio to 1:1 for the experiments in Fig. 2 in my previous post. Ed Ransley's poster was a new one for me and thank you very much for that, it will help me when I run my full 3D runs. As very rightly pointed out by you AR of anything more than 1:1.5 affects the accuracy quite a bit. The best we can do is at most have 1:3 in the first half of inlet sponge and also the last half of the outlet sponge (where the solution is any way influenced much more by the imposed boundary condition inherent in the relaxation function). However this does not seem to be much help with the high steepness problem and though I can avoid simulating steep waves now I will keep looking for a solution and let you know if I find anything useful. If there is anything else that strikes you that might be a cure pls let me know. Thanks a lot again for your invaluable tips. Pls let me know if you need any help and wish you a very nice day. |
|
June 4, 2013, 12:28 |
|
#410 |
Senior Member
Niels Gjoel Jacobsen
Join Date: Mar 2009
Location: Copenhagen, Denmark
Posts: 1,903
Rep Power: 37 |
Hi Agnimitro,
It is good that you got it working. Have you tried in the interval between implicit Euler and CN rather than the interval between explicit Euler and CN (of course, in this terminology disregarding the diffusion term)? What about fully explicit? Isn't that what is called deferred correction or something and used previously? With respect to the test case, then I uploaded a new tar on www.student.dtu.dk/~ngja on the 25th of May, and it is available in this. Thanks for your offer to help, and as always I kindly accept other wave theories to add to the library, but besides that we are currently at a state, where it is mostly small maintenance tasks, unless you have some good ideas? As you might have seen above in an old post in this thread a post-processing add-on is coming up, though it depends on the kindness of some reviewers. Kind regards Niels P.S. Are you actually planning to resolve the plants or will you use an intelligent resistance formulation? |
|
June 4, 2013, 21:46 |
GAMG vs PCG for massively parallel computations
|
#411 |
New Member
Agnimitro Chakrabarti
Join Date: Mar 2012
Location: Louisiana, USA
Posts: 6
Rep Power: 14 |
Hi Jasonchen and Niels,
We actually did a bunch of tests for scaleup (mainly strong scaling but for the limited tests that we did for weak scalings the conclusions did not differ much) as part of our initial benchmark tests on waves and veg interactions using waveFoam in order to find out what problem size we could deal with efficiently with the available resources. The results from that study can be found in the poster in the link attached below (first presented at the Scientific Computing Around Louisiana 2013 meeting). In my experience, in terms of absolute wall times GAMG runs somewhat faster for bigger problem sizes for lower number of cores while PCG runs faster when both the problem size and number of cores are large. Regarding scaleup for < 200 cores efficiencies are the same but beyond 200 cores PCG shows 3-5 times better scaling. To Niels: I haven't done any rigorous tests on the the implicit to CN regime yet, I'll go with this one for the moment and send you the results once I do them. About fully explicit Euler, I always thought OF only had a fully implicit Euler with a view that it could be used for larger time stepping (not that it is much of use with LES though) . Is the deferred correction approach you mentioned available now any more? In case not could you tell me what last OF version had it? As you can see from the poster we went with the resolution approach for this one. Actually another member of our group is also working on a drag force based approach (for use in larger scales) but not in openfoam though, if that succeeds we may go for a hybrid Immersed Boundary/drag force approach. The advantages of the resolution approach in our experience, though very costly, are 1) greater accuracy in prediction of turbulent flow fields (more on this will be coming up in proceedings/publications in the coming months) within the order of vegetation spacings 2) reduced problem size to get similar accuracy as IBM. I'll keep you updated as things roll. Also though not my main area of research if I do need a new wave theory coded in waveFoam I'll surely get it out to you. Regarding post processing tool, have you implemented or maybe know someone who has implemented a sampled function type object class to say find the deflection and rotation of points at the solid-fluid interface of a 6 DOF body like the floating body in waveDyMFoam? Thanks a lot for the link of the test case btw and for all the helpful advice. Link: https://filestogeaux.lsu.edu/public/...r2/228078wQhUP |
|
June 5, 2013, 02:02 |
|
#412 |
Senior Member
Niels Gjoel Jacobsen
Join Date: Mar 2009
Location: Copenhagen, Denmark
Posts: 1,903
Rep Power: 37 |
Hi Agnimitro,
All I ment by "fully explicit" was to do something like Code:
ddt::fvm(rho, U) +0 * fvm::div(rhoPhi, U) +1 * fvc::div(rhoPhi, U) +1 * fvm::laplacian(nuEff, U) + ... Kind regards Niels Edit! Of course you should also do the weighting on the Laplacian in order to obtain a traditional CN-behaviour. I am sorry that this has not been very clear from the above posts. Immediately above, this is just one time integration example, where the effect of using explicit convection is considered. |
|
June 7, 2013, 17:21 |
|
#413 |
Senior Member
Niels Gjoel Jacobsen
Join Date: Mar 2009
Location: Copenhagen, Denmark
Posts: 1,903
Rep Power: 37 |
Dear all,
For those of you not tuned in oo the announcement part of waves2Foam, then please be aware of this post from earlier tonight: http://www.cfd-online.com/Forums/ope...tml#post432703 Have a nice weekend, Niels Last edited by wyldckat; December 28, 2013 at 08:59. Reason: updated the link to the other post, given the transfer of posts from the news thread |
|
June 9, 2013, 04:18 |
|
#414 |
Senior Member
Niels Gjoel Jacobsen
Join Date: Mar 2009
Location: Copenhagen, Denmark
Posts: 1,903
Rep Power: 37 |
@Ed Ransley: As a follow up on the question for easy creation of a new wave theory, I have now created a small tool, which does exactly this (except for adding all the algebraic expressions, that is).
For more information see revision 1997 here: Code:
http://openfoamwiki.net/index.php/Contrib/waves2Foam#Modifications_to_the_Source_Code_.28History.29 Niels |
|
June 10, 2013, 06:41 |
waveFoam OF2.2
|
#415 |
Member
Norman Del Puppo
Join Date: Mar 2009
Location: Hinwil, CH
Posts: 57
Rep Power: 17 |
Dear Niels,
thank you again for this package! The waveFoam solver needs some modifications in order to compile in OF2.2. You have to: 1) Change: #include "twoPhaseMixture.H" to #include "incompressibleTwoPhaseMixture.H" in waves2Foam.C 2) change twoPhaseMixture twoPhaseProperties(U, phi); to incompressibleTwoPhaseMixture twoPhaseProperties(U, phi); in createFields.H 3) Add: -I$(LIB_SRC)/transportModels/twoPhaseProperties/lnInclude \ and change -ltwoPhaseInterfaceProperties \ to -ltwoPhaseProperties \ in Make/options Regards Norman |
|
June 10, 2013, 06:47 |
|
#416 |
Senior Member
Niels Gjoel Jacobsen
Join Date: Mar 2009
Location: Copenhagen, Denmark
Posts: 1,903
Rep Power: 37 |
Hi Norman,
Are you using 2.2 or 2.2.x? I have successfully compile on the very first release of 2.2, so I am a bit puzzled by your problems. Thanks for the bug report. Kind regards Niels |
|
June 10, 2013, 06:51 |
|
#417 |
Member
Norman Del Puppo
Join Date: Mar 2009
Location: Hinwil, CH
Posts: 57
Rep Power: 17 |
||
June 10, 2013, 06:58 |
|
#418 |
Senior Member
Niels Gjoel Jacobsen
Join Date: Mar 2009
Location: Copenhagen, Denmark
Posts: 1,903
Rep Power: 37 |
OK, so that would mean that they have made fundamental changes between 2.2 and the bug fixed version. Oh my!
In order to be able to support both of these versions at the same time, I will have to do some thinking, because their version number (in terms of the digits and no letters) are identical. Could you survive by modifying this by hand in the meantime. Also, can you see a differences in the results, whether you use either of the twoPhaseMixtures? I.e. running in 2.2.x or 2.2? Kind regards Niels |
|
June 10, 2013, 07:16 |
|
#419 | |
Member
Norman Del Puppo
Join Date: Mar 2009
Location: Hinwil, CH
Posts: 57
Rep Power: 17 |
Quote:
Regards Norman |
||
June 10, 2013, 07:18 |
|
#420 |
Senior Member
Niels Gjoel Jacobsen
Join Date: Mar 2009
Location: Copenhagen, Denmark
Posts: 1,903
Rep Power: 37 |
OK, no problem. Any takers for a quick comparison between 2.2 and 2.2.x?
And thanks, every feed-back is highly appreciated, as you can see in the modified compilation system, which was originally initiated by Dennis Kingsley. / Niels P.S. Yes, it is bit of a effort with the management, however, they only come with a new version every 6-8 month, so it is not that bad. |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Map of the OpenFOAM Forum - Understanding where to post your questions! | wyldckat | OpenFOAM | 10 | September 2, 2021 06:29 |
Re-Project topics | protocol | STAR-CCM+ | 0 | March 22, 2016 06:25 |
Waves2Foam Related Topics | seoseonguk | OpenFOAM Running, Solving & CFD | 0 | March 1, 2016 23:18 |
Waves2Foam Related Topics | seoseonguk | OpenFOAM Running, Solving & CFD | 0 | March 1, 2016 23:14 |
Error: "Cannot find file points" related to changing parallelized code to serial? | Suyf | OpenFOAM Running, Solving & CFD | 0 | February 12, 2015 05:31 |