|
[Sponsors] |
Error: "overflow or underflow in power operation" when specifying custom equation |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
August 21, 2020, 06:40 |
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 |
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) Code:
V13 = 0.0576 / ((ABS(69.4 * 1.225 * {CoordinateX} / 0.000017)) ** (0.2)) |
|
August 24, 2020, 21:49 |
|
#2 |
Member
Brandon M
Join Date: Feb 2019
Posts: 38
Rep Power: 7 |
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 |
|
August 25, 2020, 07:57 |
|
#3 | |
Senior Member
Tom-Robin Teschner
Join Date: Dec 2011
Location: Cranfield, UK
Posts: 211
Rep Power: 17 |
Quote:
|
||
December 2, 2020, 18:41 |
|
#4 |
New Member
Daniel Soderquist
Join Date: Dec 2020
Posts: 1
Rep Power: 0 |
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! |
|
December 3, 2020, 04:10 |
|
#5 |
Senior Member
Tom-Robin Teschner
Join Date: Dec 2011
Location: Cranfield, UK
Posts: 211
Rep Power: 17 |
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.
|
|
|
|
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 |