CFD Online Logo CFD Online URL
Home > Forums > OpenFOAM Pre-Processing

Nonuniform initial conditions

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

LinkBack Thread Tools Display Modes
Old   January 3, 2006, 07:54
Default Hi I have a body, with a po
Nico Petry
Join Date: Mar 2009
Posts: 36
Rep Power: 8
nico is on a distinguished road

I have a body, with a porous and a nonporous region. By using a field for the permeability and specifying appropriate values for certain regions i want to define porous/non-porous-zones. My problem is how to set non-uniform initial conditions. It is described in some other threads, but not enough detailed.

I would be very thankful for some help
nico is offline   Reply With Quote

Old   January 3, 2006, 08:10
Default For "easy" cases, use the setF
Senior Member
Hrvoje Jasak
Join Date: Mar 2009
Location: London, England
Posts: 1,768
Rep Power: 21
hjasak will become famous soon enough
For "easy" cases, use the setFields utility. You can find an example dictionary in:


For more complex cases, write a little application (top-level code) that will read in the field you wish to set and, set the values and write it out. Good examples could be found in OpenFOAM-1.2/applications/utilities/postProcessing/velocityField or (if you're running an older version) in setGammaDamBreak in the interFoam tutorial (OLD VERSION).


Hrvoje Jasak
Providing commercial FOAM/OpenFOAM and CFD Consulting:
hjasak is offline   Reply With Quote

Old   January 4, 2006, 07:37
Default I have meshed my geometry with
Nico Petry
Join Date: Mar 2009
Posts: 36
Rep Power: 8
nico is on a distinguished road
I have meshed my geometry with gambit and declared two different volumes. After converting the mesh with fluentMeshtoFoam i get a folder named sets in /constant/polyMesh with 2 files in it. The two files (fluid.1 & fluid.2 )each with contain a list of cells which belong to each volume.

I know that i cannot use setFields to set nonuniform initial conditions for the two different volumes, because i think it only works with using blockmesh. I read in another thread that it is possible to change boxtocell with celltocell.

By Mattijs Janssens on Thursday, November 17, 2005 - 03:05 am: Edit Post

to e.g. read cellSet c0 replace the

box (..)(..)

fieldValues ...


set "c0";

fieldValues ...

(or maybe lose the quotes around c0)
Also look at the sample cellSetDict in the cellSet utility.

My question is now, how to read in all cells belong to one file (for example polyMesh/sets/fluid.1). It would be a great help if you told me step by step, what I have to do.

the file fluid.4:

version 2.0;
format ascii;

root "OpenFOAM/nico-1.2/run/tutorials/simpleFoam";
case "test01";
instance ""constant"";
local "polyMesh/sets";

class cellSet;
object fluid.4;

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //



nico is offline   Reply With Quote


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Nonuniform initial condition using cellSetDict rinao OpenFOAM Running, Solving & CFD 6 January 9, 2013 01:42
Specifying nonuniform initial condition msyaml OpenFOAM Running, Solving & CFD 61 January 20, 2009 15:05
Burgerbs equation non constant Boundary Conditions Initial Conditions arkangel OpenFOAM Running, Solving & CFD 1 October 2, 2008 14:48
Problem with nonuniform boundary conditions qtian OpenFOAM Pre-Processing 2 July 25, 2007 15:30
Initial conditions = final conditions Chucho CFX 5 December 16, 2005 18:14

All times are GMT -4. The time now is 09:30.