CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums

Uncategorized

Register Blogs Members List Search Today's Posts Mark Forums Read

Uncategorized Entries with no category
Old

How to get an element of a wordList from a dictionary

Posted July 16, 2012 at 06:28 by tomislav_maric

Snippet:

Code:
 IOdictionary fvSchemes
    (
        IOobject
        (
           "fvSchemes", 
           runTime.system(), 
           runTime, 
           IOobject::MUST_READ, 
           IOobject::NO_WRITE
        )
    );

    Info << fvSchemes.subDict("divSchemes")["div(phi,alpha)"][1] << endl;
Senior Member
Posted in Uncategorized
Views 771 Comments 0 tomislav_maric is offline Edit Tags
Old

How to compute a better gradient for sharp fields on unstructured mesh.

Posted January 31, 2012 at 10:40 by tomislav_maric
Tags gradient

In case you are dealing with sharp fields, there are multiple options to choose from. Usually, the literature recommends the "least squares approach", or linear regression. In order to get somewhere with this, the least squares points should pick up the skew cells , not just the normal own-nei surrounding cells in OpenFOAM. Still, there is a workaround that works fine:

#1) IDW interpolation of cell values to mesh points
#2) create a surface*field
#3) average the...
Senior Member
Posted in Uncategorized
Views 1167 Comments 0 tomislav_maric is offline Edit Tags
Old

How to get a 27 cell stencil in OpenFOAM.

Posted January 31, 2012 at 10:30 by tomislav_maric

The primitiveMesh::cellCells returns with a cross cell stencil of 6 cells (the cell in question is excluded). This computation comes from the basis of OpenFOAM: face addressing. Although it is very efficient, this kind of computation introduces errros e.g. in the gradient reconstruction of sharp fields.

Try to generate a field that has a jump in a single layer of cells, whose iso surface is a plane, and try to compute the normal field of this plane from the fraction gradient using...
Senior Member
Posted in Uncategorized
Views 2078 Comments 2 tomislav_maric is offline Edit Tags
Old

Paraview: How to visualize cell data as text written in cells

Posted November 21, 2011 at 11:16 by tomislav_maric

If you are dealing with some delicate computations that require you to investigate the values of fields in some cells (I use this for debugging), there is a way to do this in Paraview:

View->Selection Inspector

Create Selection

Selection Type: Thresholds

Check the box: Invert selection

Scroll down to the Display Style subwindow and select Cell Label

Check the box: Visible

Choose: "p" for pressure...
Senior Member
Posted in Uncategorized
Views 1290 Comments 0 tomislav_maric is offline Edit Tags
Old

How to synchronise a bunch of .vtk files with OpenFOAM runTime

Posted November 21, 2011 at 11:03 by tomislav_maric

If you are visualising a bunch of .vtk files that were generated separately from the standard fields in OpenFOAM, and if you are a lucky person like me at this point (your time steps are constant), there exists a simple way to visualize the files alongside OpenFOAM data:

1) Open the OpenFOAM case as usual.
2) Open the .vtk files. The files have to be named appropriately to be read as time-dependent data: someName-001.vtk, someName-002.vtk, guess what is the next name. ...
Senior Member
Posted in Uncategorized
Views 594 Comments 0 tomislav_maric is offline Edit Tags

All times are GMT -4. The time now is 13:12.