April 13, 2018, 05:06
|
|
#21
|
New Member
yanghai
Join Date: Mar 2018
Posts: 16
Rep Power: 8
|
Quote:
Originally Posted by obscureed
Hello Yanghai,
I cannot see any immediate problem with your UDF, so I think you will have to debug it, either by starting very simple and adding elements, or by removing elements from your current UDF:
F_PROFILE(f,t,i)=100;
F_PROFILE(f,t,i)=100+log(101325.);
F_PROFILE(f,t,i)=100+log(RP_Get_Real("operating-pressure"));F_PROFILE(f,t,i)=100+log(F_P(f,t)+RP_G et_Real("operating-pressure"));
Looking up an RP value has a cost, so if the model is large enough that the UDF execution time matters, it would be better to define a variable p_op, assign to p_op the RP value before the face loop, then use p_op inside the loop.
Please can you describe when the error occurs, and specify the error message? (This is one difficulty with re-using an old thread: it is difficult for us to know which of the past situations resembles your situation.)
The temperature here is in Kelvin -- are temperatures around 110K correct for your model?
If your model is massively disrupted by the UDF (or any other influence) such that F_P goes below -p_op, then the log() will be given a negative value, which will cause trouble. It might or might not be worth guarding against this kind of catastrophic error, depending on the probability of the disruption and how much you care about a crash.
Good luck!
Ed
|
ED, thanks for your reply, like the pakk said, i try this way, but it still have the error. the error is : received a fatal signal (Segmentation fault). when i click the Initialization, the error will occur. just like i said in ( (ask) temperature profile that include the pressure i change the profile of temperature like :F_PROFILE(f,t,i)=100 that don't include the F_P(f,t), it is OK.
so do you know, where is the problem? thank you so much.
|
|
|