CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > OpenFOAM Running, Solving & CFD

How to compare volume scalar field with constant values

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

Reply
 
LinkBack Thread Tools Display Modes
Old   November 24, 2009, 13:59
Default How to compare volume scalar field with constant values
  #1
Member
 
Sachin Kanetkar
Join Date: Mar 2009
Posts: 57
Rep Power: 8
sachin is on a distinguished road
Hi,
I wanted to compare one volscalarfield w.r.t a constant value
To be more precise if I want to compare enthalpy h with specific value say enthalpy of sat liq
i need to find in all h values i.e forAll(arg1,arg2)
what should these arguments be

Please do let me know

thanks
sachin
sachin is offline   Reply With Quote

Old   November 24, 2009, 14:05
Default
  #2
Senior Member
 
Laurence R. McGlashan
Join Date: Mar 2009
Posts: 370
Rep Power: 14
l_r_mcglashan will become famous soon enough
Something like:

Code:
forAll(enthalpy,celli)
{
    if(enthalpy[celli] == satEnthalpy){}
    else{}
}
Sounds like you know how to do it already if you've found the forAll macro.
__________________
Laurence R. McGlashan :: Website
l_r_mcglashan is offline   Reply With Quote

Old   November 24, 2009, 14:07
Default
  #3
Member
 
Sachin Kanetkar
Join Date: Mar 2009
Posts: 57
Rep Power: 8
sachin is on a distinguished road
thanks for your quick reply,
I was having a basic idea...was just missing the arguments
sachin
sachin is offline   Reply With Quote

Old   November 24, 2009, 14:09
Default
  #4
Senior Member
 
Laurence R. McGlashan
Join Date: Mar 2009
Posts: 370
Rep Power: 14
l_r_mcglashan will become famous soon enough
That's probably a bit sloppy for a volScalarField.

Code:
forAll(enthalpy.internalField(),celli)
{
         if(enthalpy[celli] == satEnthalpy){}
         else{}
}
__________________
Laurence R. McGlashan :: Website
l_r_mcglashan is offline   Reply With Quote

Reply

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
CuBit t42 OpenFOAM Meshing & Mesh Conversion 6 July 10, 2008 07:51
Constant field inside the volume Ben Makhal CFX 10 February 6, 2008 17:32
from a vecor field to get a gradient of scalar dusky.he Main CFD Forum 4 March 30, 2007 09:08
transient temperature field with constant velocity Törnquist CFX 0 September 16, 2003 04:22
Scalar summation over whole volume Jakub CFX 2 April 18, 2002 12:21


All times are GMT -4. The time now is 11:03.