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

using setFieldsDict

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

Like Tree2Likes
  • 1 Post By nimasam
  • 1 Post By vishal3

Reply
 
LinkBack Thread Tools Display Modes
Old   June 7, 2013, 07:07
Default using setFieldsDict
  #1
Member
 
belkadi
Join Date: May 2013
Location: France
Posts: 31
Rep Power: 4
belkadi is on a distinguished road
Dear FOAMers,

I'm starting to use OpenFOAM since 2 weeks.
After reading some tutorials, I've established the mesh of my problems (please see attached file).
Now, I'm trying to put my initial conditions: for example half of the tank is filled with water (alpha1=1) and the remaining half is air (open to atmosphere) hence alpha1=0.
I tried to use setFieldDict

defaultFieldValues
(
volScalarFieldValue alpha1 1
);

regions
(
boxToCell
{
box (x x x) (x x x);
fieldValues
(
volScalarFieldValue alpha1 0
);
}
);

I'm wondering if I should use the boxToCell or not ? If yes what is the meaning of the syntax box (x x x) (x x x) ? Could any Foamers explain to me how to process ?

Any suggestions for this problem is welcome !

Many thanks

Kind regards

krimo
Attached Images
File Type: jpg mesh.JPG (15.2 KB, 18 views)
File Type: jpg mesh2.JPG (7.6 KB, 14 views)
belkadi is offline   Reply With Quote

Old   June 7, 2013, 09:24
Default
  #2
Senior Member
 
Bernhard
Join Date: Sep 2009
Location: Delft
Posts: 790
Rep Power: 12
Bernhard is on a distinguished road
What do you think it means? Did you try to execute and see what happens? Doesn't the name itself explain it already?
Bernhard is offline   Reply With Quote

Old   June 7, 2013, 16:01
Default
  #3
Senior Member
 
Nima Sam
Join Date: Sep 2009
Location: Tehran, Iran
Posts: 1,123
Blog Entries: 1
Rep Power: 14
nimasam is on a distinguished road
Send a message via Yahoo to nimasam
Quote:
Originally Posted by belkadi View Post
Dear FOAMers,

Now, I'm trying to put my initial conditions: for example half of the tank is filled with water (alpha1=1) and the remaining half is air (open to atmosphere) hence alpha1=0.
I tried to use setFieldDict

defaultFieldValues
(
volScalarFieldValue alpha1 1
);

regions
(
boxToCell
{
box (x x x) (x x x);
fieldValues
(
volScalarFieldValue alpha1 0
);
}
);
setFields creates non-uniform initial condition, so after you edit it you should run in terminal
Code:
setFields
and those points are the points on the main diameter of square

but i suggest that you use funkySetFields from swak4Foam package its more handy
JR22 likes this.
__________________
Training Course on OpenFOAM at (http://www.isme.ir/)
My Weblog (http://openfoam.blogfa.com/)
nimasam is offline   Reply With Quote

Old   June 8, 2013, 06:27
Default
  #4
Member
 
Join Date: Apr 2013
Posts: 32
Rep Power: 4
rajcfd is on a distinguished road
Quote:
Originally Posted by belkadi View Post
Dear FOAMers,

I'm starting to use OpenFOAM since 2 weeks.
After reading some tutorials, I've established the mesh of my problems (please see attached file).
Now, I'm trying to put my initial conditions: for example half of the tank is filled with water (alpha1=1) and the remaining half is air (open to atmosphere) hence alpha1=0.
I tried to use setFieldDict

defaultFieldValues
(
volScalarFieldValue alpha1 1
);

regions
(
boxToCell
{
box (x x x) (x x x);
fieldValues
(
volScalarFieldValue alpha1 0
);
}
);

I'm wondering if I should use the boxToCell or not ? If yes what is the meaning of the syntax box (x x x) (x x x) ? Could any Foamers explain to me how to process ?

Any suggestions for this problem is welcome !

Many thanks

Kind regards

krimo


boxtoCell will work in your case....box (xxx) (xxx)... In this you have to enter the coordinates of the box for which patching is to be done.... like box ( 0 0 0) (0.1 0.2 0.3)
rajcfd is offline   Reply With Quote

Old   June 10, 2013, 01:57
Default
  #5
Senior Member
 
Bernhard
Join Date: Sep 2009
Location: Delft
Posts: 790
Rep Power: 12
Bernhard is on a distinguished road
Quote:
Originally Posted by nimasam View Post
setFields creates non-uniform initial condition, so after you edit it you should run in terminal
Code:
setFields
and those points are the points on the main diameter of square

but i suggest that you use funkySetFields from swak4Foam package its more handy
There is no reason to use funkySetFields if you don't want to do anythin funky
Bernhard is offline   Reply With Quote

Old   July 29, 2013, 03:17
Default
  #6
New Member
 
Vishal
Join Date: Feb 2013
Posts: 20
Rep Power: 4
vishal3 is on a distinguished road
Hi Belkadi

If your case is rectangular tank, then you can use boxToCell. The points (x x x)(x x x) means those are the point on diagonal of the rectangle where you need to patch the required fields.

If your case is cylindrical you can use cylinderTocell.
there you have to specify two points on the axis of cylinder where you need to patch the field and also radius of the cylinder.

All the best..
limin zhang likes this.
vishal3 is offline   Reply With Quote

Reply

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
setFieldsDict, alpha1, free surface, wigley kolloff OpenFOAM Pre-Processing 10 April 3, 2015 05:05
codeStream in SetFieldsDict physics1 OpenFOAM Running, Solving & CFD 1 June 14, 2013 10:58
SetFieldsDict: Non uniform density physics1 OpenFOAM Running, Solving & CFD 1 May 8, 2013 16:35
SetFieldsDict file problem with 3D multiphase flow jeff_87 OpenFOAM Pre-Processing 11 May 3, 2013 06:20
Bogus setFieldsDict in damBreak4phase{,Fine} tutorial cases mwild OpenFOAM Bugs 1 August 10, 2010 09:36


All times are GMT -4. The time now is 19:05.