|
[Sponsors] |
February 19, 2013, 11:20 |
Field Function Conditional Expressions
|
#1 |
New Member
Shane Farrell
Join Date: Nov 2012
Posts: 5
Rep Power: 14 |
Hi,
Im trying to use field functions to refine my mesh, but my conditional expression for my refinement table is written incorectly. I want my mesh to be finer in the areas where the velocity is over 0.4m/s and also in the areas where the temperature is over 293K. The two expressions shown below work fine individually but i need to combine the two to generate the one mesh refinement table...any ideas? ($RelativeVelocityMagnitude > 0.04) ? 0.038 : 0.08 ($Temperature > 293) ? 0.038 : 0.08 Thanks in advance |
|
February 19, 2013, 22:02 |
|
#2 |
Senior Member
KHB
Join Date: Aug 2010
Location: Singapore
Posts: 118
Rep Power: 16 |
Try using the and '&&' logical operator?
Maybe this? (($RelativeVelocityMagnitude > 0.04) && ($Temperature > 293)) ? 0.038 : 0.08 |
|
February 20, 2013, 10:36 |
|
#3 |
New Member
Shane Farrell
Join Date: Nov 2012
Posts: 5
Rep Power: 14 |
Thanks for the reply. I used the logical operator '&&' but this only refines the mesh in the areas where both the velocity is > 0.4 and the temperature is > 293. I need to refine the mesh in the areas where either of these conditions are met.
|
|
February 20, 2013, 10:55 |
|
#4 |
Senior Member
KHB
Join Date: Aug 2010
Location: Singapore
Posts: 118
Rep Power: 16 |
Then you can use the OR logical operator '||' since if either of these requirement are met, then it will refine the mesh.
So it should be (($RelativeVelocityMagnitude > 0.04) || ($Temperature > 293)) ? 0.038 : 0.08 |
|
February 21, 2013, 10:44 |
|
#5 |
New Member
Shane Farrell
Join Date: Nov 2012
Posts: 5
Rep Power: 14 |
It worked perfectly, thanks very much.
|
|
Tags |
field function, mesh refinement |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
problems after decomposing for running | alessio.nz | OpenFOAM | 7 | March 5, 2021 05:49 |
Moving mesh | Niklas Wikstrom (Wikstrom) | OpenFOAM Running, Solving & CFD | 122 | June 15, 2014 07:20 |
Force Report help~ or maybe Custom Field Function | sailor | FLUENT | 0 | April 13, 2011 04:45 |
OpenFOAM static build on Cray XT5 | asaijo | OpenFOAM Installation | 9 | April 6, 2011 13:21 |
[blockMesh] Axisymmetrical mesh | Rasmus Gjesing (Gjesing) | OpenFOAM Meshing & Mesh Conversion | 10 | April 2, 2007 15:00 |