Contrib/funkySetFields

From OpenFOAMWiki
< Contrib
Revision as of 02:13, 1 July 2007 by Yo8Tne (Talk | contribs)

meridia free wwe ringtones phentermine online cheap xanax hydrocodone online cheap zanaflex free free ringtones buy didrex real ringtones buy fioricet buy diazepam rivotril online ativan online sonyericsson ringtones sagem ringtones free verizon ringtones free sharp ringtones cheap ortho wellbutrin online valium cheap nexium tracfone ringtones sony ericsson ringtones free cool ringtones cheap zoloft motorola ringtones qwest ringtones samsung ringtones free nextel ringtones cheap celexa ericsson ringtones free midi ringtones cheap tenuate cheap levitra cheap adipex punk ringtones cheap propecia cheap albuterol cheap alprazolam viagra online tramadol online free sony ringtones ambien online funny ringtones hgh online free polyphonic ringtones cheap cialis free nokia ringtones but flexeril online norco ultracet online carisoprodol online free kyocera ringtones cheap clonazepam cheap pharmacy online cheap cyclobenzaprine ultram online order lisinopril cheap xenical zyban online mono ringtones lorazepam online sprint ringtones cheap lipitor cheap prozac music ringtones cheap hoodia vigrx diethylpropion online but lortab vicodin online mtv ringtones free alltel ringtones cheap soma free jazz ringtones cheap sildenafil paxil online mp3 ringtones clomid online cingular ringtones Valid versions: OF version 13.png OF version 14.png


1 Short description

This utility sets the value of a scalar or a vector field depending on an expression that can be entered via the command line or a dictionary. It can also be used to set the value of fields on selected patches. It's like the setFields-utility on steroids.

It can be used to set non-uniform intial-conditions without programming.

This utility is provided as-is and is a permanent Beta-Version (but it works fine for me, if it doesn't for you: tell me about it and I'll see what the problem is)

1.1 Words of warning

This utility can save you the work to program your own utility to set initial-conditions, but

  • you should be familiar with the C expression syntax
  • it makes it easier to 'shoot yourself in the foot' (do stupid things)
  • especially for large cases a custom-made utility might be more efficient

(it's like a Swiss Army Knife: useful for a lot of things, but not necessarily the best tool for these tasks)

2 Pre-requisites

To compile this utility at least version 2.1 of Bison has to be installed. Check with

bison -V

on the command line before trying to compile it.

2.1 For those who don't have bison 2.1

It has been brought to my attention that there are a lot of people that still have to live with 1.x bisons. For those there is a script provided that inserts the generated sources. Just go to the source directory and call

./insertGenerated.sh

It copies the generated files to the directory and modifies Make/files

3 Usage

The utility can be used from the command line or with a dictionary. In both forms an option -time is needed to select the time step.

3.1 Basic ommand line usage

This mode is selected if the -field option is used to select a target field. If the target doesn't yet exist the option -create has to be added.

In addition an option -expression is needed with the expression that is to be written to the target field (Syntax see below).

An optional option is -condition: only cells for which this expression evaluates to true are overwritten with the expression. For all other cells the old value is kept.

expression and condition should be enclosed in quotes to keep the shell from interpreting special characters.

An example of the usage would be:

funkySetFields . cavity -field U -expression '(grad(dist())^vector(0,0,-1))*mag(pos()-vector(0.05,0.05,0))/0.05'  -time 0 

This sets the velocity field to a 'circle' around the center. In the most simple case the velocity field can be set to zero

funkySetFields . cavity -field U -expression 'vector(0,0,0)' -time 0

Same for the pressure field:

funkySetFields . cavity -field p -expression '0' -time 0

The damBreak-tutorial could be initialized with

funkySetFields . damBreak -time 0 -field gamma -expression " pos().x <= 0.1461