CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM Programming & Development (http://www.cfd-online.com/Forums/openfoam-programming-development/)
-   -   using setFieldsDict (http://www.cfd-online.com/Forums/openfoam-programming-development/118969-using-setfieldsdict.html)

belkadi June 7, 2013 07:07

using setFieldsDict
 
2 Attachment(s)
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

Bernhard June 7, 2013 09:24

What do you think it means? Did you try to execute and see what happens? Doesn't the name itself explain it already?

nimasam June 7, 2013 16:01

Quote:

Originally Posted by belkadi (Post 432632)
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 :D

but i suggest that you use funkySetFields from swak4Foam package its more handy

rajcfd June 8, 2013 06:27

Quote:

Originally Posted by belkadi (Post 432632)
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)

Bernhard June 10, 2013 01:57

Quote:

Originally Posted by nimasam (Post 432701)
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 :D

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 ;)

vishal3 July 29, 2013 03:17

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..


All times are GMT -4. The time now is 11:47.