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

Invalid Exponentiation

Register Blogs Community New Posts Updated Threads Search

Like Tree2Likes
  • 1 Post By Gert-Jan
  • 1 Post By Opaque

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   June 19, 2019, 10:18
Default Invalid Exponentiation
  #1
Member
 
Abdullah Arslan
Join Date: Apr 2019
Posts: 94
Rep Power: 7
Goenitz is on a distinguished road
+--------------------------------------------------------------------+
| PROBLEM ENCOUNTERED WHEN EXECUTING CFX EXPRESSION LANGUAGE |
| |
| The CFX expression language was evaluating: |
| Heat Flux in |
| |
| The problem was: |
| INVALID-EXPONENTIATION |
| |
| FURTHER INFORMATION |
| |
| The problem was encountered in executing the expression for: |
| kconst |
| The complete expression is: |
| Arr*((CH4.molf*p)^0.35)*((H2O.molf*p)^0.05) |
| The error occurs on sub-expression: |
| (CH4.molf*p)^0.35 |
| |
| BACKGROUND INFORMATION |
| |
| The error was detected at one location. The same problem may be |
| present at other locations - that has not been investigated. |
| The following values are for the first location which has the |
| problem. |
| |
| These values were set before reaching the current expression: |
| |
| Name = Expression = Value |
| |
| Arr = 390 [mol kg^-1 s^-1 Pa^-0.4= 390.000 |
| e = 2.71828 |
| XLength = 0.002 [m] = 2.000000E-03 |
| R = 8.314472 [J K^-1 mol^-1] = 8.31447 |
| NIdens = 8900 [kg m^-3] = 8900.00 |
| Eact = 43200 [J mol^-1] = 43200.0 |
| Enthalpy = 165000 [J mol^-1] = 165000. |
| p = -3.080899E-02 |
| T = 1410.75 |
| H2O.molf = 0.525324 |
| CH4.molf = 0.222359 |
| |
| END OF DIAGNOSTIC OUTPUT FOR CFX EXPRESSION LANGUAGE |
+--------------------------------------------------------------------+

P.S Error occurs after 8 iteration

Last edited by Goenitz; June 19, 2019 at 11:57.
Goenitz is offline   Reply With Quote

Old   June 19, 2019, 10:25
Default
  #2
Member
 
Abdullah Arslan
Join Date: Apr 2019
Posts: 94
Rep Power: 7
Goenitz is on a distinguished road
I have changed the powers but still cannot get rid of error. Real expression is
Arr*((CH4.molf*p)^0.46)*((H2O.molf*p)^-0.01)

It doesn't work for -ve exponent straight away (0 iteration). I initialised the solution with H2O.mf (not molf) 0.001 so that it doesn't give error (e.g. ((H2O.molf*p)^-0.01)= 1/((H2O.molf*p)^0.01) so if with H2O.molf=0, expression will be 1/ (0*p)^0.01. it is math error.)

Even if i use

Arr*((CH4.molf*p)^0.46)*((H2O.molf*p)^0.01). The H2O.molf*p term gives error before CH4.molf*p.

P.S Solution is converging for this expression
Arr*((CH4.molf*p)^1.46)*((H2O.molf*p)^1.01)

Last edited by Goenitz; June 19, 2019 at 11:56.
Goenitz is offline   Reply With Quote

Old   June 19, 2019, 10:52
Default
  #3
Senior Member
 
Gert-Jan
Join Date: Oct 2012
Location: Europe
Posts: 1,913
Rep Power: 28
Gert-Jan will become famous soon enough
Probably somewhere your molfractions get below zero, as a result of numerical errors. I would implement max functions to prevent this. As an example:

Arr*(( max(1e-5[Pa],CH4.molf*p) )^0.46)*(( max(1e-5[Pa],H2O.molf*p) )^0.01).
Goenitz likes this.
Gert-Jan is offline   Reply With Quote

Old   June 19, 2019, 11:54
Default
  #4
Member
 
Abdullah Arslan
Join Date: Apr 2019
Posts: 94
Rep Power: 7
Goenitz is on a distinguished road
Quote:
Originally Posted by Gert-Jan View Post
Probably somewhere your molfractions get below zero, as a result of numerical errors. I would implement max functions to prevent this. As an example:

Arr*(( max(1e-5[Pa],CH4.molf*p) )^0.46)*(( max(1e-5[Pa],H2O.molf*p) )^0.01).
Thank you man.

I was thinking of the same line so If statement doesn't work (it cannot stop division by zero). i was looking into max( and min( functions. Need time to understand them. However, When the simulation stops, both p and CH4.molf are non-zero (indicated bold)
Goenitz is offline   Reply With Quote

Old   June 21, 2019, 20:32
Default
  #5
Senior Member
 
Join Date: Jun 2009
Posts: 1,873
Rep Power: 33
Opaque will become famous soon enough
Looking at the list of variables reported for the expression, p is negative, and the expression (a * b) ^0.35 cannot be evaluated for a negative number.
Goenitz likes this.
Opaque is offline   Reply With Quote

Old   June 22, 2019, 08:44
Default
  #6
Member
 
Abdullah Arslan
Join Date: Apr 2019
Posts: 94
Rep Power: 7
Goenitz is on a distinguished road
Quote:
Originally Posted by Opaque View Post
Looking at the list of variables reported for the expression, p is negative, and the expression (a * b) ^0.35 cannot be evaluated for a negative number.
Never thought of this.. Thank you
Goenitz is offline   Reply With Quote

Old   June 23, 2019, 08:24
Default
  #7
Senior Member
 
Gert-Jan
Join Date: Oct 2012
Location: Europe
Posts: 1,913
Rep Power: 28
Gert-Jan will become famous soon enough
What is 'p'? Relative pressure? Then yes, this can get negative.
But don't you need absolute pressure in your equations?
Gert-Jan is offline   Reply With Quote

Old   June 26, 2019, 07:02
Default
  #8
Member
 
Abdullah Arslan
Join Date: Apr 2019
Posts: 94
Rep Power: 7
Goenitz is on a distinguished road
Quote:
Originally Posted by Gert-Jan View Post
What is 'p'? Relative pressure? Then yes, this can get negative.
But don't you need absolute pressure in your equations?
Oh Man... really feel shame.. Yes, according to Dalton's Law, it should be total pressure. Such a basic thing but got overlooked when writing expressions.

Regards
Goenitz is offline   Reply With Quote

Old   June 26, 2019, 07:52
Default
  #9
Super Moderator
 
Glenn Horrocks
Join Date: Mar 2009
Location: Sydney, Australia
Posts: 17,854
Rep Power: 144
ghorrocks is just really niceghorrocks is just really niceghorrocks is just really niceghorrocks is just really nice
Be careful now, the wrong word changes everything - pressure, total pressure and absolute pressure are completely different things. I suspect you don't want the total pressure, you want the absolute pressure.
__________________
Note: I do not answer CFD questions by PM. CFD questions should be posted on the forum.
ghorrocks is offline   Reply With Quote

Old   June 27, 2019, 08:10
Default
  #10
Member
 
Abdullah Arslan
Join Date: Apr 2019
Posts: 94
Rep Power: 7
Goenitz is on a distinguished road
What reference pressure should I choose?
I am using pabs now for change.
Inlet velocity is 0.1 m/s, Tin 793K and Pin 1 bar. I have set Vin and Tin.

Now a rough estimate is P=rhoRTin (1.2*8.3*793 ~8000Pa). I have gone through the discussion which says (as I get it) that reference pressure:
1. is a reference value which limits round off errors in floating point operations.
2. should be between min and max of what expected pressure can be in domain.

Anyway, my solution doesn't converge but diverges even if I use a between value (3kPa before)

P.S I have also gone through the discussion where it was stated that below error is due to BAD inlet or boundary conditions.

Now when I see monitor plots those are very strange.
Pref 2 [Pa]




Newton's method failed to converge while computing the variables |
| listed below. In each case, the solver continued with the variable |
| field as it was on the final iteration. |
| |
| If this situation persists, you might try decreasing the Newton |
| iteration underrelaxation factor. This can be changed by setting |
| one of the following parameters for your mixture: |
| |
| Temperature : "Constitutive Relation Under Relaxation" |
| Pressure : "Newton Pressure Under Relaxation" |
| |
+--------------------------------------------------------------------+
| |
| Location Name : Fluid1 |
| Mesh location : VERTICES |
| Routine : Post_soln |
| Variable Name : Total Temperature |
| Last 3 Changes : 6.51886E+01 6.51971E+01 6.52050E+01 |
| Tolerance : 1.0000E-02 |
| Status : DIVERGING |
| Max Iterations : 100 |
|
Attached Images
File Type: jpg p pabs and density.jpg (92.1 KB, 7 views)

Last edited by Goenitz; June 27, 2019 at 11:22. Reason: addition
Goenitz is offline   Reply With Quote

Old   June 27, 2019, 14:34
Default
  #11
Senior Member
 
Gert-Jan
Join Date: Oct 2012
Location: Europe
Posts: 1,913
Rep Power: 28
Gert-Jan will become famous soon enough
I really can't follow you. Your equation P=rhoRTin (1.2*8.3*793 ~8000Pa) gets lots of questionmarks.
The formula is rho=Pabs*Molarmass/(RT). As an example, if you would have air at STP, then 1e5*28.95/8314/273 = 1.28 kg/m3. So, in an equation like this, you are dealing with absolute pressure, not reference pressure. Meaning, if you would rewrite this equation in the correct way, you would obtain an equation for Absolute pressure




CFX solves for pressure, which is the static pressure P = Pabs-Pref, where Pref is just a constant value (mostly 1 atm) around which the static presusre fluctuates.
In your case I would set Reference pressure to 0 atm (=vacuum). Then your static pressure equals the absolute pressure. That simplifies things a lot.

Keep in mind, as Glenn mentioned, when doing CFD, there are many pressures:
Absolute pressure = Pabs
Reference pressure = Pref (usually 1 atm)
Static pressure = Ps = Pabs-Pref
Dynamic pressure = Pdyn
Total Pressure = Ptot = Pdyn+Ps

Etcetera. Don't mix things up
Gert-Jan is offline   Reply With Quote

Reply

Tags
cfx


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
parallel simulations - error message: "OPT_ITERATIONS: invalid option name" v8areu SU2 5 July 23, 2015 03:57
[swak4Foam] GroovyBC the dynamic cousin of funkySetFields that lives on the suburb of the mesh gschaider OpenFOAM Community Contributions 300 October 29, 2014 19:00
Problems building Paraview 3.12 on Gentoo Linux pajot OpenFOAM Installation 11 April 11, 2013 09:09
OpenFOAM install on Ubuntu Natty 11.04 bkubicek OpenFOAM 13 May 26, 2011 06:48
Phase locked average in run time panara OpenFOAM 2 February 20, 2008 15:37


All times are GMT -4. The time now is 01:43.