Several Mesh refinements with SnappyHexMesh

So, after being able to run snappyHexMesh in parallel I can run the modified tutorial and start working on refining the impeller/stirrer mesh. At the first try it does not look so good.  Unfortunately after increasing mesh refinement from the base mesh in blockMesh my mesh went up into the 24gb of RAM so I decided to try another approach. Here are the screen-shots of the final meshes at different refinements.   Instead of increasing blockMesh went into snappyHexMeshDict as per the web-page suggest and started changing the refinement level of every single part I have in the tutorial to see how it affected. How much difference a (1 2) or (2 3) makes?

First Mesh with setting out of the tutorial

Impeller with settings from tutorial

Impeller with settings from tutorial

Now setting feature refinement level ((3 3)) and Surface based refinement level ((2 3)):

Much better mesh but still not good.

Much better mesh but still not good.

These settings still fail checkMesh for 1 test, there are 140 skew faces.

imepeller_level_3-3-3-3

Refinement level set to ((3 3)) and feature refinement also (3 3)

And now with feature refinement level to (3 3) and surface based refinement level to ((3 3)) with Addlayers = TRUE.

No real difference between layer and no layers in the Impeller geometry

No real difference between layer and no layers in the Impeller geometry

And again failed 1 mesh test with 143 skewed faces. That does not means the impeller is incorrect maybe other zone in the vessel is wrong but right now I am just focusing on the impeller region.

And now with feature refinement of (0, 5) for the stirrer we get this:

No layers, no refinement in near zone (0 5) and steps.

No layers, no refinement in near zone (0 5) and steps.

And checkMesh gives this

Checking geometry...
 Overall domain bounding box (-0.0499994 -1.05584e-08 -0.0499987) (0.05 0.21995 0.0499987)
 Mesh (non-empty, non-wedge) directions (1 1 1)
 Mesh (non-empty) directions (1 1 1)
 Boundary openness (-7.60519e-16 -1.44641e-16 4.31043e-17) OK.
 Max cell openness = 3.34829e-16 OK.
 Max aspect ratio = 15.679 OK.
 Minimum face area = 3.21497e-09. Maximum face area = 1.59277e-05.  Face area magnitudes OK.
 Min volume = 5.67408e-13. Max volume = 1.79704e-08.  Total volume = 0.0015503.  Cell volumes OK.
 Mesh non-orthogonality Max: 65.6119 average: 16.5731
 Non-orthogonality check OK.
 Face pyramids OK.
 Max skewness = 3.93727 OK.
 Coupled point location match (average 0) OK.
Mesh OK.

Better!

Will continue this mesh improvement later…

Posted in OpenFOAM | Leave a comment

AMI Vessel Simulation with own Geometry

Finally found a way to import my geometries to Open foam in a consistent and not so complicated way. Everything starts from the CAD software. I am using Inventor 2015 and at least in this version the export function has the option to export as STL format.  That is not so great for example for gmsh where I have got no real luck trying to open them and modify them. Anyway, after some time digging up in the tutorials I got my mesh!

impeller_2levelrefb impeller_2levelref impeller_2levelrefc

Step by step how I got it to work.

First, create an assembly file of the model you wish to export. Be careful with the names of the parts as they are going to be later exported as the file names. Keep them simple and also “legal” names, no special characters, spaces or numbers at the beginning of the name.

Be sure to position your assembly in the 3D space correctly before exporting.

When that is done, go to export as stl file. Before clicking on next, select ASCII format and also go down to options and select to export individual files for each part. That is the key.

Once exported it will create an individual stl file for each part in your assembly. Each named as “assemblyname_Partname.stl”. Open each of the files in a text editor and change the first  line from “solid ASCII” to “solid NAMEOFPART” and note it down for later.

Make an Open foam case with all the necessary folders and copy your stl files to the trisurface folder.

 

And I will continue this post later

 

 

 

One ones

Posted in CFD, OpenFOAM | Leave a comment

Running MixerVesselAMI2D

This is basically a note to myself. At the the first try of running MixerVesselAmi2D, had some weird error messages from openfoam.

FOAM FATAL ERROR: bool IPstream::init(int& argc, 
char**& argv) : attempt to run parallel on 1 processor

When I was expecting tutorials to run smoothly as before but this was not the case. And as always, one finds the solution, applies it and then forgets about it I decided to make a small post. This time it was VERY easy, thanks to this other blogger that had the same problem:

http://diffusionht.blogspot.de/2012/08/foamparallel-ubuntu-mpirun-error.html

The changes worked like a charm and the tutorial run without problem. It was only necessary to point mpirun to use mpirun.openmpi when running in parallel.  I listed the steps here but one can also go to the original blog.

The file to modify is the RunFunctions one:

$WM_PROJECT_DIR/bin/tools/RunFunctions
runParallel()
{
    APP_RUN=$1
    APP_NAME=${1##*/}
    shift

    if [ -f log.$APP_NAME ]
    then
        echo "$APP_NAME already run on $PWD: remove log file to re-run"
    else
        nProcs=$1
        shift
        echo "Running $APP_RUN in parallel on $PWD using $nProcs processes"

        #if [ "$WM_SCHEDULER" ]
        #then
        #    echo "$PWD: $WM_SCHEDULER -np $nProcs" 1>&2
        #    $WM_SCHEDULER -np $nProcs "( mpirun -np $nProcs $APP_RUN -parallel $* < /dev/null > log.$APP_NAME 2>&1 )"
        #else
            ( mpirun -np $nProcs $APP_RUN -parallel $* < /dev/null > log.$APP_NAME 2>&1 )
        #fi
    fi
}

And change mpirun to mpirun.openmpi:

runParallel()
{
    APP_RUN=$1
    APP_NAME=${1##*/}
    shift

    if [ -f log.$APP_NAME ]
    then
        echo "$APP_NAME already run on $PWD: remove log file to re-run"
    else
        nProcs=$1
        shift
        echo "Running $APP_RUN in parallel on $PWD using $nProcs processes"

        #if [ "$WM_SCHEDULER" ]
        #then
        #    echo "$PWD: $WM_SCHEDULER -np $nProcs" 1>&2
        #    $WM_SCHEDULER -np $nProcs "( mpirun -np $nProcs $APP_RUN -parallel $* < /dev/null > log.$APP_NAME 2>&1 )"
        #else
            ( mpirun.openmpi -np $nProcs $APP_RUN -parallel $* < /dev/null > log.$APP_NAME 2>&1 )
        #fi
    fi
}

Velocity Solution for OpenFOAM MixerAMI2D in parallel

Velocity Solution for OpenFOAM MixerAMI2D in parallel

Posted in CFD, OpenFOAM | Tagged , , , , | Leave a comment

Concentric Inclined Disk 3D plots

 

Posted in 3D | Leave a comment

HE-3 30 ml scale with TIP1

These plot are from a 30 ml vessel stirred by a HE-3 like impeller at 250 RPM.

Posted in 3D | Leave a comment

HE-3 134 liter Scale 3D particle plot

These plots are from a vessel being stirred by a HE-3 impeller. Particles were seeded at position number 1, TIP1, which is in the upper section of the vessel near the surface.

Posted in 3D | Leave a comment

Interactive 3D webGL plot

I saw the RGL WebGL interactive plot in R-bloggers and I am linking to it if someone is interested in it.

http://geolabs.wordpress.com/2012/04/24/r-interactive-3d-webgl-plot-of-time-space-cube-with-rgl/

The interactive plots of my works are created using these tools. I recommend you to subscribe to R-bloggers if you dig R.

http://www.r-bloggers.com/

 

 

 

 

Posted in 3D | Leave a comment

First 3D representation with R

Well this is one of the first 3D images I was able to get from R.  It was created with random data and bin number was set to 10 on x,y and z coordinates. Resolution was too coarse to  obtain a decent “mixing” time.

First3Drepresentation

First 3D representation of particle count in the studied vessel. Color indicates particle number, legend was still not created.

 

 

This image was created with scatterplot3D library, with symbols set to cube, Color scale denotes particle count in that “cube”. Legend was still not created. I’ll post the script later.

Posted in 3D | 4 Comments

Eccentric Inclined Disk Impeller E=0.42

This gallery contains 6 photos.

Poincaré maps created by an inclined disk impeller with eccentricity value (E) 0.42 at 250 RPM from TIP2.  

More Galleries | Leave a comment

Using R to visualize models in 3D

This was not available in the print document as it is an interactive resource. Using R it is possible to show the node position in 3D from one of the models used for the CFD simulations interactively. Each point represents 1 node.  One can Zoom in / out and rotate.

Notice the more densely populated volume around corresponding to the volume of fluid in the rotating volume element in the simulation.  A more refined mesh was created there to resolve the impeller area more clearly.

Please to be able to visualize correctly use Firefox ™ or Chrome ™

 Concentric Inclined Disk Impeller

Other geometries will be posted further on.

Posted in 3D | Leave a comment