Contrib solidParticleFoam

From OpenFOAMWiki
Revision as of 20:54, 15 November 2008 by Hani (Talk | contribs)

Valid versions: OF version 15.png

1 Short description

A minimalistic code and case set-up to show how to use the solidParticleCloud class.

Note that OpenFOAM-1.5.x is required! It does not work with OpenFOAM-1.5!

2 Usage

Do the following steps:

  • cd solidParticleFoam/solidParticleFoam
  • wmake
  • rehash
  • cd ../box
  • blockMesh
  • solidParticleFoam

2.1 Post-Processing

Do the following steps while standing in the 'box' directory:

  • foamToVTK
  • paraview
  • In Paraview: Load state baseState.pvsm and click on the 'play' button to run an animation.

3 Physics

The code includes interaction with walls, but no collisions. The particles are affected by drag, but the fluid is unaffected by the particles.

This solver is not to be used for simulations that resemble the real world. It's just a demo.

4 Example cases

4.1 Box

Two particles with different initial velocities are inserted in the field. See above for how to run the case.

4.2 damBreak

Add the solidParticleCloud class to the interFoam/damBreak tutorial by doing the following, and you will have some nice animation to view:

Copy the \verb+interFoam+ solver, clean up, re-name and compile \begin{verbatim} cd $WM_PROJECT_USER_DIR/applications cp -r $FOAM_APP/solvers/multiphase/interFoam solidParticleInterFoam cd solidParticleInterFoam wclean rm -r Make/linux* mv interFoam.C solidParticleInterFoam.C sed s/interFoam/solidParticleInterFoam/g Make/files > temp1 sed s/FOAM_APPBIN/FOAM_USER_APPBIN/g temp1 > Make/files wmake \end{verbatim}

Add functionality from the solidParticleCloud class, described at: \verb+http://openfoamwiki.net/index.php/Contrib_solidParticleFoam+ \begin{verbatim} svn checkout http://openfoam-extend.svn.sourceforge.net/svnroot/openfoam-extend/trunk/Breeder_1.5/solvers/other/solidParticleFoam/ \end{verbatim}

After a look in the example, we know that we need to include the class definitions in \verb+solidParticleCloud.H+, we should create a \verb+solidParticleCloud+, and we should use the \verb+move+ member function to move the particles each time step: \begin{verbatim} sed s/'#include "twoPhaseMixture.H"'/'#include "twoPhaseMixture.H"\n#include "solidParticleCloud.H"'/g solidParticleInterFoam.C > temp2 sed s/'#include "setInitialDeltaT.H"'/'#include "setInitialDeltaT.H"\n solidParticleCloud particles(mesh);'/g temp2 > temp3 sed s/'runTime.write();'/'particles.move(g);\n runTime.write();'/g temp3 > solidParticleInterFoam.C rm temp* \end{verbatim}

We need to add two libraries when we compile: \begin{verbatim} sed s/'finiteVolume\/lnInclude'/'finiteVolume\/lnInclude \\\n -I$(LIB_SRC)\/lagrangian\/basic\/lnInclude \\\n -I$(LIB_SRC)\/lagrangian\/solidParticle\/lnInclude'/g Make/options > temp1 sed s/'-lfiniteVolume'/'-lfiniteVolume \\\n -llagrangian \\\n -lsolidParticle'/g temp1 > Make/options rm temp* wmake \end{verbatim}

Now, let's modify the \verb+interFoam/damBreak+ tutorial and include the particles of the \verb+solidParticleFoam/box+ tutorial: \begin{verbatim} run cp -r $FOAM_TUTORIALS/interFoam/damBreak . cd damBreak cp -r $WM_PROJECT_USER_DIR/applications/solidParticleInterFoam/solidParticleFoam/box/0/lagrangian 0 rm -rf 0/lagrangian/myCloud cp -r $WM_PROJECT_USER_DIR/applications/solidParticleInterFoam/solidParticleFoam/box/constant/particleProperties constant sed s/'0.05'/'0.005'/g 0/lagrangian/defaultCloud/positions > temp1 sed s/'9e-2'/'0.58'/g temp1 > 0/lagrangian/defaultCloud/positions rm temp1 blockMesh setFields solidParticleInterFoam >& log_solidParticleInterFoam & \end{verbatim}

View the results in \verb+paraview+ (there is a problem with LPT in paraFoam).\\ \begin{verbatim} foamToVTK paraview File/open: VTK/damBreak_..vtk File/open: VTK/lagrangian/defaultCloud/defaultCloud_..vtk \end{verbatim} For the damBreak object: \verb+Display: Opacity 0,3+\\ \verb+Color By: gamma+ (cell values)\\ For the defaultCloud object: Create box glyphs (length: 10/10/10, Scale Mode off) to visualize the particles.\\ Run the animation and enjoy...

5 Download

The most up-to-date version of the sources can be downloaded via subversion:

svn checkout http://openfoam-extend.svn.sourceforge.net/svnroot/openfoam-extend/trunk/Breeder_1.5/solvers/other/solidParticleFoam/

6 History

  • 2008-11-07: Initial upload

--Hani 10:09, 7 October 2008 (CEST)