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

FunkySetFields Boundary conditions

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

Reply
 
LinkBack Thread Tools Display Modes
Old   January 7, 2009, 10:56
Default BRIEF DESCRIPTION -----------
  #1
New Member
 
Michael List
Join Date: Mar 2009
Posts: 3
Rep Power: 7
listmg is on a distinguished road
BRIEF DESCRIPTION
-----------------
I am currently trying to apply a function to a flowfield using funkySetFields. The application works as described, however, I would like to specify the same xyz-dependent function on the boundaries as in the interior, without copying the interior values to the boundaries. The current function uses "pos" which uses the cell center. I am aware of "fpos", but am not sure how to apply it. Any assistance would be greatly appreciated!

EXAMPLE
-------
Currently I am running a unit cube to learn how to use the utility. I am running the below command to set a linear gradient on the velocity components:

funkySetFields -time 0 -field U -keepPatches \
-valuePatches "inlet exit top bottom front back" \
-expression "vector(3*pos().x,4*pos().y,5*pos().z)"

Again, this gives the desired behavior in the cells but I am unsure how to set the boundary face values correctly without manually editing them.



Thank you very much,
Mike
listmg is offline   Reply With Quote

Old   January 12, 2009, 17:28
Default Hi Mike! In fact what FSF d
  #2
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 3,840
Rep Power: 38
gschaider will become famous soon enoughgschaider will become famous soon enough
Hi Mike!

In fact what FSF does for valuePatches is take the value of the cell that the patch-face borders to and uses it as the face value. In your case this might introduce a slight error.

The problem with fpos is that it produces a surfaceField and funkySetFields knows no way to map that directly to a boundary patch of a volField (which is what you want to do), it always has to be converted (by averaging etc) back to a volField (and then you'd get the same center-of-cell values).

The only solution for that (if you can'T live with the slight error), that I can think of right now would be to write a funkySetPatchField or write a separate boundary condition or write a separate utility that correctly sets the patch values (like the parabolic-inlet that floats around on the board). Wait .... that are three solutions. The only three solutions for that .......

Bernhard
__________________
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   January 13, 2009, 08:40
Default Bernhard, Thank you for the
  #3
New Member
 
Michael List
Join Date: Mar 2009
Posts: 3
Rep Power: 7
listmg is on a distinguished road
Bernhard,

Thank you for the response! I think I will give a funkySetPatchField a shot as time goes by. For now I can do some hand/python corrections.

Thanks!
Mike
listmg is offline   Reply With Quote

Old   March 29, 2013, 07:08
Default
  #4
Senior Member
 
Julien
Join Date: Jun 2012
Location: France
Posts: 150
Rep Power: 4
Djub is on a distinguished road
Hi Foamers,
I am using this thread because its title is close to my problem.
When I use funkySetFields (so easy to use! Thanks Bernhard !) , it changes my field (as I want), but it also changes my boundary conditions! How can I prevent this behavior ?

More precisely, here is my command line:
Code:
funkySetFields -latestTime -field U -expression "vector(pos().z>1 ? 5*log(pos().z/.2) : 5*log(1/.2),0,0)"
This utility works fine and does what I want, but it also changes my boundrayField (which will be considered later as boundary conditions).

Did I misunderstood something? Is there any option to preserve my boundary fields?
Djub is offline   Reply With Quote

Old   March 29, 2013, 10:36
Default
  #5
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 3,840
Rep Power: 38
gschaider will become famous soon enoughgschaider will become famous soon enough
Quote:
Originally Posted by Djub View Post
Hi Foamers,
I am using this thread because its title is close to my problem.
When I use funkySetFields (so easy to use! Thanks Bernhard !) , it changes my field (as I want), but it also changes my boundary conditions! How can I prevent this behavior ?

More precisely, here is my command line:
Code:
funkySetFields -latestTime -field U -expression "vector(pos().z>1 ? 5*log(pos().z/.2) : 5*log(1/.2),0,0)"
This utility works fine and does what I want, but it also changes my boundrayField (which will be considered later as boundary conditions).

Did I misunderstood something? Is there any option to preserve my boundary fields?
The is not too much documentation on FSF, but the little bit there is is quite useful I think: http://openfoamwiki.net/index.php/Co...and_line_usage (keepPatches is your friend)
__________________
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   March 29, 2013, 10:57
Default
  #6
Senior Member
 
Julien
Join Date: Jun 2012
Location: France
Posts: 150
Rep Power: 4
Djub is on a distinguished road
Thanks ! (I had read this page, but not these 3 lines... Shame on me!)
Djub is offline   Reply With Quote

Old   November 18, 2013, 17:49
Default
  #7
Member
 
Tayo
Join Date: Aug 2012
Location: FL
Posts: 94
Rep Power: 4
tayo is on a distinguished road
Hello all,
I want to initialize the temperature field of a bubble in contact with a wall using funkySetFields. The wall has a fixedGradient BC acting as the heat flux, with wall temp higher than bubble temp. The issue is that temp of bubble cells at contact region overrides the wall patch temp. This makes temp at contact region higher than wall temp whereas, I expect this region to have less than or equal to the wall temp. Here's what my funkySetFieldDict looks like:

Code:
field T;
expression "xxx";
condition "yyy";
-keepPatches 1;
After initializing with funkySetField, I've tried to reinitialized the fixedGradient at the wall patch using funkySetBoundaryField but nothing seems to happen afterwards. Please provide suggestions on how to fix this. Thanks
tayo is offline   Reply With Quote

Old   November 18, 2013, 18:34
Default
  #8
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 3,840
Rep Power: 38
gschaider will become famous soon enoughgschaider will become famous soon enough
Quote:
Originally Posted by tayo View Post
Hello all,
I want to initialize the temperature field of a bubble in contact with a wall using funkySetFields. The wall has a fixedGradient BC acting as the heat flux, with wall temp higher than bubble temp. The issue is that temp of bubble cells at contact region overrides the wall patch temp. This makes temp at contact region higher than wall temp whereas, I expect this region to have less than or equal to the wall temp. Here's what my funkySetFieldDict looks like:

Code:
field T;
expression "xxx";
condition "yyy";
-keepPatches 1;
After initializing with funkySetField, I've tried to reinitialized the fixedGradient at the wall patch using funkySetBoundaryField but nothing seems to happen afterwards. Please provide suggestions on how to fix this. Thanks
a) that can't be the whole dict
b) the minus in front of keepPatches is really there? Why? That way of course FSF assumes that keepPatches is false (because you're setting another value)
__________________
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   November 18, 2013, 19:37
Default
  #9
Member
 
Tayo
Join Date: Aug 2012
Location: FL
Posts: 94
Rep Power: 4
tayo is on a distinguished road
Thanks for the quick response. Yep you're right, my typing was sloppy, indeed the minus sign is not included. Here is what my funkySetFiedDict look like:

Code:
expressions
(
  ____________
  other fields
  ____________

  temperature
  {
  field T;
  expression "T+10";
  condition "pow(pos().x-0.01,2)+pow(pos().y-0.02,2) <= pow(0.001,2)";
  keepPatches 1;
  }
);
Like I earlier said, I have fixedGradient wall BC as heat flux. Ofcourse, it displays "keeping patches unaltered" when I apply funkySetFields but the issue is the contact region has higher temps no matter high the value used in fixedGradient BC. This issue doesn't occur when I use a fixedValue wall BC instead, but only happens with fixedGradient. However, I need fixedGradient to represent the heat flux. Find the image attached for illustration.
Attached Images
File Type: jpg Image.jpg (15.9 KB, 9 views)
tayo is offline   Reply With Quote

Old   November 19, 2013, 11:20
Default
  #10
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 3,840
Rep Power: 38
gschaider will become famous soon enoughgschaider will become famous soon enough
Quote:
Originally Posted by tayo View Post
Thanks for the quick response. Yep you're right, my typing was sloppy, indeed the minus sign is not included. Here is what my funkySetFiedDict look like:

Code:
expressions
(
  ____________
  other fields
  ____________

  temperature
  {
  field T;
  expression "T+10";
  condition "pow(pos().x-0.01,2)+pow(pos().y-0.02,2) <= pow(0.001,2)";
  keepPatches 1;
  }
);
Like I earlier said, I have fixedGradient wall BC as heat flux. Ofcourse, it displays "keeping patches unaltered" when I apply funkySetFields but the issue is the contact region has higher temps no matter high the value used in fixedGradient BC. This issue doesn't occur when I use a fixedValue wall BC instead, but only happens with fixedGradient. However, I need fixedGradient to represent the heat flux. Find the image attached for illustration.
Sounds more like a general OF-problem you have. So I don't hijack a thread just because it has the name of one of the tools you used.

Paraview pictures don't prove that OF sees the value this way. They only show how PV interprets the OF-data. Especially if as in your case you're using point values.
__________________
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   November 19, 2013, 11:53
Default
  #11
Member
 
Tayo
Join Date: Aug 2012
Location: FL
Posts: 94
Rep Power: 4
tayo is on a distinguished road
The temp data from the spreadsheet also shows this high temp. I've tried forcing this fixedGradient with a funkySetBoundaryDict file but I don't understand why it does not make any changes to the temp field when I then initialize with funkySetBoundary. Here's what the dict file looks like:

Code:
temp {
field T;
expressions ( {
target fixedGradient;
patchName wall;
expression "xxx"; } );
}
tayo is offline   Reply With Quote

Old   November 20, 2013, 09:09
Default
  #12
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 3,840
Rep Power: 38
gschaider will become famous soon enoughgschaider will become famous soon enough
Quote:
Originally Posted by tayo View Post
The temp data from the spreadsheet also shows this high temp. I've tried forcing this fixedGradient with a funkySetBoundaryDict file but I don't understand why it does not make any changes to the temp field when I then initialize with funkySetBoundary. Here's what the dict file looks like:

Code:
temp {
field T;
expressions ( {
target fixedGradient;
patchName wall;
expression "xxx"; } );
}
Classic case of RTFM: have a look at http://www.openfoam.org/docs/user/boundaries.php Table 5.2: "Data to specify" is _gradient_ not _fixedGradient_
__________________
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   November 20, 2013, 11:05
Default
  #13
Member
 
Tayo
Join Date: Aug 2012
Location: FL
Posts: 94
Rep Power: 4
tayo is on a distinguished road
Quote:
Originally Posted by gschaider View Post
Classic case of RTFM: have a look at http://www.openfoam.org/docs/user/boundaries.php Table 5.2: "Data to specify" is _gradient_ not _fixedGradient_
That's exactly what I'm doing. What I'm asking is how to use funkySetBoundary to force this gradient BC since funkySetFields overwrites it. Or if there's any other way to go about this.
tayo is offline   Reply With Quote

Old   November 22, 2013, 13:00
Default
  #14
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 3,840
Rep Power: 38
gschaider will become famous soon enoughgschaider will become famous soon enough
Quote:
Originally Posted by tayo View Post
That's exactly what I'm doing. What I'm asking is how to use funkySetBoundary to force this gradient BC since funkySetFields overwrites it. Or if there's any other way to go about this.
If you use keepPatches then FSF does not consciously change gradientValue. The only thing can be a problem with the reading/writing of the BCs. But that is the problem/bug of the boundary-condition (not FSF).

But why don't you use FSBF after FSF with the correct target
__________________
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

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
FunkySetFields for OF 141 mer OpenFOAM Pre-Processing 71 June 11, 2014 11:34
Running funkySetFields sara OpenFOAM Running, Solving & CFD 10 October 3, 2012 10:08
Burgerbs equation non constant Boundary Conditions Initial Conditions arkangel OpenFOAM Running, Solving & CFD 1 October 2, 2008 14:48
FunkySetFields for cyclic bc zakifoam OpenFOAM Pre-Processing 1 December 18, 2007 07:24
Integral boundary conditions turbulent intensitylength boundary conditions olesen OpenFOAM Running, Solving & CFD 0 July 27, 2006 07:18


All times are GMT -4. The time now is 02:18.