CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > OpenFOAM Pre-Processing

non-uniform internalField

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

Like Tree2Likes
  • 1 Post By gschaider
  • 1 Post By gschaider

Reply
 
LinkBack Thread Tools Display Modes
Old   June 18, 2012, 18:13
Wink non-uniform internalField
  #1
Member
 
shiv
Join Date: Jun 2012
Location: Lucknow, IN
Posts: 51
Rep Power: 5
shash is on a distinguished road
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??
shash is offline   Reply With Quote

Old   June 18, 2012, 19:24
Default
  #2
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 3,912
Rep Power: 40
gschaider will become famous soon enoughgschaider will become famous soon enough
Quote:
Originally Posted by shash View Post
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
gschaider is offline   Reply With Quote

Old   May 11, 2013, 09:15
Default
  #3
Senior Member
 
Mojtaba.a's Avatar
 
Mojtaba Amiraslanpour
Join Date: Jun 2011
Location: Zanjan, Iran
Posts: 233
Rep Power: 7
Mojtaba.a is on a distinguished road
Send a message via Yahoo to Mojtaba.a
Quote:
Originally Posted by gschaider View Post
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
__________________
Complex Heat & Flow Simulation Research Group
If you can't explain it simply, you don't understand it well enough. "Richard Feynman"
Mojtaba.a is offline   Reply With Quote

Old   May 12, 2013, 06:00
Default
  #4
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 3,912
Rep Power: 40
gschaider will become famous soon enoughgschaider will become famous soon enough
Quote:
Originally Posted by Mojtaba.a View Post
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 likes this.
__________________
Note: I don't use "Friend"-feature on this forum out of principle. Ah. And by the way: I'm not on Facebook either. So don't be offended if I don't accept your invitation/friend request
gschaider is offline   Reply With Quote

Old   May 12, 2013, 06:22
Default
  #5
Senior Member
 
Mojtaba.a's Avatar
 
Mojtaba Amiraslanpour
Join Date: Jun 2011
Location: Zanjan, Iran
Posts: 233
Rep Power: 7
Mojtaba.a is on a distinguished road
Send a message via Yahoo to Mojtaba.a
Quote:
Originally Posted by gschaider View Post
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
__________________
Complex Heat & Flow Simulation Research Group
If you can't explain it simply, you don't understand it well enough. "Richard Feynman"
Mojtaba.a is offline   Reply With Quote

Old   May 12, 2013, 16:12
Default
  #6
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 3,912
Rep Power: 40
gschaider will become famous soon enoughgschaider will become famous soon enough
Quote:
Originally Posted by Mojtaba.a View Post
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 likes this.
__________________
Note: I don't use "Friend"-feature on this forum out of principle. Ah. And by the way: I'm not on Facebook either. So don't be offended if I don't accept your invitation/friend request
gschaider is offline   Reply With Quote

Old   May 12, 2013, 16:54
Default
  #7
Senior Member
 
Mojtaba.a's Avatar
 
Mojtaba Amiraslanpour
Join Date: Jun 2011
Location: Zanjan, Iran
Posts: 233
Rep Power: 7
Mojtaba.a is on a distinguished road
Send a message via Yahoo to Mojtaba.a
Quote:
Originally Posted by gschaider View Post
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
__________________
Complex Heat & Flow Simulation Research Group
If you can't explain it simply, you don't understand it well enough. "Richard Feynman"
Mojtaba.a 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
singularity? mihaipruna OpenFOAM Running, Solving & CFD 5 April 24, 2012 17:18
chtMultiRegionSimpleFoam javad814 OpenFOAM 1 September 26, 2011 13:30
Need help with boundary conditions: open to atmosphere Wolle OpenFOAM 2 April 11, 2011 07:32
rhoSimpleFoam claco OpenFOAM 7 April 20, 2010 04:32
RasInterFoam STRANGE RESULTS AT BOUNDARY kumar2 OpenFOAM Running, Solving & CFD 8 March 24, 2008 19:38


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