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

non-uniform internalField

Register Blogs Community New Posts Updated Threads Search

Like Tree3Likes
  • 1 Post By gschaider
  • 1 Post By gschaider
  • 1 Post By gschaider

Reply
 
LinkBack Thread Tools Search this Thread 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: 13
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: 4,225
Rep Power: 51
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: Tampa, US
Posts: 308
Rep Power: 15
Mojtaba.a is on a distinguished road
Send a message via Skype™ 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
__________________
Learn OpenFOAM in Persian
SFO (StarCCM+ FLUENT OpenFOAM) Project Team Member
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: 4,225
Rep Power: 51
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: Tampa, US
Posts: 308
Rep Power: 15
Mojtaba.a is on a distinguished road
Send a message via Skype™ 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
__________________
Learn OpenFOAM in Persian
SFO (StarCCM+ FLUENT OpenFOAM) Project Team Member
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: 4,225
Rep Power: 51
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: Tampa, US
Posts: 308
Rep Power: 15
Mojtaba.a is on a distinguished road
Send a message via Skype™ 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
__________________
Learn OpenFOAM in Persian
SFO (StarCCM+ FLUENT OpenFOAM) Project Team Member
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   January 4, 2017, 10:24
Default
  #8
New Member
 
Join Date: Nov 2016
Posts: 13
Rep Power: 9
manu551 is on a distinguished road
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"
Hello,

I'm in the second case and I've got a cell set, but the problem is how to assign two different costant values for two different regions... How can I set internalField initial value dictionaries of variables?

Thanks
manu551 is offline   Reply With Quote

Old   January 4, 2017, 12:30
Default
  #9
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51
gschaider will become famous soon enoughgschaider will become famous soon enough
Quote:
Originally Posted by manu551 View Post
Hello,

I'm in the second case and I've got a cell set, but the problem is how to assign two different costant values for two different regions... How can I set internalField initial value dictionaries of variables?

Thanks
Assuming that you have the field foo, want to preserve the boundary conditions and you have two cellSets set1 and set2 which you want to set to 42 and 666 then you could do it with funkySetFields like this
Code:
funkySetFields -time 0 -field foo -keepPatches -expression "set(set1) ? 42 : (set(set2) ? 666 : foo)"
I think it is also possible with setFields but for some reason on machines that I use mysteriously an installation of swak4foam appears and then the tempatation to use funkySetFields is overwhelming
Madeinspace 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

Reply


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
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 18:38


All times are GMT -4. The time now is 07:10.