# Field Function Conditional Expressions

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

 February 19, 2013, 11:20 Field Function Conditional Expressions #1 New Member   Shane Farrell Join Date: Nov 2012 Posts: 5 Rep Power: 5 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: 109 Rep Power: 7 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: 5 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: 109 Rep Power: 7 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: 5 It worked perfectly, thanks very much.

 Tags field function, mesh refinement

 Thread Tools Display Modes Linear Mode

 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 OffTrackbacks are On Pingbacks are On Refbacks are On Forum Rules

 Similar Threads Thread Thread Starter Forum Replies Last Post alessio.nz OpenFOAM 6 December 23, 2015 15:27 Niklas Wikstrom (Wikstrom) OpenFOAM Running, Solving & CFD 122 June 15, 2014 06:20 sailor FLUENT 0 April 13, 2011 03:45 asaijo OpenFOAM Installation 9 April 6, 2011 12:21 Rasmus Gjesing (Gjesing) OpenFOAM Native Meshers: blockMesh 10 April 2, 2007 14:00

All times are GMT -4. The time now is 00:28.