OpenFOAM‎ > ‎

How To: couple waves2Foam with dynamic mesh motion

This ‘how to’ pretend to be a guide step-by-step about how to couple the CFD ToolBox waves2Foam developed by Niels G. Jacobsen with dynamic mesh motion (more info: http://openfoamwiki.net/index.php/Contrib/waves2Foam)

 

Let’s start: 

1.    Copy the folder of solver interDyMFoam in the wave2Foam solver folder for version which you use, for example, for version 1.7.1:

cp -r $WM_PROJECT_DIR/applications/solvers/multiphase/interFoam/interDyMFoam $WM_PROJECT_USER_DIR/applications/solvers/waves2Foam/applications/solvers/solvers17/waveFoam/

2.    Now modify the name of copied folder to waveDyMFoam (or whatever name you want... but it looks fine):

cd $WM_PROJECT_USER_DIR/applications/solvers/waves2Foam/applications/solvers/solvers17/waveFoam

mv interDyMFoam/ waveDyMFoam

3.    Clean the compiled solver and modify the name of C file:

cd waveDyMFoam

wclean

mv interDyMFoam.C waveDyMFoam.C

4.    Now we must follow the guidelines in section 3.2 of waves2Foam wiki (but with some difference, as for example, we don’t need modify createFields.H since it’s read from one level-up):

Go to: http://openfoamwiki.net/index.php/Contrib/waves2Foam#waveFoam_-_How_to_Modify_interFoam Or follow the next copy&paste instructions ‘adapted’ to waveDyMFoam:

 

§  Add the following line in waveDyMFoam.C

#include "relaxationZone.H"

§  Inside main in waveDyMFoam.C add the following two lines just below #include "initContinuityErrs.H" and above createFields.H

#include "readGravitationalAcceleration.H"

#include "readWaveProperties.H"

§  After the line in waveDyMFoam.C stating #include "alphaEqnSubCycle.H" add

relaxing.correct();

5.    Now we need set properly the Make files. First, open and modify ‘Make/files’:

waveDyMFoam.C


EXE = $(FOAM_USER_APPBIN)/waveDyMFoam

6.    And in ‘Make/options’ do:

§  After -I$(LIB_SRC)/dynamicFvMesh/lnInclude \ add:

-I./../../../../../src/lnInclude

§  And add the following lines at the very bottom

    -L$(FOAM_USER_LIBBIN) \

    -lwaves2Foam

§  REMEMBER to add the two new needed \ at the end of lines:

 -I$(LIB_SRC)/meshTools/lnInclude

 -ltopoChangerFvMesh

7.    At main directory, compile the new solver typing:

wmake

8.    It’s done ;)


waveDyMFoam tutorial example


The case showed in the video is available in the attached file.

Č
ċ
ď
waveFlumeDyM_OF171.tar.gz
(10k)
Jordi Muela,
19/2/2012 23:22
Comments