CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > OpenFOAM Running, Solving & CFD

Waves2Foam Related Topics

Register Blogs Members List Search Today's Posts Mark Forums Read

Like Tree81Likes

Reply
 
LinkBack Thread Tools Display Modes
Old   June 4, 2013, 02:25
Default 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: 5
Agni is on a distinguished road
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.
Attached Images
File Type: png Fig8.png (42.0 KB, 28 views)
Agni is offline   Reply With Quote

Old   June 4, 2013, 11:28
Default
  #422
ngj
Senior Member
 
Niels Gjoel Jacobsen
Join Date: Mar 2009
Location: Deltares, Delft, The Netherlands
Posts: 1,619
Rep Power: 25
ngj will become famous soon enoughngj will become famous soon enough
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?
ngj is offline   Reply With Quote

Old   June 4, 2013, 20:46
Default GAMG vs PCG for massively parallel computations
  #423
New Member
 
Agnimitro Chakrabarti
Join Date: Mar 2012
Location: Louisiana, USA
Posts: 6
Rep Power: 5
Agni is on a distinguished road
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
Agni is offline   Reply With Quote

Old   June 5, 2013, 01:02
Default
  #424
ngj
Senior Member
 
Niels Gjoel Jacobsen
Join Date: Mar 2009
Location: Deltares, Delft, The Netherlands
Posts: 1,619
Rep Power: 25
ngj will become famous soon enoughngj will become famous soon enough
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)
+ ...
I might have mixed things up in the naming of things, but this is was I thought of as deferred correction. When you variate the constant in front of the convection terms, the above is an obvious extreme to the implicit Euler time integration, as the convection part will be time integrating by explicit Euler, since the fvc:: does not add anything to the diagonal.

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.
ngj is offline   Reply With Quote

Old   June 7, 2013, 16:21
Default
  #425
ngj
Senior Member
 
Niels Gjoel Jacobsen
Join Date: Mar 2009
Location: Deltares, Delft, The Netherlands
Posts: 1,619
Rep Power: 25
ngj will become famous soon enoughngj will become famous soon enough
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
ngj is offline   Reply With Quote

Old   June 9, 2013, 03:18
Default
  #426
ngj
Senior Member
 
Niels Gjoel Jacobsen
Join Date: Mar 2009
Location: Deltares, Delft, The Netherlands
Posts: 1,619
Rep Power: 25
ngj will become famous soon enoughngj will become famous soon enough
@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
Kind regards

Niels
ngj is offline   Reply With Quote

Old   June 10, 2013, 05:41
Default waveFoam OF2.2
  #427
Member
 
norman1981's Avatar
 
Norman Del Puppo
Join Date: Mar 2009
Location: Hinwil, CH
Posts: 57
Rep Power: 8
norman1981 is on a distinguished road
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
norman1981 is offline   Reply With Quote

Old   June 10, 2013, 05:47
Default
  #428
ngj
Senior Member
 
Niels Gjoel Jacobsen
Join Date: Mar 2009
Location: Deltares, Delft, The Netherlands
Posts: 1,619
Rep Power: 25
ngj will become famous soon enoughngj will become famous soon enough
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
ngj is offline   Reply With Quote

Old   June 10, 2013, 05:51
Default
  #429
Member
 
norman1981's Avatar
 
Norman Del Puppo
Join Date: Mar 2009
Location: Hinwil, CH
Posts: 57
Rep Power: 8
norman1981 is on a distinguished road
Quote:
Originally Posted by ngj View Post
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
Good point! I am using 2.2.x, sorry about that!
Regards
Norman
norman1981 is offline   Reply With Quote

Old   June 10, 2013, 05:58
Default
  #430
ngj
Senior Member
 
Niels Gjoel Jacobsen
Join Date: Mar 2009
Location: Deltares, Delft, The Netherlands
Posts: 1,619
Rep Power: 25
ngj will become famous soon enoughngj will become famous soon enough
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
ngj is offline   Reply With Quote

Old   June 10, 2013, 06:16
Default
  #431
Member
 
norman1981's Avatar
 
Norman Del Puppo
Join Date: Mar 2009
Location: Hinwil, CH
Posts: 57
Rep Power: 8
norman1981 is on a distinguished road
Quote:
Originally Posted by ngj View Post
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
Yes, I can survive. I only wanted to help in some way because I think managing several different OF versions costs a lot of efforts! I am sorry but I don't have a way to compare results because I have only 2.2.x installed on my laptop.

Regards

Norman
norman1981 is offline   Reply With Quote

Old   June 10, 2013, 06:18
Default
  #432
ngj
Senior Member
 
Niels Gjoel Jacobsen
Join Date: Mar 2009
Location: Deltares, Delft, The Netherlands
Posts: 1,619
Rep Power: 25
ngj will become famous soon enoughngj will become famous soon enough
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.
ngj is offline   Reply With Quote

Old   June 10, 2013, 10:29
Default Waves2FOAM OF2.2.0 and OF2.2.x
  #433
Member
 
Dennis Kingsley
Join Date: Mar 2009
Location: USA
Posts: 45
Rep Power: 8
dkingsley is on a distinguished road
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
norman1981 likes this.
dkingsley is offline   Reply With Quote

Old   June 10, 2013, 20:50
Default waveFlume tutorial, turbulence, modified k - omega
  #434
Senior Member
 
kumar
Join Date: Mar 2009
Posts: 112
Rep Power: 8
kumar2 is on a distinguished road
Dear Niels and All Modelers,

I have been trying to run the wave flume tutorial in the turbulent mode, using the modified k-omega 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.8e-12 m^2/s^2. Turbulent length scale=(0.001/100)*0.084=8.4e-07m.
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.8e-12;
1)inlet --> type fixedValue; value uniform 6.8e-12;
2)bottom--> type zeroGradient;
3)outlet --> type zeroGradient;
4)atmosphere--> type inletOutlet; inletValue uniform 6.8e-12; value uniform 6.8e-12;

// 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.2e-12;
1)inlet--> type fixedValue; value uniform 2.2e-12;
2)bottom--> type zeroGradient;
3)outlet--> type zeroGradient;
4)atmosphere--> type inletOutlet; inletValue uniform 2.2e-12; value uniform 2.2e-12;

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
Attached Images
File Type: jpg waveFlume.jpg (28.0 KB, 53 views)
kumar2 is offline   Reply With Quote

Old   June 11, 2013, 01:10
Default
  #435
ngj
Senior Member
 
Niels Gjoel Jacobsen
Join Date: Mar 2009
Location: Deltares, Delft, The Netherlands
Posts: 1,619
Rep Power: 25
ngj will become famous soon enoughngj will become famous soon enough
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
ngj is offline   Reply With Quote

Old   June 11, 2013, 04:30
Default waveFlume tutorial, turbulence, modified k - omega
  #436
Senior Member
 
kumar
Join Date: Mar 2009
Posts: 112
Rep Power: 8
kumar2 is on a distinguished road
Quote:
Originally Posted by ngj View Post
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
Hi Niels,

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 k-omega is switched on in all cases with wall functions also switched on in case 3.3).

Cheers and thanks again

Kumar
kumar2 is offline   Reply With Quote

Old   June 11, 2013, 09:39
Default
  #437
New Member
 
Hf
Join Date: Nov 2012
Posts: 22
Rep Power: 4
jasonchen is on a distinguished road
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
jasonchen is offline   Reply With Quote

Old   June 11, 2013, 13:37
Default
  #438
ngj
Senior Member
 
Niels Gjoel Jacobsen
Join Date: Mar 2009
Location: Deltares, Delft, The Netherlands
Posts: 1,619
Rep Power: 25
ngj will become famous soon enoughngj will become famous soon enough
Hi Jason,

For my part I can tell that such functionality is not planned for the follow-up of waves2Foam.

The tricky part is to get the data from OF-format 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 unix-command internally. See
Code:
help unix
in Matlab; this does require that you use Matlab on a Linux/Unix/OSX distribution.

Once you have achieved to get the data into Matlab, the rest is merely book keeping.

Kind regards

Niels
ngj is offline   Reply With Quote

Old   June 11, 2013, 14:51
Default
  #439
ngj
Senior Member
 
Niels Gjoel Jacobsen
Join Date: Mar 2009
Location: Deltares, Delft, The Netherlands
Posts: 1,619
Rep Power: 25
ngj will become famous soon enoughngj will become famous soon enough
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
ngj is offline   Reply With Quote

Old   June 11, 2013, 14:58
Default
  #440
Senior Member
 
kumar
Join Date: Mar 2009
Posts: 112
Rep Power: 8
kumar2 is on a distinguished road
Quote:
Originally Posted by jasonchen View Post
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
Hi Jason,

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
gregjunqua likes this.
kumar2 is offline   Reply With Quote

Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


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 CFD-Wiki 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


All times are GMT -4. The time now is 15:33.