CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > ANSYS > CFX

CFD-post probe

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

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   April 18, 2015, 00:29
Question CFD-post probe
  #1
New Member
 
Join Date: Jul 2013
Posts: 16
Rep Power: 12
mamalili is on a distinguished road
hi every 1
I want to write below function to take b values of a values in CFD-post to define new expression and so new variable, but I dont know how to do it,

b: when a=0 --> b=0 & when a is not zero --> b=1/a
tank U my friends
mamalili is offline   Reply With Quote

Old   April 18, 2015, 02:21
Default
  #2
Super Moderator
 
Glenn Horrocks
Join Date: Mar 2009
Location: Sydney, Australia
Posts: 17,700
Rep Power: 143
ghorrocks is just really niceghorrocks is just really niceghorrocks is just really niceghorrocks is just really nice
b = if(a=0,0,1/a)
ghorrocks is offline   Reply With Quote

Old   April 18, 2015, 14:17
Unhappy
  #3
New Member
 
Join Date: Jul 2013
Posts: 16
Rep Power: 12
mamalili is on a distinguished road
tank U dear ghorrocks
I try it in details of expressions in the expressions tab, but I see this error:

"""""""""""""""""""""""""""""""""""""""""""""""""" """"""""""""""""""""""

WARNING
Syntax error detected in the expression assigned to 'h2VF'.
Successfully read 26 characters:
if(H2 at STP.Mass Fraction
then error detected at:
=0,0,1/(1+(0.09/1.185)*(1/H2 at STP.Mass Fraction-1)))
Details - Unexpected character.


ERROR
Syntax error detected in the expression assigned to 'h2VF'.
Successfully read 26 characters:
if(H2 at STP.Mass Fraction
then error detected at:
=0,0,1/(1+(0.09/1.185)*(1/H2 at STP.Mass Fraction-1)))
Details - Unexpected character.


"""""""""""""""""""""""""""""""""""""""" """"""""""""""""""""""""""""""""""""


my variable is HVF ( hydrogen volume fraction) and define so:
HVF=1/(1+(0.09/1.185)*(1/H2 at STP.Mass Fraction-1))

but where "H2 at STP.Mass Fraction" is zero HVF undefined
mamalili is offline   Reply With Quote

Old   April 19, 2015, 06:53
Default
  #4
Super Moderator
 
Glenn Horrocks
Join Date: Mar 2009
Location: Sydney, Australia
Posts: 17,700
Rep Power: 143
ghorrocks is just really niceghorrocks is just really niceghorrocks is just really niceghorrocks is just really nice
Your variable name is hydrogen VOLUME FRACTION but the CEL expression is using the H2 MASS FRACTION. Are you talking about mass fractions or volume fractions?
ghorrocks is offline   Reply With Quote

Old   April 20, 2015, 06:26
Default
  #5
New Member
 
Join Date: Jul 2013
Posts: 16
Rep Power: 12
mamalili is on a distinguished road
Deer ghorrocks
Thank you for all of your efforts.
I explain it so:
My solution contains H2 Mass Fraction(HMF) and I need H2 Volume Fraction(HVF), and we know that:


HVF=1/(1+(0.09/1.185)*(1/HMF-1))

I created a new expression (VHF) in expression tab,
Now please exactly tell me: what I write in the expression details?
I really appreciate it if you can guide me, on this.
Thank you for your time
mamalili is offline   Reply With Quote

Old   April 20, 2015, 07:37
Default
  #6
Super Moderator
 
Glenn Horrocks
Join Date: Mar 2009
Location: Sydney, Australia
Posts: 17,700
Rep Power: 143
ghorrocks is just really niceghorrocks is just really niceghorrocks is just really niceghorrocks is just really nice
I suspect CFX is looking for the C equality test (==), not the variable assignment operator (=). So try if(a==0,0,1/a)

You might need to put a bit of a tolerance around this to handle numerical noise. But as you just seem to be handling the special case for when a=0 maybe not.
ghorrocks is offline   Reply With Quote

Old   April 30, 2015, 10:45
Default
  #7
New Member
 
Join Date: Jul 2013
Posts: 16
Rep Power: 12
mamalili is on a distinguished road
thank U very much deer ghorrocks
your answer was true.

I faced with new problem:

I decide to define "Hazard region" so:

where: 0.04<HVF<0.07

with this relation, when or where hazard region existe, CFD post show me '1' and when it not existe, CFD post referd '0' to me.

I try to define (0.04<HVF) and it was successful , but the try to define it (0.04<HVF<0.07) was unsuccessful and CFD post dont refered any thing to me.
mamalili is offline   Reply With Quote

Old   April 30, 2015, 18:39
Default
  #8
Super Moderator
 
Glenn Horrocks
Join Date: Mar 2009
Location: Sydney, Australia
Posts: 17,700
Rep Power: 143
ghorrocks is just really niceghorrocks is just really niceghorrocks is just really niceghorrocks is just really nice
CFX uses C logic operations so look at a C reference manual for the correct syntax. There is also a breif description in the CFX reference manual.

try something like if(HVF>0.04 && HVF<0.07,do this,or do that)
ghorrocks is offline   Reply With Quote

Old   May 1, 2015, 16:20
Smile
  #9
New Member
 
Join Date: Jul 2013
Posts: 16
Rep Power: 12
mamalili is on a distinguished road
Yes it is working very well
Thank U dignified ghorrocks!
mamalili is offline   Reply With Quote

Reply

Thread Tools Search this Thread
Search this Thread:

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem in CFD -post pratikvn ANSYS 4 March 21, 2018 02:56
Post processing in CFD Post or Fluent. Blobs OpenFOAM Post-Processing 2 June 26, 2016 07:23
CFD Design...The CFD Future John C. Chien Main CFD Forum 20 November 19, 2015 23:40
CFD Online Celebrates 20 Years Online jola Site News & Announcements 22 January 31, 2015 00:30
CFD for fans & blower housings David Carroll Main CFD Forum 8 August 24, 2000 17:25


All times are GMT -4. The time now is 19:56.