|
[Sponsors] |
UDM value for stopping calculation based on convergence criteria |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
September 21, 2020, 10:20 |
UDM value for stopping calculation based on convergence criteria
|
#1 |
Member
|
Hi, I want to interrupt my calculation based on convergence criteria. My criteria should be the value I store in tthe UDM. Somehow I don't manage to store the value in the UDM with my UDF. I activate 1 UDM in fluent.
I receive an error, that is most likely becauce I use the loops not correctly. when I just message0 the value of my criteria (fnew*fprev) in the console, everything works great. When I build in the loops and want to set the UDM to 0 or 1 it fails. Error: Error: received a fatal signal (Segmentation fault). Error Object: #f UDF: Code:
DEFINE_ADJUST(adjust_UDS_bc, d) { Thread* t; cell_t c; face_t f; thread_loop_c(t, d); { if ((fnew * fprev) <= 0) { begin_c_loop(c, t) { C_UDMI(c, t, 0) = 1; } end_c_loop(c, t) Message0(" UDM: %lf \n", fnew * fprev); } if ((fnew * fprev) > 0) { begin_c_loop(c, t) { C_UDMI(c, t, 0) = 0; } end_c_loop(c, t) Message0(" UDM: %lf \n", fnew* fprev); } } } Maybe someone has a better understanding of the loops and can help |
|
October 5, 2020, 04:35 |
|
#2 |
Senior Member
Alexander
Join Date: Apr 2013
Posts: 2,363
Rep Power: 34 |
Code:
DEFINE_ADJUST(adjust_UDS_bc, d) { Thread* t; cell_t c; face_t f; Message0(" UDM: %lf \n", fnew * fprev); thread_loop_c(t, d); { begin_c_loop(c, t) { if ((fnew * fprev) <= 0) C_UDMI(c, t, 0) = 1; else C_UDMI(c, t, 0) = 0; } end_c_loop(c, t) } }
__________________
best regards ****************************** press LIKE if this message was helpful |
|
October 5, 2020, 08:52 |
|
#3 |
Member
|
||
October 6, 2020, 04:38 |
|
#4 |
Senior Member
Alexander
Join Date: Apr 2013
Posts: 2,363
Rep Power: 34 |
did you try the code, I've attached above?
__________________
best regards ****************************** press LIKE if this message was helpful |
|
Tags |
udf |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Setting up additional convergence criteria: output parameters are ‘constant’ | Pierre1 | CFX | 3 | March 21, 2015 05:47 |
question about convergence criteria in Flow Simulation | drdet | FloEFD, FloWorks & FloTHERM | 2 | January 16, 2015 10:36 |
Individual convergence criteria for velocity components? | CoolHand | OpenFOAM Running, Solving & CFD | 0 | March 3, 2014 17:47 |
Convergence criteria | Gaurav | Siemens | 0 | February 3, 2006 05:53 |
Convergence criteria | Sileno | Phoenics | 1 | December 6, 2005 08:25 |