The IHFOAM Thread
Dear colleagues,
Now that IHFOAM has been released I open this thread to gather questions, comments, bug reports and mainly anything you can think about regarding IHFOAM. You can find a general wiki page, which will be growing day by day here: http://openfoamwiki.net/index.php/Contrib/IHFOAM The release thread can be found here: http://www.cfd-online.com/Forums/ope...m-release.html I look forward to having some feedback from you. Best, Pablo |
Compilation problem on OpenFOAM 2.2.x
Hi Pablo,
This is really exciting. A new wave generation package for OpenFOAM. Thank you for your hard work and making the code open-source. I have compiled IHFOAM for OpenFOAM 2.2.1 on my personal computer and it works without a problem (successfully ran the example provided). :D However, I have problem compiling IHFOAM for OpenFOAM 2.2.x (i'm using this version on my university cluster). IHFOAM throw the following error. :( Code:
wmakeLnInclude: linking include files to ./lnInclude Kind regards, katakgoreng |
Hi katakgoreng,
thanks for your words. I see the problem, DOFVERSION gets exported in the wrong way: Code:
-DOFVERSION=22x Thanks for reporting this, I will update the allMake scripts soon to avoid problems (especially with 2.3.x). In the mean time I suggest that you change these two lines: Code:
ofversion=`echo $WM_PROJECT_VERSION | sed -e 's/\./\n/g' -e 's/-/\n/' | grep "[0-9]" | tr -d '\n'` Code:
export OF_VERSION=220 Code:
ofversion=`echo $WM_PROJECT_VERSION | sed -e 's/\./\n/g' -e 's/-/\n/' | sed -e 's/x/9/g' | grep "[0-9]" | tr -d '\n'` Best, Pablo EDIT: I am not able to reproduce the error, in my installation of 2.2.x DOFVERSION=22, no x is found. However, I will push the change today |
Hi Pablo,
I managed to compile the library after following your suggestion. I applied the following in the allMake script. Code:
ofversion=`echo $WM_PROJECT_VERSION | sed -e 's/\./\n/g' -e 's/-/\n/' | sed -e 's/x/9/g' | grep "[0-9]" | tr -d '\n'` Kind regards, katakgoreng |
baseWaveFlume error
Hi Pablo,
Thank you very much for a new toolbox for waves, it looks amazing. I was just trying to check out a tutorial case named baseWaveFlume by running runCase, and it gave me the following error in the terminal: Code:
Running... I am also attaching log files: BlockMesh: https://www.dropbox.com/s/onlb1p42tcda8gv/blockMesh.log ihFoam: https://www.dropbox.com/s/ltpdgv7btjbsi0s/ihFoam.log setFields: https://www.dropbox.com/s/5nbu2xzgy7v3zup/setFields.log The openFoam version I am using is 2.1.1. Thank you very much in advance, Dmitrijs |
Hi Dmitrjs,
apparently there is a floating point error when evaluating the elliptic integrals for the cnoidal wave theory. Can I see your IHwavesDict? Best, Pablo |
Hi Pablo,
Thank you for a super quick reply! Here is the file: https://www.dropbox.com/s/cfui3ucupz4ekeg/IHWavesDict Regards, Dmitrijs |
Hi Dmitrijs,
I see, you are running the case with no modifications. Unfortunately I am not able to reproduce your error. From the logs I can confirm that we are using the same build (2.1.1-221db2718bbb) and the case runs flawlessly for me: Code:
IH Wave Generation BC Which OS are you running? Version? 32 or 64 bits? Can run the case with other wave theories? Best, Pablo |
Water depth
Hi Pablo,
Thank you for your suggestions, I tried other wave theories and everything else runs fine. It's OK because I do not need to use cnoidal wave theory in my research, so I can continue with other ones. Another question I want to ask is how do you specify the water depth, I looked in the user guide, but couldn't find it. Sorry about this noob question :) Dmitrijs |
Hi Dmitrjs,
no water depth needs to be specified, it is measured automatically by the BCs depending on the water (alpha1 field) that is set in setFieldsDict. Best, Pablo |
Dear Pablo,
first of all I would like to thank you a lot for having released IHFoam; it seems extremely useful and powerful, since it allows to reduce the computational domain extension significantly handling appropriately the boundary conditions for both wave generation and absorption. My main interest is focused on the evaluation of wave loads induced on semi and fully-submerged body. After having successfully installed IHFoam on OpenFOAM 2.2.2 version, I run the tutorial case "baseWaveFlume" and all seemed ok. Afterwards, I created a new case. I took as reference a case described in a MSc thesis freely available at the following URL: http://publications.lib.chalmers.se/...ext/151295.pdf The case is constituted by a 2D domain; there is an horizontal circular cylinder placed in the middle, whose axis is put exactly on the sea free surface at rest. At the inlet I generate a StokesV type wave. Since I would like to evaluate loads induced on the cylinder by the wave motion, I set in the controlDict file the forces function object structured as follows: forces { type forces; functionObjectLibs ("libforces.so"); log yes; patches (cylinder); pName p_rgh; UName U; rhoName rho; rhoInf 1; outputControl timeStep; outputInterval 1; } Unfortunately I get results that are completely different from those shown in the thesis. My first question is: is it correct to integrate the p_rgh term on the cylinder surface? I looked at the source code, and it seems almost identical to that of the openfoam distribution except for the porosity treatment, so I thought that integrating the p_rgh term was correct; but looking at the results I am not so sure. If you need more information before answering I can send you the case by email. I thank you a lot for your attention and for your help. Bye :D |
Hi,
thanks for your feedback. The ihFoam solver solves the same equations as interFoam when no porosity is present. You can check it by running the same case, first with ihFoam and then with interFoam (loading the BCs dyanmically), you will obtain the same results. Regarding the force calculation, I would not integrate dynamic pressure (p_rgh) but total pressure (p). You should also check out if libforces.so is suitable for a two-phase case, as I remember doing some modifications long time ago, but now I am not quite sure what they were about. Best, Pablo |
Dear Pablo,
I thank you a lot for your quick answer. Concerning the libforces library, I have already checked if it works appropriately: I have read in other threads about the problems concerning the use of it with interFoam, but I think that they are solved in the version 2.2.2 I am using: in particular I am referring to the density value that is taken into account. The reason why I have integrated p_rgh and not p is that I would like to neglect the loads due to hydrostatic pressure and to consider only the dynamic ones; this because the work I took as reference explicitly tells that "...the initial force in still water are subtracted..." and I interpreted them as the hydrostatic forces. Unfortunately at the present I have no more idea where the problem is. I thank you a lot again for your help. Bye Gabriele |
Hi Gabriele,
p_rgh is not generally the dynamic pressure, but a pseudo-dynamic pressure (p - rho g z). This is, the pseudo-dynamic pressure is dependent on the location of the fluid and its density. It is easy to see that a case at rest should have dynamic pressure equals zero, but that is only the case if the free surface lies at Z = 0. Moreover, two bodies of water at rest with different free surface elevation have different pseudo-dynamic pressure values. That is why I don't work with p_rgh, but with p, with which you can calculate the overpressure with respect to the initial state. Best, Pablo |
Dear Paul,
yes, you are right! My error was exactly what you said! I erroneously thought that p_rgh was exactly the dynamic pressure and not a pseudo-dynamic pressure dependent on z since I put the origin of the coordinate system at z=0 and at the initial time p_rgh=0. I thank you a lot for your useful help. Bye Gabriele |
tsmooth - arbitrary starting time
Hi Pablo,
From IHFOAM manual, it stated that the tapering function, "tsmooth" varies linearly from t=0 to t=tsmooth. Say I want to start my wave simulation at arbitrary time e.g t=-32s instead of t=0s, will the tapering function, "tsmooth" works in this case? Kind regards, katakgoreng |
Hi katakgoreng,
no, it will not work in that case. It won't be difficult for you to change the implementation and make it start at a given tStart. Best, Pablo |
Shifted water depth
3 Attachment(s)
Hi Pablo,
I modified the baseWaveFlume tutorial to simulate the following waves: Type - Regular, Stokes 1 Period - 3.651s Wave height - 0.033m Wave Length - 10.862m Frequency - 1.72 Hz I also modified the tank: Length (x) - 17.965m Height (z) - 1.1 Width (y) - 0.1 In setFields directory I specified the water level to be 1m, however, by looking at the results it seems like the water level is shifted a bit. Below is the plot of the surface elevation against time at x=9.989m: Attachment 32807 The cell size in x direction is 0.0128, in y it is 0.006875. The water level is shifted by 0.003125m. This happens at any x location along the wave tank. The analytical solution of Stokes 1st waves is also included for comparison. I then refined the mesh to get the cell size of 0.00367 in y direction and got the following: Attachment 32808 The water level is shifted upwards now by 0.001m. My question is: would you say that this error is due to the mesh resolution or is there something I messed up in the set-up? Even if I force the solution to start at water depth of 1 (by adding/subtracting the differences), it is not quite stable compared to the analytical solution: Attachment 32809 I am also attaching my case: https://www.dropbox.com/s/ju3xfehxk4...eWaveFlume.zip Thank you very much in advance! Dmitrijs |
Quote:
Thank you for your reply. I will implement the changes as needed. Moving on to other problem. I managed to run IHFOAM for irregular waves (First Order) without any problem. However, when I turn the "secondOrder" switch as follows: Code:
waveType irregular; Code:
PIMPLE: Operating solver in PISO mode Really appreciate your help in this matter. Kind regards, katakgoreng |
Hi Dmitrijs, katakgoreng,
@Dmitrijs I don't see anything wrong, setFields does not magically set water at your desired level, it just fills up full cells whose centre is inside the box you define. If the top of the filled cells is not exactly at 1 m, then you are definitely not obtaining that water level. I would also not expect great results from your resolution, as the wave height is discretized by 2 cells only, which may not be enough. @katakgoreng I copied your IHWavesDict over to the default baseWaveFlume tutorial and it runs perfectly well for me: Code:
Create time The problem seem the same you were facing with the cnoidal function. Which OS and version are you using? 32/64 bits? Best, Pablo |
All times are GMT -4. The time now is 15:44. |