|
[Sponsors] |
[swak4Foam] funkySetFields - how to set two "zones"? |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
April 9, 2010, 04:30 |
funkySetFields - how to set two "zones"?
|
#1 |
Senior Member
Gijsbert Wierink
Join Date: Mar 2009
Posts: 383
Rep Power: 18 |
Dear all,
I use funkySetFields to create a spherical zone (a drop or a bubble) and that works great. Now, does anyone have any idea how to set the field to two bubbles or e.g. two water blobs in the damBreak case? Can I for example just plug two expressions in funkySetFields (one for each bubble/drop)? Many thanks in advance!
__________________
Regards, Gijs |
|
April 9, 2010, 07:37 |
|
#2 | |
Senior Member
Sebastian Gatzka
Join Date: Mar 2009
Location: Frankfurt, Germany
Posts: 729
Rep Power: 20 |
Quote:
But you can run it twice with the appropriate expression. funkySetFields will not overwrite your previously set fields.
__________________
Schrödingers wife: "What did you do to the cat? It's half dead!" |
||
April 9, 2010, 07:42 |
|
#3 | |
Senior Member
Gijsbert Wierink
Join Date: Mar 2009
Posts: 383
Rep Power: 18 |
Quote:
__________________
Regards, Gijs |
||
April 9, 2010, 08:20 |
|
#4 |
Assistant Moderator
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51 |
||
April 9, 2010, 09:13 |
|
#5 | |
Senior Member
Gijsbert Wierink
Join Date: Mar 2009
Posts: 383
Rep Power: 18 |
@Sebastian:
Thank you, it works! Behold, two bubbles rising and colliding . @Bernhard: Hi Bernhard, Quote:
Code:
funkySetFields -field alpha1 -expression 1 -time 0 -keepPatches -condition "pow(pos().x,2) + pow(pos().y+0.1,2) < pow(0.02,2)" Have a good weekend!
__________________
Regards, Gijs |
||
April 12, 2010, 05:44 |
|
#6 | |
Assistant Moderator
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51 |
Quote:
Code:
An optional option is -condition: only cells for which this expression evaluates to true are overwritten with the expression. For all other cells the old value is kept. |
||
April 13, 2010, 16:08 |
|
#7 | ||
Senior Member
Gijsbert Wierink
Join Date: Mar 2009
Posts: 383
Rep Power: 18 |
Hi Bernhard,
Quote:
Quote:
__________________
Regards, Gijs |
|||
April 14, 2010, 13:14 |
|
#8 | |
Assistant Moderator
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51 |
Quote:
OK. You're halfway there. For more than one sphere just use the operator for a "logical or" || to connect your conditions (basically "(sphere1cond) || (sphere2cond)" put brackets around the expressions to avoid problems) Bernhard |
||
April 14, 2010, 15:36 |
|
#9 |
Senior Member
Gijsbert Wierink
Join Date: Mar 2009
Posts: 383
Rep Power: 18 |
Hi Bernhard,
No worries, we're all in a hurry sometimes . Thank you for the tip, that was exactly what I was looking for! Thanks again and take care
__________________
Regards, Gijs |
|
June 4, 2010, 03:24 |
|
#10 |
New Member
John Chang
Join Date: Jun 2010
Posts: 4
Rep Power: 16 |
Hi Gijsbert,
I am a beginner in the OF. I have a geometry exported from the STL file which needs to be divided into 2 zones. So my question is can I do that through funkySetFields or have to go through the normal process like creating cellSet, faceSet, and setsToZones?? And how can I do that?because I am confused what numbers to put into the topoSetSources...... Your advice would be highly appreciated. Cheers. |
|
June 4, 2010, 03:39 |
|
#11 |
Senior Member
Gijsbert Wierink
Join Date: Mar 2009
Posts: 383
Rep Power: 18 |
Hi John,
Do you mean you want to create two zones as in two separate e.g. fluid zones? I think you have to do that with a mesh generator. In my understanding funkySetFields sets a field to a certain value, e.g. a sphere filled with air. But perhaps Bernhard knows a trick?
__________________
Regards, Gijs |
|
June 4, 2010, 03:51 |
|
#12 |
New Member
John Chang
Join Date: Jun 2010
Posts: 4
Rep Power: 16 |
Thank you for the prompt reply Gijsbert. 2 separate zones as in 2 layers of which the heat transfer mode is different for each. The logic goes like this, if you are in zone A use this equation if else use this. But zone B values are highly dependent on zone A value.
I'm leaning more towards the cellSet and faceSet methods, but have no idea how to divide the geometry into 2 respective zones. Thank you for you time. |
|
June 4, 2010, 04:10 |
|
#13 |
Senior Member
Gijsbert Wierink
Join Date: Mar 2009
Posts: 383
Rep Power: 18 |
I think you should define two separate zones on your mesh generator for that. You need to split a volume (so that they're still connected) and give them different names, like e.g. fluidZone1 and fluidZone2. Then, you can define different rules for each zone.
__________________
Regards, Gijs |
|
June 4, 2010, 04:37 |
|
#14 |
New Member
John Chang
Join Date: Jun 2010
Posts: 4
Rep Power: 16 |
Thanks again for the reply. Yes, what you said is exactly what I want to do. However, I can't seem to define two separate zones in one geometry using my mesh generator. I thought I can do this from setting up the cellSet and faceSet but again I don't quite know how to use them.
If you don't mind giving me your email address, I will forward you to my case. Cheers |
|
June 4, 2010, 04:51 |
|
#15 | ||
Senior Member
Gijsbert Wierink
Join Date: Mar 2009
Posts: 383
Rep Power: 18 |
Hi John,
Well, I must confess I never used cellSet, I always define the zones in Gambit and then convert the mesh with the -writeZones flag. But I suppose you could use cellSet for that purpose as well. Check out this thread for some details. From what I gather from that thread you need to define a cellSetDict in the system directory, in which you define a name, an action, and a method to select cells ("topoSetSources"). So, it would look something like this: Quote:
Quote:
__________________
Regards, Gijs |
|||
July 5, 2010, 06:27 |
|
#16 |
Member
G B
Join Date: Mar 2010
Posts: 37
Rep Power: 16 |
Well, i hate to post the same thing twice (because of the clutter and such). But i really need some help with funkysetfields. I have a very simple mesh:
(0 0 0) //0 (1.05 -0.045844 0) //1 (1.25 -0.054576 0) //2 (12 -0.523931 0) //3 (12 0.523931 0) //4 (1.25 0.054576 0) //5 (1.05 0.045844 0) //6 (0 0 0) //7 It's a wedge of height 8.23 cm. So anyways, i want to set a field for the cells with cellcentre <= 0.0105 (yeah, i have it in meters). So i have this for FST: expressions ( temperature1 { field T; expression "52.96281*(pow(pos().z,0.262054))+273"; conditions "pos().x <= 0.0105"; keepPatches 1; } The thing is, that it is setting the field for the whole wedge, as if my condition wasnt there. Perhaps im using the condition wrong, or theres another way to write it. Any help would be much appreciated. I have tried putting it in cm, putting a another expression temperature2 for the rest of the mesh (it just uses this for the whole mesh). Ive tried limiting the position in the y and z axis. Anyways, im having a problem using the condition. Anyones help is welcome, thanks in advance! GB |
|
July 5, 2010, 08:12 |
|
#17 | ||
Senior Member
Gijsbert Wierink
Join Date: Mar 2009
Posts: 383
Rep Power: 18 |
Hi GB,
Quote:
Quote:
Code:
expression "52.96281*(pow(pos().x,0.262054))+273"; conditions "pos().x <= 0.0105"; Hope this helps
__________________
Regards, Gijs Last edited by gwierink; July 5, 2010 at 08:14. Reason: typo |
|||
July 5, 2010, 09:31 |
|
#18 |
Member
G B
Join Date: Mar 2010
Posts: 37
Rep Power: 16 |
Hi Gijs, thanks for your reply. However, my mesh does have height (i just didnt put the other vertex). The thing is that the profile should change with height, and only for those x values. If you want, i can post the full blockmesh.
Thank you1 |
|
July 5, 2010, 09:36 |
|
#19 | |
Senior Member
Gijsbert Wierink
Join Date: Mar 2009
Posts: 383
Rep Power: 18 |
Hi GB,
Quote:
__________________
Regards, Gijs |
||
July 5, 2010, 09:39 |
|
#20 |
Member
G B
Join Date: Mar 2010
Posts: 37
Rep Power: 16 |
Ah well, its because im trying to put a temperature profile that varies with height (which is represented by the z coordinate in my mesh). So i want the field for the whole height, but not for the whole mesh. I want one part of the mesh (limited by x < 0.0105) to have the profile, and for the other i would like, in worse case, a fixed temperature (not the same profile).
|
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Possible bug with stitchMesh and cyclics in OpenFoam | Jack001 | OpenFOAM Pre-Processing | 0 | May 21, 2016 09:00 |
set BC mass-flow-inlet via UDF and via GUI perform different result | sawa25 | FLUENT | 1 | February 25, 2015 01:51 |
error with icoDyMFOAM; how to set face extrusion zones | kiyono | OpenFOAM | 1 | June 17, 2011 16:07 |
[swak4Foam] Problem with funkySetFields: How to set field on patch? | DanielPT | OpenFOAM Community Contributions | 4 | May 6, 2011 10:45 |
OpenFOAM on MinGW crosscompiler hosted on Linux | allenzhao | OpenFOAM Installation | 127 | January 30, 2009 20:08 |