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

if Loop in the PRE

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

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   January 21, 2020, 05:41
Default if Loop in the PRE
  #1
New Member
 
Sebastian K
Join Date: Jan 2020
Posts: 29
Rep Power: 6
eSKa is on a distinguished road
Hi,

I tried alot of things, I read a lot of posts, but couldnt find a solution.

My Problem:
If there is no Rest File, my variable Pup is zero (Pup =0).
This variable is used in a division (eta= Pdown/Pup).
The Solver doesnt start because of the the problem - dividing with 0.


My idea:
I want to give the variable Pup a value for the first e.g. 50 Iterations. In my case I say Pup = 5. Only to start the Simulation.
And if we have more than 50 Iteration this variable should be calculated like it must be.

my expression in the PRE:
eta = Pdown/Pup
Pup = if(citern<50,5 [kg m^-1 s^-2],torqueMachine*2*pi*n)

--> because the solver cant calculate with a Pup = 0, he should take the Value 5 in the beginning, and after 50 Iteration I wanted him to calculate the real Value

An error appears:
Error on if statement at position 1. The true and false expressions have inconsistensdimensions.

Could it be that all of the expression in the if loop must have the same dimension? In this case impossible


Thanks for ideas.
eSKa is offline   Reply With Quote

Old   January 21, 2020, 10:39
Default
  #2
Senior Member
 
Join Date: Jun 2009
Posts: 1,800
Rep Power: 32
Opaque will become famous soon enough
Dimensions, or units

Your expression seems to have different units between the True and the False values.
Opaque is offline   Reply With Quote

Old   January 21, 2020, 13:51
Default
  #3
Senior Member
 
M
Join Date: Dec 2017
Posts: 642
Rep Power: 12
AtoHM is on a distinguished road
I once had a division by zero in my expressions and the solver didnt stop, strange.


Why cant there be consistent dimensions?
AtoHM is offline   Reply With Quote

Old   January 21, 2020, 15:11
Default
  #4
Senior Member
 
Join Date: Jun 2009
Posts: 1,800
Rep Power: 32
Opaque will become famous soon enough
Quote:
Originally Posted by AtoHM View Post
I once had a division by zero in my expressions and the solver didnt stop, strange.


Why cant there be consistent dimensions?
Not sure I understand the question.

In any case, the dimensions on both results must be the same; otherwise, the expression makes no sense.

Recall the expression is to fulfill a left hand side, say

MyValue = if (conditional, value for TRUE, value for FALSE)

the expected dimensions for MyValue are unique; therefore, either result must provide the same dimensions.
Opaque is offline   Reply With Quote

Old   January 22, 2020, 03:53
Default
  #5
New Member
 
Sebastian K
Join Date: Jan 2020
Posts: 29
Rep Power: 6
eSKa is on a distinguished road
Hi, thanks for the replies.

It was really the wrong dimension, a big mistake of me, I thought it must be the Pressure (Pascal) dimension, but it wasnt.

Thanks a lot, now it works!
eSKa 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
[Other] refineWallLayer Error Yuby OpenFOAM Meshing & Mesh Conversion 2 November 11, 2021 11:04
[Gmsh] Extrude on gmsh Pedro Felix OpenFOAM Meshing & Mesh Conversion 0 October 30, 2019 12:33
Need help setting up chtMultiRegion OskarT OpenFOAM Pre-Processing 1 September 25, 2019 15:51
[Gmsh] Problem with Gmsh nishant_hull OpenFOAM Meshing & Mesh Conversion 23 August 5, 2015 02:09
NACA0012 geometry/design software needed Franny Main CFD Forum 13 July 7, 2007 15:57


All times are GMT -4. The time now is 03:42.