CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > Siemens > STAR-CCM+

Field Function Conditional Expressions

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   February 19, 2013, 11:20
Default Field Function Conditional Expressions
  #1
New Member
 
Shane Farrell
Join Date: Nov 2012
Posts: 5
Rep Power: 14
shanefarrell is on a distinguished road
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
shanefarrell is offline   Reply With Quote

Old   February 19, 2013, 22:02
Default
  #2
Senior Member
 
KHB
Join Date: Aug 2010
Location: Singapore
Posts: 118
Rep Power: 16
lava12005 is on a distinguished road
Try using the and '&&' logical operator?
Maybe this?
(($RelativeVelocityMagnitude > 0.04) && ($Temperature > 293)) ? 0.038 : 0.08
lava12005 is offline   Reply With Quote

Old   February 20, 2013, 10:36
Default
  #3
New Member
 
Shane Farrell
Join Date: Nov 2012
Posts: 5
Rep Power: 14
shanefarrell is on a distinguished road
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.
shanefarrell is offline   Reply With Quote

Old   February 20, 2013, 10:55
Default
  #4
Senior Member
 
KHB
Join Date: Aug 2010
Location: Singapore
Posts: 118
Rep Power: 16
lava12005 is on a distinguished road
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
lava12005 is offline   Reply With Quote

Old   February 21, 2013, 10:44
Default
  #5
New Member
 
Shane Farrell
Join Date: Nov 2012
Posts: 5
Rep Power: 14
shanefarrell is on a distinguished road
It worked perfectly, thanks very much.
shanefarrell is offline   Reply With Quote

Reply

Tags
field function, mesh refinement


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
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


All times are GMT -4. The time now is 15:08.