|
[Sponsors] |
Calculating flow variables only once in begin_f_loop() |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
June 6, 2020, 11:40 |
|
#21 |
Member
Homayoon sohrabi
Join Date: May 2020
Posts: 56
Rep Power: 6 |
yeah actually i need to apply velocity profile for solid-liquid interface. but now i am encountering new error. when i interpret my udf which includes 2 different functions, and then when i want to initialize my solution, it says i have a segmentation fault. what should i do?
|
|
June 6, 2020, 11:42 |
|
#22 |
Member
Homayoon sohrabi
Join Date: May 2020
Posts: 56
Rep Power: 6 |
yeah but after interpreting my udf which includes 2 different functions, when i want to initialize my solution, it says there is "segmentation fault", what should i do to get rid of that?
|
|
June 6, 2020, 15:51 |
Gradient
|
#23 |
Senior Member
|
The most likely reason for that is the unavailability of the velocity gradients. By default, gradients are not stored by Fluent. You need to issue following command before hooking the UDF
solve set exp And then provide yes as answer to the question regarding keeping the memory from being freed.
__________________
Regards, Vinerm PM to be used if and only if you do not want something to be shared publicly. PM is considered to be of the least priority. |
|
June 7, 2020, 05:59 |
|
#24 |
Member
Homayoon sohrabi
Join Date: May 2020
Posts: 56
Rep Power: 6 |
i interpreted my udf and then i provided "yes" answer to all three questions appeared after writing command "solve set exp" and hook my udf to boundary condition afterwards, but it was still encountering same error! is there any chance that there is another reason for that error??
|
|
June 7, 2020, 08:17 |
Segmentation Fault
|
#25 |
Senior Member
|
There is no other reason, at least, not due to the code. And don't count the number of questions, check whether the question regarding keeping the memory from being freed has been answered yes or not. As stated earlier, you have to initialize the case before hooking the UDF. And before you hook it, go to contour plots and display du-dy to ensure that C_U_G[1] exists.
__________________
Regards, Vinerm PM to be used if and only if you do not want something to be shared publicly. PM is considered to be of the least priority. |
|
June 7, 2020, 10:18 |
|
#26 |
Member
Homayoon sohrabi
Join Date: May 2020
Posts: 56
Rep Power: 6 |
i did that and the error didnt occurred again, thanks to you. but there is another problem and that is that during the calculation it shows there is "reversed flow" in too many faces in every iteration! what is that?
|
|
June 12, 2020, 04:00 |
|
#27 |
Member
Homayoon sohrabi
Join Date: May 2020
Posts: 56
Rep Power: 6 |
Hello
my UDF works properly for slip lenght equal to 1 micrometer, but when i apply slip lenght 20 micrometer, my calculation diverges and says "divergence in AMG" and "floating point exception". how can i get rid of them?? thanks in advance |
|
June 15, 2020, 03:46 |
Change in value
|
#28 |
Senior Member
|
It is quite possible that case diverges for 20, but not for 1. The system is chaotic anyway. But if it is really this change in value or something else, you need to try some other value to debug. Try with slightly smaller or larger values, say, 17 and 22.
__________________
Regards, Vinerm PM to be used if and only if you do not want something to be shared publicly. PM is considered to be of the least priority. |
|
June 15, 2020, 06:14 |
|
#29 |
Member
Homayoon sohrabi
Join Date: May 2020
Posts: 56
Rep Power: 6 |
Actually I did that too, but it only works with 1 micrometer and less values, it doesnt even converges for 2 micrometer. what should i do??
|
|
June 15, 2020, 06:22 |
Gradient
|
#30 |
Senior Member
|
Plot the gradient values and check if those are reasonable. The divergence is not because of UDF, but because of the values.
__________________
Regards, Vinerm PM to be used if and only if you do not want something to be shared publicly. PM is considered to be of the least priority. |
|
June 15, 2020, 06:50 |
|
#31 |
Member
Homayoon sohrabi
Join Date: May 2020
Posts: 56
Rep Power: 6 |
actually no they are not reasonable at all. neither pressure gradient, nor velocity gradient. so what should i do to get rid of that??
|
|
June 15, 2020, 06:56 |
Gradients
|
#32 |
Senior Member
|
Gradients are based on the flow solution. If those are not accurate, then the flow is not converged.
__________________
Regards, Vinerm PM to be used if and only if you do not want something to be shared publicly. PM is considered to be of the least priority. |
|
June 15, 2020, 07:02 |
|
#33 |
Member
Homayoon sohrabi
Join Date: May 2020
Posts: 56
Rep Power: 6 |
during the calculation it says there is reversed flow at some faces of pressure outlet and when the calculation is diverged after 15-16 iterations, i get these errors:
divergence detected in AMG solver: pressure correction error at host: floating point exception error at node 0:floating point exception error at node 1:floating point exception error at node 2:floating point exception |
|
June 15, 2020, 07:04 |
Case Setup
|
#34 |
Senior Member
|
First, run a case without any UDF. Converge it properly and then hook the UDF to run it further. Before hooking UDF, ensure that the gradient values are realistic. You may also prefer to use _RG in place of _G to ensure that the gradients are bounded.
__________________
Regards, Vinerm PM to be used if and only if you do not want something to be shared publicly. PM is considered to be of the least priority. |
|
June 15, 2020, 07:43 |
|
#35 |
Member
Homayoon sohrabi
Join Date: May 2020
Posts: 56
Rep Power: 6 |
now i just did that too, and thanks to you, the calculation doesnt diverge after hooking udf, but my residuals got too high. i mean my continuity residual got to about 1e+3 and doesnt vary too much. what should i do now to lower residuals??
thanks for your help |
|
June 15, 2020, 09:02 |
Residuals
|
#36 |
Senior Member
|
If the case converges without the UDF, but diverges with the UDF, then most likely the boundary condition being applied using UDF is not well defined. Not the code, but the physics is not good.
__________________
Regards, Vinerm PM to be used if and only if you do not want something to be shared publicly. PM is considered to be of the least priority. |
|
June 15, 2020, 09:20 |
|
#37 |
Member
Homayoon sohrabi
Join Date: May 2020
Posts: 56
Rep Power: 6 |
yes my case converges without UDF, even converges with UDF for slip lenght equal to 1 micrometer or less, but when i apply another value for slip lenght over 1 micrometer, suddenly my calculation diverges. so now what is your advice for boundary condition physics? what parameters should i modify?
|
|
June 15, 2020, 09:22 |
Physical Model
|
#38 |
Senior Member
|
For physics, the only advice is to study more of literature. Find out the validity of the model you are using and its range of usage.
__________________
Regards, Vinerm PM to be used if and only if you do not want something to be shared publicly. PM is considered to be of the least priority. |
|
June 15, 2020, 10:05 |
|
#39 |
Member
Homayoon sohrabi
Join Date: May 2020
Posts: 56
Rep Power: 6 |
actually im trying to validate another project so that i know if im doing right or not!? so i dont think there would be any problem with the basis of my model, because its just the same as project, i just dont know what parameters should i modify to get the correct convergence with this UDF!
|
|
June 15, 2020, 10:09 |
Validation
|
#40 |
Senior Member
|
If you are trying to validate against some previously done work, then you have to use same conditions as used in that work.
__________________
Regards, Vinerm PM to be used if and only if you do not want something to be shared publicly. PM is considered to be of the least priority. |
|
Tags |
fluent - udf - parallel, slip b.c., slip flow, udf and programming |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
UDF program for calculating the mass flow outlet with a pulsed output flow | Benito89 | Fluent UDF and Scheme Programming | 9 | August 21, 2019 23:57 |
Match Pressure Inlet/Outlet Boundary Condition Mass Flow Rate | MSchneid | Fluent UDF and Scheme Programming | 3 | February 23, 2019 06:00 |
mass flow in is not equal to mass flow out | saii | CFX | 12 | March 19, 2018 05:21 |
Calculating mass flow rate at multiphase flows | Kuslo187 | OpenFOAM Post-Processing | 1 | August 21, 2015 18:11 |
How to update polyPatchbs localPoints | liu | OpenFOAM Running, Solving & CFD | 6 | December 30, 2005 17:27 |