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

[swak4Foam] funkySetFields over a cellZone

Register Blogs Community New Posts Updated Threads Search

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

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   February 14, 2014, 06:31
Default funkySetFields over a cellZone
  #1
Member
 
Radu Mustata
Join Date: Mar 2009
Location: Zaragoza, Spain
Posts: 99
Rep Power: 17
r2d2 is on a distinguished road
Dear All,
What would be the syntax of funkySetFields to set a value of a field only on a part of a cellZone of my mesh?
This does not work:

expressions
(

setProp1
{
field alpha;
zoneName pipe;
condition " (pos().y < -0.331)";
expression "1";
keepPatches true;
}

);

Many thanks in advance...
r2d2 is offline   Reply With Quote

Old   February 14, 2014, 11:41
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 r2d2 View Post
Dear All,
What would be the syntax of funkySetFields to set a value of a field only on a part of a cellZone of my mesh?
This does not work:

expressions
(

setProp1
{
field alpha;
zoneName pipe;
condition " (pos().y < -0.331)";
expression "1";
keepPatches true;
}

);

Many thanks in advance...
This is documented in the incomplete reference guide that comes with the sources and on the original funkySetFields-page (I point this out because it is my impression that the fact that there IS documentation seems to confuse people): you're looking for the zone-function. Your condition would be (if I interpret it correctly) "zone(pipe) && (pos().y<-0.331)"
saumavadey 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   February 17, 2014, 03:33
Default
  #3
Member
 
Radu Mustata
Join Date: Mar 2009
Location: Zaragoza, Spain
Posts: 99
Rep Power: 17
r2d2 is on a distinguished road
Dear Bernhard,
My fault for being a bit lazy...actually I found it while you gave me the solution.
Many thanks,
radu
r2d2 is offline   Reply With Quote

Old   July 24, 2021, 03:56
Default
  #4
New Member
 
Saumava Dey
Join Date: Sep 2020
Posts: 29
Rep Power: 5
saumavadey is on a distinguished road
Hello!

I was trying to set the field for a volTensorField for a particular cellzone the following way:

roughness_channel1
{
field nRGHo;
zone(channel1);
expression "tensor(0.15, 0.0, 0.0, 0.0, 0.15, 0.0, 0.0, 0.0, 0.0)";
keepPatches 1;
}

But it doesn't work. The field for the entire domain gets replaced by the given tensor value. Can anyone explain why is it happening?
saumavadey is offline   Reply With Quote

Old   July 26, 2021, 03:49
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 saumavadey View Post
Hello!

I was trying to set the field for a volTensorField for a particular cellzone the following way:

roughness_channel1
{
field nRGHo;
zone(channel1);
expression "tensor(0.15, 0.0, 0.0, 0.0, 0.15, 0.0, 0.0, 0.0, 0.0)";
keepPatches 1;
}

But it doesn't work. The field for the entire domain gets replaced by the given tensor value. Can anyone explain why is it happening?

To constrain the cells the cells that FSF manipulates you've got to use a "condition" (it is a bit more typing but sooo much more flexible). The condition can be any expression with a boolean result. In your case something like
Code:
roughness_channel1
    {
        field nRGHo;
        condition "zone(channel1)";
        expression "tensor(0.15, 0.0, 0.0, 0.0, 0.15, 0.0, 0.0, 0.0, 0.0)";
        keepPatches 1;
    }
saumavadey 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   July 26, 2021, 04:07
Default
  #6
New Member
 
Saumava Dey
Join Date: Sep 2020
Posts: 29
Rep Power: 5
saumavadey is on a distinguished road
Yes! Got it! It works well.... Thanks a lot!
saumavadey 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
decomposePar problem: Cell 0contains face labels out of range vaina74 OpenFOAM Pre-Processing 37 July 20, 2020 05:38
[snappyHexMesh] Error snappyhexmesh - Multiple outside loops avinashjagdale OpenFOAM Meshing & Mesh Conversion 53 March 8, 2019 09:42
[mesh manipulation] Importing Multiple Meshes thomasnwalshiii OpenFOAM Meshing & Mesh Conversion 18 December 19, 2015 18:57
OF-2.2.x: Derived class from cellZone and "undefined symbol error" A_Pete OpenFOAM Programming & Development 6 April 28, 2014 01:53


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