|
[Sponsors] |
January 21, 2020, 05:41 |
if Loop in the PRE
|
#1 |
New Member
Sebastian K
Join Date: Jan 2020
Posts: 29
Rep Power: 6 |
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. |
|
January 21, 2020, 10:39 |
|
#2 |
Senior Member
Join Date: Jun 2009
Posts: 1,815
Rep Power: 32 |
Dimensions, or units
Your expression seems to have different units between the True and the False values. |
|
January 21, 2020, 13:51 |
|
#3 |
Senior Member
M
Join Date: Dec 2017
Posts: 644
Rep Power: 12 |
I once had a division by zero in my expressions and the solver didnt stop, strange.
Why cant there be consistent dimensions? |
|
January 21, 2020, 15:11 |
|
#4 | |
Senior Member
Join Date: Jun 2009
Posts: 1,815
Rep Power: 32 |
Quote:
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. |
||
January 22, 2020, 03:53 |
|
#5 |
New Member
Sebastian K
Join Date: Jan 2020
Posts: 29
Rep Power: 6 |
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! |
|
Thread Tools | Search this Thread |
Display Modes | |
|
|
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 |