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

[swak4Foam] FunkySetFields Boundary conditions

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

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   January 7, 2009, 10:56
Default FunkySetFields Boundary conditions
  #1
New Member
 
Michael List
Join Date: Mar 2009
Posts: 3
Rep Power: 17
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: 4,225
Rep Power: 51
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: 17
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, 06:08
Default
  #4
Senior Member
 
Julien
Join Date: Jun 2012
Location: France
Posts: 152
Rep Power: 13
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, 09:36
Default
  #5
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 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, 09:57
Default
  #6
Senior Member
 
Julien
Join Date: Jun 2012
Location: France
Posts: 152
Rep Power: 13
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
Posts: 94
Rep Power: 13
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: 4,225
Rep Power: 51
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
Posts: 94
Rep Power: 13
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, 35 views)
tayo is offline   Reply With Quote

Old   November 19, 2013, 11:20
Default
  #10
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 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
Posts: 94
Rep Power: 13
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: 4,225
Rep Power: 51
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
Posts: 94
Rep Power: 13
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: 4,225
Rep Power: 51
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 Search this Thread
Search this Thread:

Advanced Search
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 Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Multiphase flow - incorrect velocity on inlet Mike_Tom CFX 6 September 29, 2016 01:27
Velocity vector in impeller passage ngoc_tran_bao CFX 24 May 3, 2016 21:16
Basic Nozzle-Expander Design karmavatar CFX 20 March 20, 2016 08:44
Low torque values on Screw Turbine Shaun Waters CFX 34 July 23, 2015 08:16
Low Mixing time Problem Mavier CFX 5 April 29, 2013 00:00


All times are GMT -4. The time now is 01:41.