
[Sponsors] 
June 4, 2013, 02:25 
Re: Effect of temporal schemes in waveFlume tutorial and steepness limitations

#421 
New Member
Agnimitro Chakrabarti
Join Date: Mar 2012
Location: Louisiana, USA
Posts: 6
Rep Power: 6 
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, 11:28 

#422 
Senior Member
Niels Gjoel Jacobsen
Join Date: Mar 2009
Location: Deltares, Delft, The Netherlands
Posts: 1,713
Rep Power: 27 
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 postprocessing addon 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, 20:46 
GAMG vs PCG for massively parallel computations

#423 
New Member
Agnimitro Chakrabarti
Join Date: Mar 2012
Location: Louisiana, USA
Posts: 6
Rep Power: 6 
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 35 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 solidfluid 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, 01:02 

#424 
Senior Member
Niels Gjoel Jacobsen
Join Date: Mar 2009
Location: Deltares, Delft, The Netherlands
Posts: 1,713
Rep Power: 27 
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 CNbehaviour. 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, 16:21 

#425 
Senior Member
Niels Gjoel Jacobsen
Join Date: Mar 2009
Location: Deltares, Delft, The Netherlands
Posts: 1,713
Rep Power: 27 
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: Release of a Wave Generation and Absorption Toolbox for OF 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, 03:18 

#426 
Senior Member
Niels Gjoel Jacobsen
Join Date: Mar 2009
Location: Deltares, Delft, The Netherlands
Posts: 1,713
Rep Power: 27 
@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, 05:41 
waveFoam OF2.2

#427 
Member
Norman Del Puppo
Join Date: Mar 2009
Location: Hinwil, CH
Posts: 57
Rep Power: 9 
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, 05:47 

#428 
Senior Member
Niels Gjoel Jacobsen
Join Date: Mar 2009
Location: Deltares, Delft, The Netherlands
Posts: 1,713
Rep Power: 27 
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, 05:51 

#429 
Member
Norman Del Puppo
Join Date: Mar 2009
Location: Hinwil, CH
Posts: 57
Rep Power: 9 

June 10, 2013, 05:58 

#430 
Senior Member
Niels Gjoel Jacobsen
Join Date: Mar 2009
Location: Deltares, Delft, The Netherlands
Posts: 1,713
Rep Power: 27 
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, 06:16 

#431  
Member
Norman Del Puppo
Join Date: Mar 2009
Location: Hinwil, CH
Posts: 57
Rep Power: 9 
Quote:
Regards Norman 

June 10, 2013, 06:18 

#432 
Senior Member
Niels Gjoel Jacobsen
Join Date: Mar 2009
Location: Deltares, Delft, The Netherlands
Posts: 1,713
Rep Power: 27 
OK, no problem. Any takers for a quick comparison between 2.2 and 2.2.x?
And thanks, every feedback 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 68 month, so it is not that bad. 

June 10, 2013, 10:29 
Waves2FOAM OF2.2.0 and OF2.2.x

#433 
Member
Dennis Kingsley
Join Date: Mar 2009
Location: USA
Posts: 45
Rep Power: 9 
Niels,
I just sent you an updated patch that should handle OF2.2.0 and OF2.2.x. OF2.2.x did in fact change the name of twoPhaseMixture to incompressibleTwoPhaseMixture. djk 

June 10, 2013, 20:50 
waveFlume tutorial, turbulence, modified k  omega

#434 
Senior Member
kumar
Join Date: Mar 2009
Posts: 112
Rep Power: 9 
Dear Niels and All Modelers,
I have been trying to run the wave flume tutorial in the turbulent mode, using the modified komega model but the runs are blowing up after about 2 waves entering the domian. I am not sure if I am using the correct initial and boundary conditions for k and omega. I am trying to reproduce Niels published results in International journal for Numerical Methods in Fluids 2012, section 3.1 ( Exchange of energy between the harmonics) This is how I calculated k: the horizontal particle velocity is about 0.2 m/s (period=3.5s; wavelength=6.8m; waveheight=0.084m). Taking the turbulent intensity as 0.001 percent of the horizontal particle velocity and turbulent length scale as 0.001 percent of the wave height, k=3/2*(0.2*0.001/100)^2=6.8e12 m^2/s^2. Turbulent length scale=(0.001/100)*0.084=8.4e07m. Then omega=sqrt(k)/turb.length=3.1. From k and omega, I calculated nut. (For higher values of k, the code blows up earlier.) //inlet and BC for k internalField uniform 6.8e12; 1)inlet > type fixedValue; value uniform 6.8e12; 2)bottom> type zeroGradient; 3)outlet > type zeroGradient; 4)atmosphere> type inletOutlet; inletValue uniform 6.8e12; value uniform 6.8e12; // inlet and BC for omega: internalField uniform 3.1; 1)inlet> type fixedValue; value uniform 3.1; 2)bottom> type zeroGradient; 3)outlet> type zeroGradient; 4)atmosphere> type inletOutlet; inletValue uniform 3.1; value uniform 3.1; // inlet and BC for nut internalField uniform 2.2e12; 1)inlet> type fixedValue; value uniform 2.2e12; 2)bottom> type zeroGradient; 3)outlet> type zeroGradient; 4)atmosphere> type inletOutlet; inletValue uniform 2.2e12; value uniform 2.2e12; The free surface profile, k and omega fields just before the code blows at t= 6.0 seconds from start is attached. When the code blows up(and this happens quite abruptly), I see a spike in the Uy solution( given below) Courant Number mean: 0.0151587 max: 0.278172 Interface Courant Number mean: 0.000481256 max: 0.244935 deltaT = 0.00497824 Time = 6.01581 DILUPBiCG: Solving for Uy, Initial residual = 0.00827393, Final residual = 6.31356e+15, No Iterations 1001 and continuity errors: (given below) time step continuity errors : sum local = 4.99397e+69, global = 2.22466e+68, cumulative = 2.22466e+68 Please let me know what could be the reason for the code blowing up and if my initial conditions and BC are ok for k and omega Thanks in advance Beat regards Kumar 

June 11, 2013, 01:10 

#435 
Senior Member
Niels Gjoel Jacobsen
Join Date: Mar 2009
Location: Deltares, Delft, The Netherlands
Posts: 1,713
Rep Power: 27 
Hi Kumar,
Why would you use a turbulence model for such a case, where the boundary layers will be fully laminar? In our article we only used a turbulence model for the case with wave breaking. Kind regards Niels 

June 11, 2013, 04:30 
waveFlume tutorial, turbulence, modified k  omega

#436  
Senior Member
kumar
Join Date: Mar 2009
Posts: 112
Rep Power: 9 
Quote:
Thanks so much for your quick reply. I realize now that I misunderstood the line in the publication( page 1077 , para3, first line). ( I though komega is switched on in all cases with wall functions also switched on in case 3.3). Cheers and thanks again Kumar 

June 11, 2013, 09:39 

#437 
New Member
Hf
Join Date: Nov 2012
Posts: 24
Rep Power: 6 
Hello Niels and Kumar,
I want to plot a free surface profile figure like the one posted by Kumar. Is this function included in the wave2Foam's followup project? I recognize the figure by Kumar was plotted by matlab. At one time instant, I can read from the corresponding time diretory the alpha1 field for all cells starting from cell #0. And also I can export from paraFoam the alpha1 valude for all selected cells with point coordinates included for each alpha1 value. With these data I have tried but without success to plot a contour of alpha1 in matlab. I know this may be trivial. Which cmds/funcs you use in matlab? Thanks. Best 

June 11, 2013, 13:37 

#438 
Senior Member
Niels Gjoel Jacobsen
Join Date: Mar 2009
Location: Deltares, Delft, The Netherlands
Posts: 1,713
Rep Power: 27 
Hi Jason,
For my part I can tell that such functionality is not planned for the followup of waves2Foam. The tricky part is to get the data from OFformat to something, which is easily read by Matlab. Here, I would suggest that you make some small Matlab functions, which most easily could be applying a bit of unixcommand internally. See Code:
help unix Once you have achieved to get the data into Matlab, the rest is merely book keeping. Kind regards Niels 

June 11, 2013, 14:51 

#439 
Senior Member
Niels Gjoel Jacobsen
Join Date: Mar 2009
Location: Deltares, Delft, The Netherlands
Posts: 1,713
Rep Power: 27 
Dear Norman, Dennis and others,
I have made a small correction to the compilation of waves2Foam, so now compilation of the same part of the source code should be achievable. I defined an additional environmental variable WAVES_XVERSION, so please remember to update your waves2Foam/bin/bashrc file based on the changes to waves2Foam/bin/bashrc.org. Also, the changes are done in the dark, as I do have neither 2.2.0 nor 2.2.x, so please report any difficulties. All the best, Niels 

June 11, 2013, 14:58 

#440  
Senior Member
kumar
Join Date: Mar 2009
Posts: 112
Rep Power: 9 
Quote:
I first use the OF utility writeCellCenters to write the cell centers then I use the following matlab function readOpenFoamWithMatlab.m to read the cell centers as shown way down. %%%%%%%%%%%%%function readOpenFoamWithMatlab.m %%% function alpha1=readOpenFoamWithMatlab(str,no_of_headerLine s) % no spaces. fid=fopen(str,'r'); %no_of_headerLines=20; for i=1:no_of_headerLines, fgets(fid); end no_of_cells=fscanf(fid,'%d'); fgets(fid); data=textscan(fid,'%f'); alpha1=data{1,1}(; % no smiley face, the editor is inputing this ! [r,c]=size(alpha1); if r~=no_of_cells, pause; end fclose(fid); %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Read the cell centers into MATLAB as shown below: %%%%%%%%%%%%%%%%%%%%%%%%%%%%%% no_of_headerLines=20; % I am pretty sure, but good to check.. ccx=readOpenFoamWithMatlab('ccx',no_of_headerLines ); ccy=readOpenFoamWithMatlab('ccy',no_of_headerLines ); ccz=readOpenFoamWithMatlab('ccz',no_of_headerLines ); XX=unique(ccx); YY=unique(ccy); X=zeros(length(YY),length(XX)); Y=zeros(length(YY),length(XX)); for i=1:length(YY), X(i,: )=XX; end for i=1:length(XX), Y(:,i)=YY; end [r,c]=size(X); %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Now read alpha fields %%%% alpha=readOpenFoamWithMatlab('alpha1',no_of_header Lines); alpha_i=griddata(ccx,ccy,alpha,X,Y); figure; pcolor(X,Y,alpha1); colorbar; shading flat; Please let me know if this does not work. Best regards Kumar 

Thread Tools  
Display Modes  


Similar Threads  
Thread  Thread Starter  Forum  Replies  Last Post 
Other Topics at OpenFOAM Workshop Milan 2008  hjasak  OpenFOAM  2  October 26, 2013 04:33 
Sections / Topics in CFD Wiki  Roberthealy1  CFDWiki  6  August 23, 2007 17:58 
CFD Related Educational Programmes  Jonas Larsson  Main CFD Forum  3  February 9, 2007 11:11 
project topics  vivekanand  CFX  0  October 27, 2004 05:17 
Advanced Topics in Aerodynamics  Antonio Filippone  Main CFD Forum  0  August 28, 1999 12:16 