Contrib solidParticleFoam
Contents
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:
For 1.5.x:
svn checkout http://openfoam-extend.svn.sourceforge.net/svnroot/openfoam-extend/trunk/Breeder_1.5/solvers/other/solidParticleFoam/
For 2.0.x and 2.1.x:
svn checkout http://openfoam-extend.svn.sourceforge.net/svnroot/openfoam-extend/trunk/Breeder_2.0/solvers/other/solidParticleFoam
Compile solidParticleFoam and run the box test case:
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 solidParticleDamBreak
Add the solidParticleCloud class to the interFoam/damBreak tutorial by doing the following, and you will have some nice animation to view:
Copy the interFoam solver, clean up, re-name and compile:
cd $WM_PROJECT_DIR cp -r --parents applications/solvers/multiphase/interFoam $WM_PROJECT_USER_DIR cd $WM_PROJECT_USER_DIR/applications/solvers/multiphase mv interFoam solidParticleInterFoam cd solidParticleInterFoam wclean rm -rf Make/linux* mv interFoam.C solidParticleInterFoam.C sed -i.orig s/interFoam/solidParticleInterFoam/g Make/files sed -i s/FOAM_APPBIN/FOAM_USER_APPBIN/g Make/files wmake
At this point you can check that the code still works for the damBreak tutorial.
Add functionality from the solidParticleCloud class, described at http://openfoamwiki.net/index.php/Contrib_solidParticleFoam. Do a checkout, so that we can grab some files easily (the grabbing later assumes that you have followed the above instructions exactly, so that you are now in the $WM_PROJECT_USER_DIR/applications/solidParticleInterFoam directory):
svn checkout http://openfoam-extend.svn.sourceforge.net/svnroot/openfoam-extend/trunk/Breeder_1.5/solvers/other/solidParticleFoam/
After a look in the solidParticleCloud example, we know that we need to include the class definitions in solidParticleCloud.H, we should create a solidParticleCloud, and we should use the 'move' member function to move the particles each time step:
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*
We need to add two libraries when we compile:
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 rehash
Now, let's modify the interFoam/damBreak tutorial and include the particles of the solidParticleFoam/box tutorial (we have to modify the initial positions since we will use them in a new geometry):
run cp -r $FOAM_TUTORIALS/interFoam/damBreak solidParticleDamBreak cd solidParticleDamBreak 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 &
View the results in paraview (there is a problem with LPT in paraFoam):
- foamToVTK
- paraview
- File/open: VTK/solidParticeDamBreak_..vtk
- File/open: VTK/lagrangian/defaultCloud/defaultCloud_..vtk
- For the solidParticleDamBreak object: Display: Opacity 0,3. 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
- 2008-11-15: Added the solidParticleDamBreak example
--Hani 10:09, 7 October 2008 (CEST)