CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM Pre-Processing (http://www.cfd-online.com/Forums/openfoam-pre-processing/)
-   -   non-uniform internalField (http://www.cfd-online.com/Forums/openfoam-pre-processing/103377-non-uniform-internalfield.html)

shash June 18, 2012 18:13

non-uniform internalField
 
hi,
I am new to openfoam, i need to set initial pressure field as function of height.
i donot want to use setfields (uses third party software) to get the task done, can i use internalField nonuniform <List>; //but donot know how to set the list??

gschaider June 18, 2012 19:24

Quote:

Originally Posted by shash (Post 367097)
hi,
I am new to openfoam, i need to set initial pressure field as function of height.
i donot want to use setfields (uses third party software) to get the task done, can i use internalField nonuniform <List>; //but donot know how to set the list??

setFields is not third party. But it won't set the type of field you want

Setting that list can be done by hand using a text editor (but it is not practical ;) ), by writing your own utility in C++ or using funkySetFields which is third party software

Mojtaba.a May 11, 2013 09:15

Quote:

Originally Posted by gschaider (Post 367108)
setFields is not third party. But it won't set the type of field you want

Setting that list can be done by hand using a text editor (but it is not practical ;) ), by writing your own utility in C++ or using funkySetFields which is third party software

Dear Bernhard,
is funkySetFields utility capable of setting a list of cells within a complex region?
by complex region I mean not to be a common shape like rectangle or circle. is it possible to define user defined regions to select particular cells?

Thank you,
Mojtaba

gschaider May 12, 2013 06:00

Quote:

Originally Posted by Mojtaba.a (Post 426687)
Dear Bernhard,
is funkySetFields utility capable of setting a list of cells within a complex region?
by complex region I mean not to be a common shape like rectangle or circle. is it possible to define user defined regions to select particular cells?

Thank you,
Mojtaba

If you can define the region by an expression (in terms of coordinates or other fields) ... you're in business.

If the complex region is written to disc as a cell zone or a cell set ... you're in business (but I think setFields can handle that too)

If it is defined as a mixture of the above ... you're in business.

Bottom line: you've got to be more specific about what you mean with "complex"

Mojtaba.a May 12, 2013 06:22

Quote:

Originally Posted by gschaider (Post 426978)
If you can define the region by an expression (in terms of coordinates or other fields) ... you're in business.

If the complex region is written to disc as a cell zone or a cell set ... you're in business (but I think setFields can handle that too)

If it is defined as a mixture of the above ... you're in business.

Bottom line: you've got to be more specific about what you mean with "complex"

Thank you Bernhard,
well in my case, by complex I mean a region which is surrounded by multiple straight line borders.
For instance this simple region, which is surrounded by these lines:

y=-x+1
y=0
x=0

Thank you

gschaider May 12, 2013 16:12

Quote:

Originally Posted by Mojtaba.a (Post 426983)
Thank you Bernhard,
well in my case, by complex I mean a region which is surrounded by multiple straight line borders.
For instance this simple region, which is surrounded by these lines:

y=-x+1
y=0
x=0

Thank you

Well. If a triangle is your idea of complex .... ;)

That can be easily done with a condition like this in funkySetFields:
Code:

(pos().y>0) && (pos().x>0) && ((pos().x+pos().y)<1)
Either you use it in a condition if you want the rest of the field unchanged
Code:

funkySetFields -time 0 -field alpha -keepPatches -expression "1" -condition "<cond>"
or you reset the wholde field
Code:

funkySetFields -time 0 -field alpha -keepPatches -expression "<cond> ? 1 : 0"
(for <cond> insert the above expression)

Mojtaba.a May 12, 2013 16:54

Quote:

Originally Posted by gschaider (Post 427038)
Well. If a triangle is your idea of complex .... ;)

That can be easily done with a condition like this in funkySetFields:
Code:

(pos().y>0) && (pos().x>0) && ((pos().x+pos().y)<1)
Either you use it in a condition if you want the rest of the field unchanged
Code:

funkySetFields -time 0 -field alpha -keepPatches -expression "1" -condition "<cond>"
or you reset the wholde field
Code:

funkySetFields -time 0 -field alpha -keepPatches -expression "<cond> ? 1 : 0"
(for <cond> insert the above expression)

Thank you Bernhard,
This really helped. :)
I have an another little problem. I want to set z0 values (roughness parameter) for this particular region. as you know z0 is not a field in OF like U or p. well you know these better than me ;)
Do you have any idea how I can set values for it?
in nut file I have something like this:

ground
{
type nutkAtmRoughWallFunction;
z0 $z0;
value uniform 0.0;
}

Can I use funkySetFields for setting the values of z0?

Thank you


All times are GMT -4. The time now is 17:28.