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

using setFieldsDict

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

Like Tree6Likes
  • 2 Post By nimasam
  • 4 Post By vishal3

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   June 7, 2013, 08:07
Default using setFieldsDict
  #1
Member
 
belkadi
Join Date: May 2013
Location: France
Posts: 31
Rep Power: 12
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, 139 views)
File Type: jpg mesh2.JPG (7.6 KB, 110 views)
belkadi is offline   Reply With Quote

Old   June 7, 2013, 10:24
Default
  #2
Senior Member
 
Bernhard
Join Date: Sep 2009
Location: Delft
Posts: 790
Rep Power: 21
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, 17:01
Default
  #3
Senior Member
 
Nima Samkhaniani
Join Date: Sep 2009
Location: Tehran, Iran
Posts: 1,266
Blog Entries: 1
Rep Power: 24
nimasam is on a distinguished road
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 and SHANRU like this.
__________________
My Personal Website (http://nimasamkhaniani.ir/)
Telegram channel (https://t.me/cfd_foam)
nimasam is offline   Reply With Quote

Old   June 8, 2013, 07:27
Default
  #4
Member
 
Join Date: Apr 2013
Posts: 32
Rep Power: 12
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, 02:57
Default
  #5
Senior Member
 
Bernhard
Join Date: Sep 2009
Location: Delft
Posts: 790
Rep Power: 21
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, 04:17
Default
  #6
New Member
 
Vishal
Join Date: Feb 2013
Posts: 28
Rep Power: 13
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..
vishal3 is offline   Reply With Quote

Reply

Thread Tools Search this Thread
Search this Thread:

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


All times are GMT -4. The time now is 04:45.