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

Field Function Conditional Expressions

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

Reply
 
LinkBack Thread Tools 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: 5
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: 109
Rep Power: 8
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: 5
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: 109
Rep Power: 8
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: 5
shanefarrell is on a distinguished road
It worked perfectly, thanks very much.
shanefarrell is offline   Reply With Quote

Reply

Tags
field function, mesh refinement

Thread Tools
Display Modes

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
problems after decomposing for running alessio.nz OpenFOAM 6 December 23, 2015 15:27
Moving mesh Niklas Wikstrom (Wikstrom) OpenFOAM Running, Solving & CFD 122 June 15, 2014 06:20
Force Report help~ or maybe Custom Field Function sailor FLUENT 0 April 13, 2011 03:45
OpenFOAM static build on Cray XT5 asaijo OpenFOAM Installation 9 April 6, 2011 12:21
Axisymmetrical mesh Rasmus Gjesing (Gjesing) OpenFOAM Native Meshers: blockMesh 10 April 2, 2007 14:00


All times are GMT -4. The time now is 09:54.