CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Visualization & Post-Processing Software > Tecplot

Error: "overflow or underflow in power operation" when specifying custom equation

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   August 21, 2020, 06:40
Default Error: "overflow or underflow in power operation" when specifying custom equation
  #1
Senior Member
 
Tom-Robin Teschner
Join Date: Dec 2011
Location: Cranfield, UK
Posts: 211
Rep Power: 17
t.teschner is on a distinguished road
I am trying to create a new variable that calculates the skin friction coefficient along the flat plate example.

I am following the NASA flat plate domain definition (https://turbmodels.larc.nasa.gov/flatplate.html) and after my simulation, I am trying to calculate the skin friction coefficient based on empirical findings (first equation on this page: https://www.cfd-online.com/Wiki/Skin...on_coefficient) for comparison.

The equation I am using in Data -> Alter -> Specify Equation ... is as follows:

Code:
V13 = 0.0576 * (ABS(69.4 * 1.225 * {CoordinateX} / 0.000017)) ** (-0.2)
This gives me an error saying that "Overflow or underflow in power operation". I can change the above to

Code:
V13 = 0.0576 / ((ABS(69.4 * 1.225 * {CoordinateX} / 0.000017)) ** (0.2))
which gives a similar error "Overflow or underflow in divide operation". Anyone came across something similar and knows how to solve that? I did something similar in Paraview without issues.
t.teschner is offline   Reply With Quote

Old   August 24, 2020, 21:49
Default
  #2
Member
 
Brandon M
Join Date: Feb 2019
Posts: 38
Rep Power: 7
Brandon_CFD is on a distinguished road
Hello Tom-Robin,


It seems that you're getting a divide by zero, which can be resolved using the "IgnoreDivideByZero" parameter in $!AlterData. This requires that you use a macro, since this isn't available in the GUI. For example:
#!MC 1410
$!AlterData
Equation = 'V13 = 0.0576 * (ABS(69.4 * 1.225 * X / 0.000017)) ** (-0.2)'
IGNOREDIVIDEBYZERO = YES
Brandon_CFD is offline   Reply With Quote

Old   August 25, 2020, 07:57
Default
  #3
Senior Member
 
Tom-Robin Teschner
Join Date: Dec 2011
Location: Cranfield, UK
Posts: 211
Rep Power: 17
t.teschner is on a distinguished road
Quote:
Originally Posted by Brandon_CFD View Post
Hello Tom-Robin,


It seems that you're getting a divide by zero, which can be resolved using the "IgnoreDivideByZero" parameter in $!AlterData. This requires that you use a macro, since this isn't available in the GUI. For example:
#!MC 1410
$!AlterData
Equation = 'V13 = 0.0576 * (ABS(69.4 * 1.225 * X / 0.000017)) ** (-0.2)'
IGNOREDIVIDEBYZERO = YES
Thanks for that, I figured that there was an issue with division by zero but was missing your MACRO knowledge. Appreciate your help!
t.teschner is offline   Reply With Quote

Old   December 2, 2020, 18:41
Default
  #4
New Member
 
Daniel Soderquist
Join Date: Dec 2020
Posts: 1
Rep Power: 0
dsoder is on a distinguished road
This may be a trivial solution and a hack, but in some cases you may be able to bypass a divide-by-zero error simply by adding a negligible number somewhere in the denominator such that the denominator won't equal zero. This method isn't pretty, but it allows you to just use the GUI rather than creating a macro.

Example:
{speed_of_sound}={velocity_magnitude}/({Mach}+.00000001)

Your case:
V13 = 0.0576 / ((ABS(69.4 * 1.225 * ({CoordinateX}+.00000001) / 0.000017)) ** (0.2))

Hope this helps!
dsoder is offline   Reply With Quote

Old   December 3, 2020, 04:10
Default
  #5
Senior Member
 
Tom-Robin Teschner
Join Date: Dec 2011
Location: Cranfield, UK
Posts: 211
Rep Power: 17
t.teschner is on a distinguished road
I guess that would be the more CFD-like answer. Yes, that would do the job as well, will keep this in mind, thanks for pointing that out.
t.teschner is offline   Reply With Quote

Reply


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
Power calculation in centrifugal pump - CFD Post Hazem_9 ANSYS 1 May 11, 2017 15:22
Constant Power Fan Model using General Momentum Source Dano62 CFX 0 April 14, 2016 14:09
Problems with power variable ghost82 EnSight 4 January 2, 2015 10:52
plzzz help::energy equation using power law method sepidehkavousi Main CFD Forum 5 April 20, 2012 09:05
Viscosity and the Energy Equation Rich Main CFD Forum 0 December 16, 2009 15:01


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