CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > ANSYS > FLUENT > Fluent UDF and Scheme Programming

UDM value for stopping calculation based on convergence criteria

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   September 21, 2020, 10:20
Default UDM value for stopping calculation based on convergence criteria
  #1
Member
 
Deutschland
Join Date: Jun 2020
Location: https://t.me/pump_upp
Posts: 43
Rep Power: 6
schwaral is on a distinguished road
Send a message via ICQ to schwaral Send a message via AIM to schwaral Send a message via Yahoo to schwaral
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
schwaral is offline   Reply With Quote

Old   October 5, 2020, 04:35
Default
  #2
Senior Member
 
Alexander
Join Date: Apr 2013
Posts: 2,363
Rep Power: 34
AlexanderZ will become famous soon enoughAlexanderZ will become famous soon enough
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)
	}
}
fnew * fprev suppose to be defined somewhere else
__________________
best regards


******************************
press LIKE if this message was helpful
AlexanderZ is offline   Reply With Quote

Old   October 5, 2020, 08:52
Default
  #3
Member
 
Deutschland
Join Date: Jun 2020
Location: https://t.me/pump_upp
Posts: 43
Rep Power: 6
schwaral is on a distinguished road
Send a message via ICQ to schwaral Send a message via AIM to schwaral Send a message via Yahoo to schwaral
Quote:
Originally Posted by AlexanderZ View Post

fnew * fprev suppose to be defined somewhere else
Yes, These two variable are defined globally and calculated in a diffrent UDF. I think that is not the problem?
schwaral is offline   Reply With Quote

Old   October 6, 2020, 04:38
Default
  #4
Senior Member
 
Alexander
Join Date: Apr 2013
Posts: 2,363
Rep Power: 34
AlexanderZ will become famous soon enoughAlexanderZ will become famous soon enough
did you try the code, I've attached above?
__________________
best regards


******************************
press LIKE if this message was helpful
AlexanderZ is offline   Reply With Quote

Reply

Tags
udf


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
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


All times are GMT -4. The time now is 21:37.