# Uncategorized

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

In this blog, quick reference notes about OpenFOAM are posted in a form of a summary to address a specific topic per post, which I think could be helpful as a reminder for my Alzheimer condition
Uncategorized Entries with no category

## Gnuplot Vector Probes from the funtionObject

Posted June 9, 2012 at 16:27 by Hisham (Notes for OpenFOAM!)

When using the functionObject to probe a vector (e.g. velocity) at a location, the output is in the format:
Code:
```# Time  vector
1.20   (2.14   8.512   1.005)
.
.
.```
Unlike sampling or using probeLocations, until now AFAIK it is not possible to use U.component(0) to spit only the X-component. To resolve that using gnuplot, one can use:
Code:
`plot 'probeFile' using "%lf (%lf %*lf %*lf)"`
to plot the Ux component...
Senior Member
Posted in Uncategorized

## The directionMixed Boundary Condition

Posted June 7, 2012 at 11:53 by Hisham (Notes for OpenFOAM!)
Updated June 7, 2012 at 14:45 by Hisham

A mixed boundary condition is a combination of a fixedValue (Drichilet) and a fixedGradient (Neumann) boundaries determined by a fraction value. When fraction = 1, the BC is fixedValue and when it is set to zero the BC is fixedGradient. Values in between calculate a value in between (see code).

The directionMixed BC allows changing the fraction value for different directions. Assuming a plane-strain stress analysis that needs fixation in X-direction (Dx = 0) and free Y-direction...
Senior Member
Posted in Uncategorized

## Set (Initial) Internal Fields Using #codeStream

Posted April 23, 2012 at 14:55 by Hisham (Notes for OpenFOAM!)
Tags

To set up (initial) internal fields of variables according to an expression, one can use the #codeStream feature as:
Code:
```internalField  #codeStream
{
code
#{
const IOdictionary& d = static_cast<const IOdictionary&>(dict);
const fvMesh& mesh = refCast<const fvMesh>(d.db());
scalarField fld(mesh.nCells(), 12.34);// uniform value of the field as 12.34 or just fld(mesh.nCells())```
...
Senior Member
Posted in Uncategorized

## codedFixedValue Boundary Condition

Posted April 11, 2012 at 17:57 by Hisham (Notes for OpenFOAM!)
Tags

This is an example of using codedFixedValue boundary condition to input expressions that are time and position dependent.

Code:
```    PatchName
{
type               codedFixedValue;
value              uniform (0 0 0); //\$internalField;
redirectType    BC_Given_Name;
code
#{
fixedValueFvPatchVectorField myPatch (*this);
forAll(myPatch, celli)
{
myPatch[celli]```
...
Senior Member
Posted in Uncategorized

## Cyclic (Periodic) Boundary Condition

Posted April 11, 2012 at 17:57 by Hisham (Notes for OpenFOAM!)
Updated April 12, 2012 at 07:12 by Hisham

OF V.2.x
Cyclic (periodic) boundary condition is used to model repetitive geometries by joining two patches as if they were physically attached to each other!
The "simplest" way to apply a cyclic BC is to have two patches that are identical and define them in the ./constant/polyMesh/boundary as:
Code:
``` RightPatch
{
type            cyclic;
nFaces          49;
startFace       9506;
neighbourPatch```
...
Senior Member
Posted in Uncategorized