|
[Sponsors] |
February 14, 2014, 06:31 |
funkySetFields over a cellZone
|
#1 |
Member
Radu Mustata
Join Date: Mar 2009
Location: Zaragoza, Spain
Posts: 99
Rep Power: 17 |
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... |
|
February 14, 2014, 11:41 |
|
#2 | |
Assistant Moderator
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51 |
Quote:
__________________
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 |
||
February 17, 2014, 03:33 |
|
#3 |
Member
Radu Mustata
Join Date: Mar 2009
Location: Zaragoza, Spain
Posts: 99
Rep Power: 17 |
Dear Bernhard,
My fault for being a bit lazy...actually I found it while you gave me the solution. Many thanks, radu |
|
July 24, 2021, 03:56 |
|
#4 |
New Member
Saumava Dey
Join Date: Sep 2020
Posts: 29
Rep Power: 5 |
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? |
|
July 26, 2021, 03:49 |
|
#5 | |
Assistant Moderator
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51 |
Quote:
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; }
__________________
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 |
||
July 26, 2021, 04:07 |
|
#6 |
New Member
Saumava Dey
Join Date: Sep 2020
Posts: 29
Rep Power: 5 |
Yes! Got it! It works well.... Thanks a lot!
|
|
|
|
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 |