|
[Sponsors] |
June 19, 2019, 10:18 |
Invalid Exponentiation
|
#1 |
Member
Abdullah Arslan
Join Date: Apr 2019
Posts: 94
Rep Power: 7 |
+--------------------------------------------------------------------+
| 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. |
|
June 19, 2019, 10:25 |
|
#2 |
Member
Abdullah Arslan
Join Date: Apr 2019
Posts: 94
Rep Power: 7 |
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. |
|
June 19, 2019, 10:52 |
|
#3 |
Senior Member
Gert-Jan
Join Date: Oct 2012
Location: Europe
Posts: 1,913
Rep Power: 28 |
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). |
|
June 19, 2019, 11:54 |
|
#4 | |
Member
Abdullah Arslan
Join Date: Apr 2019
Posts: 94
Rep Power: 7 |
Quote:
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) |
||
June 21, 2019, 20:32 |
|
#5 |
Senior Member
Join Date: Jun 2009
Posts: 1,873
Rep Power: 33 |
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.
|
|
June 22, 2019, 08:44 |
|
#6 |
Member
Abdullah Arslan
Join Date: Apr 2019
Posts: 94
Rep Power: 7 |
||
June 23, 2019, 08:24 |
|
#7 |
Senior Member
Gert-Jan
Join Date: Oct 2012
Location: Europe
Posts: 1,913
Rep Power: 28 |
What is 'p'? Relative pressure? Then yes, this can get negative.
But don't you need absolute pressure in your equations? |
|
June 26, 2019, 07:02 |
|
#8 | |
Member
Abdullah Arslan
Join Date: Apr 2019
Posts: 94
Rep Power: 7 |
Quote:
Regards |
||
June 26, 2019, 07:52 |
|
#9 |
Super Moderator
Glenn Horrocks
Join Date: Mar 2009
Location: Sydney, Australia
Posts: 17,854
Rep Power: 144 |
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. |
|
June 27, 2019, 08:10 |
|
#10 |
Member
Abdullah Arslan
Join Date: Apr 2019
Posts: 94
Rep Power: 7 |
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 | | Last edited by Goenitz; June 27, 2019 at 11:22. Reason: addition |
|
June 27, 2019, 14:34 |
|
#11 |
Senior Member
Gert-Jan
Join Date: Oct 2012
Location: Europe
Posts: 1,913
Rep Power: 28 |
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 |
|
Tags |
cfx |
|
|
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 |